[XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

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.2.0 (/timeleft) (UPDATE)

Post by realh » 31 Aug 2016 12:45

The code is unchanged in this release, but the plugin has a new home on github.

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
https://github.com/realh/flexitime

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

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

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Post by realh » 18 Nov 2016 17:16

Just bumping this to make sure the thread is newer than the one for 1.1.3.

ccx
sunday driver
sunday driver
Posts: 55
Joined: 07 Feb 2009 22:41
Owned TM-games: TMUF

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Post by ccx » 28 Jan 2017 20:28

Hello Realh !

I discovered your plugin on a server (Where I typed "/plugins" ;)) and I loved it. So I downloaded the last version (1.3.3), and have some questions.

- I used "plugin.autotime.php" to set time of the next map depending on its author time. I commented it to use you author time mode, is it what to do, or both can work together ? How ?

- It looks to work, but the original Timer still displays under your one. How to remove, or hide it please ?

- When I press Tab key at start of a map, I always see 07:00 minutes. While yours start for example to 06:00, depending on author time. How can I fix it ?

- If I type /timeleft pause, then your timer disappeared, and Nadeo original one then display better. The problem is that when it comes to 0, the map changes :(

- The vote time is 20 seconds, is it possible to make it shorter ?

- IMHO you shoud add in the installation guide to add the line <plugin>plugin.flexitime.php</plugin> in the plugins.xml, I forgot it because not in the guide. Could be helpful for newbies.
Where to add it ? At the end ?

- If that works like that, ok, but I don't undestand why variables are twice declared : once in the xml, and once in the php.
E.g. in .xml :
<admin_level>2</admin_level>
and in .php :
private $ADMIN_LEVEL = 1;
Hmm, maybe better to have same values in both files ?

Thanks a lot for that plugin, to you and all people that helped you to fix it. :lovetm

ccx.

PS : Is it possible to update that page http://plugins.xaseco.org/browse.php to have the freshest link ? I began with first version, and I were about to cry :roflol:

Xymph
Pit Crew
Pit Crew
Posts: 5648
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)

Post by Xymph » 28 Jan 2017 22:36

ccx wrote:- The vote time is 20 seconds, is it possible to make it shorter ?
viewtopic.php?f=28&t=37079
ccx wrote:PS : Is it possible to update that page http://plugins.xaseco.org/browse.php to have the freshest link ?
Thanks for the reminder.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

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.2.0 (/timeleft) (UPDATE)

Post by L3cKy » 18 Feb 2017 01:36

If a player pause the timer and forget to resume it before he leave the server the timer won't start alone ... would be nice to add an function that the time automatically resume when the player who stopped it leaves the server

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.2.0 (/timeleft) (UPDATE)

Post by L3cKy » 15 Mar 2017 12:13

NOTE: This works only if you set the admin level to "2" (<admin_level>2</admin_level>) in the flexitime.xml file.

This little addon will automatically resume the timer if an admin used the command "/timeleft pause" and forgot to resume it after he left the server and no other admin is on the server.

Add following code into plugin.flexitime.php

1. add after Line 31

Code: Select all

Aseco::registerEvent("onPlayerDisconnect", "realh_flexitime_disco");
2. add after Line 447 and before 448

Code: Select all

	public function disco() {
		if ($this->aseco->server->getGame() == "TMF") {
			$this->aseco->client->query("GetStatus");
			$status = $this->aseco->client->getResponse();
		}
		$adm = 0;
		foreach ($this->aseco->server->players->player_list as $player) {
			if ($this->aseco->isAdmin($player) != 0) {
				$adm ++;
			}
		}
		if ($status["Code"] == 4 && $this->paused == true && !$adm) {
			$this->paused = false;
			$this->showChatMsg("Server unpaused the timer.");
		}
	}
3. add at the end

Code: Select all

function realh_flexitime_disco($aseco, $command) {
    global $realh_flexitime;
    $realh_flexitime->disco();
}

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.2.0 (/timeleft) (UPDATE)

Post by L3cKy » 27 May 2017 14:29

Just found another little "issue" at command "/timeset" if custom_tracktime is enabled.
If you set a new time with "/timeset 05:30" it just accept and writes fully minutes in the database like 5 and NOT 05:30.

I changed following code in function "public function commandTimeSet($command) {"

Code: Select all

 $param = intval(trim($command["params"]));
to

Code: Select all

$param = $command["params"];

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.2.0 (/timeleft) (UPDATE)

Post by L3cKy » 01 Jun 2017 17:23

With this Plugin Ladder Servers wont handle Ladder Points anymore because of the "<timeattack_limit>" is set to "0" at the matchsettings.
Maybe this should stand also in the Readme ... just in case. ;)

Greetings

Post Reply