TM-FORUM

The TrackMania universal forum ^_^
It is currently 25 Apr 2017 05:41

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 31 Aug 2016 13:45 
Offline
pedestrian
pedestrian

Joined: 26 Oct 2011 17:01
Posts: 10
Owned TM-games: TMUF, TM2
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


Top
 Profile  
 
 Post subject: Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 18 Nov 2016 18:16 
Offline
pedestrian
pedestrian

Joined: 26 Oct 2011 17:01
Posts: 10
Owned TM-games: TMUF, TM2
Just bumping this to make sure the thread is newer than the one for 1.1.3.


Top
 Profile  
 
 Post subject: Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 28 Jan 2017 21:28 
Offline
sunday driver
sunday driver

Joined: 07 Feb 2009 23:41
Posts: 53
Owned TM-games: TMUF
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:


Top
 Profile  
 
 Post subject: Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 28 Jan 2017 23:36 
Offline
Pit Crew
Pit Crew

Joined: 19 Aug 2007 13:58
Posts: 5631
Owned TM-games: TMN, TMU, TMF, TM²
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


Top
 Profile  
 
 Post subject: Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 18 Feb 2017 02:36 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 05 Sep 2007 14:55
Posts: 133
Location: Sweden
Owned TM-games: TMUF
Manialink(s): woa
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


Top
 Profile  
 
 Post subject: Re: [XASECO] Plugin: FlexiTime 1.2.0 (/timeleft) (UPDATE)
PostPosted: 15 Mar 2017 13:13 
Offline
happy cruiser
happy cruiser
User avatar

Joined: 05 Sep 2007 14:55
Posts: 133
Location: Sweden
Owned TM-games: TMUF
Manialink(s): woa
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:
Aseco::registerEvent("onPlayerDisconnect", "realh_flexitime_disco");


2. add after Line 447 and before 448
Code:
   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:
function realh_flexitime_disco($aseco, $command) {
    global $realh_flexitime;
    $realh_flexitime->disco();
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group