private static Boolean SendMessage(Server server, String message) { var con = new RConnection(); con.HostName = server.Host; con.Port = (ushort)server.Port; con.PlaintextPassword = server.Password; con.Connect(); while (!con.Client.Connected) { System.Threading.Thread.Sleep(200); } con.Login(); con.Command("admin.say", message, "all"); System.Threading.Thread.Sleep(200); con.Shutdown(); return(true); }
void Connection_Connected(RConnection sender) { Console.WriteLine("{0} {1}", DateTime.Now, "Node is now connected to game server"); sender.Login(); sender.EnableEvents(); }