From 1899bc9a004498ae8eae9c31932faa66827b883f Mon Sep 17 00:00:00 2001
From: Rushaway
Date: Wed, 20 Nov 2024 11:18:12 +0100
Subject: [PATCH] feat: steam auth id convar
---
README.md | 1 +
docs/index.html | 14 ++++++++++++++
src/addons/sourcemod/scripting/zombiereloaded.sp | 2 +-
src/addons/sourcemod/scripting/zr/cvars.inc | 2 ++
src/addons/sourcemod/scripting/zr/roundend.inc | 4 +++-
5 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 4ab27c65..90565b42 100644
--- a/README.md
+++ b/README.md
@@ -163,6 +163,7 @@ Find all cvars details on [online docs](https://srcdslab.github.io/sm-plugin-zom
- zr_roundend_overlays_zombie - "overlays/zr/zombies_win - Overlay, relative to \"materials\" folder, to display when zombies win the round. [Dependency: zr_roundend_overlay]
- zr_roundend_balance_teams - "1" - Balances the team every time the round ends. Disable this if you use something else to balance teams.
- zr_roundend_zombies_win - "1" - Should zombies win if roundtime runs out.
+- zr_roundend_authid_type - "1" - AuthID type used [0 = Engine, 1 = Steam2, 2 = Steam3, 3 = Steam64]
- zr_account_cashfill - "1" - Reset player's cash each spawn.
- zr_account_cashfill_value - "12000" - Amount of cash to set player's account to. [Dependency: zr_account_cashfill]
- zr_account_cashdmg - "0" - Attacker receives amount of cash equivalent to the damage that was inflicted.
diff --git a/docs/index.html b/docs/index.html
index f893e94f..b6ae662e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -3378,6 +3378,20 @@
0 or 1
+
+
+ zr_roundend_authid_type |
+ 1 |
+
+
+ AuthID type used to display stats at round end. See AuthIdType Enumeration
+ Options:
+ 0 = Engine
+ 1 = Steam2
+ 2 = Steam3
+ 3 = Steam64
+
+ |
diff --git a/src/addons/sourcemod/scripting/zombiereloaded.sp b/src/addons/sourcemod/scripting/zombiereloaded.sp
index b015f6fc..5b413c3b 100644
--- a/src/addons/sourcemod/scripting/zombiereloaded.sp
+++ b/src/addons/sourcemod/scripting/zombiereloaded.sp
@@ -45,7 +45,7 @@
#include
-#define VERSION "3.10.12"
+#define VERSION "3.10.13"
// Comment this line to exclude version info command. Enable this if you have
// the repository and HG installed (Mercurial or TortoiseHG).
diff --git a/src/addons/sourcemod/scripting/zr/cvars.inc b/src/addons/sourcemod/scripting/zr/cvars.inc
index f41e4cdd..7f26a9c8 100644
--- a/src/addons/sourcemod/scripting/zr/cvars.inc
+++ b/src/addons/sourcemod/scripting/zr/cvars.inc
@@ -104,6 +104,7 @@ enum struct CvarsList
Handle CVAR_ROUNDEND_OVERLAY_HUMAN;
Handle CVAR_ROUNDEND_BALANCE_TEAMS;
Handle CVAR_ROUNDEND_ZOMBIES_WIN;
+ Handle CVAR_ROUNDEND_AUTHID_TYPE;
Handle CVAR_INFECT_SPAWNTIME_MIN;
Handle CVAR_INFECT_SPAWNTIME_MAX;
Handle CVAR_INFECT_CONSECUTIVE_BLOCK;
@@ -386,6 +387,7 @@ void CvarsCreate()
g_hCvarsList.CVAR_ROUNDEND_OVERLAY_ZOMBIE = CreateConVar("zr_roundend_overlays_zombie", "overlays/zr/zombies_win", "Overlay, relative to \"materials\" folder, to display when zombies win the round. [Dependency: zr_roundend_overlay]");
g_hCvarsList.CVAR_ROUNDEND_BALANCE_TEAMS = CreateConVar("zr_roundend_balance_teams", "1", "Balances the team every time the round ends. Disable this if you use something else to balance teams.");
g_hCvarsList.CVAR_ROUNDEND_ZOMBIES_WIN = CreateConVar("zr_roundend_zombies_win", "1", "Should zombies win if roundtime runs out.");
+ g_hCvarsList.CVAR_ROUNDEND_AUTHID_TYPE = CreateConVar("zr_roundend_authid_type", "1", "AuthID type used [0 = Engine, 1 = Steam2, 2 = Steam3, 3 = Steam64]", FCVAR_NONE, true, 0.0, true, 3.0);
// ===========================
diff --git a/src/addons/sourcemod/scripting/zr/roundend.inc b/src/addons/sourcemod/scripting/zr/roundend.inc
index be989d91..e10cb1f1 100644
--- a/src/addons/sourcemod/scripting/zr/roundend.inc
+++ b/src/addons/sourcemod/scripting/zr/roundend.inc
@@ -292,6 +292,8 @@ void RoundEndOnRoundEnd(int reason)
void RoundEndDisplayStats()
{
+ AuthIdType authType = view_as(GetConVarInt(g_hCvarsList.CVAR_ROUNDEND_AUTHID_TYPE));
+
for(int player = 1; player <= MaxClients; player++)
{
if(!IsClientInGame(player) || (IsFakeClient(player) && !IsClientSourceTV(player)))
@@ -306,7 +308,7 @@ void RoundEndDisplayStats()
FormatEx(sPlayerID, sizeof(sPlayerID), "%d", GetClientUserId(player));
FormatEx(sPlayerName, sizeof(sPlayerName), "\"%N\"", player);
- if(!GetClientAuthId(player, AuthId_Steam2, sPlayerAuth, sizeof(sPlayerAuth)))
+ if(!GetClientAuthId(player, authType, sPlayerAuth, sizeof(sPlayerAuth)))
FormatEx(sPlayerAuth, sizeof(sPlayerAuth), "STEAM_ID_PENDING");
if(IsPlayerAlive(player))