Skip to content
Permalink
Browse files

* Fix kicking of players in games that use the Steam3 [U:1:X] steamid…

… representation
  • Loading branch information...
januk@freenet.de
januk@freenet.de committed Sep 20, 2014
1 parent 5433c25 commit 998834cef8565ce87f3f3c95cce58dc1b25f5998
Showing with 5 additions and 4 deletions.
  1. +4 −3 web_upload/includes/sb-callback.php
  2. +1 −1 web_upload/pages/admin.kickit.php
@@ -1554,12 +1554,13 @@ function KickPlayer($sid, $name)
}
if($found) {
$steam = $matches[3][$index];
$steam2 = $steam;
// Hack to support steam3 [U:1:X] representation.
if(strpos($steam, "[U:") === 0) {
$steam = renderSteam2(getAccountId($steam), 0);
$steam2 = renderSteam2(getAccountId($steam), 0);
}
// check for immunity
$admin = $GLOBALS['db']->GetRow("SELECT a.immunity AS pimmune, g.immunity AS gimmune FROM `".DB_PREFIX."_admins` AS a LEFT JOIN `".DB_PREFIX."_srvgroups` AS g ON g.name = a.srv_group WHERE authid = '".$steam."' LIMIT 1;");
$admin = $GLOBALS['db']->GetRow("SELECT a.immunity AS pimmune, g.immunity AS gimmune FROM `".DB_PREFIX."_admins` AS a LEFT JOIN `".DB_PREFIX."_srvgroups` AS g ON g.name = a.srv_group WHERE authid = '".$steam2."' LIMIT 1;");
if($admin && $admin['gimmune']>$admin['pimmune'])
$immune = $admin['gimmune'];
elseif($admin)
@@ -1569,7 +1570,7 @@ function KickPlayer($sid, $name)
if($immune <= $userbank->GetProperty('srv_immunity')) {
$requri = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], ".php")+4);
$kick = $r->sendCommand("kickid ".$steam." \"You have been kicked by this server, check http://" . $_SERVER['HTTP_HOST'].$requri." for more info.\"");
$kick = $r->sendCommand("kickid \"".$steam."\" \"You have been kicked by this server, check http://" . $_SERVER['HTTP_HOST'].$requri." for more info.\"");
$log = new CSystemLog("m", "Player kicked", $username . " kicked player '".htmlspecialchars($name)."' (".$steam.") from ".$data['ip'].":".$data['port'].".", true, true);
$objResponse->addScript("ShowBox('Player kicked', 'Player \'".addslashes(htmlspecialchars($name))."\' has been kicked from the server.', 'green', 'index.php?p=servers');");
} else {
@@ -104,7 +104,7 @@ function KickPlayer($check, $sid, $num, $type) {
$gothim = true;
$GLOBALS['db']->Execute("UPDATE `".DB_PREFIX."_bans` SET sid = '".$sid."' WHERE authid = '".$check."' AND RemovedBy IS NULL;");
$requri = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], "pages/admin.kickit.php"));
$kick = $r->sendCommand("kickid ".$match." \"You have been banned by this server, check http://" . $_SERVER['HTTP_HOST'].$requri." for more info.\"");
$kick = $r->sendCommand("kickid \"".$match."\" \"You have been banned by this server, check http://" . $_SERVER['HTTP_HOST'].$requri." for more info.\"");
$objResponse->addAssign("srv_$num", "innerHTML", "<font color='green' size='1'><b><u>Player Found & Kicked!!!</u></b></font>");
$objResponse->addScript("set_counter('-1');");
return $objResponse;

0 comments on commit 998834c

Please sign in to comment.
You can’t perform that action at this time.