Example #1
0
        public AccountData Serialize()
        {
            AccountData accountData = new AccountData()
            {
                Id                       = this.Id,
                Login                    = this.Login,
                PasswordHash             = this.PasswordHash,
                Nickname                 = this.Nickname,
                AvailableBreeds          = this.AvailableBreeds,
                Ticket                   = this.Ticket,
                SecretQuestion           = this.SecretQuestion,
                SecretAnswer             = this.SecretAnswer,
                Lang                     = this.Lang,
                Email                    = this.Email,
                CreationDate             = this.CreationDate,
                BanEndDate               = this.BanEndDate,
                BanReason                = this.BanReason,
                LastConnection           = this.m_loadedLastConnection,
                LastConnectionIp         = this.m_loadedLastConnectionIP,
                SubscriptionEndDate      = this.SubscriptionEnd,
                Tokens                   = (uint)this.Tokens,
                LastVote                 = this.LastVote,
                BreedFlags               = this.AvailableBreedsFlag,
                Characters               = WorldCharacters.Select(entry => new WorldCharacterData(entry.CharacterId, entry.WorldId)).ToList(),
                DeletedCharactersCount   = 0,
                IsBanned                 = false,
                IsJailed                 = false,
                LastDeletedCharacterDate = DateTime.Now.Subtract(TimeSpan.FromDays(4)),
                UserGroupId              = (int)Role
            };

            return(accountData);
        }
Example #2
0
 public AccountData Serialize()
 {
     return(new AccountData
     {
         Id = Id,
         Login = Login,
         PasswordHash = PasswordHash,
         Nickname = Nickname,
         UserGroupId = Role,
         AvailableBreeds = AvailableBreeds,
         Ticket = Ticket,
         SecretQuestion = SecretQuestion,
         SecretAnswer = SecretAnswer,
         Lang = Lang,
         Email = Email,
         CreationDate = CreationDate,
         IsJailed = IsJailed,
         IsBanned = IsBanned,
         BanEndDate = BanEndDate,
         BanReason = BanReason,
         LastConnection = m_loadedLastConnection,
         LastConnectionIp = m_loadedLastConnectionIP,
         LastHardwareId = LastHardwareId,
         SubscriptionEndDate = SubscriptionEnd,
         Characters = WorldCharacters.Select(entry => new WorldCharacterData(entry.CharacterId, entry.WorldId)).ToList(),
         LastVote = LastVote,
         Vip = Vip,
     });
 }
Example #3
0
 public IEnumerable <int> GetWorldCharactersId(int worldId) => WorldCharacters.Where(c => c.WorldId == worldId).Select(c => c.CharacterId);
Example #4
0
 public sbyte GetCharactersCountByWorld(int worldId) => (sbyte)WorldCharacters.Count(entry => entry.WorldId == worldId);