small fix
This commit is contained in:
parent
0f8a2d91ec
commit
8b5563fbd2
@ -55,10 +55,11 @@ class ManiaControl implements CommandListener {
|
|||||||
/**
|
/**
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
const VERSION = '0.01';
|
const VERSION = '0.01';
|
||||||
const API_VERSION = '2013-04-16';
|
const API_VERSION = '2013-04-16';
|
||||||
const OS_UNIX = 'Unix';
|
const OS_UNIX = 'Unix';
|
||||||
const OS_WIN = 'Windows';
|
const OS_WIN = 'Windows';
|
||||||
|
const CONNECT_TIMEOUT = 20;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public properties
|
* Public properties
|
||||||
@ -357,9 +358,8 @@ class ManiaControl implements CommandListener {
|
|||||||
}
|
}
|
||||||
$pass = (string)$pass[0];
|
$pass = (string)$pass[0];
|
||||||
|
|
||||||
//TODO timeout as constant
|
|
||||||
try {
|
try {
|
||||||
$this->client = Connection::factory($host, $port, 20, $login, $pass);
|
$this->client = Connection::factory($host, $port, self::CONNECT_TIMEOUT, $login, $pass);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR);
|
trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR);
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ class ManiaControl implements CommandListener {
|
|||||||
try {
|
try {
|
||||||
$this->client->setModeScriptSettings($scriptSettings);
|
$this->client->setModeScriptSettings($scriptSettings);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $this->getClientErrorText());
|
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->log('Script Callbacks successfully enabled!');
|
$this->log('Script Callbacks successfully enabled!');
|
||||||
|
@ -126,7 +126,7 @@ class PluginManager {
|
|||||||
* @param string $adminLogin
|
* @param string $adminLogin
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function activatePlugin($pluginClass, $adminLogin = false) {
|
public function activatePlugin($pluginClass, $adminLogin = null) {
|
||||||
if(!is_string($pluginClass)) {
|
if(!is_string($pluginClass)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user