[Plugin] Checkpoint Records

UASECO is a fork of the XAseco2/1.03 controller for Trackmania and has been overhauled to support the Modescript Gamemodes of Trackmania².

Moderators: undef.de, NADEO

iziboi
Posts: 5
Joined: 20 Mar 2018, 04:59

Re: [Plugin] Checkpoint Records

Post by iziboi »

Awesome plugin, thanks for sharing!

But, how to setup it for "Rounds" to do not rester checkpoint stats every round?

EDIT:

Fixed by removing:

Code: Select all

    /**
     * Called when a round ends
     * @param $aseco
     * @param $count
     */
    public function onEndRound($aseco, $count)
    {
        $this->initialize($aseco);
    }
Now would be nice warm up ignore.
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de »

If a player is driving the checkpoint time of e.g. 7.146 and an other player drives the exact time a little bit later, then the player who was driving the time earlier should be still displayed.

Currently that's not the case, now the second player is shown. To change that you have to change the function from

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

        if (!array_key_exists($cpId, $this->checkpoints)) {
            $this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() >= $time) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }
    
to

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

	$force_update = false;
        if (!array_key_exists($cpId, $this->checkpoints)) {
		$this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
		$force_update = true;
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() > $time || $force_update === true ) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }


Also the file "plugin.checkpoint_records.ext.php" isn't required to be external, you could include the content into "plugin.checkpoint_records.php" after the end of the class "PluginCheckpointRecords".

Example structure:

Code: Select all

<?php
$_PLUGIN = new PluginCheckpointRecords();

class PluginCheckpointRecords extends Plugin {
	// Code here
}

class RecordsCheckpoint extends Checkpoint {
	// Code here
}

?>
That makes the handling/install much easier.


EDIT: I changed the plugin by myself, you can download the changed plugin at UASECO plugin repository: https://www.uaseco.org/plugins/details.php?id=2
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
braker
Posts: 7
Joined: 30 Dec 2017, 15:46

Re: [Plugin] Checkpoint Records

Post by braker »

Thank you for updating the plugin.
Just wanted to do it, I'm really stressed because of university and didn't have the time.
User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami »

Hi
This plugin (latest version) stopped working after uaseco 0.9.6 upgrade. I cant get it to work again. The configs looks ok and no errors in uaseco log.
Any idea?
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de »

Just checked plugin.checkpoint_records.php/1.12.1 build 2018-11-17 with 0.9.6 and it's working for me as it should. Maybe you have placed the position outside the viewport? Try to use the default values from the checkpoint_records.xml.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami »

Hi Undef
yes, Plugin v.1.12.1 build 2018-11-17
I'm using default values i xml:

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<settings>
	<scale>0.32</scale>
	<pos_x>120</pos_x>
	<pos_y>81</pos_y>
	<columns>5</columns>
	<spacing>1</spacing>
</settings>
plugin.checkpoint_records.php = default
plugins.xml = ok

Hmm..investigating...
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de »

Which gamemode do you use? I have tested only Rounds.Script.txt and TimeAttack.Script.txt.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami »

I use TimeAttack.
Thx for helping. Havent figured it out yet...
User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami »

Finally solved missing plugin(s).
When some of the other plugins also disapeared (Vote, Donate), i replaced the plugins.xml with a old backup. Everything looked fine in file before, so i don't know what caused the problem (corruption?).
Anyway, everything is running fine now :)
RelaxedRacer
Posts: 61
Joined: 08 Feb 2011, 02:30

Re: [Plugin] Checkpoint Records

Post by RelaxedRacer »

I found a little problem today in the plugin (and maybe more plugins have this not shure)
When a player has a " in the nickname i got errors and it didnt displayed correctly.

I changed this in the code that solved it:

Code: Select all

    public function getPlayerNick()
    {
       // return $this->player->nickname;
		$nicknrpl = str_ireplace('"', '', $this->player->nickname);
		return $nicknrpl;
    }
Maybe this " can be added to stripstyles, or i donno, i'm no expert on this :roflol:
TMNF Server Link: tmtp://#join=racing_room_speed
TMMP Server Link: maniaplanet://#join=racing_room_speed@TMStadium@nadeo
TMGL Server Link: uplay://launch/5595/0/#join=n0AEQqlwQkGDQIke4YeZNw@Trackmania
Discord YouTube Twitch
Post Reply

Return to “UASECO”

Who is online

Users browsing this forum: No registered users and 1 guest