Пример #1
0
 public static void Shutdown()
 {
     VarEquipCache.Shutdown();
     ActorCache.Shutdown();
     TexturePathCache.Shutdown();
     EquipParamCache.Shutdown();
 }
Пример #2
0
        public static void LoadCache()
        {
            DateTime dateGenerated = DateTime.Now;
            string   version       = GetCurrentGameVersion();

            using (SQLiteConnection conn = new SQLiteConnection(BuildConnectionString(true)))
            {
                conn.Open();
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "INSERT INTO BuildInfo ([Version], [Date]) VALUES (@version, @date)";
                    cmd.Parameters.Add("version", System.Data.DbType.String).Value = version;
                    cmd.Parameters.Add("date", System.Data.DbType.DateTime).Value  = dateGenerated;
                    cmd.ExecuteNonQuery();
                }
            }

            GameVersion   = version;
            DateGenerated = dateGenerated;

            VarEquipCache.FillCache();
            ActorCache.FillCache();
            TexturePathCache.FillCache();
            EquipParamCache.FillCache();

            CacheBuilt = true;
        }
Пример #3
0
        public static void Init()
        {
            executionDirectory = System.Windows.Forms.Application.StartupPath;
            cachePath          = Path.Combine(executionDirectory, cacheFileName);
            if (!File.Exists(cachePath))
            {
                CreateCacheDb();
                CacheBuilt = false;
            }
            else
            {
                LoadDbInfo();
            }

            VarEquipCache.Init();
            ActorCache.Init();
            TexturePathCache.Init();
            EquipParamCache.Init();
        }