Skip to content

Commit

Permalink
* Fix kicking of players in games that use the Steam3 [U:1:X] steamid…
Browse files Browse the repository at this point in the history
… representation
  • Loading branch information
januk@freenet.de committed Sep 20, 2014
1 parent 5433c25 commit 998834c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions web_upload/includes/sb-callback.php
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion web_upload/pages/admin.kickit.php
Expand Up @@ -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;
Expand Down

0 comments on commit 998834c

Please sign in to comment.