Class Plugin
Extend this class to create a Plugin that can be used with the PluginHandler. This will also provide function shortcuts for registering chat commands, dependency handling and the possibility of Plugin communication.
- ManiaLive\DedicatedApi\Callback\Adapter implements ManiaLive\DedicatedApi\Callback\Listener
- ManiaLive\PluginHandler\Plugin implements ManiaLive\Threading\Listener, ManiaLive\Features\Tick\Listener, ManiaLive\Application\Listener, ManiaLive\Data\Listener, ManiaLive\PluginHandler\Listener
final public
|
|
final protected
|
#
setVersion( mixed $version )
Sets the current version number for this Plugin. Can only be used during initialization! |
final public
mixed
|
|
final public
string
|
|
final public
string
|
|
final public
string
|
|
final public
|
#
addDependency(
Adds a Dependency to the Plugin. Can only be used during initialisation! |
final public
array[ManiaLive\PluginHandler\Dependency]
|
|
final protected
|
#
setPublicMethod( string $name )
Declare this method as public. It then can be called by other Plugins. |
final protected
|
#
callPublicMethod( string $pluginId, string $method )
Calls a public method of the specified plugin. The method has been marked as public by the owner. The plugin has to be registered at the plugin handler. |
final public
|
#
getPublicMethod( string $method )
Gets a method, that has been marked as public, from this Plugin. This method will be invoked by the Plugin Handler. If you want to call a method from another Plugin, then use the internal callPublicMethod function. |
final public
array
|
|
final public
boolean
|
|
final public
boolean
|
#
isPluginLoaded( string $pluginId, mixed $min =
Is the plugin currently loaded or not? |
final protected
|
|
final protected
|
|
final protected
|
#
enableApplicationEvents( mixed $events = ManiaLive\PluginHandler\AppEvent::ALL )
Start invoking methods for application intern events which are onInit, onRun, onPreLoop, onPostLoop, onTerminate |
final protected
|
#
disableApplicationEvents( mixed $events = ManiaLive\PluginHandler\AppEvent::ALL )
Stop listening for application events. |
final protected
|
|
final protected
|
|
final protected
|
#
enableDedicatedEvents( mixed $events = ManiaLive\PluginHandler\ServerEvent::ALL )
Start invoking methods for extern dedicated server events which are the callbacks described in the ListCallbacks.html which you have retrieved with your dedicated server. Otherwise you can find an online copy here http://server.xaseco.org/callbacks.php |
final protected
|
#
disableDedicatedEvents( mixed $events = ManiaLive\PluginHandler\ServerEvent::ALL )
Stop listening for dedicated server events. |
final protected
|
#
enableStorageEvents( mixed $events = ManiaLive\PluginHandler\PlayerEvent::ALL )
Start listening for Storage events: onPlayerNewBestTime, onPlayerNewRank, onPlayerNewBestScore. |
final protected
|
#
disableStorageEvents( mixed $events = ManiaLive\PluginHandler\PlayerEvent::ALL )
Stop listening for Storage Events. |
final protected
|
#
enableThreadingEvents( mixed $events = ManiaLive\PluginHandler\ThreadEvent::ALL )
Starts listening for threading events like: onThreadStart, onThreadRestart, onThreadDies, onThreadTimeOut |
final protected
|
#
disableThreadingEvents( mixed $events = ManiaLive\PluginHandler\ThreadEvent::ALL )
Stop listening for threading events. |
final protected
|
#
enablePluginEvents( mixed $events = ManiaLive\PluginHandler\PluginEvent::ALL )
Start listen for plugin events like onPluginLoaded and onPluginUnloaded |
final protected
|
#
disablePluginEvents( mixed $events = ManiaLive\PluginHandler\PluginEvent::ALL )
stop to listen for plugin events. |
final public
|
#
registerChatCommand( string $name, integer $method, string $parameterCount = 0, boolean $addLogin = false, array[string] $authorizedLogin = array() )
Registers a chatcommand at the Interpreter. |
final public
|
#
unregisterAllChatCommands( )
This will unregister all chat commands that have been created using the plugins method registerChatCommand. |
final protected
|
|
final protected
|
|
public
|
|
public
|
|
public
|
|
public
|
#
onUnload( )
If you override this method you might want to call the parent's onUnload as well, as it does some useful stuff! Use this method to remove any windows that are currently displayed by the plugin, you might also need to destroy some objects that have been created without using the plugin intern methods. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
onPlayerNewBestScore(
Event lauch when beat his best score |
public
|
#
onPlayerNewBestTime(
Event lauch when a player beat his best Time |
public
|
#
onPlayerNewRank(
Event lauch when player's rank change |
public
|
#
onPlayerChangeSide(
Event lauch when the player change to spectator or to player |
public
|
#
onPlayerFinishLap(
Event launched when a player finishes a lap. |
public
|
|
public
|
protected
|
$storage |
|
|
protected
|
$connection |
|
|
protected
|
$db |
|