Ejemplo n.º 1
0
        /// <summary>
        /// Create a new <see cref="GenericUnlockManager"/> from <see cref="Account"/> database model.
        /// </summary>
        public GenericUnlockManager(WorldSession session, AccountModel model)
        {
            this.session = session;

            foreach (AccountGenericUnlock unlockModel in model.AccountGenericUnlock)
            {
                unlocks.Add(unlockModel.Entry, new GenericUnlock(unlockModel));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new <see cref="KeybindingSet"/> from an existing database model.
        /// </summary>
        public KeybindingSet(AccountModel model)
        {
            Owner    = model.Id;
            InputSet = InputSets.Account;

            foreach (AccountKeybinding binding in model.AccountKeybinding)
            {
                bindings.Add(binding.InputActionId, new Keybinding(Owner, binding));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new <see cref="CurrencyManager"/> from existing <see cref="Account"/> and <see cref="Character"/> database models.
        /// </summary>
        public CostumeManager(Player owner, AccountModel accountModel, Character characterModel)
        {
            player = owner;

            foreach (CharacterCostume costumeModel in characterModel.CharacterCostume)
            {
                costumes.Add(costumeModel.Index, new Costume(costumeModel));
            }

            foreach (AccountCostumeUnlock costumeUnlockModel in accountModel.AccountCostumeUnlock)
            {
                costumeUnlocks.Add(costumeUnlockModel.ItemId, new CostumeUnlock(costumeUnlockModel));
            }
        }
        public AccountCurrencyManager(WorldSession session, AccountModel model)
        {
            this.session = session;

            foreach (AccountCurrencyModel currencyModel in model.AccountCurrency)
            {
                // Disabled Character Token for now due to causing server errors if the player tries to use it. TODO: Fix level 50 creation
                if ((AccountCurrencyType)currencyModel.CurrencyId == AccountCurrencyType.MaxLevelToken)
                {
                    continue;
                }

                currencies.Add((AccountCurrencyType)currencyModel.CurrencyId, new AccountCurrency(currencyModel));
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new <see cref="EntitlementManager"/> from existing database model.
        /// </summary>
        public EntitlementManager(WorldSession session, AccountModel model)
        {
            this.session = session;

            foreach (AccountEntitlementModel entitlementModel in model.AccountEntitlement)
            {
                EntitlementEntry entry = GameTableManager.Instance.Entitlement.GetEntry(entitlementModel.EntitlementId);
                if (entry == null)
                {
                    throw new DatabaseDataException($"Account {model.Id} has invalid entitlement {entitlementModel.EntitlementId} stored!");
                }

                var entitlement = new AccountEntitlement(entitlementModel, entry);
                accountEntitlements.Add(entitlement.Type, entitlement);
            }
        }
Ejemplo n.º 6
0
 public KeybindingManager(Player owner, AccountModel accountModel, Character characterModel)
 {
     player               = owner;
     accountKeybindings   = new KeybindingSet(accountModel);
     characterKeybindings = new KeybindingSet(characterModel);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Create a new <see cref="CostumeUnlock"/> from supplied <see cref="GenericUnlockEntryEntry"/>.
 /// </summary>
 public GenericUnlock(AccountModel account, GenericUnlockEntryEntry entry)
 {
     Entry     = entry;
     accountId = account.Id;
     isDirty   = true;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Create a new <see cref="CostumeUnlock"/> from supplied item id.
 /// </summary>
 public CostumeUnlock(AccountModel account, uint itemId)
 {
     ItemId    = itemId;
     accountId = account.Id;
     saveMask  = CostumeUnlockSaveMask.Create;
 }