Exemplo n.º 1
0
 private static void DevMode()
 {
     if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.DevelopmentMode))
     {
         string text  = PathMgr.Temp("dev");
         string text2 = PathMgr.Temp("dev", "raw");
         string path  = PathMgr.Local("raw.zip");
         if (Directory.Exists(text))
         {
             Utils.Rmdir(text);
         }
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         Directory.CreateDirectory(text);
         Directory.CreateDirectory(text2);
         foreach (KeyValuePair <Mods, bool> keyValuePair in Program.ListOfMod)
         {
             if (keyValuePair.Value)
             {
                 string name  = "scripts-" + keyValuePair.Key.ToString().ToLower().Replace("_", "-");
                 string path2 = keyValuePair.Key.ToString().ToLower().Replace("_", "-");
                 Directory.CreateDirectory(Path.Combine(text2, path2));
                 foreach (string text3 in Directory.GetFiles(PathMgr.Assets(name), "*.*", SearchOption.AllDirectories))
                 {
                     File.Copy(text3, Path.Combine(Path.Combine(text2, path2), Path.GetFileName(text3)));
                 }
             }
         }
         ZipFile.CreateFromDirectory(text, "raw.zip");
     }
 }
Exemplo n.º 2
0
        private static void CheckVersion()
        {
            try
            {
                using (var wc = new System.Net.WebClient())
                {
                    var latestStatus = wc.DownloadString(Properties.Resources.AutopatcherStatus);
                    if (latestStatus != "ok")
                    {
                        Abort = true;
                        return;
                    }

                    var latestVersion = wc.DownloadString(Properties.Resources.AutopatcherVersion);
                    if ((string)ConfigMgr.GetValue(ConfigMgr.Key.Version) != latestVersion)
                    {
                        Utils.Write("[Obsolete Autopatcher version]", true, true);
                        Utils.Write("Download the latest version from:", true, true);
                        Utils.Write(Properties.Resources.Repository, true, true);
                        Abort = true;
                    }
                }
            }
            catch
            {
                Abort = true;
            }
        }
Exemplo n.º 3
0
        private static void CheckVersion()
        {
            try
            {
                using (var wc = new WebClient())
                {
                    var latestStatus = wc.DownloadString(Resources.CliStatus);
                    if (latestStatus != "ok")
                    {
                        _abort = true;
                        return;
                    }

                    var latestVersion = wc.DownloadString(Resources.CliVersion);
                    if ((string)ConfigMgr.GetValue(ConfigMgr.Key.Version) != latestVersion)
                    {
                        Utils.Write("[Obsolete CLI version]", true, true);
                        Utils.Write("Download the latest version from:", true, true);
                        Utils.Write(Resources.Repository, true, true);
                        _abort = true;
                    }
                }
            }
            catch
            {
                _abort = true;
            }
        }
Exemplo n.º 4
0
        private static void Initialize()
        {
            if (ListOfMod == null)
            {
                ListOfMod = new Dictionary <Mods, bool>();
            }

            foreach (Mods mod in Enum.GetValues(typeof(Mods)))
            {
                ListOfMod.Add(mod, false);
            }

            if (ListOfLua == null)
            {
                ListOfLua = new List <string>();
            }

            ConfigMgr.Initialize();

            Message();
            //CheckVersion();
            CheckDependencies();

            if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.iOS))
            {
                Os = @"ios";
            }
            else
            {
                Os = @"android";
            }

            AddLua(Resources.Aircraft);
            AddLua(Resources.Enemy);

            if (GetValue(Mods.GodMode_Damage) || GetValue(Mods.GodMode_Cooldown) ||
                GetValue(Mods.GodMode_Damage_Cooldown) ||
                GetValue(Mods.GodMode_Damage_WeakEnemy) || GetValue(Mods.GodMode_Damage_Cooldown_WeakEnemy))
            {
                AddLua(Resources.Weapon);
            }

            if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.ReplaceSkin))
            {
                AddLua(Resources.Ship);
                AddLua(Resources.ShipSkin);
            }

            if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.RemoveSkill))
            {
                AddLua(Resources.EnemySkill);
            }

            if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.EasyMode))
            {
                AddLua(Resources.MapData);
                AddLua(Resources.MapDataLoop);
            }
        }
Exemplo n.º 5
0
 private static void Message()
 {
     Utils.Write("", true, true);
     Utils.Write("Azurlane Autopatcher", true, true);
     Utils.Write("Version {0}", true, true, ConfigMgr.GetValue(ConfigMgr.Key.Version));
     Utils.Write("{0}", true, true, Properties.Resources.Author);
     Utils.Write("", true, true);
 }
Exemplo n.º 6
0
 internal static string Thirdparty(string path = null)
 {
     return(path != null
         ? Path.Combine(Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Thirdparty)), path)
         : Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Thirdparty)));
 }
Exemplo n.º 7
0
 internal static string Thirdparty(string path = null) => path != null?Path.Combine(Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Thirdparty_Folder)), path) : Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Thirdparty_Folder));
Exemplo n.º 8
0
 internal static string Temp(string path = null) => path != null?Path.Combine(Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Tmp)), path) : Local((string)ConfigMgr.GetValue(ConfigMgr.Key.Tmp));