summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/NetworkTest/Info.lua
blob: f366fd1be04a87a681565a097ce1527d818a73cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

-- 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
				
				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)",
					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
	},
}