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