Skip to content

Commit

Permalink
🎨 Delay Convar Fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
rumblefrog committed Apr 8, 2018
1 parent eacf799 commit 58968ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sbpp_discord.sp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma semicolon 1

#define PLUGIN_AUTHOR "RumbleFrog, SourceBans++ Dev Team"
#define PLUGIN_VERSION "1.0.2"
#define PLUGIN_VERSION "1.0.3"

#include <sourcemod>
#include <sourcebanspp>
Expand Down Expand Up @@ -37,17 +37,17 @@ public void OnPluginStart()
Convars[Ban] = CreateConVar("sbpp_discord_banhook", "", "Discord web hook endpoint for ban forward", FCVAR_PROTECTED);
Convars[Report] = CreateConVar("sbpp_discord_reporthook", "", "Discord web hook endpoint for report forward. If left empty, the ban endpoint will be used instead", FCVAR_PROTECTED);

FindConVar("hostname").GetString(sHostname, sizeof sHostname);

int iIPB = FindConVar("hostip").IntValue;
Format(sHost, sizeof sHost, "%d.%d.%d.%d:%d", iIPB >> 24 & 0x000000FF, iIPB >> 16 & 0x000000FF, iIPB >> 8 & 0x000000FF, iIPB & 0x000000FF, FindConVar("hostport").IntValue);

Convars[Ban].AddChangeHook(OnConvarChanged);
Convars[Report].AddChangeHook(OnConvarChanged);
}

public void OnConfigsExecuted()
{
FindConVar("hostname").GetString(sHostname, sizeof sHostname);

int iIPB = FindConVar("hostip").IntValue;
Format(sHost, sizeof sHost, "%d.%d.%d.%d:%d", iIPB >> 24 & 0x000000FF, iIPB >> 16 & 0x000000FF, iIPB >> 8 & 0x000000FF, iIPB & 0x000000FF, FindConVar("hostport").IntValue);

Convars[Ban].GetString(sEndpoints[Ban], sizeof sEndpoints[]);
Convars[Report].GetString(sEndpoints[Report], sizeof sEndpoints[]);
}
Expand Down

0 comments on commit 58968ce

Please sign in to comment.