Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qubqub committed Nov 3, 2023
1 parent f6ad07e commit 0c7a1d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class LogFileWatcher {
private bool useShareCode;
private string sessionId;

private readonly object lockObject = new object();
// private readonly object lockObject = new object();
private bool toggleCountryInfoApi;
private bool toggleFgdbCreativeApi;
private string creativeShareCode;
Expand Down Expand Up @@ -212,12 +212,12 @@ private void ReadLogFile() {
|| line.Line.IndexOf("[EOSPartyPlatformService.Base] Reset, reason: Shutdown", StringComparison.OrdinalIgnoreCase) >= 0) {
offset = i > 0 ? tempLines[i - 1].Offset : offset;
lastDate = line.Date;
} else if (line.Line.IndexOf("[HandleSuccessfulLogin] Selected show is", StringComparison.OrdinalIgnoreCase) >= 0) {
if (this.autoChangeProfile && Stats.IsGameRunning && Stats.InShow && !Stats.EndedShow) {
} else if (this.autoChangeProfile && line.Line.IndexOf("[HandleSuccessfulLogin] Selected show is", StringComparison.OrdinalIgnoreCase) >= 0) {
if (Stats.IsGameRunning && Stats.InShow && !Stats.EndedShow) {
this.StatsForm.SetLinkedProfileMenu(this.selectedShowId, logRound.PrivateLobby, this.StatsForm.IsCreativeShow(this.selectedShowId));
}
} else if (line.Line.IndexOf("[GameSession] Changing state from Countdown to Playing", StringComparison.OrdinalIgnoreCase) >= 0) {
if (this.preventOverlayMouseClicks && Stats.InShow && !Stats.EndedShow) {
} else if (this.preventOverlayMouseClicks && line.Line.IndexOf("[GameSession] Changing state from Countdown to Playing", StringComparison.OrdinalIgnoreCase) >= 0) {
if (Stats.IsGameRunning && Stats.InShow && !Stats.EndedShow) {
this.StatsForm.PreventOverlayMouseClicks();
}
}
Expand Down Expand Up @@ -579,7 +579,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
ServerConnectionLog serverConnectionLog = this.StatsForm.SelectServerConnectionLog(this.sessionId, this.selectedShowId);
if (serverConnectionLog != null) {
if (!serverConnectionLog.IsNotify) {
if (this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
if (Stats.IsGameRunning && this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
this.OnServerConnectionNotification?.Invoke(Stats.LastCountryAlpha2Code, Stats.LastCountryRegion, Stats.LastCountryCity);
}
}
Expand All @@ -592,7 +592,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
this.StatsForm.UpsertServerConnectionLog(this.sessionId, this.selectedShowId, Stats.LastServerIp, Stats.ConnectedToServerDate, true, true);
this.serverPingWatcher.Start();
this.SetCountryCodeByIP(Stats.LastServerIp);
if (this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
if (Stats.IsGameRunning && this.StatsForm.CurrentSettings.NotifyServerConnected && !string.IsNullOrEmpty(Stats.LastCountryAlpha2Code)) {
this.OnServerConnectionNotification?.Invoke(Stats.LastCountryAlpha2Code, Stats.LastCountryRegion, Stats.LastCountryCity);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,7 @@ private void LogFile_OnPersonalBestNotification(RoundInfo info) {
List<RoundInfo> queryResult = this.RoundDetails.Find(recordQuery).ToList();
double record = queryResult.Count > 0 ? queryResult.Min(r => (r.Finish.Value - r.Start).TotalMilliseconds) : Double.MaxValue;

if (currentRecord < record && !this.ExistsPersonalBestLog(info.SessionId, info.ShowNameId, info.Name)) {
if (IsGameRunning && currentRecord < record && !this.ExistsPersonalBestLog(info.SessionId, info.ShowNameId, info.Name)) {
string timeDiffContent = String.Empty;
if (record != Double.MaxValue) {
TimeSpan timeDiff = TimeSpan.FromMilliseconds(record - currentRecord);
Expand Down

0 comments on commit 0c7a1d8

Please sign in to comment.