Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update submodule and skip maintenance check before patching #79

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/FFXIVQuickLauncher
Submodule FFXIVQuickLauncher updated 29 files
+28 −5 src/XIVLauncher.Common.Unix/Compatibility/GameFixes/Implementations/MacVideoFix.cs
+24 −45 src/XIVLauncher.Common/Dalamud/AssetManager.cs
+5 −12 src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs
+3 −3 src/XIVLauncher.Common/Patching/IndexedZiPatch/IndexedZiPatchIndex.cs
+3 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/AddDirectoryChunk.cs
+3 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/ApplyFreeSpaceChunk.cs
+3 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/ApplyOptionChunk.cs
+3 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/DeleteDirectoryChunk.cs
+3 −4 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/EndOfFileChunk.cs
+3 −3 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/FileHeaderChunk.cs
+7 −7 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkChunk.cs
+9 −12 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkAddData.cs
+6 −9 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkDeleteData.cs
+6 −9 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkExpandData.cs
+5 −8 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkFile.cs
+2 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkHeader.cs
+2 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkIndex.cs
+3 −5 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkPatchInfo.cs
+3 −4 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/SqpkCommand/SqpkTargetInfo.cs
+3 −4 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/XXXXChunk.cs
+9 −8 src/XIVLauncher.Common/Patching/ZiPatch/Chunk/ZiPatchChunk.cs
+30 −0 src/XIVLauncher.Common/Patching/ZiPatch/Util/AdvanceOnDispose.cs
+7 −8 src/XIVLauncher.Common/Patching/ZiPatch/Util/SqexFileStream.cs
+1 −1 src/XIVLauncher.Common/Patching/ZiPatch/Util/SqpackDatFile.cs
+22 −2 src/XIVLauncher.Common/Util/PlatformHelpers.cs
+2 −2 src/XIVLauncher/Resources/CHANGELOG.txt
+10 −0 src/XIVLauncher/Updates.cs
+10 −0 src/XIVLauncher/Windows/ViewModel/MainWindowViewModel.cs
+1 −1 src/XIVLauncher/XIVLauncher.csproj
102 changes: 54 additions & 48 deletions src/XIVLauncher.Core/Components/MainPage/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ private void ProcessLogin(LoginAction action)
if (GameHelpers.CheckIsGameOpen() && action == LoginAction.Repair)
{
App.ShowMessageBlocking("The game and/or the official launcher are open. XIVLauncher cannot repair the game if this is the case.\nPlease close them and try again.", "XIVLauncher");

Reactivate();
return;
}
Expand Down Expand Up @@ -151,6 +150,10 @@ private void ProcessLogin(LoginAction action)
Log.Verbose("Reactivated after Login() != true");
this.Reactivate();
}
// Check gate status before continuing
if (!await CheckGateStatus()) {
this.Reactivate();
}
}).ContinueWith(t =>
{
if (!App.HandleContinuationBlocking(t))
Expand Down Expand Up @@ -202,52 +205,6 @@ public async Task<bool> Login(string username, string password, bool isOtp, bool

private async Task<Launcher.LoginResult> TryLoginToGame(string username, string password, string otp, bool isSteam, LoginAction action)
{
bool? gateStatus = null;

#if !DEBUG
try
{
// TODO: Also apply the login status fix here
var gate = await App.Launcher.GetGateStatus(App.Settings.ClientLanguage ?? ClientLanguage.English).ConfigureAwait(false);
gateStatus = gate.Status;
}
catch (Exception ex)
{
Log.Error(ex, "Could not obtain gate status");
}

if (gateStatus == null)
{
/*
CustomMessageBox.Builder.NewFrom(Loc.Localize("GateUnreachable", "The login servers could not be reached. This usually indicates that the game is under maintenance, or that your connection to the login servers is unstable.\n\nPlease try again later."))
.WithImage(MessageBoxImage.Asterisk)
.WithButtons(MessageBoxButton.OK)
.WithShowHelpLinks(true)
.WithCaption("XIVLauncher")
.WithParentWindow(_window)
.Show();
*/

App.ShowMessageBlocking("Login servers could not be reached or maintenance is in progress. This might be a problem with your connection.");

return null;
}

if (gateStatus == false)
{
/*
CustomMessageBox.Builder.NewFrom(Loc.Localize("GateClosed", "FFXIV is currently under maintenance. Please try again later or see official sources for more information."))
.WithImage(MessageBoxImage.Asterisk)
.WithButtons(MessageBoxButton.OK)
.WithCaption("XIVLauncher")
.WithParentWindow(_window)
.Show();*/

App.ShowMessageBlocking("Maintenance is in progress.");

return null;
}
#endif

try
{
Expand Down Expand Up @@ -1129,7 +1086,56 @@ private void InstallerOnFail()

Environment.Exit(0);
}
private async Task<bool> CheckGateStatus()
{
bool? gateStatus = null;

#if !DEBUG
try
{
// TODO: Also apply the login status fix here
var gate = await App.Launcher.GetGateStatus(App.Settings.ClientLanguage ?? ClientLanguage.English).ConfigureAwait(false);
gateStatus = gate.Status;
}
catch (Exception ex)
{
Log.Error(ex, "Could not obtain gate status");
}

if (gateStatus == null)
{
/*
CustomMessageBox.Builder.NewFrom(Loc.Localize("GateUnreachable", "The login servers could not be reached. This usually indicates that the game is under maintenance, or that your connection to the login servers is unstable.\n\nPlease try again later."))
.WithImage(MessageBoxImage.Asterisk)
.WithButtons(MessageBoxButton.OK)
.WithShowHelpLinks(true)
.WithCaption("XIVLauncher")
.WithParentWindow(_window)
.Show();
*/

App.ShowMessageBlocking("Login servers could not be reached or maintenance is in progress. This might be a problem with your connection.");

return false;
}

if (gateStatus == false)
{
/*
CustomMessageBox.Builder.NewFrom(Loc.Localize("GateClosed", "FFXIV is currently under maintenance. Please try again later or see official sources for more information."))
.WithImage(MessageBoxImage.Asterisk)
.WithButtons(MessageBoxButton.OK)
.WithCaption("XIVLauncher")
.WithParentWindow(_window)
.Show();*/

App.ShowMessageBlocking("Maintenance is in progress.");

return false;
}
#endif
return true;
}
private async Task<bool> RepairGame(Launcher.LoginResult loginResult)
{
var doLogin = false;
Expand Down Expand Up @@ -1244,4 +1250,4 @@ private void Reactivate()

Program.ShowWindow();
}
}
}