Skip to content

Commit

Permalink
Wrap Prints in DEBUG defines, Fixup README
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooshua committed Feb 16, 2023
1 parent 794a2bd commit 5b3d23e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintained forks of various sourcemod plugins and gamedatas
## Plugins

### Antilag
*Originaly by Backwards*
*Originally by Backwards*

Antilag merges several individual exploit plugins by Backwards and refactors them for enhanced functionality and maintainability.
- More reliance on gamedata instead of hardcoded addresses
Expand All @@ -15,10 +15,11 @@ You can use the cvar `sourceforks_antilag_punishment` to configure the punishmen
- **0**: Benign (same functionality as original plugin)
- **1**: Notify admins, otherwise benign
- **2**: Kick the cheater if they continue
- **3**: Permanently ban the cheater if the continue.
- **3**: Permanently ban the cheater if they continue.


### MovementUnlocker
*Originally by Peace-Maker*

Almost identical to the original, but refactored to use gamedata.

Expand Down
14 changes: 13 additions & 1 deletion src/scripting/sourceforks_antilag.sp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public Plugin:myinfo =
url = "http://www.steamcommunity.com/id/mypassword"
}

#define DEBUG 0

#define GAMEDATA_FILE "sourceforks_antilag.games"
#define DEFAULT_HEAT (6*60)
#define HEAT_SUSPICIOUS (5 * 60)
Expand All @@ -46,7 +48,9 @@ enum Punishment

stock void Blame(const char[] ip)
{
#if DEBUG
PrintToServer("Blaming '%s'", ip);
#endif

for (int i = 1; i < MAXPLAYERS; i++)
{
Expand All @@ -62,7 +66,10 @@ stock void Blame(const char[] ip)
if (!StrEqual(ip, clientIp))
continue;

//PrintToServer("Found client %i", i);
#if DEBUG
PrintToServer("Found client %i", i);
#endif

if (ClientHeat[i] > 0)
ClientHeat[i]--;
}
Expand Down Expand Up @@ -96,7 +103,9 @@ public Action Timer_CoolDownPlayers(Handle self)
if (IsFakeClient(i))
continue;

#if DEBUG
PrintToServer("Client %i Heat %i", i, ClientHeat[i]);
#endif

// =================
// Alert adminstrators to suspicious network activity.
Expand Down Expand Up @@ -139,7 +148,10 @@ public Action Timer_CoolDownPlayers(Handle self)

public Action Timer_WarmUpPlayers(Handle self)
{
#if DEBUG
PrintToServer("Warming up");
#endif

for (int i = 1; i < MAXPLAYERS; i++)
{
ClientHeat[i] = DEFAULT_HEAT;
Expand Down

0 comments on commit 5b3d23e

Please sign in to comment.