示例#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);
 }
示例#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);
            }
        }
示例#3
0
 public int GetCellIndex(CellRoom cell)
 {
     return(RoomList.IndexOf(cell));
 }