Пример #1
0
        public override void WriteDb(string dbPath, string subPath, ServerType serverType, FileType fileType = FileType.Detect)
        {
            DbDebugItem <int> debug = new DbDebugItem <int>(this);

            debug.DbSource = ServerDbs.Skills;
            if (debug.Write(dbPath, subPath, serverType, fileType))
            {
                DbWriterMethods.DbIntCommaRange(debug, this, 0, 18);
            }

            debug.DbSource = ServerDbs.SkillsNoDex;
            if (debug.Write(dbPath, subPath, serverType, fileType))
            {
                DbWriterMethods.DbSkillsNoDexCommaRange(debug, this, ServerSkillAttributes.Cast.Index, 2);
            }

            debug.DbSource = ServerDbs.SkillsNoCast;
            if (serverType == ServerType.RAthena && debug.Write(dbPath, subPath, serverType, fileType))
            {
                DbWriterMethods.DbSkillsNoCastCommaRange(debug, this, ServerSkillAttributes.Flag.Index, 1);
            }

            debug.DbSource = ServerDbs.SkillsCast;
            if (debug.Write(dbPath, subPath, serverType, fileType))
            {
                DbWriterMethods.DbSkillsCastCommaRange(debug, this, ServerSkillAttributes.Cast.Index + 2, 6);
            }
        }
Пример #2
0
        protected override void _loadDb()
        {
            Attached["NumberOfAttributesToGuess"] = 18;
            DbDebugItem <int> debug = new DbDebugItem <int>(this);

            if (debug.Load(ServerDbs.Skills))
            {
                DbLoaderMethods.DbCommaLoader(debug, this);
            }
            if (debug.Load(ServerDbs.SkillsNoDex))
            {
                DbLoaderMethods.DbCommaRange(debug, AttributeList, ServerSkillAttributes.Cast.Index, 2);
            }

            if (AllLoaders.GetServerType() == ServerType.RAthena)
            {
                if (debug.Load(ServerDbs.SkillsNoCast))
                {
                    DbLoaderMethods.DbCommaNoCast(debug, AttributeList, ServerSkillAttributes.Flag.Index, 1);
                }
            }

            if (debug.Load(ServerDbs.SkillsCast))
            {
                DbLoaderMethods.DbCommaRange(debug, AttributeList, ServerSkillAttributes.Cast.Index + 2, 6);
            }
        }
Пример #3
0
        protected override void _loadDb()
        {
            base._loadDb();

            if (AllLoaders.GetServerType() == ServerType.RAthena)
            {
                DbDebugItem <int> debug = new DbDebugItem <int>(this);
                // These are all being read twice and assigned to their respective table
                if (debug.Load(ServerDbs.ItemsAvail))
                {
                    DbLoaderMethods.DbCommaRange(debug, AttributeList, ServerItemAttributes.Sprite.Index, 1, false);
                }
                if (debug.Load(ServerDbs.ItemsDelay))
                {
                    DbLoaderMethods.DbCommaRange(debug, AttributeList, ServerItemAttributes.Delay.Index, 1, false);
                }
                if (debug.Load(ServerDbs.ItemsNoUse))
                {
                    DbLoaderMethods.DbCommaLoader(debug, AttributeList, DbLoaderMethods.DbItemsNouseFunction, false);
                }
                if (debug.Load(ServerDbs.ItemsStack))
                {
                    DbLoaderMethods.DbCommaLoader(debug, AttributeList, DbLoaderMethods.DbItemsStackFunction, false);
                }
                if (debug.Load(ServerDbs.ItemsTrade))
                {
                    DbLoaderMethods.DbCommaLoader(debug, AttributeList, DbLoaderMethods.DbItemsTradeFunction, false);
                }
                if (debug.Load(ServerDbs.ItemsBuyingStore))
                {
                    DbLoaderMethods.DbCommaLoader(debug, AttributeList, DbLoaderMethods.DbItemsBuyingStoreFunction, false);
                }
            }
        }
Пример #4
0
        protected virtual void _loadDb()
        {
            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            if (!debug.Load())
            {
                return;
            }
            DbLoader(debug, this);
        }
Пример #5
0
        public override void WriteDb(string dbPath, string subPath, ServerType serverType, FileType fileType = FileType.Detect)
        {
            DbDebugItem <int> debug = new DbDebugItem <int>(this);

            debug.DbSource = DbSource;
            if (debug.Write(dbPath, subPath, serverType, fileType))
            {
                DbWriterMethods.DbItemsCommaWriter(debug, this);
            }

            if (serverType == ServerType.RAthena)
            {
                debug.DbSource = ServerDbs.ItemsAvail;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsCommaRange(debug, this, ServerItemAttributes.Sprite.Index, 1, "");
                }

                debug.DbSource = ServerDbs.ItemsDelay;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsCommaRange(debug, this, ServerItemAttributes.Delay.Index, 1, "");
                }

                debug.DbSource = ServerDbs.ItemsNoUse;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsNouse(debug, this);
                }

                debug.DbSource = ServerDbs.ItemsStack;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsStack(debug, this);
                }

                debug.DbSource = ServerDbs.ItemsTrade;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsTrade(debug, this);
                }

                debug.DbSource = ServerDbs.ItemsBuyingStore;
                if (debug.Write(dbPath, subPath, serverType, fileType))
                {
                    DbWriterMethods.DbItemsBuyingStore(debug, this);
                }
            }
        }
Пример #6
0
        public override void WriteDb(string dbPath, string subPath, ServerType serverType, FileType fileType = FileType.Detect)
        {
            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            if (!debug.Write(dbPath, subPath, serverType, fileType))
            {
                return;
            }
            if ((fileType & FileType.Sql) == FileType.Sql && DbWriterSql != null)
            {
                DbWriterSql(debug, this);
                return;
            }
            DbWriter(debug, this);
        }
Пример #7
0
        public sealed override void LoadDb(string path)
        {
            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            debug.FilePath = path;

            string text = File.ReadAllText(path);

            if (text.StartsWith("{") || text.Contains("(\r\n\t") || text.Contains("(\n\t") || path.IsExtension(".conf"))
            {
                debug.FileType = FileType.Conf;
            }
            else
            {
                debug.FileType = FileType.Txt;
            }

            Attached["FromUserRawInput"] = true;
            Table.EnableRawEvents        = true;
            DbLoader(debug, this);
        }