-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.Commands.cs
34 lines (27 loc) · 993 Bytes
/
Program.Commands.cs
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
using System;
namespace PokeD.Server.Android
{
public static partial class Program
{
private static bool ExecuteCommand(string message)
{
var command = message.Remove(0, 1).ToLower();
message = message.Remove(0, 1);
if (message.StartsWith("stop"))
{
Server?.Stop();
Console.WriteLine("Stopped the server. Press any key to continue...");
Console.Read();
//Environment.Exit((int) ExitCodes.Success);
}
else if (command.StartsWith("help server"))
return Server.ExecuteCommand(message.Remove(0, 11));
else if (command.StartsWith("help"))
return ExecuteHelpCommand(message.Remove(0, 4));
else
return Server.ExecuteCommand(message);
return true;
}
private static bool ExecuteHelpCommand(string command) { return false; }
}
}