[XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

[XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 20 Aug 2016 20:35

Sorry for not getting round to releasing this here before.

Flexitime plugin for TrackMania Forever xaseco

This plugin provides the /timeleft chat command, allowing players with the appropriate privilege level to change the time left on the fly. It also optionally provides functionality similar to the customtime (providing a /timeset command) and authortime plugins.

Download
http://www.realh.co.uk/tm/plugins/flexitime-1.1.3.zip

To install
Copy plugin.flexitime.php to xaseco's plugins directory and flexitime.xml to the parent of that directory. Edit flexitime.xml (using a decent editor with syntax highlighting is strongly recommended) to customise the plugin for your server. The plugin runs its own timer in place of the standard timer so disable the latter by setting <timeattack_limit> or whatever to 0 in the server's MatchSettings config.

If you want to use the custom_time (/timeset) feature you will need to make sure your database has the appropriate table. See <http://plugins.xaseco.org/info.php?id=13>.

Example usage:

Query the time remaining:
/timeleft

Set the remaining time to 10 minutes:
/timeleft 10

Add 10 minutes to the remaining time:
/timeleft +10

Romnickol
highway camper
highway camper
Posts: 1
Joined: 05 Oct 2016 15:27
Owned TM-games: Turbo

Post by Romnickol » 05 Oct 2016 17:10

Some problems:
1) sometimes it puts 0:00 time to the map and it "skips" (1-2 seconds driving and final screen with "No winner!";
2) nobody gets LP;
3) when the server has 16+ online, it lags a bit (maybe server problem, not plugin)?

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 17 Nov 2016 20:50

Same problem over here sometimes it skips a track without any interaction at server synchro -> round begin.

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 18 Nov 2016 17:09

I just sort of hacked this plugin together. Xaseco isn't well documented and I don't know enough about it to work out why these bugs happen.

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 19 Nov 2016 17:04

I wrote a little tricky one to fix this problem ... ^^
Over 2 Hours without any autoskip ;)

ADD

Code: Select all

Aseco::registerEvent("onNewChallenge", "realh_flexitime_new_challenge");
ADD

Code: Select all

	public function initTimer_begin() {
        $this->paused = false;
		$this->time_left = 60;
		$this->showHud("");
    }
ADD

Code: Select all

function realh_flexitime_new_challenge($aseco) {
    global $realh_flexitime;
    	$realh_flexitime->initTimer_begin();
}
So long ...
Last edited by L3cKy on 19 Nov 2016 22:02, edited 2 times in total.

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 19 Nov 2016 19:19

Thanks. I've updated it on github. Your test() method does exactly the same as hidePanel() so I used that instead.

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 19 Nov 2016 19:33

Nice BUT there is one problem ... is you restart xaseco or start the server the time wont start untill you restart or skip the map.

To prevent this i just added

Code: Select all

$this->client->query("NextChallenge");
into the aseco.php before the end of function sendHeader() ... need to find another fix for that. ^^

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 19 Nov 2016 23:18

Can you restart the timer from in game? Maybe this would work:

Code: Select all

/timeleft 60
/timeleft resume

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 19 Nov 2016 23:31

Sure i can ... but think about you have a cronjob or something and u are at work and xaseco restarts ... than the time wont start before someone force a skip or restart ...
At my fix there was a problem ... i refixed it now and it works like a charm ... the main problem is you just added only "onBeginRound" ... and forgott "onNewChallenge" ... sometimes you have over 30 seconds between "onEndRound" and "onBeginRound" ... somewhere there it comes to this mistake but dont ask me where and why XD
thats why i added "onNewChallenge" and done a "fake" timer to prevent the server to skip the track ...
The trick is to tell the plugin that a time is already running down before the round starts so the plugin cant do a skip couse of an running time ^^
At "onBeginRound" the normal initTimer() is overwriting the fake one ... it just need to fix the restart/skip when xaseco gets restartet or starter and hide the fake timer before Round begin.

I think there is the problem

Code: Select all

$this->time_left <= 0
When it is no time of course there will be a skip ^^

ADD

Code: Select all

Aseco::registerEvent("onNewChallenge", "realh_flexitime_new_challenge");
ADD

Code: Select all

	public function initTimer_begin() {
        $this->paused = false;
		$this->time_left = 60;
}
ADD

Code: Select all

function realh_flexitime_new_challenge($aseco) {
    global $realh_flexitime;
    	$realh_flexitime->initTimer_begin();
}
IMPORTANT is to force a restart somewhere ... ^^

Code: Select all

$this->client->query("NextChallenge");
i done it at the aseco.php before the end of function sendHeader() ...

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 20 Nov 2016 01:23

I don't know why I thought initTimer_begin() did the same as hidePanel(), it's more like a cut down version of the original initTimer(). Now I understand the problem better, and why your fix works... but...

So I don't think there needs to be a handler for onNewChallenge as well as onBeginRound. The real problem is that I need to skip the check for time_left <= 0 when paused is true.

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 20 Nov 2016 01:30

L3cKy wrote:Nice BUT there is one problem ... is you restart xaseco or start the server the time wont start untill you restart or skip the map.

To prevent this i just added

Code: Select all

$this->client->query("NextChallenge");
into the aseco.php before the end of function sendHeader() ... need to find another fix for that. ^^
Is that still going to be a problem, or is that just because I messed up the last fix? The handler for onStartup should result in initTimer() being called, so hopefully all will be OK when the other problem is fixed properly.

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 22 Nov 2016 12:30

Your fix isnt working ... now the plugin dont skip anymore when the timer reaches 0 XD ...

realh
pedestrian
pedestrian
Posts: 10
Joined: 26 Oct 2011 16:01
Owned TM-games: TMUF, TM2

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by realh » 22 Nov 2016 13:53

It was a typo ('-' instead of '->'). I'm surprised PHP ran the script at all.

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Plugin: FlexiTime 1.1.3 (/timeleft)

Post by L3cKy » 22 Nov 2016 17:25

Looks like the issue is gone ;)
Thanks alot for fixing.

So long ...

Post Reply

Who is online

Users browsing this forum: Steeler [Crawler] and 2 guests