private void ProcessChat(string line)
{
// Line: [INFO] <N3X15> !#
string name = line.Substring(8, line.IndexOf('>')-8);
string msg = line.Substring(line.IndexOf('>')+2);
Console.WriteLine("[Chat]: {0} -> {1} sez: \"{2}\"", line, name, msg);
if (msg.StartsWith("!") && msg.Length > 1)
{
string[] c = msg.Split(' ');
string[] args = new string[c.Length-1];
string cmd = c[0].Remove(0,1);
Array.Copy(c, 1, args, 0, c.Length - 1);
Console.WriteLine("Command " + cmd + " received.");
if(ChatCommand!=null)
ChatCommand(KnownPlayers[name], cmd, args);
}
if (Chat != null)
Chat(KnownPlayers[name], msg);
}