Skip to content

Commit

Permalink
v2.0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryddag committed Feb 20, 2018
1 parent fbe573b commit 907729c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 65 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## [v2.0.3.1](https://github.com/ProjectCeleste/Celeste_Launcher/tree/v2.0.3.1) (2018-02-20)

[Full Changelog](https://github.com/ProjectCeleste/Celeste_Launcher/compare/v2.0.3.0...v2.0.3.1)

**Enhancements:**

- Add support for "procdump" to help debug game issue.
- Add fallback server for "GameScan".


## [v2.0.3.0](https://github.com/ProjectCeleste/Celeste_Launcher/tree/v2.0.3.0) (2018-02-13)

[Full Changelog](https://github.com/ProjectCeleste/Celeste_Launcher/compare/v2.0.2.0...v2.0.3.0)
Expand Down
118 changes: 59 additions & 59 deletions Celeste_Launcher_Gui/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.AccessControl;
using System.Windows.Forms;
using Celeste_AOEO_Controls;
using Celeste_AOEO_Controls.MsgBox;
Expand Down Expand Up @@ -172,18 +171,10 @@ private async void Btn_Play_Click(object sender, EventArgs e)
if (!path.EndsWith(Path.DirectorySeparatorChar.ToString()))
path += Path.DirectorySeparatorChar;

var spartanPath = $"{path}Spartan.exe";
var spartanPath = Path.Combine(path, "Spartan.exe");

if (!File.Exists(spartanPath))
{
MsgBox.ShowMessage(
"Error: Spartan.exe not found!",
@"Celeste Fan Project",
MessageBoxButtons.OK, MessageBoxIcon.Error);

btn_Play.Enabled = true;
return;
}
throw new FileNotFoundException("Spartan.exe not found!", spartanPath);

string lang;
switch (Program.UserConfig.GameLanguage)
Expand All @@ -210,49 +201,63 @@ private async void Btn_Play_Click(object sender, EventArgs e)
throw new ArgumentOutOfRangeException();
}

if (Program.UserConfig.IsDiagnosticMode)
try
{
var procdumpFileName = "procdump.exe";
const int maxNumOfCrashDumps = 30;
if (!File.Exists(procdumpFileName))
throw new FileNotFoundException("Diagonstic Mode requires procdump.exe (File not Found)");

// First ensure that all directories are set
var pathToCrashDumpFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
@"Spartan\MiniDumps");
Directory.CreateDirectory(pathToCrashDumpFolder);

// Check for cleanup
Directory.GetFiles(pathToCrashDumpFolder)
.OrderByDescending(File.GetLastWriteTime) // Sort by age --> old one last
.Skip(maxNumOfCrashDumps) // Skip max num crash dumps
.ToList()
.ForEach(File.Delete); // Remove the rest

var excludeExceptions = new string[]
if (Program.UserConfig.IsDiagnosticMode)
{
"E0434F4D.COM", // .NET native exception
"E06D7363.msc",
"E06D7363.PAVEEFileLoadException@@",
"E0434F4D.System.IO.FileNotFoundException" // .NET managed exception
};

var excludeExcpetionsCmd = string.Join(" ", excludeExceptions.Select(elem => "-fx " + elem));
var procdumpFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "procdump.exe");
const int maxNumOfCrashDumps = 30;
if (!File.Exists(procdumpFileName))
throw new FileNotFoundException("Diagonstic Mode requires procdump.exe (File not Found)",
procdumpFileName);

// First ensure that all directories are set
var pathToCrashDumpFolder =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
@"Spartan\MiniDumps");

if (!Directory.Exists(pathToCrashDumpFolder))
Directory.CreateDirectory(pathToCrashDumpFolder);

// Check for cleanup
Directory.GetFiles(pathToCrashDumpFolder)
.OrderByDescending(File.GetLastWriteTime) // Sort by age --> old one last
.Skip(maxNumOfCrashDumps) // Skip max num crash dumps
.ToList()
.ForEach(File.Delete); // Remove the rest

var excludeExceptions = new[]
{
"E0434F4D.COM", // .NET native exception
"E06D7363.msc",
"E06D7363.PAVEEFileLoadException@@",
"E0434F4D.System.IO.FileNotFoundException" // .NET managed exception
};

var fullCmdArgs = "-accepteula -mm -e 1 -n 10 " + excludeExcpetionsCmd +
" -g -w Spartan.exe \"" + pathToCrashDumpFolder + "\"";
var excludeExcpetionsCmd = string.Join(" ", excludeExceptions.Select(elem => "-fx " + elem));

// MsgBox.ShowMessage(fullCmd);
var startInfo = new ProcessStartInfo(procdumpFileName, fullCmdArgs)
{
WorkingDirectory = path,
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
};
var fullCmdArgs = "-accepteula -mm -e 1 -n 10 " + excludeExcpetionsCmd +
" -g -w Spartan.exe \"" + pathToCrashDumpFolder + "\"";

Process.Start(startInfo);
// MsgBox.ShowMessage(fullCmd);
var startInfo = new ProcessStartInfo(procdumpFileName, fullCmdArgs)
{
WorkingDirectory = path,
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
};

Process.Start(startInfo);
}
}
catch (Exception exception)
{
MsgBox.ShowMessage(
$"Warning: {exception.Message}",
@"Celeste Fan Project",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

var arg = Program.UserConfig?.MpSettings == null || Program.UserConfig.MpSettings.IsOnline
Expand Down Expand Up @@ -634,24 +639,19 @@ private void PictureBoxButtonCustom6_Click(object sender, EventArgs e)
x.ShowDialog();
}
}

private void UpdateDiagModeToolStripFromConfig()
{
if (Program.UserConfig.IsDiagnosticMode)
{
enableDiagnosticModeToolStripMenuItem.Text = @"Disable Diagnostic Mode";
}
else
{
enableDiagnosticModeToolStripMenuItem.Text = @"Enable Diagnostic Mode";
}
enableDiagnosticModeToolStripMenuItem.Text = Program.UserConfig.IsDiagnosticMode
? @"Disable Diagnostic Mode"
: @"Enable Diagnostic Mode";
}

private void EnableDiagnosticModeToolStripMenuItem_Click(object sender, EventArgs e)
{
Program.UserConfig.IsDiagnosticMode = !Program.UserConfig.IsDiagnosticMode;

UpdateDiagModeToolStripFromConfig();
UpdateDiagModeToolStripFromConfig();
}
}
}
27 changes: 21 additions & 6 deletions Libs/Celeste_Public_Api/GameScanner_Api/GameScannnerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,28 @@ private static IEnumerable<GameFileInfo> FilesInfoOverrideFromCelesteXml(bool be
{
var tempFileName = Path.Combine(GetTempPath(), Path.GetRandomFileName());

using (var client = new WebClient())
try
{
client.DownloadFile(
betaUpdate
? "https://downloads.projectceleste.com/game_files/manifest_override_b.xml"
: "https://downloads.projectceleste.com/game_files/manifest_override.xml",
tempFileName);
using (var client = new WebClient())
{
client.DownloadFile(
betaUpdate
? "https://downloads.projectceleste.com/game_files/manifest_override_b.xml"
: "https://downloads.projectceleste.com/game_files/manifest_override.xml",
tempFileName);
}
}
catch
{
//FallBack Server
using (var client = new WebClient())
{
client.DownloadFile(
betaUpdate
? "https://ns544971.ip-66-70-180.net/game_files/manifest_override_b.xml"
: "https://ns544971.ip-66-70-180.net/game_files/manifest_override.xml",
tempFileName);
}
}

var retVal = XmlUtils.DeserializeFromFile<GameFilesInfo>(tempFileName).FileInfo.Values;
Expand Down

0 comments on commit 907729c

Please sign in to comment.