diff options
author | Mattes D <github@xoft.cz> | 2015-03-12 13:35:45 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-12 13:35:45 +0100 |
commit | f9991c9f92dac9df5b3ea62e69d46830adf9fa62 (patch) | |
tree | b754ba22c81b4738226b933a2f718bc194bfe0d6 /src/Bindings/ManualBindings_Network.cpp | |
parent | Merge pull request #1807 from flx5/master (diff) | |
parent | Use std::memcpy to fix alignment (diff) | |
download | cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar.gz cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar.bz2 cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar.lz cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar.xz cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.tar.zst cuberite-f9991c9f92dac9df5b3ea62e69d46830adf9fa62.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"); |