internal RoomHost AddRoom(GameSettings settings) { var id = Interlocked.Increment(ref RoomId); var rc = new RoomHost(this, id, settings); Rooms.Add(id, rc); Send(Commands.RoomS2C.NewRoom(id, settings)); return(rc); }
internal void RemoveRoom(RoomHost rc) { var room = rc.Room; if (Rooms.Remove(room.Id)) { rc.Dispose(); room.RemoveUsers(); Send(Commands.RoomS2C.RemoveRoom(room.Id)); } }