Constants

ID

ID

VERSION

VERSION

NAME

NAME

AUTHOR

AUTHOR

MLID_KARMA

MLID_KARMA

TABLE_KARMA

TABLE_KARMA

CB_KARMA_CHANGED

CB_KARMA_CHANGED

CB_KARMA_MXUPDATED

CB_KARMA_MXUPDATED

SETTING_AVAILABLE_VOTES

SETTING_AVAILABLE_VOTES

SETTING_WIDGET_ENABLE

SETTING_WIDGET_ENABLE

SETTING_WIDGET_TITLE

SETTING_WIDGET_TITLE

SETTING_WIDGET_POSX

SETTING_WIDGET_POSX

SETTING_WIDGET_POSY

SETTING_WIDGET_POSY

SETTING_WIDGET_WIDTH

SETTING_WIDGET_WIDTH

SETTING_WIDGET_HEIGHT

SETTING_WIDGET_HEIGHT

SETTING_NEWKARMA

SETTING_NEWKARMA

STAT_PLAYER_MAPVOTES

STAT_PLAYER_MAPVOTES

SETTING_WIDGET_DISPLAY_MX

SETTING_WIDGET_DISPLAY_MX

SETTING_MX_KARMA_ACTIVATED

SETTING_MX_KARMA_ACTIVATED

SETTING_MX_KARMA_IMPORTING

SETTING_MX_KARMA_IMPORTING

MX_IMPORT_TABLE

MX_IMPORT_TABLE

MX_KARMA_URL

MX_KARMA_URL

MX_KARMA_START_SESSION

MX_KARMA_START_SESSION

MX_KARMA_ACTIVATE_SESSION

MX_KARMA_ACTIVATE_SESSION

MX_KARMA_SAVE_VOTES

MX_KARMA_SAVE_VOTES

MX_KARMA_GET_MAP_RATING

MX_KARMA_GET_MAP_RATING

Properties

$updateManialink

$updateManialink : 

Type

$mxKarma

$mxKarma : 

Type

Methods

prepare()

prepare(\ManiaControl\ManiaControl  $maniaControl) 

Prepare the Plugin

Parameters

\ManiaControl\ManiaControl $maniaControl

getId()

getId() : integer

Get plugin id

Returns

integer

getName()

getName() : string

Get Plugin Name

Returns

string

getVersion()

getVersion() : string

Get Plugin Version

Returns

string

getAuthor()

getAuthor() : string

Get Plugin Author

Returns

string

getDescription()

getDescription() : string

Get Plugin Description

Returns

string

load()

load(\ManiaControl\ManiaControl  $maniaControl) : boolean

Load the plugin

Parameters

\ManiaControl\ManiaControl $maniaControl

Returns

boolean

getMxKarmaVotes()

getMxKarmaVotes(\ManiaControl\Players\Player  $player = null) 

Fetch the mxKarmaVotes for the current map

Parameters

\ManiaControl\Players\Player $player

unload()

unload() 

Unload the plugin and its Resources

handleBeginMap()

handleBeginMap() 

Handle Begin Map Callback

handlePlayerConnect()

handlePlayerConnect(\ManiaControl\Players\Player  $player) 

Handle PlayerConnect callback

Parameters

\ManiaControl\Players\Player $player

handlePlayerChat()

handlePlayerChat(array  $chatCallback) 

Handle PlayerChat callback

Parameters

array $chatCallback

getMapPlayerVotes()

getMapPlayerVotes(\ManiaControl\Maps\Map  $map) : array

Get all players votes

Parameters

\ManiaControl\Maps\Map $map

Returns

array

handle1Second()

handle1Second() 

Handle ManiaControl 1 Second Callback

getMapKarma()

getMapKarma(\ManiaControl\Maps\Map  $map) : float

Get the current karma of the map

Parameters

\ManiaControl\Maps\Map $map

Returns

float —

| bool

getMapVotes()

getMapVotes(\ManiaControl\Maps\Map  $map) : array

Get the current Votes for the Map

Parameters

\ManiaControl\Maps\Map $map

Returns

array

importMxKarmaVotes()

importMxKarmaVotes(\ManiaControl\Maps\Map  $map) 

Import old Karma votes to Mania-Exchange Karma

Parameters

\ManiaControl\Maps\Map $map

sendMxKarmaVotes()

sendMxKarmaVotes(\ManiaControl\Maps\Map  $map) 

Save Mx Karma Votes at MapEnd

Parameters

\ManiaControl\Maps\Map $map

buildKarmaSettingName()

buildKarmaSettingName(string  $serverLogin) : string

Build the Karma Setting Name for the given Server Login

Parameters

string $serverLogin

Returns

string

initTables()

initTables() 

Create necessary database tables

mxKarmaOpenSession()

mxKarmaOpenSession() 

Open a Mx Karma Session

activateSession()

activateSession(string  $mxKarmaCode) 

Activates the MX-Karma Session

Parameters

string $mxKarmaCode

buildActivationHash()

buildActivationHash(string  $sessionSeed, string  $mxKey) : string

Builds a sha512 activation Hash for the MX-Karma

Parameters

string $sessionSeed
string $mxKey

Returns

string

postKarmaVotes()

postKarmaVotes(\ManiaControl\Maps\Map  $map, array  $votes, boolean  $import = false) 

Post the Karma votes to MX-Karma

Parameters

\ManiaControl\Maps\Map $map
array $votes
boolean $import

queryManialinkUpdateFor()

queryManialinkUpdateFor(\ManiaControl\Players\Player  $player) 

Query the player to update the manialink

Parameters

\ManiaControl\Players\Player $player

handleVote()

handleVote(\ManiaControl\Players\Player  $player, integer  $vote) : boolean

Handle a vote done by a player

Parameters

\ManiaControl\Players\Player $player
integer $vote

Returns

boolean

savePlayerVote()

savePlayerVote(\ManiaControl\Players\Player  $player, \ManiaControl\Maps\Map  $map, float  $vote) : boolean

Save the vote of the player for the map

Parameters

\ManiaControl\Players\Player $player
\ManiaControl\Maps\Map $map
float $vote

Returns

boolean

buildManialink()

buildManialink(boolean  $forceBuild = false) 

Build Karma Voting Manialink if necessary

Parameters

boolean $forceBuild