public bool RegisterCell(string serial, CellRoom cell) { if (RoomMap.ContainsKey(serial)) { string message = string.Format("Cell {0} is already exist", serial); ServerApp.Logger.Error(message); return(false); } RoomList.Add(cell); RoomMap[serial] = cell; return(true); }
public CellRoom CreateRoom(string memberID) { lock (this) { string serial = GetUniqueSerial(); CellRoom room = new CellRoom(serial, memberID); if (RegisterCell(serial, room)) { room.Join(memberID); return(room); } return(null); } }
public int GetCellIndex(CellRoom cell) { return(RoomList.IndexOf(cell)); }