function unBanUser($steamId, $bannedIP) { // This will send an RCON command to the server $serverQueries = new ServerQueries(); // Get the list of servers $servers = $serverQueries->getServers(); // Cycle through each server foreach ($servers as $server) { $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); if ($r->isValid()) { $r->Auth(); $r->sendRconCommand("removeid " . $steamId); $r->sendRconCommand("removeip " . $bannedIP); } } }
function kickUser($steamId, $serverId, $menssageTOplayer, $menssageTOserver) { // Leave this in to be compatible with the alternate thread version $kick = "kickid"; $command = $kick . " \"" . $steamId . "\" " . $menssageTOplayer; echo $command; // This will send an RCON command to the server $serverQueries = new ServerQueries(); $server = $serverQueries->getServer($serverId); $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); if ($r->isValid()) { $r->Auth(); $r->kickUser($steamId, $menssageTOplayer); $r->sendRconCommand("banid 5 " . "\"" . $steamId . "\" "); $r->sendRconCommand("es_msg " . $menssageTOserver); } }
$serverQueries = new ServerQueries(); $server = $serverQueries->getServer($serverId); // Create an rcon object to connect to a single server on each iteration $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); $success = 0; // Make sure it connected to the server if ($r->isValid()) { // Is admin banning allowed $adminBanning = 0; if ($config->allowAdminBans) { $adminBanning = 1; } $r->Auth(); // Establish the connection $command = "gb_saveConfig \"" . $server->getId() . "\" \"" . $url . "\" \"" . $config->banMessage . "\" \"" . $config->matchHash . "\" \"" . $config->teachAdmins . "\" \"" . $config->siteName . "\" \"" . $adminBanning . "\" "; $r->sendRconCommand($command); $success = 1; // Successfully updated } // Send back the new active state header('Content-Type: text/xml'); header("Cache-Control: no-cache, must-revalidate"); function convertXmlSpecial($string) { $string = str_replace("&", "&", $string); $string = str_replace("'", "'", $string); $string = str_replace("\"", """, $string); $string = str_replace("<", "<", $string); $string = str_replace(">", ">", $string); return $string; }
require_once ROOTDIR . "/include/database/class.UserQueries.php"; require_once ROOTDIR . "/include/class.rcon.php"; $serverId = $_GET['serverId']; $serverQueries = new ServerQueries(); $userQueries = new UserQueries(); $server = $serverQueries->getServer($serverId); $users = $userQueries->getUsers(); // Create an rcon object to connect to a single server on each iteration $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); $active = 0; // Make sure it connected to the server if ($r->isValid()) { $r->Auth(); // Establish the connection $active = 1; $r->sendRconCommand("es gb_refreshAdmins"); } // Send back the new active state header('Content-Type: text/xml'); header("Cache-Control: no-cache, must-revalidate"); function convertXmlSpecial($string) { $string = str_replace("&", "&", $string); $string = str_replace("'", "'", $string); $string = str_replace("\"", """, $string); $string = str_replace("<", "<", $string); $string = str_replace(">", ">", $string); return $string; } echo "<?xml version=\"1.0\" ?>"; ?>
require_once ROOTDIR . "/include/database/class.ReasonQueries.php"; require_once ROOTDIR . "/include/class.rcon.php"; $serverId = $_GET['serverId']; $serverQueries = new ServerQueries(); $reasonQueries = new ReasonQueries(); $server = $serverQueries->getServer($serverId); $reasons = $reasonQueries->getReasonList(); // Create an rcon object to connect to a single server on each iteration $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); $active = 0; // Make sure it connected to the server if ($r->isValid()) { $active = 1; $r->Auth(); // Establish the connection $r->sendRconCommand("es gb_refreshBanReasons"); } // Send back the new active state header('Content-Type: text/xml'); header("Cache-Control: no-cache, must-revalidate"); function convertXmlSpecial($string) { $string = str_replace("&", "&", $string); $string = str_replace("'", "'", $string); $string = str_replace("\"", """, $string); $string = str_replace("<", "<", $string); $string = str_replace(">", ">", $string); return $string; } echo "<?xml version=\"1.0\" ?>"; ?>
// Cycle through each user and create the keygroup foreach($banLengths as $banLength) { // Create a key for the user $command = "gb_addBanLength ".$banLength->getId()." \"".$banLength->getLength()."\" \"".$banLength->getTimeScale()."\""; $r->sendRconCommand($command); } // Now save the keygroup $r->sendRconCommand("es_keygroupsave GlobalBan_Length |GlobalBan"); // Now reload the clan_db script $r->sendRconCommand("es_reload GlobalBan"); */ $r->sendRconCommand("es gb_refreshBanLengths"); } // Send back the new active state header('Content-Type: text/xml'); header("Cache-Control: no-cache, must-revalidate"); function convertXmlSpecial($string) { $string = str_replace("&", "&", $string); $string = str_replace("'", "'", $string); $string = str_replace("\"", """, $string); $string = str_replace("<", "<", $string); $string = str_replace(">", ">", $string); return $string; } echo "<?xml version=\"1.0\" ?>"; ?>