Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Added force flag to bypass lastrun timer
Browse files Browse the repository at this point in the history
  • Loading branch information
RobFreiburger committed Jan 28, 2012
1 parent 7af6655 commit 42069e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion whitelist-kick.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Configurable variables
$jsonURL = 'servers.json';
$whitelistURL = 'http://example.com/whitelist';
$forceKickVerification = 'gKnVsgV7zHt2RbDt'; // random string that must be passed in order to bypass lastrun timer
$secondsBeforeKick = 5; // time between kick announcement and kick commands
$maxPlayersToKick = 3; // maximum # of non-whitelisted players to kick per server
$cooldownSeconds = 180; // interval between successful kicks
Expand Down Expand Up @@ -31,6 +32,12 @@
exit("Invalid argument(s) passed to script.\n");
}

// Set FORCE variable to true if valid string is passed to script
$FORCEKICK = False;
if (strcmp($_GET["force"], $forceKickVerification) === 0) {
$FORCEKICK = True;
}

unset($_GET);

// Get whitelist and loop through all validated servers
Expand Down Expand Up @@ -137,7 +144,7 @@
continue;
}

if (whitelistKick_init($server->abbv, $cooldownSeconds)) {
if ($FORCE || whitelistKick_init($server->abbv, $cooldownSeconds)) {

if (count($nonWhitelistedPlayers) > $maxPlayersToKick) {
$tempArray = array();
Expand Down

0 comments on commit 42069e3

Please sign in to comment.