Skip to content

Commit 404361a

Browse files
authored
Merge pull request #4 from tslashd/dev
2 parents 6f8ff6e + 4912c48 commit 404361a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ST-Events/Players.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public HookResult OnPlayerConnect(EventPlayerConnectFull @event, GameEventInfo i
4949
name = playerData.GetString("name");
5050
if (country == "XX" && playerData.GetString("country") != "XX")
5151
country = playerData.GetString("country");
52-
joinDate = playerData.GetInt32("joined");
53-
lastSeen = playerData.GetInt32("lastseen");
52+
joinDate = playerData.GetInt32("join_date");
53+
lastSeen = playerData.GetInt32("last_seen");
5454
connections = playerData.GetInt32("connections");
5555
playerData.Close();
5656

@@ -69,7 +69,7 @@ public HookResult OnPlayerConnect(EventPlayerConnectFull @event, GameEventInfo i
6969
connections = 1;
7070

7171
// Write new player to database
72-
Task<int> newPlayerTask = DB.Write($"INSERT INTO `Player` (`name`, `steam_id`, `country`, `joined`, `lastseen`, `connections`) VALUES ('{MySqlHelper.EscapeString(name)}', {player.SteamID}, '{country}', {joinDate}, {lastSeen}, {connections});");
72+
Task<int> newPlayerTask = DB.Write($"INSERT INTO `Player` (`name`, `steam_id`, `country`, `join_date`, `last_seen`, `connections`) VALUES ('{MySqlHelper.EscapeString(name)}', {player.SteamID}, '{country}', {joinDate}, {lastSeen}, {connections});");
7373
int newPlayerTaskRows = newPlayerTask.Result;
7474
if (newPlayerTaskRows != 1)
7575
throw new Exception($"CS2 Surf ERROR >> OnPlayerConnect -> Failed to write new player to database, this shouldnt happen. Player: {name} ({player.SteamID})");

0 commit comments

Comments
 (0)