Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public int GetCellIndex(CellRoom cell)
 {
     return(RoomList.IndexOf(cell));
 }