From 06e2b03989577cabeb7d370af46b45141e0d2304 Mon Sep 17 00:00:00 2001 From: Altair Sossai Date: Tue, 5 Nov 2024 16:56:01 -0300 Subject: [PATCH] Add player team handling and transition state management to L4D2 Game Info Sync plugin --- .../plugins/optional/l4d2_gameinfo_sync.smx | Bin 6275 -> 12118 bytes .../sourcemod/scripting/l4d2_gameinfo_sync.sp | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/addons/sourcemod/plugins/optional/l4d2_gameinfo_sync.smx b/addons/sourcemod/plugins/optional/l4d2_gameinfo_sync.smx index d203b412295d71e3b396de3299f3495a0f708c33..9cf381456141884c5449d0daacd91e01afcadf16 100644 GIT binary patch literal 12118 zcmXw9byQo+*9}lei>0`gP`tRiwZ);hyG!r_MT-@8cXuo94y8bGcP;J#g6o&}zW4j% z+`VVA@0oLF&D}G1tw=~HsvsgDsIve7tVsX>&LaQ-_=5ny{D&cI000V{D{{bt697Pm z^BfBRU;~bL@bI++0B+$3hKCyj0GNRzEj+$h0RVEC001+br@F!Q@SMDG?(P8qjKH}# zoQr=40P5jf8P4y#0DynS)`Q2DHvm8dM{9Tx`2YZL832A8AQ8@g!Z8RQpM2p3!!Z^f zU*WtO4FJf1bMgoP;4K`B;K2sxBXF#P#}k~3AOQf~a4r}F09+!&YcsJoH3Kl48aW#Q zm>s?u+dxd5{v|F(j&NdUBY-T#yR`-_>~H{1XE zo!uSGoXnj6Ynj*>IXRh{ng7=`hnU&G6EK?^TQHkLZ2lSPA8G@!`yYkancM$==l@3g zS7BjeZ){}qKe@fhKiqBU#0$+?ZP9(LCGM^9+X%op@hjbr=;-(wpjY{+Q^Z1U?yoG# zF<7IP$|+YVR|Qt)SAbF~X@=>}DQ4=Qu@B<{=6I>OA+rgsL$&Y9nWPDmmpG}JY)eJ0 zbaB#)>S?&;O@W^GPY*BSLJwJ<&`%s+<_{0k+Abkb*vrH5&GSvy&0_SIIwRE)7|~@p zGQFRYzYoHOts(PU#6!QPfW2wAd~o|TxE&4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g7pdn!;> z&|@F*@fi6+luxo{HE)=+@AjZc{NiIJDK`ZFV}GX;S(@46q>Ng4x2!vi-+if)Gb?=B z=k{m+2%9wRA==3;H^ zYCt?tO;EDVQe|hXoS6f{a}Z1Ih6k$JN(F-yw<=7%^`OPksr)Z9oI*YqzkTy4H65mb zjJ|Q{3e`WF`-ynoUlET-_^Dp={QD!q!7#IOo)37(Jj+(eiG8}X+Qjhr*zd!f2f=%OfQ=W xL&^E#35~=}s6P%+=`(v9i=hdNnn&UWI=AT3cT{|{3;#I98iW$mMqyF!{s+pg(UbrH diff --git a/addons/sourcemod/scripting/l4d2_gameinfo_sync.sp b/addons/sourcemod/scripting/l4d2_gameinfo_sync.sp index a36afc34e..df63986a0 100644 --- a/addons/sourcemod/scripting/l4d2_gameinfo_sync.sp +++ b/addons/sourcemod/scripting/l4d2_gameinfo_sync.sp @@ -3,7 +3,14 @@ #include #include +#include #include +#include +#include + +#define L4D2_TEAM_SPECTATOR 1 +#define L4D2_TEAM_SURVIVOR 2 +#define L4D2_TEAM_INFECTED 3 public Plugin myinfo = { @@ -21,21 +28,53 @@ ConVar char ConfigurationName[64]; +bool inTransition = false; + public void OnPluginStart() { hUrl = CreateConVar("gameinfo_url", "", "Game Info API URL", FCVAR_PROTECTED); hSecretKey = CreateConVar("gameinfo_secret", "", "Game Info API Secret Key", FCVAR_PROTECTED); HookEvent("round_start", RoundStart_Event); + HookEvent("player_team", PlayerTeam_Event, EventHookMode_Post); CreateTimer(5.0, Every_5_Seconds_Timer, _, TIMER_REPEAT); } +public void OnRoundIsLive() +{ + inTransition = false; + + SendPlayers(); +} + +public void L4D2_OnEndVersusModeRound_Post() +{ + inTransition = true; + + CreateTimer(10.0, L4D2_OnEndVersusModeRound_Post_Timer); +} + void RoundStart_Event(Handle event, const char[] name, bool dontBroadcast) { CreateTimer(5.0, RoundStart_Timer); } +void PlayerTeam_Event(Event event, const char[] name, bool dontBroadcast) +{ + if (IsInReady()) + return; + + SendPlayers(); +} + +Action L4D2_OnEndVersusModeRound_Post_Timer(Handle timer) +{ + inTransition = false; + + return Plugin_Continue; +} + Action RoundStart_Timer(Handle timer) { SendConfiguration(); @@ -53,6 +92,9 @@ Action Every_5_Seconds_Timer(Handle hTimer) void SendConfiguration() { + if (inTransition) + return; + JSONObject command = new JSONObject(); command.SetInt("teamSize", GetConVarInt(FindConVar("survivor_limit"))); @@ -73,6 +115,9 @@ void SendConfiguration() void SendRound() { + if (inTransition) + return; + JSONObject command = new JSONObject(); command.SetInt("areTeamsFlipped", GameRules_GetProp("m_bAreTeamsFlipped")); @@ -85,6 +130,9 @@ void SendRound() void SendScoreboard() { + if (inTransition) + return; + JSONObject command = new JSONObject(); int flipped = GameRules_GetProp("m_bAreTeamsFlipped"); @@ -100,6 +148,92 @@ void SendScoreboard() request.Put(command, DoNothing); } +void SendPlayers() +{ + if (inTransition) + return; + + JSONObject command = new JSONObject(); + + JSONArray survivors = new JSONArray(); + JSONArray infecteds = new JSONArray(); + JSONArray spectators = new JSONArray(); + + char communityId[25]; + char name[MAX_NAME_LENGTH]; + + for (int client = 1; client <= MaxClients; client++) + { + if (!IsClientInGame(client)) + continue; + + int team = GetClientTeam(client); + if (team != L4D2_TEAM_SPECTATOR && team != L4D2_TEAM_SURVIVOR && team != L4D2_TEAM_INFECTED) + continue; + + JSONObject player = new JSONObject(); + + GetClientAuthId(client, AuthId_SteamID64, communityId, sizeof(communityId)); + player.SetString("communityId", communityId); + + GetClientName(client, name, sizeof(name)); + player.SetString("name", name); + + player.SetFloat("latency", GetClientLatency(client, NetFlow_Both)); + + if (team == L4D2_TEAM_SURVIVOR) + { + player.SetInt("character", IdentifySurvivor(client)); + player.SetInt("permanentHealth", GetSurvivorPermanentHealth(client)); + player.SetInt("temporaryHealth", GetSurvivorTemporaryHealth(client)); + player.SetInt("primaryWeapon", IdentifyWeapon(GetPlayerWeaponSlot(client, 0))); + + int slot1 = GetPlayerWeaponSlot(client, 1); + int secondaryWeapon = IdentifyWeapon(slot1); + + player.SetInt("secondaryWeapon", secondaryWeapon); + + if (secondaryWeapon == WEPID_MELEE) + player.SetInt("meleeWeapon", IdentifyMeleeWeapon(slot1)); + + player.SetInt("slotNumber3", IdentifyWeapon(GetPlayerWeaponSlot(client, 2))); + player.SetInt("slotNumber4", IdentifyWeapon(GetPlayerWeaponSlot(client, 3))); + player.SetInt("slotNumber5", IdentifyWeapon(GetPlayerWeaponSlot(client, 4))); + //player.SetInt("blackAndWhite", 0); + player.SetBool("incapacitated", IsIncapacitated(client)); + player.SetBool("isPlayerAlive", IsPlayerAlive(client)); + player.SetBool("isFakeClient", IsFakeClient(client)); + //player.SetInt("progress", 0); + + survivors.Push(player); + } + + if (team == L4D2_TEAM_INFECTED) + { + player.SetInt("Type", GetInfectedClass(client)); + //player.SetInt("DamageTotal", 0); + //player.SetInt("CurrentHp", 0); + //player.SetInt("MaxHp", 0); + player.SetBool("isInfectedGhost", IsInfectedGhost(client)); + player.SetBool("isPlayerAlive", IsPlayerAlive(client)); + player.SetBool("isFakeClient", IsFakeClient(client)); + + infecteds.Push(player); + } + + if (team == L4D2_TEAM_SPECTATOR) + spectators.Push(player); + } + + command.Set("survivors", survivors); + command.Set("infecteds", infecteds); + command.Set("spectators", spectators); + + HTTPRequest request = BuildHTTPRequest("/api/game-info/players"); + + request.Put(command, DoNothing); +} + void DoNothing(HTTPResponse httpResponse, any value) { }