Changed Plugin Class to Interface! (Final)

-> static methods for Name, Version, Author, Description
This commit is contained in:
Steffen Schröder
2013-12-03 22:21:17 +01:00
parent 35a7232894
commit 6c247f0519
8 changed files with 247 additions and 63 deletions

View File

@ -10,11 +10,11 @@ use ManiaControl\Plugins\Plugin;
*
* @author steeffeen
*/
class ChatlogPlugin extends Plugin implements CallbackListener {
class ChatlogPlugin implements CallbackListener, Plugin {
/**
* Constants
*/
const VERSION = '1.0';
const VERSION = 1.0;
const SETTING_FOLDERNAME = 'Log-Folder Name';
const SETTING_FILENAME = 'Log-File Name';
const SETTING_USEPID = 'Use Process-Id for File Name';
@ -28,16 +28,12 @@ class ChatlogPlugin extends Plugin implements CallbackListener {
/**
* Constuct chatlog plugin
*
* @param ManiaControl $maniaControl
*/
public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
// Plugin details
self::$name = 'Chatlog Plugin';
self::$version = self::VERSION;
self::$author = 'steeffeen';
self::$description = 'Plugin logging the chat messages of the server.';
// Init settings
$this->maniaControl->settingManager->initSetting($this, self::SETTING_FOLDERNAME, 'logs');
$this->maniaControl->settingManager->initSetting($this, self::SETTING_FILENAME, 'ChatLog.log');
@ -75,6 +71,38 @@ class ChatlogPlugin extends Plugin implements CallbackListener {
'handlePlayerChatCallback');
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getName()
*/
public static function getName() {
return 'Chatlog Plugin';
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getVersion()
*/
public static function getVersion() {
return self::VERSION;
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getAuthor()
*/
public static function getAuthor() {
return 'steeffeen';
}
/**
*
* @see \ManiaControl\Plugins\Plugin::getDescription()
*/
public static function getDescription() {
return 'Plugin logging the chat messages of the server.';
}
/**
* Handle PlayerChat callback
*