Exemplo n.º 1
0
        public static Account FromDb(DbAccount acc)
        {
            return(new Account()
            {
                AccountId = acc.AccountId,
                Name = acc.Name,

                NameChosen = acc.NameChosen,
                Converted = false,
                Admin = acc.Admin,
                Rank = acc.Rank,
                VerifiedEmail = acc.Verified,
                AgeVerified = acc.AgeVerified,
                FirstDeath = acc.FirstDeath,

                Credits = acc.Credits,
                NextCharSlotPrice = Program.Resources.Settings.CharacterSlotCost,
                CharSlotCurrency = Program.Resources.Settings.CharacterSlotCurrency,
                MenuMusic = Program.Resources.Settings.MenuMusic,
                DeadMusic = Program.Resources.Settings.DeadMusic,
                BeginnerPackageTimeLeft = 0,

                Vault = Vault.FromDb(acc, new DbVault(acc)),
                Stats = Stats.FromDb(acc, new DbClassStats(acc)),
                Guild = GuildIdentity.FromDb(acc, new DbGuild(acc)),

                Skins = acc.Skins ?? new ushort[0],
                Banned = acc.Banned,
                BanReasons = acc.Notes,
                BanLiftTime = acc.BanLiftTime,
                LastSeen = acc.LastSeen
            });
        }
Exemplo n.º 2
0
        public static Account FromDb(DbAccount acc)
        {
            return(new Account()
            {
                AccountId = acc.AccountId,
                Name = acc.Name,

                NameChosen = acc.NameChosen,
                Admin = acc.Admin,
                Rank = acc.Rank,
                FirstDeath = acc.FirstDeath,

                Credits = acc.Credits,
                NextCharSlotPrice = Program.Resources.Settings.NewAccounts.SlotCost,
                NextCharSlotCurrency = (int)Program.Resources.Settings.NewAccounts.SlotCurrency,
                MenuMusic = Program.Resources.Settings.MenuMusic,
                DeadMusic = Program.Resources.Settings.DeadMusic,

                Vault = Vault.FromDb(acc, new DbVault(acc)),
                Stats = Stats.FromDb(acc, new DbClassStats(acc)),
                Guild = GuildIdentity.FromDb(acc, new DbGuild(acc)),

                Skins = acc.Skins ?? new ushort[0],
                CanMapEdit = acc.Admin || acc.Rank > 50
            });
        }