plugin interface id

This commit is contained in:
Steffen Schröder 2013-12-09 10:04:22 +01:00
parent 53f568847f
commit 88f5239965
7 changed files with 70 additions and 9 deletions

View File

@ -22,6 +22,13 @@ interface Plugin {
*/ */
public function __construct(ManiaControl $maniaControl); public function __construct(ManiaControl $maniaControl);
/**
* Get plugin id
*
* @return int
*/
public static function getId();
/** /**
* Get Plugin Name * Get Plugin Name
* *

View File

@ -14,7 +14,8 @@ class ChatlogPlugin implements CallbackListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 1;
const VERSION = 0.1;
const SETTING_FOLDERNAME = 'Log-Folder Name'; const SETTING_FOLDERNAME = 'Log-Folder Name';
const SETTING_FILENAME = 'Log-File Name'; const SETTING_FILENAME = 'Log-File Name';
const SETTING_USEPID = 'Use Process-Id for File Name'; const SETTING_USEPID = 'Use Process-Id for File Name';
@ -71,6 +72,14 @@ class ChatlogPlugin implements CallbackListener, Plugin {
'handlePlayerChatCallback'); 'handlePlayerChatCallback');
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()

View File

@ -16,7 +16,8 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 3;
const VERSION = 0.1;
const SETTING_ANNOUNCE_SERVERDONATION = 'Enable Server-Donation Announcements'; const SETTING_ANNOUNCE_SERVERDONATION = 'Enable Server-Donation Announcements';
/** /**
@ -41,12 +42,20 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_BILLUPDATED, $this, 'handleBillUpdated'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_BILLUPDATED, $this, 'handleBillUpdated');
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()
*/ */
public static function getName() { public static function getName() {
return 'Donation Plugin'; return 'Donations Plugin';
} }
/** /**
@ -70,7 +79,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
* @see \ManiaControl\Plugins\Plugin::getDescription() * @see \ManiaControl\Plugins\Plugin::getDescription()
*/ */
public static function getDescription() { public static function getDescription() {
return 'DonationPlugin commands like /donate, /pay and /getplanets and a donation widget.'; return 'Plugin offering commands like /donate, /pay and /getplanets and a donation widget.';
} }
/** /**

View File

@ -13,7 +13,8 @@ class EndurancePlugin implements CallbackListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 4;
const VERSION = 0.1;
const CB_CHECKPOINT = 'Endurance.Checkpoint'; const CB_CHECKPOINT = 'Endurance.Checkpoint';
/** /**
@ -36,6 +37,14 @@ class EndurancePlugin implements CallbackListener, Plugin {
$this->maniaControl->callbackManager->registerScriptCallbackListener(self::CB_CHECKPOINT, $this, 'callback_Checkpoint'); $this->maniaControl->callbackManager->registerScriptCallbackListener(self::CB_CHECKPOINT, $this, 'callback_Checkpoint');
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()

View File

@ -23,7 +23,8 @@ class KarmaPlugin implements CallbackListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 5;
const VERSION = 0.1;
const MLID_KARMA = 'KarmaPlugin.MLID'; const MLID_KARMA = 'KarmaPlugin.MLID';
const TABLE_KARMA = 'mc_karma'; const TABLE_KARMA = 'mc_karma';
const SETTING_AVAILABLE_VOTES = 'Available Votes (X-Y: Comma separated)'; const SETTING_AVAILABLE_VOTES = 'Available Votes (X-Y: Comma separated)';
@ -75,6 +76,14 @@ class KarmaPlugin implements CallbackListener, Plugin {
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCHAT, $this, 'handlePlayerChat'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MP_PLAYERCHAT, $this, 'handlePlayerChat');
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()

View File

@ -24,7 +24,8 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 6;
const VERSION = 0.1;
const MLID_RECORDS = 'ml_local_records'; const MLID_RECORDS = 'ml_local_records';
const TABLE_RECORDS = 'mc_localrecords'; const TABLE_RECORDS = 'mc_localrecords';
const SETTING_WIDGET_TITLE = 'Widget Title'; const SETTING_WIDGET_TITLE = 'Widget Title';
@ -84,6 +85,14 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
} }
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()

View File

@ -16,7 +16,8 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
/** /**
* Constants * Constants
*/ */
const VERSION = 1.0; const ID = 7;
const VERSION = 0.1;
const CB_JUMPTO = 'Obstacle.JumpTo'; const CB_JUMPTO = 'Obstacle.JumpTo';
const SCB_ONFINISH = 'OnFinish'; const SCB_ONFINISH = 'OnFinish';
const SCB_ONCHECKPOINT = 'OnCheckpoint'; const SCB_ONCHECKPOINT = 'OnCheckpoint';
@ -40,6 +41,14 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
$this->maniaControl->callbackManager->registerScriptCallbackListener(self::SCB_ONCHECKPOINT, $this, 'callback_OnCheckpoint'); $this->maniaControl->callbackManager->registerScriptCallbackListener(self::SCB_ONCHECKPOINT, $this, 'callback_OnCheckpoint');
} }
/**
*
* @see \ManiaControl\Plugins\Plugin::getId()
*/
public static function getId() {
return self::ID;
}
/** /**
* *
* @see \ManiaControl\Plugins\Plugin::getName() * @see \ManiaControl\Plugins\Plugin::getName()
@ -69,7 +78,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
* @see \ManiaControl\Plugins\Plugin::getDescription() * @see \ManiaControl\Plugins\Plugin::getDescription()
*/ */
public static function getDescription() { public static function getDescription() {
return 'Plugin offering various Commands for the ShootMania Obstacle Game Mode.'; return "Plugin offering various Commands for the ShootMania 'Obstacle' Game Mode by steeffeen.";
} }
/** /**