Beispiel #1
0
 public void RemoveRoom(Room room)
 {
     rooms.Remove(room.Id);
 }
Beispiel #2
0
 public Room CreateAndAdd(Server svr, string name)
 {
     if (IsFull) return null;
     Room room = new Room(svr, firstOpenId, name);
     Add(room);
     return room;
 }
Beispiel #3
0
 public void LeaveRoom()
 {
     if (room != null)
     {
         room.RemoveClient(this);
         room = null;
     }
 }
Beispiel #4
0
 public void Add(Room room)
 {
     if (room == null || IsFull) return;
     rooms[firstOpenId] = room;
     count++;
     while (!IsFull && rooms[firstOpenId] != null)
         firstOpenId = (byte)(firstOpenId == byte.MaxValue ? 0 : firstOpenId + 1);
 }
Beispiel #5
0
 public void JoinRoom(Room room)
 {
     LeaveRoom();
     this.room = room;
     room.AddClient(this);
 }