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); } } }
protected override PeerBase CreatePeer(InitRequest initRequest) { GameClientPeer peer = new GameClientPeer(initRequest); clientPeerList.Add(peer); return(peer); }