Пример #1
0
        public static void Main(string[] args)
        {
            // TODO: properly pass parameters
            string asset_path = "Assets/";

            if (args.Length > 0)
            {
                asset_path = args[0];
            }

            AGSEngineDesktop.Init();
            GameStarter.Run(asset_path,
                            Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/AudioMixerGame/");
        }
Пример #2
0
        static public void Run(string pak)
        {
            GameStarter game = new GameStarter();

            game.Run(pak ?? "classic");
        }
Пример #3
0
        private void RTPatcher_Completed(object sender, RTPatcherCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                Logger.Debug($"{sender.ToString()} cancelled");
            }
            else if (e.Error != null)
            {
                if (e.Error is ResultException ex)
                {
                    string logFileName = Path.GetFileName(ex.LogPath);
                    switch (ex.Result)
                    {
                    case 4:
                        Logger.Error(ex.Message);
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_not_exist_directory"));
                        break;

                    case 7:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_error_open_patch_file"));
                        break;

                    case 9:
                        Logger.Error($"error=[{ex.Message}] file=[{Path.Combine(UserSettings.GamePath, ex.FileName)}] version=[{ex.ClientVersion}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_corrupt", $"{Path.Combine(UserSettings.GamePath, ex.FileName)}@Version=[{ex.ClientVersion}]"));
                        break;

                    case 15:
                        Logger.Error($"error=[{ex.Message}] file=[{Path.Combine(UserSettings.GamePath, ex.FileName)}] version=[{ex.ClientVersion}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_missing_file", $"{Path.Combine(UserSettings.GamePath, ex.FileName)}@Version=[{ex.ClientVersion}]"));
                        break;

                    case 18:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_open_patch_file_fail"));
                        break;

                    case 20:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_read_patch_file_fail"));
                        break;

                    case 22:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_rename_fail"));
                        break;

                    case 29:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_insufficient_storage"));
                        break;

                    case 32:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_time_date_fail"));
                        break;

                    case 36:
                        Logger.Error($"error=[{ex.Message}] file=[{Path.Combine(UserSettings.GamePath, ex.FileName)}] version=[{ex.ClientVersion}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_corrupt_file", $"{Path.Combine(UserSettings.GamePath, ex.FileName)}@Version=[{ex.ClientVersion}]"));
                        break;

                    case 49:
                        Logger.Error($"error=[{ex.Message}]@Version=[{ex.ClientVersion.ToString()}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_administrator_required"));
                        break;

                    default:
#if !DEBUG
                        string logFileText = File.ReadAllText(ex.LogPath);

                        try
                        {
                            UploadToPasteBin(logFileName, logFileText, PasteBinExpiration.OneWeek, true, "text");
                        }
                        catch (PasteBinApiException)
                        {
                        }

                        Logger.Error($"See {logFileName} for details. Error Code=[{ex.Result}]");
                        MsgBox.Error(StringLoader.GetText("exception_rtpatch_result", ex.Result, logFileName));
#endif
                        break;
                    }

                    Methods.RTPatchCleanup(true);
                }
                else
                {
                    Methods.RTPatchCleanup(false);
                    Logger.Error(e.Error);
                    MsgBox.Error(Methods.ExeptionParser(e.Error));
                }
            }
            else
            {
                Methods.RTPatchCleanup(true);
                Logger.Debug($"{sender.ToString()} successfuly completed");
                switch (_nextState)
                {
                case NextState.Download:
                    CurrentState = State.Download;
                    Downloader.Run(e.Language);

                    break;

                case NextState.Play:
                    GameStarter.Run(e.Language, true);

                    break;

                case NextState.PlayRaw:
                    GameStarter.Run(e.Language, false);

                    break;
                }

                _nextState = 0;
                return;
            }

            CurrentState = State.Idle;
        }
Пример #4
0
 public static void Main(string[] args)
 {
     AGSEngineDesktop.Init();
     GameStarter.Run();
 }