From 04347084d658baedd6dc615fa34b62d3c19f1d2e Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 28 Jan 2015 15:15:54 +0100 Subject: NetworkTest plugin: Added cNetwork:Connect test code. --- MCServer/Plugins/NetworkTest/Info.lua | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 MCServer/Plugins/NetworkTest/Info.lua (limited to 'MCServer/Plugins/NetworkTest/Info.lua') diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua new file mode 100644 index 000000000..6bb639860 --- /dev/null +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -0,0 +1,46 @@ + +-- Info.lua + +-- Implements the g_PluginInfo standard plugin description + +g_PluginInfo = +{ + Name = "NetworkTest", + Version = "1", + Date = "2015-01-28", + Description = [[Implements test code (and examples) for the cNetwork API]], + + Commands = + { + }, + + ConsoleCommands = + { + net = + { + Subcommands = + { + client = + { + HelpString = "Connects, as a client, to a specified webpage (google.com by default) and downloads its front page using HTTP", + Handler = HandleConsoleNetClient, + ParameterCombinations = + { + { + Params = "", + Help = "Connects, as a client, to google.com and downloads its front page using HTTP", + }, + { + Params = "host [port]", + Help = "Connects, as a client, to the specified host and downloads its front page using HTTP", + }, + }, -- ParameterCombinations + }, -- client + }, -- Subcommands + }, -- net + }, +} + + + + -- cgit v1.2.3 From 17498a97a289119debdb651ab898ddea99e86ff9 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 29 Jan 2015 11:09:56 +0100 Subject: cNetwork: Exported lookup functions to Lua API. Also added an example in the NetworkTest plugin. --- MCServer/Plugins/NetworkTest/Info.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'MCServer/Plugins/NetworkTest/Info.lua') diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua index 6bb639860..8c2604e31 100644 --- a/MCServer/Plugins/NetworkTest/Info.lua +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -36,6 +36,27 @@ g_PluginInfo = }, }, -- ParameterCombinations }, -- client + + lookup = + { + HelpString = "Looks up the IP addresses corresponding to the given hostname (google.com by default)", + Handler = HandleConsoleNetLookup, + ParameterCombinations = + { + { + Params = "", + Help = "Looks up the IP addresses of google.com.", + }, + { + Params = "Hostname", + Help = "Looks up the IP addresses of the specified hostname.", + }, + { + Params = "IP", + Help = "Looks up the canonical name of the specified IP.", + }, + }, + }, -- lookup }, -- Subcommands }, -- net }, -- cgit v1.2.3 From 014b96adb33fa902072d9f35661bc4f5e7c323e8 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 30 Jan 2015 21:24:02 +0100 Subject: Exported cServerHandle and cNetwork:Listen to Lua. Also added an example to the NetworkTest plugin. --- MCServer/Plugins/NetworkTest/Info.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'MCServer/Plugins/NetworkTest/Info.lua') diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua index 8c2604e31..f366fd1be 100644 --- a/MCServer/Plugins/NetworkTest/Info.lua +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -37,6 +37,32 @@ g_PluginInfo = }, -- ParameterCombinations }, -- client + close = + { + HelpString = "Close a listening socket", + Handler = HandleConsoleNetClose, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Closes a socket listening on the specified port [1024]", + }, + }, -- ParameterCombinations + }, -- close + + listen = + { + HelpString = "Creates a new listening socket on the specified port with the specified service attached to it", + Handler = HandleConsoleNetListen, + ParameterCombinations = + { + { + Params = "[Port] [Service]", + Help = "Starts listening on the specified port [1024] providing the specified service [echo]", + }, + }, -- ParameterCombinations + }, -- listen + lookup = { HelpString = "Looks up the IP addresses corresponding to the given hostname (google.com by default)", @@ -57,6 +83,7 @@ g_PluginInfo = }, }, }, -- lookup + }, -- Subcommands }, -- net }, -- cgit v1.2.3 From 16636ff6e2bff3658e0843eee9dfad440771b62f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 12 Feb 2015 20:05:55 +0100 Subject: LuaAPI: Added client TLS support for TCP links. --- MCServer/Plugins/NetworkTest/Info.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MCServer/Plugins/NetworkTest/Info.lua') diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua index f366fd1be..c3c2ea8fc 100644 --- a/MCServer/Plugins/NetworkTest/Info.lua +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -84,6 +84,12 @@ g_PluginInfo = }, }, -- lookup + wasc = + { + HelpString = "Requests the webadmin homepage using https", + Handler = HandleConsoleNetWasc, + }, -- wasc + }, -- Subcommands }, -- net }, -- cgit v1.2.3 From 9c5162041e6e0699283862b87e2e424bf8e3b8b8 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 20 Feb 2015 14:28:05 +0100 Subject: cNetwork: Added UDP API. --- MCServer/Plugins/NetworkTest/Info.lua | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'MCServer/Plugins/NetworkTest/Info.lua') diff --git a/MCServer/Plugins/NetworkTest/Info.lua b/MCServer/Plugins/NetworkTest/Info.lua index c3c2ea8fc..52422d427 100644 --- a/MCServer/Plugins/NetworkTest/Info.lua +++ b/MCServer/Plugins/NetworkTest/Info.lua @@ -84,6 +84,48 @@ g_PluginInfo = }, }, -- lookup + udp = + { + Subcommands = + { + close = + { + Handler = HandleConsoleNetUdpClose, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Closes the UDP endpoint on the specified port [1024].", + } + }, + }, -- close + + listen = + { + Handler = HandleConsoleNetUdpListen, + ParameterCombinations = + { + { + Params = "[Port]", + Help = "Listens on the specified UDP port [1024], dumping the incoming datagrams into log", + }, + }, + }, -- listen + + send = + { + Handler = HandleConsoleNetUdpSend, + ParameterCombinations = + { + { + Params = "[Host] [Port] [Message]", + Help = "Sends the message [\"hello\"] through UDP to the specified host [localhost] and port [1024]", + }, + }, + } -- send + }, -- Subcommands ("net udp") + }, -- udp + wasc = { HelpString = "Requests the webadmin homepage using https", -- cgit v1.2.3