Beispiel #1
0
        public Room GetRoom(ushort roomID)
        {
            lock (_lock)
            {
                if (RoomsMap.ContainsKey(roomID))
                {
                    return(RoomsMap[roomID]);
                }

                return(null);
            }
        }
Beispiel #2
0
        public ushort GetEmptyRoom()
        {
            lock (_lock)
            {
                for (ushort i = 0; i < ushort.MaxValue; i++)
                {
                    // max 65535 rooms

                    if (RoomsMap.ContainsKey((ushort)i))
                    {
                        continue;
                    }

                    return((ushort)i);
                }
            }

            return(ushort.MaxValue);
        }