예제 #1
0
파일: Room.cs 프로젝트: zd304/ProjectD
        public void JoinRoom(GameClientPeer peer, string userName)
        {
            if (!userNames.Contains(userName))
            {
                return;
            }
            userNames.Remove(userName);

            RoomClient client = new RoomClient();

            client.peer      = peer;
            client.userNamae = userName;
            roomClients.Add(client);

            if (userNames.Count <= 0 && maxClient == roomClients.Count)
            {
                for (int i = 0; i < roomClients.Count; ++i)
                {
                    RoomClient  roomClient = roomClients[i];
                    NullMessage message    = new NullMessage();

                    roomClient.peer.SendEvent(OperationCode.JoinRoom, message);
                }
            }
        }
예제 #2
0
        protected override PeerBase CreatePeer(InitRequest initRequest)
        {
            GameClientPeer peer = new GameClientPeer(initRequest);

            clientPeerList.Add(peer);
            return(peer);
        }