Skip to content

Commit

Permalink
Windows did not like saving async (reverted)...
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpmartell committed Jul 20, 2024
1 parent bff2a8a commit c3a0963
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions LittleWarGameClient/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void webView_WebMessageReceived(object sender, Microsoft.Web.WebView2.Co
else
mouseLocked = false;
settings.SetMouseLock(mouseLocked);
settings.SaveAsync();
settings.Save();
CaptureCursor();
break;
default:
Expand Down Expand Up @@ -109,7 +109,7 @@ private void Form1_ResizeEnd(object sender, EventArgs e)
{
CaptureCursor();
settings.SetWindowSize(this.Size);
settings.SaveAsync();
settings.Save();
}

private void Form1_Resize(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion LittleWarGameClient/Fullscreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal void Toggle()
Enter();
}
settings.SetFullScreen(state);
settings.SaveAsync();
settings.Save();
}

private void Enter()
Expand Down
5 changes: 3 additions & 2 deletions LittleWarGameClient/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ internal void Save()
settings.SaveTo(fileName);
}

internal async void SaveAsync()
//This somehow triggers Windows Defender as a Trojan???
/*internal async void SaveAsync()
{
await Task.Run(() => {
for (int numTries = 0; numTries < 5; numTries++)
Expand All @@ -99,7 +100,7 @@ await Task.Run(() => {
}
}
});
}
}*/

internal void SetMouseLock(bool value)
{
Expand Down
2 changes: 1 addition & 1 deletion LittleWarGameClient/VersionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal virtual void CheckForUpdate(object? sender, EventArgs e)
System.Windows.Forms.Application.Exit();
}
settings.SetLastUpdateChecked(DateTime.Now.Date);
settings.SaveAsync();
settings.Save();
}

private bool RequiresUpdate()
Expand Down

0 comments on commit c3a0963

Please sign in to comment.