Esempio n. 1
0
 public void RemoveRoom(Room room)
 {
     rooms.Remove(room.Id);
 }
Esempio n. 2
0
 public Room CreateAndAdd(Server svr, string name)
 {
     if (IsFull) return null;
     Room room = new Room(svr, firstOpenId, name);
     Add(room);
     return room;
 }
Esempio n. 3
0
 public void LeaveRoom()
 {
     if (room != null)
     {
         room.RemoveClient(this);
         room = null;
     }
 }
Esempio n. 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);
 }
Esempio n. 5
0
 public void JoinRoom(Room room)
 {
     LeaveRoom();
     this.room = room;
     room.AddClient(this);
 }