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 /MCServer/Plugins/NetworkTest | |
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 'MCServer/Plugins/NetworkTest')
-rw-r--r-- | MCServer/Plugins/NetworkTest/Info.lua | 6 | ||||
-rw-r--r-- | MCServer/Plugins/NetworkTest/NetworkTest.lua | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua index 52422d427..d8c3095fe 100644 --- a/MCServer/Plugins/NetworkTest/Info.lua +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -50,6 +50,12 @@ g_PluginInfo = }, -- ParameterCombinations }, -- close + ips = + { + HelpString = "Prints all locally available IP addresses", + Handler = HandleConsoleNetIps, + }, -- ips + listen = { HelpString = "Creates a new listening socket on the specified port with the specified service attached to it", diff --git a/MCServer/Plugins/NetworkTest/NetworkTest.lua b/MCServer/Plugins/NetworkTest/NetworkTest.lua index daab0a4bf..22056d4e9 100644 --- a/MCServer/Plugins/NetworkTest/NetworkTest.lua +++ b/MCServer/Plugins/NetworkTest/NetworkTest.lua @@ -288,6 +288,19 @@ end +function HandleConsoleNetIps(a_Split) + local Addresses = cNetwork:EnumLocalIPAddresses() + LOG("IP addresses enumerated, " .. #Addresses .. " found") + for idx, addr in ipairs(Addresses) do + LOG(" IP #" .. idx .. ": " .. addr) + end + return true +end + + + + + function HandleConsoleNetLookup(a_Split) -- Get the name to look up: local Addr = a_Split[3] or "google.com" |