public void Save()
        {
            Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
            using (System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <int, AccountRelation> > enumerator = this.m_relations.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    System.Collections.Generic.KeyValuePair <int, AccountRelation> current = enumerator.Current;
                    database.Save(current);
                }
                goto IL_63;
            }
IL_49:
            AccountRelation poco;

            if (this.m_relationsToRemove.TryPop(out poco))
            {
                database.Delete(poco);
            }
IL_63:
            if (this.m_relationsToRemove.Count == 0)
            {
                return;
            }
            goto IL_49;
        }
 internal void LoadSpells()
 {
     Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
     foreach (CharacterSpellRecord current in database.Query <CharacterSpellRecord>(string.Format(CharacterSpellRelator.FetchByOwner, this.Owner.Id), new object[0]))
     {
         CharacterSpell characterSpell = new CharacterSpell(current);
         this.m_spells.Add(characterSpell.Id, characterSpell);
     }
 }
 public void Save(Stump.ORM.Database database)
 {
     if (this.Record.IsNew)
     {
         database.Insert(this.Record);
     }
     else
     {
         database.Update(this.Record);
     }
     this.IsDirty      = false;
     this.Record.IsNew = false;
 }
        public override void Save()
        {
            lock (base.Locker)
            {
                Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
                using (System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <int, BasePlayerItem> > enumerator = (
                           from item in base.Items
                           where this.Tokens == null || item.Value != this.Tokens
                           select item).GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        System.Collections.Generic.KeyValuePair <int, BasePlayerItem> current = enumerator.Current;
                        if (current.Value.Record.IsNew)
                        {
                            database.Insert(current.Value.Record);
                            current.Value.Record.IsNew = false;
                        }
                        else
                        {
                            if (current.Value.Record.IsDirty)
                            {
                                database.Update(current.Value.Record);
                            }
                        }
                    }
                    goto IL_EF;
                }
IL_D6:
                BasePlayerItem basePlayerItem = base.ItemsToDelete.Dequeue();
                database.Delete(basePlayerItem.Record);
IL_EF:
                if (base.ItemsToDelete.Count > 0)
                {
                    goto IL_D6;
                }
                if ((this.Tokens == null && this.Owner.Account.Tokens > 0u) || (this.Tokens != null && this.Owner.Account.Tokens != this.Tokens.Stack))
                {
                    this.Owner.Account.Tokens = ((this.Tokens == null) ? 0u : this.Tokens.Stack);
                    IPCAccessor.Instance.Send(new UpdateAccountMessage(this.Owner.Account));
                }
            }
        }
        public virtual void Save()
        {
            lock (this.Locker)
            {
                Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
                using (System.Collections.Generic.Dictionary <int, T> .Enumerator enumerator = this.Items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        System.Collections.Generic.KeyValuePair <int, T> current = enumerator.Current;
                        T value = current.Value;
                        if (value.Record.IsNew)
                        {
                            Stump.ORM.Database arg_74_0 = database;
                            value = current.Value;
                            arg_74_0.Insert(value.Record);
                            value = current.Value;
                            value.Record.IsNew = false;
                        }
                        else
                        {
                            value = current.Value;
                            if (value.Record.IsDirty)
                            {
                                Stump.ORM.Database arg_CF_0 = database;
                                value = current.Value;
                                arg_CF_0.Update(value.Record);
                            }
                        }
                    }
                    goto IL_111;
                }
IL_F1:
                T t = this.ItemsToDelete.Dequeue();
                database.Delete(t.Record);
IL_111:
                if (this.ItemsToDelete.Count > 0)
                {
                    goto IL_F1;
                }
            }
        }
Beispiel #6
0
 public void Save(Stump.ORM.Database database)
 {
     this.Record.Spells = this.GetTaxCollectorSpellsLevels();
     if (this.Record.IsNew)
     {
         database.Insert(this.Record);
     }
     else
     {
         database.Update(this.Record);
     }
     foreach (GuildMember current in
              from x in this.Members
              where !x.IsConnected && x.IsDirty
              select x)
     {
         current.Save(database);
     }
     this.IsDirty      = false;
     this.Record.IsNew = false;
 }
        public void Save()
        {
            lock (this.m_locker)
            {
                Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
                foreach (System.Collections.Generic.KeyValuePair <int, ItemShortcut> current in this.m_itemShortcuts)
                {
                    if (current.Value.IsDirty || current.Value.IsNew)
                    {
                        database.Save(current.Value);
                    }
                }
                using (System.Collections.Generic.Dictionary <int, SpellShortcut> .Enumerator enumerator2 = this.m_spellShortcuts.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        System.Collections.Generic.KeyValuePair <int, SpellShortcut> current2 = enumerator2.Current;
                        if (current2.Value.IsDirty || current2.Value.IsNew)
                        {
                            database.Save(current2.Value);
                        }
                    }
                    goto IL_FD;
                }
IL_E3:
                Stump.Server.WorldServer.Database.Shortcuts.Shortcut shortcut = this.m_shortcutsToDelete.Dequeue();
                if (shortcut != null)
                {
                    database.Delete(shortcut);
                }
IL_FD:
                if (this.m_shortcutsToDelete.Count > 0)
                {
                    goto IL_E3;
                }
            }
        }
        public void Save()
        {
            lock (this.m_locker)
            {
                Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
                using (System.Collections.Generic.Dictionary <int, CharacterSpell> .Enumerator enumerator = this.m_spells.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        System.Collections.Generic.KeyValuePair <int, CharacterSpell> current = enumerator.Current;
                        database.Save(current.Value.Record);
                    }
                    goto IL_79;
                }
IL_65:
                CharacterSpellRecord poco = this.m_spellsToDelete.Dequeue();
                database.Delete(poco);
IL_79:
                if (this.m_spellsToDelete.Count > 0)
                {
                    goto IL_65;
                }
            }
        }
 public void Save(Stump.ORM.Database database)
 {
     database.Update(this.Record);
     this.IsDirty = false;
 }
 internal void Load()
 {
     Stump.ORM.Database database = ServerBase <WorldServer> .Instance.DBAccessor.Database;
     this.m_spellShortcuts = database.Query <SpellShortcut>(string.Format(SpellShortcutRelator.FetchByOwner, this.Owner.Id), new object[0]).ToDictionary((SpellShortcut x) => x.Slot);
     this.m_itemShortcuts  = database.Query <ItemShortcut>(string.Format(ItemShortcutRelator.FetchByOwner, this.Owner.Id), new object[0]).ToDictionary((ItemShortcut x) => x.Slot);
 }