Constants

TABLE_MAPS

TABLE_MAPS

CB_MAPS_UPDATED

CB_MAPS_UPDATED

CB_KARMA_UPDATED

CB_KARMA_UPDATED

SETTING_PERMISSION_ADD_MAP

SETTING_PERMISSION_ADD_MAP

SETTING_PERMISSION_REMOVE_MAP

SETTING_PERMISSION_REMOVE_MAP

SETTING_PERMISSION_ERASE_MAP

SETTING_PERMISSION_ERASE_MAP

SETTING_PERMISSION_SHUFFLE_MAPS

SETTING_PERMISSION_SHUFFLE_MAPS

SETTING_PERMISSION_CHECK_UPDATE

SETTING_PERMISSION_CHECK_UPDATE

SETTING_PERMISSION_SKIP_MAP

SETTING_PERMISSION_SKIP_MAP

SETTING_PERMISSION_RESTART_MAP

SETTING_PERMISSION_RESTART_MAP

SETTING_AUTOSAVE_MAPLIST

SETTING_AUTOSAVE_MAPLIST

SETTING_MAPLIST_FILE

SETTING_MAPLIST_FILE

SETTING_WRITE_OWN_MAPLIST_FILE

SETTING_WRITE_OWN_MAPLIST_FILE

SEARCH_BY_AUTHOR

SEARCH_BY_AUTHOR

SEARCH_BY_MAP_NAME

SEARCH_BY_MAP_NAME

Properties

$mapEnded

$mapEnded : 

Type

$mapBegan

$mapBegan : 

Type

Methods

getUsageInformation()

getUsageInformation() 

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

__construct()

__construct(\ManiaControl\ManiaControl  $maniaControl) 

Construct a new map manager instance

Parameters

\ManiaControl\ManiaControl $maniaControl

updateMap()

updateMap(\ManiaControl\Players\Player|null  $admin, string  $uid) 

Update a Map from Mania Exchange

Parameters

\ManiaControl\Players\Player|null $admin
string $uid

removeMap()

removeMap(\ManiaControl\Players\Player|null  $admin, string  $uid, boolean  $eraseFile = false, boolean  $message = true) : boolean

Remove a Map

Parameters

\ManiaControl\Players\Player|null $admin
string $uid
boolean $eraseFile
boolean $message

Returns

boolean

addMapFromMx()

addMapFromMx(integer  $mapId, string  $login, boolean  $update = false) 

Adds a Map from Mania Exchange

Parameters

integer $mapId
string $login
boolean $update

getMapByUid()

getMapByUid(string  $uid) : \ManiaControl\Maps\Map

Get Map by UID

Parameters

string $uid

Returns

\ManiaControl\Maps\Map

initializeMap()

initializeMap(mixed  $rpcMap) : \ManiaControl\Maps\Map

Initializes a Map

Parameters

mixed $rpcMap

Returns

\ManiaControl\Maps\Map

getMapByMxId()

getMapByMxId(integer  $mxId) : \ManiaControl\Maps\Map

Get's a Map by it's Mania-Exchange Id

Parameters

integer $mxId

Returns

\ManiaControl\Maps\Map

shuffleMapList()

shuffleMapList(\ManiaControl\Players\Player  $admin = null) : boolean

Shuffles the MapList

Parameters

\ManiaControl\Players\Player $admin

Returns

boolean

restructureMapList()

restructureMapList() 

Restructures the Maplist

getMapByIndex()

getMapByIndex(integer  $index) : \ManiaControl\Maps\Map|null

Returns the Map by it's given Array Index

Parameters

integer $index

The index starts at 0

Returns

\ManiaControl\Maps\Map|null

getMapIndex()

getMapIndex(\ManiaControl\Maps\Map  $map) : integer

Returns the MapIndex of a given map

Parameters

\ManiaControl\Maps\Map $map

Returns

integer

getMaps()

getMaps(integer  $offset = null, integer  $length = null) : array<mixed,\ManiaControl\Maps\Map>

Get all Maps

Parameters

integer $offset
integer $length

Returns

array<mixed,\ManiaControl\Maps\Map>

handleOnInit()

handleOnInit() 

Handle OnInit callback

handleAfterInit()

handleAfterInit() 

Handle AfterInit callback

handleScriptBeginMap()

handleScriptBeginMap(string  $mapUid, string  $restart) 

Handle Script BeginMap callback

Parameters

string $mapUid
string $restart

fetchMapByFileName()

fetchMapByFileName(string  $relativeFileName) : \ManiaControl\Maps\Map

Fetch a map by its file path

Parameters

string $relativeFileName

Returns

\ManiaControl\Maps\Map

handleBeginMap()

handleBeginMap(array  $callback) 

Handle BeginMap callback

Parameters

array $callback

handleScriptEndMap()

handleScriptEndMap() 

Handle Script EndMap Callback

handleEndMap()

handleEndMap(array  $callback) 

Handle EndMap Callback

Parameters

array $callback

mapsModified()

mapsModified(array  $callback) 

Handle Maps Modified Callback

Parameters

array $callback

getMapsCount()

getMapsCount() : integer

Get the Number of Maps

Returns

integer

searchMapsByAuthor()

searchMapsByAuthor(  $searchString) : array

Searches the current map list for an author

Parameters

$searchString

Returns

array

searchMapsByMapName()

searchMapsByMapName(  $searchString) : array

Searches the current map list for a map name

Parameters

$searchString

Returns

array

updateMapTimestamp()

updateMapTimestamp(string  $uid) : boolean

Update the Timestamp of a Map

Parameters

string $uid

Returns

boolean

processMapFile()

processMapFile(string  $file, \ManiaControl\ManiaExchange\MXMapInfo  $mapInfo, string  $login, boolean  $update) 

Process the MapFile

Parameters

string $file
\ManiaControl\ManiaExchange\MXMapInfo $mapInfo
string $login
boolean $update

Throws

\Maniaplanet\DedicatedServer\InvalidArgumentException

updateFullMapList()

updateFullMapList() 

Updates the full Map list, needed on Init, addMap and on ShuffleMaps

saveMap()

saveMap(\ManiaControl\Maps\Map  $map) : boolean

Save a Map in the Database

Parameters

\ManiaControl\Maps\Map $map

Returns

boolean

fetchCurrentMap()

fetchCurrentMap() : \ManiaControl\Maps\Map

Freshly fetch current Map

Returns

\ManiaControl\Maps\Map

beginMap()

beginMap(string  $uid, boolean  $restart = false) 

Manage the Begin of a Map

Parameters

string $uid
boolean $restart

endMap()

endMap() 

Manage the End of a Map

initalizeCommunicationListenings()

initalizeCommunicationListenings() 

Initializes the Communication Listenings

searchMaps()

searchMaps(  $searchString, string  $searchBy = self::SEARCH_BY_MAP_NAME) : array

Searches the current map list

Parameters

$searchString
string $searchBy

Returns

array

initTables()

initTables() : boolean

Initialize necessary database tables

Returns

boolean