public override void OnUserChangeRoom(ClientInfo client, Room oldRoom, Room newRoom) { Dictionary <string, ClientInfo> clients = BotHandler.TRequestClients(); foreach (KeyValuePair <string, ClientInfo> info in clients) { if (info.Value.GUID != client.GUID) { if (info.Value.RoomId == newRoom.ID) { Message m = new Message("Server", MessageType.Message); m.SetContent(client.Name + " Joined your room"); m.SetColor(NColor.Orange); info.Value.Send(m); } else if (info.Value.RoomId == oldRoom.ID) { Message m = new Message("Server", MessageType.Message); m.SetContent(client.Name + " Left your room"); m.SetColor(NColor.Orange); info.Value.Send(m); } } } }
public override void OnUserConnect(ClientInfo client) { Message m = new Message("Test Bot", MessageType.Message); m.SetColor(NColor.Blue); m.SetContent("Welcome " + client.Name); BotHandler.TRequestClients().SendToAll(m, new List <ClientInfo>() { client }); }