Esempio n. 1
0
        public static bool RoomConnect(CGameUser _user, int _roomNum)
        {
            Console.WriteLine("Program RoomConnect _user:{0} _roomNum:{1}", _user, _roomNum);
            if (listRoom.Count == 0)
            {
                return(false);
            }

            bool _connect;

            lock (listRoom)
            {
                _connect = listRoom[_roomNum].UserInsert(_user);
            }

            if (_connect)
            {
                _user.SetRoom(listRoom[_roomNum]);
            }

            return(_connect);
        }
Esempio n. 2
0
        public static void RoomCreate(CGameUser _user, string _roomName)
        {
            Console.WriteLine("Program RoomCreate _user:{0} _name:{1}", _user, _roomName);

            CRoom _room = new CRoom();

            _room.name = _roomName;
            _room.UserInsert(_user);
            _user.SetRoom(_room);
            lock (listRoom)
            {
                listRoom.Add(_room);

                //Room number 받아오는 부분에 버그가 있음...
                //1 -> 2 후에...
                //1 or 2제거된후에....
                //받아오면~~~~~ 2
                //2 2 번이된다 오류임....~~~
                //_room.number = listRoom.Count();
                _room.number = roomIdentity;
                roomIdentity++;
            }
        }