public override void OnMessage(RoomConnection sender, Message m) { switch (m.Type) { case "init": new Task(() => { //Console.WriteLine(sender.Room); //sender.Connection.Send("say", @"Hi, everybody! Yes, I am annoying."); //System.Threading.Thread.Sleep(25); sender.Connection.Send("say", @"Play Cheese Edits: https://www.mediafire.com/?9114ak36c52wqe6"); System.Threading.Thread.Sleep(100); sender.Connection.Disconnect(); this.connections.Remove(sender.Room); }).Start(); break; case "add": if (!players.Contains(m.GetString(1).ToLower())) { players.Add(m.GetString(1).ToLower()); } break; } }
public virtual void OnDisconnect(RoomConnection sender, string reason) { Console.WriteLine("{0} kicked by reason {1}", sender.Room, reason); connections.Remove(sender.Room); }
public abstract void OnMessage(RoomConnection sender, Message m);
public virtual void OnConnected(RoomConnection sender) { }
public virtual void OnConnectFailed(RoomConnection sender) { connections.Remove(sender.Room); }