Ejemplo n.º 1
0
        public void BeforeLeaveGame(BeforeLeaveGameRequest request, long clientId)
        {
            var role = ManagerMediator.RoleManager.GetRoleByClientId(clientId);

            if (role != null)
            {
                if (_roleScoreDict.TryGetValue(role.RoleId, out var score))
                {
                    if (score > 0)
                    {
                        var dbRequest = new GameDBProto.SaveRoleScoreRequest {
                            RoleId = role.RoleId, Score = score
                        };
                        var dbMail = new MailPacket
                        {
                            Id       = (int)GameDBProto.MessageId.SaveRoleScoreRequestId,
                            Content  = dbRequest.ToByteArray(),
                            UserId   = role.UserId,
                            ClientId = role.ClientId
                        };
                        ManagerMediator.Dispatcher.WriteDBMail(dbMail, DBMailQueueType.Role);
                    }
                    _roleScoreDict.Remove(role.RoleId);
                }
            }
        }
Ejemplo n.º 2
0
        public void BeforeLeaveGame(BeforeLeaveGameRequest request, long clientId)
        {
            var roleId = ManagerMediator.RoleManager.GetRoleIdByClientId(clientId);
            var desk   = _room.GetDesk(_room.GetRoleDesk(roleId));

            if (desk != null)
            {
                if (desk.GameLogic is IInnerMail innerMail)
                {
                    innerMail.BeforeLeaveGame(request, clientId);
                }
            }
        }
Ejemplo n.º 3
0
 public void BeforeLeaveGame(BeforeLeaveGameRequest request, long clientId)
 {
     //throw new NotImplementedException();
 }