Skip to content

Commit

Permalink
Merge pull request #51 from leojonathanoh/fix/daemon-fix-daemon-crash…
Browse files Browse the repository at this point in the history
…ing-for-cs2-when-first-player-connects

Fix (daemon): Fix daemon crashing for CS2 when first player connects
  • Loading branch information
leojonathanoh committed Feb 4, 2024
2 parents ae8eea0 + 2334f01 commit 4d14934
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scripts/hlstats.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,10 @@ sub getPlayerInfo
$player->updateTimestamp();
}
} else {
if ($userid != 0) {
# In CS2, the first user is always assigned userid of '0'. Always create a player regardless of its value
# E.g. L 02/01/2024 - 21:02:01.253 - "X<0><[U:Y]><>" entered the game
# For all other games, userid is always above '0'
if ($userid != 0 || $g_servers{$s_addr}->{play_game} == CS2()) {
if ($create_player > 0) {
my $preIpAddr = "";
if ($g_preconnect->{"$s_addr/$userid/$name"}) {
Expand Down

0 comments on commit 4d14934

Please sign in to comment.