コード例 #1
0
        protected override Player MakePlayer(GamePeer peer, PlayerInfo info)
        {
            //Get Info from webserver
            BlackjackPlayer newPlayer = new BlackjackPlayer(peer, info);

            return newPlayer;
        }
コード例 #2
0
        public static PlayerKey MakeFromPeer(GamePeer peer)
        {
            PlayerKey key;

            key.ID = peer.ConnectionId;
            return(key);
        }
コード例 #3
0
ファイル: GamePeer.cs プロジェクト: rkdrnf/photonserver
 public void OnBroadcastMessage(GamePeer peer, EventData eventData, SendParameters sendParameters)
 {
     if (peer != this)
     {
         this.SendEvent(eventData, sendParameters);
     }
 }
コード例 #4
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public virtual void HandleOperationRequest(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            switch (operationRequest.OperationCode)
            {
                case CommonOperationCode.Join:
                    HandleJoinOperation(peer, operationRequest, sendParameters);
                    break;

                case CommonOperationCode.Exit:
                    HandleExitOperation(peer, operationRequest, sendParameters);
                    break;

                case CommonOperationCode.Chat:
                    HandleChatOperation(peer, operationRequest, sendParameters);
                    break;

                case CommonOperationCode.GetRooms:
                    SendAllRoomStatus(peer, sendParameters);
                    break;

                case CommonOperationCode.ConfirmJoin:
                    var task = HandleConfirmJoinOperation(peer, operationRequest, sendParameters);
                    task.Wait();
                    break;
            }
        }
コード例 #5
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public async Task HandleConfirmJoinOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var joinRequest = new ConfirmJoinRequest(peer.Protocol, operationRequest);

            if (!peer.ValidateOperation(joinRequest, sendParameters))
            {
                return;
            }

            //string playerInfoStr = await WebHelper.RequestPlayerInfo(joinRequest.UserKey);
            string playerInfoStr = "{ \"username\": \"test\", \"game_money\": 2000 }";

            PlayerInfo info = JsonConvert.DeserializeObject <PlayerInfo>(playerInfoStr);

            PeerManager.Instance.OnPeerJoin(peer, new PeerInfo(peer, joinRequest.RoomID, joinRequest.UserKey));

            var room = FindRoom(joinRequest.RoomID);

            if (room != null)
            {
                room.ExecutionFiber.Enqueue(() => room.Join(peer, joinRequest, sendParameters, info));
            }
            else
            {
                var response = new OperationResponse(CommonOperationCode.ConfirmJoin,
                                                     new Dictionary <byte, object> {
                    { (byte)CommonParameterKey.Success, false }
                });
                peer.SendOperationResponse(response, sendParameters);
            }
        }
コード例 #6
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public virtual void HandleOperationRequest(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            switch (operationRequest.OperationCode)
            {
            case CommonOperationCode.Join:
                HandleJoinOperation(peer, operationRequest, sendParameters);
                break;

            case CommonOperationCode.Exit:
                HandleExitOperation(peer, operationRequest, sendParameters);
                break;

            case CommonOperationCode.Chat:
                HandleChatOperation(peer, operationRequest, sendParameters);
                break;

            case CommonOperationCode.GetRooms:
                SendAllRoomStatus(peer, sendParameters);
                break;

            case CommonOperationCode.ConfirmJoin:
                var task = HandleConfirmJoinOperation(peer, operationRequest, sendParameters);
                task.Wait();
                break;
            }
        }
コード例 #7
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public async Task HandleConfirmJoinOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var joinRequest = new ConfirmJoinRequest(peer.Protocol, operationRequest);
            if (!peer.ValidateOperation(joinRequest, sendParameters))
            {
                return;
            }

            //string playerInfoStr = await WebHelper.RequestPlayerInfo(joinRequest.UserKey);
            string playerInfoStr = "{ \"username\": \"test\", \"game_money\": 2000 }";

            PlayerInfo info = JsonConvert.DeserializeObject<PlayerInfo>(playerInfoStr);

            PeerManager.Instance.OnPeerJoin(peer, new PeerInfo(peer, joinRequest.RoomID, joinRequest.UserKey));

            var room = FindRoom(joinRequest.RoomID);

            if (room != null)
            {
                room.ExecutionFiber.Enqueue(() => room.Join(peer, joinRequest, sendParameters, info));
            }
            else
            {
                var response = new OperationResponse(CommonOperationCode.ConfirmJoin,
                new Dictionary<byte, object> { { (byte)CommonParameterKey.Success, false } });
                peer.SendOperationResponse(response, sendParameters);
            }
        }
コード例 #8
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public void SendAllRoomStatus(GamePeer peer, SendParameters sendParameters)
        {
            GetRoomsResponse response = new GetRoomsResponse();

            response.RoomProperties = PacketHelper.Serialize <RoomPropertyList>(GetRoomProperties());
            peer.SendOperationResponse(new OperationResponse(CommonOperationCode.GetRooms, response), sendParameters);
        }
コード例 #9
0
ファイル: GamePeer.cs プロジェクト: rkdrnf/photonserver
 public void OnBroadcastMessage(GamePeer peer, EventData eventData, SendParameters sendParameters)
 {
     if (peer != this)
     {
         this.SendEvent(eventData, sendParameters);
     }
 }
コード例 #10
0
ファイル: BaccaratPlayer.cs プロジェクト: rkdrnf/photonserver
 public BaccaratPlayer(GamePeer peer, PlayerInfo info)
     : base(peer, info)
 {
     money = info.game_money;
     win = 0;
     lose = 0;
 }
コード例 #11
0
 public BlackjackPlayer(GamePeer peer, PlayerInfo info)
     : base(peer, info)
 {
     money = info.game_money;
     win = 0;
     lose = 0;
     status = PlayerStatus.Waiting;
 }
コード例 #12
0
 public void RemovePlayer(GamePeer peer)
 {
     lock (playerLock)
     {
         PlayerKey pKey = PlayerKey.MakeFromPeer(peer);
         playersDic.Remove(pKey);
     }
 }
コード例 #13
0
 public Player AddPlayer(GamePeer peer, PlayerInfo info)
 {
     lock (playerLock)
     {
         Player newPlayer = MakePlayer(peer, info);
         playersDic.Add(newPlayer.key, newPlayer);
         return(newPlayer);
     }
 }
コード例 #14
0
ファイル: PeerManager.cs プロジェクト: rkdrnf/photonserver
        public void OnPeerJoin(GamePeer peer, PeerInfo info)
        {
            ClearPeerInfo(peer);

            peersDic.Add(peer.ConnectionId, peer);
            peerInfosDic.Add(peer.ConnectionId, info);

            peer.OnLeaveHandler += OnPeerLeave;
        }
コード例 #15
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        protected void BroadcastMessage(GamePeer peer, EventData eventData, SendParameters sendParameters)
        {
            if (BroadcastMessageHandler == null)
            {
                return;
            }

            BroadcastMessageHandler(peer, eventData, sendParameters);
        }
コード例 #16
0
        public void OnPeerJoin(GamePeer peer, PeerInfo info)
        {
            ClearPeerInfo(peer);

            peersDic.Add(peer.ConnectionId, peer);
            peerInfosDic.Add(peer.ConnectionId, info);

            peer.OnLeaveHandler += OnPeerLeave;
        }
コード例 #17
0
        public override void RemovePlayer(GamePeer peer, ExitRequest exitReq, SendParameters sendParameters)
        {
            BaccaratPlayer player = playerManager.GetPlayer(peer) as BaccaratPlayer;
            playersBetDic.Remove(player);
            seatsDic.Remove(player.seat);

            base.RemovePlayer(peer, exitReq, sendParameters);

            CheckAllBet();
        }
コード例 #18
0
        public Player GetPlayer(GamePeer peer)
        {
            PlayerKey key = PlayerKey.MakeFromPeer(peer);

            if (playersDic.ContainsKey(key))
            {
                return(playersDic[key]);
            }

            return(null);
        }
コード例 #19
0
        private void HandleBetRequest(GamePeer gamePeer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var room = FindPeerRoom(gamePeer) as BaccaratGameRoom;

            var sendBetRequest = new SendBetRequest(gamePeer.Protocol, operationRequest);

            if (room != null)
            {
                room.Bet(gamePeer, sendBetRequest);
            }
        }
コード例 #20
0
        private void HandleBetBroadcastRequest(GamePeer gamePeer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var room = FindPeerRoom(gamePeer) as BlackjackGameRoom;

            var betBroadcast = new BroadcastBetRequest(gamePeer.Protocol, operationRequest);

            if (room != null)
            {
                room.BroadcastBet(gamePeer, betBroadcast);
            }
        }
コード例 #21
0
        private void HandleActionRequest(GamePeer gamePeer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var room = FindPeerRoom(gamePeer) as BlackjackGameRoom;

            var actionRequest = new ActionRequest(gamePeer.Protocol, operationRequest);

            if (room != null)
            {
                room.OnPlayerAction(gamePeer, actionRequest);
            }
        }
コード例 #22
0
        private void ClearPeerInfo(GamePeer peer)
        {
            if (peersDic.ContainsKey(peer.ConnectionId))
            {
                peersDic.Remove(peer.ConnectionId);
            }

            if (peerInfosDic.ContainsKey(peer.ConnectionId))
            {
                peerInfosDic.Remove(peer.ConnectionId);
            }
        }
コード例 #23
0
ファイル: PeerManager.cs プロジェクト: rkdrnf/photonserver
        private void ClearPeerInfo(GamePeer peer)
        {
            if (peersDic.ContainsKey(peer.ConnectionId))
            {
                peersDic.Remove(peer.ConnectionId);
            }

            if (peerInfosDic.ContainsKey(peer.ConnectionId))
            {
                peerInfosDic.Remove(peer.ConnectionId);
            }
        }
コード例 #24
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        protected GameRoom FindPeerRoom(GamePeer peer)
        {
            foreach (var room in roomsDic.Values)
            {
                if (room.HasPlayer(peer))
                {
                    return(room);
                }
            }

            return(null);
        }
コード例 #25
0
        public bool HasPlayer(GamePeer peer)
        {
            PlayerKey pKey;

            pKey.ID = peer.ConnectionId;

            if (playersDic.ContainsKey(pKey))
            {
                return(true);
            }
            return(false);
        }
コード例 #26
0
        public void Bet(GamePeer peer, SendBetRequest sendBet)
        {
            BaccaratPlayer player = playerManager.GetPlayer(peer) as BaccaratPlayer;
            var bet = new BaccaratBet(sendBet.BankerBet, sendBet.PlayerBet, sendBet.TieBet);

            if (HasBet(player) == false && CanBet(player, bet))
            {
                playersBetDic.Add(player, bet);
            }

            CheckAllBet();
        }
コード例 #27
0
        public void BroadcastBet(GamePeer peer, BroadcastBetRequest broadcastBet)
        {
            broadcastBet.Actor = playerManager.GetPlayer(peer).key.ID;
            var eventData = new EventData(EventCode.BaccaratBroadcastBet) { Parameters = broadcastBet.OperationRequest.Parameters };

            lock (syncRoot)
            {
                BroadcastMessage(peer, eventData, new SendParameters());
            }

            var response = new OperationResponse(CommonOperationCode.BaccaratBroadcastBet, new Dictionary<byte, object> { { (byte)CommonParameterKey.Success, true } });
            peer.SendOperationResponse(response, new SendParameters());
        }
コード例 #28
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public bool CanJoin(GamePeer peer)
        {
            if (playerManager.HasPlayer(peer))
            {
                return false; //already joined.
            }

            if (playerManager.isFull())
            {
                return false; //exceed max player count.
            }

            return true;
        }
コード例 #29
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public bool CanJoin(GamePeer peer)
        {
            if (playerManager.HasPlayer(peer))
            {
                return(false); //already joined.
            }

            if (playerManager.isFull())
            {
                return(false); //exceed max player count.
            }

            return(true);
        }
コード例 #30
0
        public override void HandleOperationRequest(GamePeer gamePeer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            base.HandleOperationRequest(gamePeer, operationRequest, sendParameters);
            //nothing

            switch(operationRequest.OperationCode)
            {
                case CommonOperationCode.BaccaratBet:
                    HandleBetRequest(gamePeer, operationRequest, sendParameters);
                    break;

                case CommonOperationCode.BaccaratBroadcastBet:
                    HandleBetBroadcastRequest(gamePeer, operationRequest, sendParameters);
                    break;
            }
        }
コード例 #31
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public void HandleChatOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var chatRequest = new ChatRequest(peer.Protocol, operationRequest);

            if (!peer.ValidateOperation(chatRequest, sendParameters))
            {
                return;
            }

            var room = FindPeerRoom(peer);

            if (room != null)
            {
                room.Chat(peer, chatRequest, sendParameters);
            }
        }
コード例 #32
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public void Chat(GamePeer peer, ChatRequest chatReq, SendParameters sendParameters)
        {
            var eventData = new EventData(EventCode.Chat)
            {
                Parameters = chatReq.OperationRequest.Parameters
            };

            lock (syncRoot)
            {
                BroadcastMessage(peer, eventData, sendParameters);
            }

            var response = new OperationResponse(CommonOperationCode.Chat);

            peer.SendOperationResponse(response, sendParameters);
        }
コード例 #33
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public void HandleExitOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var exitRequest = new ExitRequest(peer.Protocol, operationRequest);

            if (!peer.ValidateOperation(exitRequest, sendParameters))
            {
                return;
            }

            var room = FindPeerRoom(peer);

            if (room != null)
            {
                room.ExecutionFiber.Enqueue(() => room.Leave(peer));
            }
            peer.Leave();
        }
コード例 #34
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public void HandleJoinOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var joinRequest = new JoinRequest(peer.Protocol, operationRequest);
            if (!peer.ValidateOperation(joinRequest, sendParameters))
            {
                return;
            }

            var room = FindRoom(joinRequest.RoomID);

            var response = new OperationResponse(CommonOperationCode.Join,
                   new Dictionary<byte, object> { { (byte)CommonParameterKey.Success, false } });
            response.Parameters[(byte)JoinParameterKey.RoomID] = joinRequest.RoomID;

            if (room != null && room.CanJoin(peer))
            {
                response.Parameters[(byte)CommonParameterKey.Success] = true;
            }
            peer.SendOperationResponse(response, sendParameters);
        }
コード例 #35
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public void Join(GamePeer peer, ConfirmJoinRequest joinReq, SendParameters sendParameters, PlayerInfo info)
        {
            if (CanJoin(peer))
            {
                Player newPlayer = playerManager.AddPlayer(peer, info);

                BroadcastMessageHandler += peer.OnBroadcastMessage;
                peer.OnLeaveHandler     += OnPeerLeave;

                OnJoin(peer);
            }
            else
            {
                var response = new OperationResponse(CommonOperationCode.ConfirmJoin,
                                                     new Dictionary <byte, object> {
                    { (byte)CommonParameterKey.Success, false }
                });

                peer.SendOperationResponse(response, sendParameters);
            }
        }
コード例 #36
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public virtual void RemovePlayer(GamePeer peer, ExitRequest exitReq, SendParameters sendParameters)
        {
            lock (syncRoot)
            {
                if (playerManager.HasPlayer(peer) == false)
                {
                    return; //already removed.
                }

                BroadcastMessageHandler -= peer.OnBroadcastMessage;
                peer.OnLeaveHandler     -= OnPeerLeave;

                PlayerLeaveEvent leaveEvent = new PlayerLeaveEvent();
                leaveEvent.Actor = playerManager.GetPlayer(peer).key.ID;

                EventData eventData = new EventData(EventCode.PlayerLeave, leaveEvent);
                BroadcastMessage(peer, eventData, sendParameters);

                playerManager.RemovePlayer(peer);
            }
        }
コード例 #37
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        public void HandleJoinOperation(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            var joinRequest = new JoinRequest(peer.Protocol, operationRequest);

            if (!peer.ValidateOperation(joinRequest, sendParameters))
            {
                return;
            }

            var room = FindRoom(joinRequest.RoomID);

            var response = new OperationResponse(CommonOperationCode.Join,
                                                 new Dictionary <byte, object> {
                { (byte)CommonParameterKey.Success, false }
            });

            response.Parameters[(byte)JoinParameterKey.RoomID] = joinRequest.RoomID;

            if (room != null && room.CanJoin(peer))
            {
                response.Parameters[(byte)CommonParameterKey.Success] = true;
            }
            peer.SendOperationResponse(response, sendParameters);
        }
コード例 #38
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public void Join(GamePeer peer, ConfirmJoinRequest joinReq, SendParameters sendParameters, PlayerInfo info)
        {
            if (CanJoin(peer))
            {
                Player newPlayer = playerManager.AddPlayer(peer, info);

                BroadcastMessageHandler += peer.OnBroadcastMessage;
                peer.OnLeaveHandler += OnPeerLeave;

                OnJoin(peer);
            }
            else
            {
                var response = new OperationResponse(CommonOperationCode.ConfirmJoin,
                new Dictionary<byte, object> { { (byte)CommonParameterKey.Success, false } });

                peer.SendOperationResponse(response, sendParameters);
            }
        }
コード例 #39
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 public void Leave(GamePeer peer)
 {
     OnPeerLeave(peer);
 }
コード例 #40
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 protected abstract void OnJoin(GamePeer peer);
コード例 #41
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 public bool HasPlayer(GamePeer peer)
 {
     return playerManager.HasPlayer(peer);
 }
コード例 #42
0
 public void HandleOperationRequest(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
 {
     gameCore.HandleOperationRequest(peer, operationRequest, sendParameters);
 }
コード例 #43
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 public void Leave(GamePeer peer)
 {
     OnPeerLeave(peer);
 }
コード例 #44
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 protected abstract void OnJoin(GamePeer peer);
コード例 #45
0
 public PeerInfo GetPeerInfo(GamePeer peer)
 {
     return(peerInfosDic.ContainsKey(peer.ConnectionId) ? peerInfosDic[peer.ConnectionId] : null);
 }
コード例 #46
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public virtual void RemovePlayer(GamePeer peer, ExitRequest exitReq, SendParameters sendParameters)
        {
            lock (syncRoot)
            {
                if (playerManager.HasPlayer(peer) == false)
                {
                    return; //already removed.
                }

                BroadcastMessageHandler -= peer.OnBroadcastMessage;
                peer.OnLeaveHandler -= OnPeerLeave;

                PlayerLeaveEvent leaveEvent = new PlayerLeaveEvent();
                leaveEvent.Actor = playerManager.GetPlayer(peer).key.ID;

                EventData eventData = new EventData(EventCode.PlayerLeave, leaveEvent);
                BroadcastMessage(peer, eventData, sendParameters);

                playerManager.RemovePlayer(peer);

            }
        }
コード例 #47
0
 public void HandleOperationRequest(GamePeer peer, OperationRequest operationRequest, SendParameters sendParameters)
 {
     gameCore.HandleOperationRequest(peer, operationRequest, sendParameters);
 }
コード例 #48
0
ファイル: PeerInfo.cs プロジェクト: rkdrnf/photonserver
 public PeerInfo(GamePeer peer, int roomID, string userKey)
 {
     this.connectionID = peer.ConnectionId;
     this.roomID       = roomID;
     this.userKey      = userKey;
 }
コード例 #49
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
        protected GameRoom FindPeerRoom(GamePeer peer)
        {
            foreach (var room in roomsDic.Values)
            {
                if (room.HasPlayer(peer))
                {
                    return room;
                }
            }

            return null;
        }
コード例 #50
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 private void OnPeerLeave(GamePeer peer)
 {
     RemovePlayer(peer, null, new SendParameters());
 }
コード例 #51
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        protected void BroadcastMessage(GamePeer peer, EventData eventData, SendParameters sendParameters)
        {
            if (BroadcastMessageHandler == null) return;

            BroadcastMessageHandler(peer, eventData, sendParameters);
        }
コード例 #52
0
 protected abstract Player MakePlayer(GamePeer peer, PlayerInfo info);
コード例 #53
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 private void OnPeerLeave(GamePeer peer)
 {
     RemovePlayer(peer, null, new SendParameters());
 }
コード例 #54
0
ファイル: PeerManager.cs プロジェクト: rkdrnf/photonserver
 public PeerInfo GetPeerInfo(GamePeer peer)
 {
     return peerInfosDic.ContainsKey(peer.ConnectionId) ? peerInfosDic[peer.ConnectionId] : null;
 }
コード例 #55
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
        public void Chat(GamePeer peer, ChatRequest chatReq, SendParameters sendParameters)
        {
            var eventData = new EventData(EventCode.Chat) { Parameters = chatReq.OperationRequest.Parameters };
            lock (syncRoot)
            {
                BroadcastMessage(peer, eventData, sendParameters);
            }

            var response = new OperationResponse(CommonOperationCode.Chat);
            peer.SendOperationResponse(response, sendParameters);
        }
コード例 #56
0
ファイル: GameCore.cs プロジェクト: rkdrnf/photonserver
 public void HandleDisconnect(GamePeer peer)
 {
     peer.Leave();
 }
コード例 #57
0
 public void OnPeerLeave(GamePeer peer)
 {
     ClearPeerInfo(peer);
 }
コード例 #58
0
ファイル: PeerManager.cs プロジェクト: rkdrnf/photonserver
 public void OnPeerLeave(GamePeer peer)
 {
     ClearPeerInfo(peer);
 }
コード例 #59
0
ファイル: Player.cs プロジェクト: rkdrnf/photonserver
 public Player(GamePeer peer, PlayerInfo info)
 {
     this.peer = peer;
     this.key = PlayerKey.MakeFromPeer(peer);
     this.name = info.username;
 }
コード例 #60
0
ファイル: GameRoom.cs プロジェクト: rkdrnf/photonserver
 public bool HasPlayer(GamePeer peer)
 {
     return(playerManager.HasPlayer(peer));
 }