From 3a40ffa4d52b8e7e380e857b8a03a7a0c61fac4d Mon Sep 17 00:00:00 2001 From: T <74899888+tslashd@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:12:20 +0200 Subject: [PATCH 1/4] Player table last_seen --- src/ST-Events/Players.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ST-Events/Players.cs b/src/ST-Events/Players.cs index fe93343..011cbaf 100644 --- a/src/ST-Events/Players.cs +++ b/src/ST-Events/Players.cs @@ -123,7 +123,7 @@ public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo else { // Update data in Player DB table - Task updatePlayerTask = DB.Write($"UPDATE `Player` SET country = '{playerList[player.UserId ?? 0].Profile.Country}', `lastseen` = {(int)DateTimeOffset.UtcNow.ToUnixTimeSeconds()}, `connections` = `connections` + 1 WHERE `id` = {playerList[player.UserId ?? 0].Profile.ID} LIMIT 1;"); + Task updatePlayerTask = DB.Write($"UPDATE `Player` SET country = '{playerList[player.UserId ?? 0].Profile.Country}', `last_seen` = {(int)DateTimeOffset.UtcNow.ToUnixTimeSeconds()}, `connections` = `connections` + 1 WHERE `id` = {playerList[player.UserId ?? 0].Profile.ID} LIMIT 1;"); if (updatePlayerTask.Result != 1) throw new Exception($"CS2 Surf ERROR >> OnPlayerDisconnect -> Failed to update player data in database. Player: {player.PlayerName} ({player.SteamID})"); From ee835860c833a03fb6e68b2eac0d1bfad0b79878 Mon Sep 17 00:00:00 2001 From: T <74899888+tslashd@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:24:43 +0200 Subject: [PATCH 2/4] ignore sln files --- .gitignore | 3 ++- CS2SurfTimer.sln | 30 ------------------------------ 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 CS2SurfTimer.sln diff --git a/.gitignore b/.gitignore index 7812496..efcca51 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.idea src/bin/Debug/* src/obj/* -src/SurfTimer.csproj \ No newline at end of file +src/SurfTimer.csproj +*.sln \ No newline at end of file diff --git a/CS2SurfTimer.sln b/CS2SurfTimer.sln deleted file mode 100644 index ab56b21..0000000 --- a/CS2SurfTimer.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A9962DB7-AE8A-4370-B381-19529A91B7EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SurfTimer", "src\SurfTimer.csproj", "{98841535-B479-49B7-8D35-03786D4C31B9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {98841535-B479-49B7-8D35-03786D4C31B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {98841535-B479-49B7-8D35-03786D4C31B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {98841535-B479-49B7-8D35-03786D4C31B9} = {A9962DB7-AE8A-4370-B381-19529A91B7EC} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2AE70C13-97FA-4E60-93C0-94275277887E} - EndGlobalSection -EndGlobal From 8a3e30bb047d535b2c4c83082df2d5bf90d01c27 Mon Sep 17 00:00:00 2001 From: T <74899888+tslashd@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:27:28 +0200 Subject: [PATCH 3/4] Player table last_seen --- src/ST-Events/Players.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ST-Events/Players.cs b/src/ST-Events/Players.cs index fe93343..011cbaf 100644 --- a/src/ST-Events/Players.cs +++ b/src/ST-Events/Players.cs @@ -123,7 +123,7 @@ public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo else { // Update data in Player DB table - Task updatePlayerTask = DB.Write($"UPDATE `Player` SET country = '{playerList[player.UserId ?? 0].Profile.Country}', `lastseen` = {(int)DateTimeOffset.UtcNow.ToUnixTimeSeconds()}, `connections` = `connections` + 1 WHERE `id` = {playerList[player.UserId ?? 0].Profile.ID} LIMIT 1;"); + Task updatePlayerTask = DB.Write($"UPDATE `Player` SET country = '{playerList[player.UserId ?? 0].Profile.Country}', `last_seen` = {(int)DateTimeOffset.UtcNow.ToUnixTimeSeconds()}, `connections` = `connections` + 1 WHERE `id` = {playerList[player.UserId ?? 0].Profile.ID} LIMIT 1;"); if (updatePlayerTask.Result != 1) throw new Exception($"CS2 Surf ERROR >> OnPlayerDisconnect -> Failed to update player data in database. Player: {player.PlayerName} ({player.SteamID})"); From 985c168a613909391dd48933e7c2343e8624ab6e Mon Sep 17 00:00:00 2001 From: T <74899888+tslashd@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:29:02 +0200 Subject: [PATCH 4/4] Revert "ignore sln files" This reverts commit ee835860c833a03fb6e68b2eac0d1bfad0b79878. --- .gitignore | 3 +-- CS2SurfTimer.sln | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 CS2SurfTimer.sln diff --git a/.gitignore b/.gitignore index efcca51..7812496 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ *.idea src/bin/Debug/* src/obj/* -src/SurfTimer.csproj -*.sln \ No newline at end of file +src/SurfTimer.csproj \ No newline at end of file diff --git a/CS2SurfTimer.sln b/CS2SurfTimer.sln new file mode 100644 index 0000000..ab56b21 --- /dev/null +++ b/CS2SurfTimer.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A9962DB7-AE8A-4370-B381-19529A91B7EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SurfTimer", "src\SurfTimer.csproj", "{98841535-B479-49B7-8D35-03786D4C31B9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {98841535-B479-49B7-8D35-03786D4C31B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98841535-B479-49B7-8D35-03786D4C31B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {98841535-B479-49B7-8D35-03786D4C31B9} = {A9962DB7-AE8A-4370-B381-19529A91B7EC} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2AE70C13-97FA-4E60-93C0-94275277887E} + EndGlobalSection +EndGlobal