Example #1
0
 private void OnMandatoryLogOut(MandatoryLogOutEvent e)
 {
     if (e.PlayerId != 0 && e.Token != null)
     {
         _playerInfoManager.RemovePlayerInfo(e.Token);
     }
 }
Example #2
0
 private void OnMandatoryLogOut(MandatoryLogOutEvent e)
 {
     if (e.PlayerId != 0 && _dictPlayers.ContainsKey(e.PlayerId))
     {
         var player = _dictPlayers[e.PlayerId];
         _logger.InfoFormat("Hall player login timeout ... Id:{0}, Name:{1}", player.PlayerId, player.PlayerName);
         RemovePlayer(player.PlayerId);
     }
 }
Example #3
0
        private bool FilterMandatoryLogOutEvent(MandatoryLogOutEvent e)
        {
            if (e.LogOutReason == MandatoryLogOutEvent.Reason.GameExit)
            {
                //dispose mandatory logout event on gameover if the correspoding message have been sent
                if (_statistic.IsGameOverMandateLogOutSend)
                {
                    e.IsDisposed = true;
                    return(true);
                }

                //never send mandaotry logout message on gameover until the gameover message have been sent
                if (!_statistic.IsGameOverMsgSend)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #4
0
        private void SendMandateLogOutMessage(MandatoryLogOutEvent e)
        {
            _logger.InfoFormat("Mandatory Logout Message HallRoom Id {0} Room Id {1} PlayerEntityId {2}", e.HallRoomId, e.RoomId, e.PlayerId);

            LongData hallRoomId = LongData.Allocate();

            hallRoomId.Value = e.HallRoomId;
            IntData roomId = IntData.Allocate();

            roomId.Value = e.RoomId;
            LongData playerId = LongData.Allocate();

            playerId.Value = e.PlayerId;

            SendAndReleaseMessage(RpcMessageType.MandateLogOut, hallRoomId, roomId, playerId);

            if (e.LogOutReason == MandatoryLogOutEvent.Reason.GameExit)
            {
                _statistic.IsGameOverMandateLogOutSend = true;
            }
        }