Skip to content

Commit

Permalink
попытка фикса спама ивентами
Browse files Browse the repository at this point in the history
  • Loading branch information
Inconnu1337 committed Oct 13, 2024
1 parent 1ffd54d commit acfa92a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Content.Server/GameTicking/GameTicker.Lobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ public bool UserHasJoinedGame(ICommonSession session)
=> UserHasJoinedGame(session.UserId);

public bool UserHasJoinedGame(NetUserId userId)
=> PlayerGameStatuses[userId] == PlayerGameStatus.JoinedGame;
{
// Sunrise-Edit: Я не понимаю почему, но PlayerGameStatuses[userId] может вернуть ошибку.
// => PlayerGameStatuses[userId] == PlayerGameStatus.JoinedGame;
if (!PlayerGameStatuses.TryGetValue(userId, out var status))
return false;
return status == PlayerGameStatus.JoinedGame;
}
}
}

0 comments on commit acfa92a

Please sign in to comment.