Constants

CB_PLAYERCONNECT

CB_PLAYERCONNECT

CB_PLAYERDISCONNECT

CB_PLAYERDISCONNECT

CB_PLAYERINFOCHANGED

CB_PLAYERINFOCHANGED

CB_SERVER_EMPTY

CB_SERVER_EMPTY

TABLE_PLAYERS

TABLE_PLAYERS

SETTING_JOIN_LEAVE_MESSAGES

SETTING_JOIN_LEAVE_MESSAGES

SETTING_JOIN_LEAVE_MESSAGES_SPECTATOR

SETTING_JOIN_LEAVE_MESSAGES_SPECTATOR

STAT_JOIN_COUNT

STAT_JOIN_COUNT

STAT_SERVERTIME

STAT_SERVERTIME

Properties

Methods

getUsageInformation()

getUsageInformation() 

Gets Information about the Class, and a List of the Public Method

__construct()

__construct(\ManiaControl\ManiaControl  $maniaControl) 

Construct a new Player Manager

Parameters

\ManiaControl\ManiaControl $maniaControl

onInit()

onInit() 

Handle OnInit callback

playerConnect()

playerConnect(array  $callback) 

Handle PlayerConnect Callback

Parameters

array $callback

playerDisconnect()

playerDisconnect(array  $callback) 

Handle PlayerDisconnect callback

Parameters

array $callback

getPlayerCount()

getPlayerCount(boolean  $withoutSpectators = true, boolean  $withoutBots = true) : integer

Get the count of all Players

Parameters

boolean $withoutSpectators
boolean $withoutBots

Returns

integer

playerInfoChanged()

playerInfoChanged(array  $callback) 

Update PlayerInfo

Parameters

array $callback

getPlayer()

getPlayer(mixed  $login, boolean  $connectedPlayersOnly = false) : \ManiaControl\Players\Player

Get a Player by login

Parameters

mixed $login
boolean $connectedPlayersOnly

Returns

\ManiaControl\Players\Player

getSpectators()

getSpectators() : array<mixed,\ManiaControl\Players\Player>

Get a List of Spectators

Returns

array<mixed,\ManiaControl\Players\Player>

getSpectatorCount()

getSpectatorCount() : integer

Get the count of all spectators

Returns

integer

getPlayerByIndex()

getPlayerByIndex(integer  $index, boolean  $connectedPlayersOnly = false) : \ManiaControl\Players\Player

Get a Player by index

Parameters

integer $index
boolean $connectedPlayersOnly

Returns

\ManiaControl\Players\Player

initTables()

initTables() : boolean

Initialize necessary database tables

Returns

boolean

addPlayer()

addPlayer(\ManiaControl\Players\Player  $player) : boolean

Add a player

Parameters

\ManiaControl\Players\Player $player

Returns

boolean

savePlayer()

savePlayer(\ManiaControl\Players\Player  $player) : boolean

Save player in database and fill up properties

Parameters

\ManiaControl\Players\Player $player

Returns

boolean

removePlayer()

removePlayer(string  $login, boolean  $savePlayedTime = true) : \ManiaControl\Players\Player

Remove a Player

Parameters

string $login
boolean $savePlayedTime

Returns

\ManiaControl\Players\Player

$player

updatePlayedTime()

updatePlayedTime(\ManiaControl\Players\Player  $player) : boolean

Update total played time of the player

Parameters

\ManiaControl\Players\Player $player

Returns

boolean

getPlayerFromDatabaseByLogin()

getPlayerFromDatabaseByLogin(string  $playerLogin) : \ManiaControl\Players\Player

Get a Player from the database

Parameters

string $playerLogin

Returns

\ManiaControl\Players\Player

getPlayerFromDatabaseByIndex()

getPlayerFromDatabaseByIndex(integer  $playerIndex) : \ManiaControl\Players\Player

Get a Player out of the database

Parameters

integer $playerIndex

Returns

\ManiaControl\Players\Player