Example #1
0
 static Integration()
 {
     CosturaUtility.Initialize();
 }
Example #2
0
 public UpdateChecker()
 {
     CosturaUtility.Initialize();
 }
Example #3
0
 public static void Initialize()
 {
     CosturaUtility.Initialize();
 }
Example #4
0
 static Program()
 {
     CosturaUtility.Initialize();
     AssemblyResolver.Instance.Initialize();
 }
Example #5
0
 public static void Initialize()
 {
     ExtractBrowserDependencies.ExtractContent();
     CosturaUtility.Initialize();
 }
 static VolumeBoundPropertyProvider()
 {
     CosturaUtility.Initialize();
 }
Example #7
0
 /// <summary>
 /// Initializes the <see cref="Program"/> class.
 /// </summary>
 static Program()
 {
     // Load embedded resources
     CosturaUtility.Initialize();
 }
Example #8
0
 public ProxyPlugin()
 {
     CosturaUtility.Initialize();
 }
Example #9
0
 public App()
 {
     CosturaUtility.Initialize();
 }
Example #10
0
 public Plugin()
 {
     CosturaUtility.Initialize();
     AssemblyResolver.Instance.Initialize(this);
 }
Example #11
0
        private static int Main(string[] args)
        {
            CosturaUtility.Initialize();

            ModType modType;
            bool    launchGame = false;

            if (args.Length == 0)
            {
                if (File.Exists("GettingOverIt.exe") && Directory.Exists("GettingOverIt_Data"))
                {
                    Console.WriteLine("client/server not specified, but found client specific files. Updating client.");
                    modType = ModType.Client;
                }
                else
                {
                    Console.WriteLine("client/server not specified, could not find client specific files. Updating server.");
                    modType = ModType.Server;
                }
            }
            else
            {
                modType = args[0] == "server"
                    ? ModType.Server
                    : args[0] == "client"
                        ? ModType.Client
                        : ModType.Invalid;

                if (modType == ModType.Client && args.Length >= 2 && args[1] == "launch")
                {
                    launchGame = true;
                }
            }

            if (modType == ModType.Invalid)
            {
                Console.WriteLine("Invalid mod type specified. Please specify 'client' or 'server'.");
                return(2);
            }

            string currentModuleFileName = Directory.GetCurrentDirectory();

            if (modType == ModType.Client)
            {
                currentModuleFileName = Path.Combine(currentModuleFileName, "GettingOverIt.exe");
            }
            else if (modType == ModType.Server)
            {
                currentModuleFileName = Path.Combine(currentModuleFileName, "GettingOverIt.Server.exe");
            }

            var waitingProcesses = FindProcesses(currentModuleFileName, "GettingOverIt", "GettingOverIt.Server");

            if (waitingProcesses.Length > 0)
            {
                Console.WriteLine("Waiting for processes to exit...");

                foreach (var process in waitingProcesses)
                {
                    process.WaitForExit();
                }
            }

            if (!LocalData.Load())
            {
                Console.Error.WriteLine("Failed to load local version info. Press any key to close the updater.");
                Console.ReadKey(true);
                return(1);
            }

            using (var client = new ApiClient())
            {
                ModVersion latestVersion;

                try
                {
                    latestVersion = client.QueryLatestVersion(modType);
                }
                catch (Exception ex) when(ex is WebException || ex is ApiRequestFailedException)
                {
                    Console.Error.WriteLine($"Failed to query latest version: {ex.Message}. Press any key to close the updater.");
                    Console.ReadKey(true);
                    return(1);
                }

                int retries = 0;
                while (retries < MaxRetries)
                {
                    bool success = DownloadVersionAsync(latestVersion).Result;

                    if (success)
                    {
                        Console.WriteLine("Update downloaded successfully.");
                        Thread.Sleep(2000);
                        break;
                    }

                    ++retries;

                    if (retries < MaxRetries)
                    {
                        Console.Error.WriteLine($"Failed to download some files, retrying update in 3 seconds (attempt {retries}/{MaxRetries})...");
                        Thread.Sleep(3000);
                        Console.Clear();
                    }
                    else
                    {
                        Console.Error.WriteLine("Failed to download all files successfully, aborting update. Press any key to close the updater.");
                        Console.ReadKey(true);
                        return(1);
                    }
                }
            }

            if (launchGame)
            {
                Console.WriteLine("Launching game...");
                Process.Start("GettingOverIt.exe");
            }

            return(0);
        }
Example #12
0
 public XIVLogPlugin()
 {
     instance = this;
     CosturaUtility.Initialize();
     AssemblyResolver.Instance.Initialize(this);
 }
Example #13
0
 public ModuleWeaver()
 {
     CosturaUtility.Initialize();
 }
Example #14
0
 static KagamiAddon()
 {
     CosturaUtility.Initialize();
     AssemblyResolver.Initialize();
 }
Example #15
0
 /// <summary>
 /// 静态构造函数, 注册依赖注入回调
 /// </summary>
 static XLZMain()
 {
     // 初始化 Costura.Fody
     CosturaUtility.Initialize();
 }
Example #16
0
 /// <summary>
 /// Preps the updater for run
 /// </summary>
 private void Init()
 {
     CosturaUtility.Initialize();
     updater = new ASBUpdater();
 }
Example #17
0
        public static void Main()
        {
            CosturaUtility.Initialize();

            App.Main();
        }
Example #18
0
 static Program()
 {
     CosturaUtility.Initialize();
 }
Example #19
0
 private ForgefierApp()
 {
     InitializeComponent();
     CosturaUtility.Initialize();
 }