server teammode property

This commit is contained in:
kremsy
2014-02-01 19:06:21 +01:00
committed by Steffen Schröder
parent 00529d111d
commit e792c706c7
5 changed files with 83 additions and 31 deletions

View File

@ -18,7 +18,8 @@ class Server implements CallbackListener {
/**
* Constants
*/
const TABLE_SERVERS = 'mc_servers';
const TABLE_SERVERS = 'mc_servers';
const CB_TEAM_STATUS_CHANGED = 'ServerCallback.TeamStatusChanged';
/**
* Public Properties
@ -33,10 +34,12 @@ class Server implements CallbackListener {
public $serverCommands = null;
public $usageReporter = null;
/**
* Private Properties
*/
private $maniaControl = null;
private $teamMode = false;
/**
* Construct a new Server
@ -126,6 +129,28 @@ class Server implements CallbackListener {
$this->updateProperties();
}
/**
* Set if the Server Runs a Team-Mode or not
*
* @param bool $teamMode
*/
public function setTeamMode($teamMode = true) {
$this->teamMode = $teamMode;
// Trigger callback
$this->maniaControl->callbackManager->triggerCallback(self::CB_TEAM_STATUS_CHANGED, array(self::CB_TEAM_STATUS_CHANGED, $teamMode));
}
/**
* Check if the Server Runs a TeamMode
*
* @return bool
*/
public function isTeamMode() {
return $this->teamMode;
}
/**
* Fetch Game Data Directory
*

View File

@ -83,7 +83,6 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
//Check if Pause exists in current GameMode
$scriptInfos = $this->maniaControl->client->getModeScriptInfo();
$pauseExists = false;
foreach($scriptInfos->commandDescs as $param) {
if ($param->name == "Command_ForceWarmUp") {
@ -122,6 +121,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
$this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 30, 'Cancel Vote');
}
/**
* Handle //cancelvote command
*