small fixes

This commit is contained in:
kremsy 2014-05-08 20:51:28 +02:00
parent d84017d4c1
commit 696505769d
2 changed files with 9 additions and 6 deletions

View File

@ -218,7 +218,8 @@ class GbxRemote
{
$header = $this->read(8);
if($header === false)
throw new TransportException('Connection interrupted while reading header', TransportException::INTERRUPTED);
throw new TransportException('Connection interrupted while reading header '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
//throw new TransportException('Connection interrupted while reading header', TransportException::INTERRUPTED);
extract(unpack('Vsize/Vhandle', $header));
/** @var $size int */
@ -231,7 +232,8 @@ class GbxRemote
$data = $this->read($size);
if($data === false)
throw new TransportException('Connection interrupted while reading data', TransportException::INTERRUPTED);
//throw new TransportException('Connection interrupted while reading data', TransportException::INTERRUPTED);
throw new TransportException('Connection interrupted while reading data '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
$this->lastNetworkActivity = time();
return array($handle, $data);
@ -245,7 +247,8 @@ class GbxRemote
{
$data = pack('V2a*', strlen($xml), ++$this->requestHandle, $xml);
if(!$this->write($data))
throw new TransportException('Connection interrupted while writing', TransportException::INTERRUPTED);
throw new TransportException('Connection interrupted while writing '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
//throw new TransportException('Connection interrupted while writing', TransportException::INTERRUPTED);
$this->lastNetworkActivity = time();
}

View File

@ -59,14 +59,14 @@ class DynamicPointlimitPlugin implements CallbackListener, CommandListener, Plug
public function load(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'changePointlimit');
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'changePointlimit');
$allowOthers = $this->maniaControl->settingManager->getSetting($this, self::ACCEPT_OTHER_MODES);
if (!$allowOthers && $this->maniaControl->server->titleId != 'SMStormRoyal@nadeolabs') {
$error = 'This plugin only supports Royal (check Settings)!';
throw new \Exception($error);
}
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'changePointlimit');
$this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'changePointlimit');
}
/**