Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

First connection problem fix #91

Merged
Merged
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
3 changes: 2 additions & 1 deletion Content.Server/Database/UserDbDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public sealed class UserDbDataManager
// but this runs into ordering issues with game ticker.
public void ClientConnected(ICommonSession session)
{
DebugTools.Assert(!_users.ContainsKey(session.UserId), "We should not have any cached data on client connect.");
if (_users.ContainsKey(session.UserId))
return;

var cts = new CancellationTokenSource();
var task = Load(session, cts.Token);
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/GameTicking/GameTicker.Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ private async void PlayerStatusChanged(object? sender, SessionStatusEventArgs ar
_roundStartCountdownHasNotStartedYetDueToNoPlayers = false;
_roundStartTime = _gameTiming.CurTime + LobbyDuration;
}

_userDb.ClientConnected(session);

break;
}
Expand Down
Loading