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); } }
$s = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/") . $s; $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"]; return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); } $url = selfURL(); $url = substr($url, 0, strrpos($url, "/")) . "/"; $serverId = $_GET['serverId']; $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 }
array_shift($argv); } elseif ($argv[0] == "-C") { array_shift($argv); read_properties(array_shift($argv), $server, $port, $passwd); } elseif ($argv[0] == "--") { array_shift($argv); break; } else { break; } } if (is_null($passwd)) { die("No password specified\n"); } echo "Server={$server} port={$port} passwd={$passwd}\n"; $rcon = new rcon($server, $port); $rcon->auth($passwd); if (count($argv)) { echo $rcon->cmd(implode(" ", $argv)) . "\n"; } else { if (is_interactive()) { echo "Enter /quit to finish\n"; while (true) { $line = readline("RCON> "); if (trim($line) != "") { $t = trim($line); if ($line == "/quit") { exit; } readline_add_history($line); echo $rcon->cmd($line) . "\n";
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GlobalBan. If not, see <http://www.gnu.org/licenses/>. */ require_once ROOTDIR . "/include/database/class.ServerQueries.php"; 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);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GlobalBan. If not, see <http://www.gnu.org/licenses/>. */ require_once ROOTDIR . "/include/database/class.ServerQueries.php"; 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);
?> </b></div> </div> <table id="serverListTable" class="bordercolor" width="100%" cellspacing="1" cellpadding="5" border="0" style="margin-top: 1px;"> <tr> <?php $i = 0; $serversPerRow = 3; // The number of servers to show per row foreach ($servers as $server) { $serverIp = new InetAddress($server->getIp()); $serverSC = new SourceServer($serverIp, $server->getPort()); $serverSC->initialize(); // Create an rcon object to connect to a single server on each iteration $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); // $liveData = new LIVE(); $serverData = $serverSC->getServerInfo(); ?> <td class="colColor1" valign="top"> <?php if ($r->isValid()) { ?> <img src="images/connect.png" onmouseover="Tip('<?php echo $LAN_SERVERLIST_002; ?> ', SHADOW, true, FADEIN, 300, FADEOUT, 300, CLICKCLOSE, true, BGCOLOR, getStyleBackgroundColor('container'), BORDERCOLOR, getStyleBackgroundColor('serverListTable'))"/><?php } else { ?> <img src="images/disconnect.png" onmouseover="Tip('<?php echo $LAN_SERVERLIST_003;
function kickUser($steamId, $serverId, $config) { $serverQueries = new ServerQueries(); $server = $serverQueries->getServer($serverId); $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); $r->Auth(); $r->rconCommand("kickid " . $steamId . " '" . $config->banMessage . "'"); }
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GlobalBan. If not, see <http://www.gnu.org/licenses/>. */ require_once ROOTDIR . "/include/database/class.ServerQueries.php"; require_once ROOTDIR . "/include/database/class.LengthQueries.php"; require_once ROOTDIR . "/include/class.rcon.php"; $serverId = $_GET['serverId']; $serverQueries = new ServerQueries(); $lengthQueries = new LengthQueries(); $server = $serverQueries->getServer($serverId); $banLengths = $lengthQueries->getLengthList(); // 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 /* // First delete the existing clanMembers keygroup and then re-create it $r->sendRconCommand("es_keygroupdelete GlobalBan_Length; es_keygroupcreate GlobalBan_Length"); // 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()."\"";