diff options
author | Mattes D <github@xoft.cz> | 2015-02-22 10:51:16 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-02-22 10:51:16 +0100 |
commit | c758482ece08e7b393e343464bf9a2c2d74bf34f (patch) | |
tree | 0aa3dc3c9ce3715215f3b14cbe80c188a7047891 /src/Bindings/ManualBindings_Network.cpp | |
parent | Door handler: Removed needless check. (diff) | |
download | cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar.gz cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar.bz2 cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar.lz cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar.xz cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.tar.zst cuberite-c758482ece08e7b393e343464bf9a2c2d74bf34f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings_Network.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/Bindings/ManualBindings_Network.cpp b/src/Bindings/ManualBindings_Network.cpp index a628eb9ca..628cda7f0 100644 --- a/src/Bindings/ManualBindings_Network.cpp +++ b/src/Bindings/ManualBindings_Network.cpp @@ -129,6 +129,30 @@ static int tolua_cNetwork_CreateUDPEndpoint(lua_State * L) +/** Binds cNetwork::EnumLocalIPAddresses */ +static int tolua_cNetwork_EnumLocalIPAddresses(lua_State * L) +{ + // Function signature: + // cNetwork:EnumLocalIPAddresses() -> {string, ...} + + cLuaState S(L); + if ( + !S.CheckParamUserTable(1, "cNetwork") || + !S.CheckParamEnd(2) + ) + { + return 0; + } + + // Push the enumerated addresses: + S.Push(cNetwork::EnumLocalIPAddresses()); + return 1; +} + + + + + /** Binds cNetwork::HostnameToIP */ static int tolua_cNetwork_HostnameToIP(lua_State * L) { @@ -903,11 +927,12 @@ void ManualBindings::BindNetwork(lua_State * tolua_S) // Fill in the functions (alpha-sorted): tolua_beginmodule(tolua_S, "cNetwork"); - tolua_function(tolua_S, "Connect", tolua_cNetwork_Connect); - tolua_function(tolua_S, "CreateUDPEndpoint", tolua_cNetwork_CreateUDPEndpoint); - tolua_function(tolua_S, "HostnameToIP", tolua_cNetwork_HostnameToIP); - tolua_function(tolua_S, "IPToHostname", tolua_cNetwork_IPToHostname); - tolua_function(tolua_S, "Listen", tolua_cNetwork_Listen); + tolua_function(tolua_S, "Connect", tolua_cNetwork_Connect); + tolua_function(tolua_S, "CreateUDPEndpoint", tolua_cNetwork_CreateUDPEndpoint); + tolua_function(tolua_S, "EnumLocalIPAddresses", tolua_cNetwork_EnumLocalIPAddresses); + tolua_function(tolua_S, "HostnameToIP", tolua_cNetwork_HostnameToIP); + tolua_function(tolua_S, "IPToHostname", tolua_cNetwork_IPToHostname); + tolua_function(tolua_S, "Listen", tolua_cNetwork_Listen); tolua_endmodule(tolua_S); tolua_beginmodule(tolua_S, "cServerHandle"); |