Commit 26968456 authored by saviola's avatar saviola
Browse files

- removed mode checks - should just work for all modes by now

parent 6c1c65d1
......@@ -3,8 +3,7 @@
* (X)Aseco Train Statistics version 0.9
*
*
* This plugin collects train statistics for each player on each map on a per
* map basis.
* This plugin collects train statistics for each player on each map.
*
* Changelog:
*
......@@ -13,7 +12,7 @@
* - removed majority of unused code
* - added configuration constant for the checkpoint hook (for busy servers)
* - times will be written into the database in the format ss.cc (where ss =
* seconds and cc = hundreth of a second), so wipe your xts table before this
* seconds and cc = hundreths of a second), so wipe your xts table before this
* update, there is no backwards compatibility.
*
* Version 0.8:
......@@ -276,23 +275,11 @@ Aseco::registerEvent('onPlayerFinish', 'xtsFinished');
Aseco::registerEvent('onPlayerDisconnect', 'xtsPlayerDisconnects');
Aseco::registerEvent('onStartup', 'xtsInit');
/**
* Checks whether a supported mode is activated.
*/
function checkStatus($aseco)
{
return in_array($aseco->server->gameinfo->mode, array(0, 1, 2, 3, 5)) ? $aseco->server->gameinfo->mode : false;
}
/**
* Registers each checkpoint for each player, to notice players giving up
*/
function xtsCheckpointReached($aseco, $params)
{
if (false === checkStatus($aseco)) return;
$xts = Xts::getInstance();
list($playerUid, $login, $time, $score, $index) = $params;
......@@ -305,8 +292,6 @@ function xtsCheckpointReached($aseco, $params)
*/
function xtsFinished($aseco, $record)
{
if (false === checkStatus($aseco)) return;
XtsLogger::log("Player finished: " . $record->player->login, XtsLogger::DEBUG);
$xts = Xts::getInstance();
......@@ -348,8 +333,6 @@ function xtsInit($aseco)
*/
function xtsNewChallenge($aseco, $challenge)
{
if (false === checkStatus($aseco)) return;
Xts::getInstance()->setChallenge($challenge);
}
......@@ -358,8 +341,6 @@ function xtsNewChallenge($aseco, $challenge)
*/
function xtsPlayerDisconnects($aseco, $player)
{
if (false === checkStatus($aseco)) return;
XtsLogger::log('Player disconnecting: '.$player->login, XtsLogger::DEBUG);
Xts::getInstance()->saveRecords($player->login);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment