/// <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)); } }
/// <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)); } }
/// <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)); } }
/// <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); } }
public KeybindingManager(Player owner, AccountModel accountModel, Character characterModel) { player = owner; accountKeybindings = new KeybindingSet(accountModel); characterKeybindings = new KeybindingSet(characterModel); }
/// <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; }
/// <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; }