// bug #1
// command_clearbans => command_banGuid
PHP
$mod->registerCommand("pbbanguid", "#^pbbanguid [0-9a-z]+ ?(.*?)$#i", "command_clearbans", $punkbuster_object);
// fixed
PHP
$mod->registerCommand("pbbanguid", "#^pbbanguid [0-9a-z]+ ?(.*?)$#i", "command_banGuid", $punkbuster_object);
//bug #2
// $return => $result
PHP
private function pb_banGuid($guid, $name = "???", $ip = "???", $reason = "") {
$return = $this->rcon->rcon("pb_sv_banguid $guid \"$name\" \"$ip\" \"$reason\"");
return (stripos($result, "Ban Added to Ban List") !== false) ? true : false; // unknown $result
}
//fixed
PHP
private function pb_banGuid($guid, $name = "???", $ip = "???", $reason = "") {
$result = $this->rcon->rcon("pb_sv_banguid $guid \"$name\" \"$ip\" \"$reason\"");
return (stripos($result, "Ban Added to Ban List") !== false) ? true : false;
}
//bug #3
// $guid overwrite, $guid => $banguid
// translation fix, punkbuster.php & languages/en/punkbuster.lng
// punkbuster_bunguidsuccess => punkbuster_banguidsuccess
// punkbuster_bunguidfailed => punkbuster_banguidfailed
PHP
public function command_banGuid($guid, $parameters) {
if ($this->disabled) return false;
$guid = $parameters[0]; // error !!!
$name = (isset($parameters[1])) ? $parameters[1] : "???";
$ip = (isset($parameters[2])) ? $parameters[1] : "???"; // $parameters[2]
$reason = (isset($parameters[3])) ? $parameters[1] : ""; // $parameters[3]
if ($this->pb_banGuid($guid, $name, $ip, $reason)) {
$this->players[$guid]->say($this->mod->getLngString("punkbuster_bunguidsuccess"));
$this->pb_updateBanFile();
}
else {
$this->players[$guid]->say($this->mod->getLngString("punkbuster_bunguidfailed"));
}
}
Alles anzeigen
//fixed
PHP
public function command_banGuid($guid, $parameters) {
if ($this->disabled) return false;
$banguid = $parameters[0];
$name = (isset($parameters[1])) ? $parameters[1] : "???";
$ip = (isset($parameters[2])) ? $parameters[2] : "???";
$reason = (isset($parameters[3])) ? $parameters[3] : "";
if ($this->pb_banGuid($banguid, $name, $ip, $reason)) {
$this->players[$guid]->say($this->mod->getLngString("punkbuster_banguidsuccess"));
$this->pb_updateBanFile();
}
else {
$this->players[$guid]->say($this->mod->getLngString("punkbuster_banguidfailed"));
}
}
Alles anzeigen
//bug #3
// pb_update() => pb_restart()
PHP
public function command_restart($guid, $parameters) {
if ($this->disabled) return false;
$this->pb_update(); // pb_restart();
$this->players[$guid]->say($this->mod->getLngString("punkbuster_restart"));
}
//fixed