Skip to content

Commit

Permalink
Add round start event hook to trigger configuration send
Browse files Browse the repository at this point in the history
  • Loading branch information
altair-sossai committed Nov 4, 2024
1 parent 6e93bcd commit 24b66ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Binary file modified addons/sourcemod/plugins/optional/l4d2_gameinfo_sync.smx
Binary file not shown.
14 changes: 13 additions & 1 deletion addons/sourcemod/scripting/l4d2_gameinfo_sync.sp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ public void OnPluginStart()
hUrl = CreateConVar("gameinfo_url", "", "Game Info API URL", FCVAR_PROTECTED);
hSecretKey = CreateConVar("gameinfo_secret", "", "Game Info API Secret Key", FCVAR_PROTECTED);

SendConfiguration();
HookEvent("round_start", RoundStart_Event);
}

void RoundStart_Event(Handle event, const char[] name, bool dontBroadcast)
{
CreateTimer(5.0, RoundStart_Timer);
}

Action RoundStart_Timer(Handle timer)
{
SendConfiguration();

return Plugin_Continue;
}

void SendConfiguration()
Expand Down

0 comments on commit 24b66ff

Please sign in to comment.