コード例 #1
0
        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;
        }
コード例 #2
0
        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));
                }
            }
        }
コード例 #3
0
        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;
                }
            }
        }
コード例 #4
0
        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;
                }
            }
        }
コード例 #5
0
        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;
                }
            }
        }