3 events to 1 function

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
User avatar
lgrfbs-sweden
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 15 Apr 2007 15:48
Owned TM-games: TMN
Location: Sweden
Contact:

3 events to 1 function

Post by lgrfbs-sweden » 29 Nov 2008 18:05

Hi
Can I do it like this in a aseco script:

Code: Select all

Aseco::registerEvent('onPlayerConnect', 'chk_dt'); // Check the date and time ag
Aseco::registerEvent('onBeginRace', 'chk_dt'); // Check the date and time agains
Aseco::registerEvent('onPlayerChat', 'chk_dt'); // Check the date and time again
So this 3 events call same functions?
Admin On:Image
My server:lgrfbs server / XASECO plugins
Image

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

Re: 3 events to 1 function

Post by Xymph » 30 Nov 2008 00:02

lgrfbs-sweden wrote:Can I do it like this in a aseco script:

Code: Select all

Aseco::registerEvent('onPlayerConnect', 'chk_dt'); // Check the date and time ag
Aseco::registerEvent('onBeginRace', 'chk_dt'); // Check the date and time agains
Aseco::registerEvent('onPlayerChat', 'chk_dt'); // Check the date and time again
So this 3 events call same functions?
Depends on what you want to do inside that function, as each is called with different parameters (e.g. a player object for onPlayerConnect). But if you're not using any of the possible parameters, that should work I think.
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
lgrfbs-sweden
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 15 Apr 2007 15:48
Owned TM-games: TMN
Location: Sweden
Contact:

Re: 3 events to 1 function

Post by lgrfbs-sweden » 30 Nov 2008 04:01

thanks will try it.
It is a code for a live scorebord script for competition/race and then the end time, for example the race ends 2008-11-30 13:30 then the clock step over this time the script will send the "Game end" to the external php file and go to sleep until next race will begin.

So by using this 3 event I will in worse case have a resolution on 6 minute (a map is 6 minute)
Admin On:Image
My server:lgrfbs server / XASECO plugins
Image

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

Re: 3 events to 1 function

Post by Xymph » 30 Nov 2008 13:44

lgrfbs-sweden wrote:It is a code for a live scorebord script for competition/race and then the end time, for example the race ends 2008-11-30 13:30 then the clock step over this time the script will send the "Game end" to the external php file and go to sleep until next race will begin.

So by using this 3 event I will in worse case have a resolution on 6 minute (a map is 6 minute)
You can use the onEverySecond event to help you track elapsed time, as long as you're very careful what you do inside your event handler.
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
lgrfbs-sweden
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 15 Apr 2007 15:48
Owned TM-games: TMN
Location: Sweden
Contact:

Re: 3 events to 1 function

Post by lgrfbs-sweden » 30 Nov 2008 21:45

Okey, thanks don't know about "onEverySecond" until now.
the only thing this will do is check for end date and time for a race as allready begin.
We have not upgrade ours server yet therefor we are await new server hardware so the old
TMN server with aseco 0.91 is still runing here, will "onEverySecond" work anyway ?
Admin On:Image
My server:lgrfbs server / XASECO plugins
Image

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

Re: 3 events to 1 function

Post by Xymph » 01 Dec 2008 08:45

lgrfbs-sweden wrote:We have not upgrade ours server yet therefor we are await new server hardware so the old
TMN server with aseco 0.91 is still runing here, will "onEverySecond" work anyway ?
That version is so badly out of date it's not even funny anymore. Anyway, this event was introduced in v0.95.
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
lgrfbs-sweden
smooth traffic navigator
smooth traffic navigator
Posts: 200
Joined: 15 Apr 2007 15:48
Owned TM-games: TMN
Location: Sweden
Contact:

Re: 3 events to 1 function

Post by lgrfbs-sweden » 01 Dec 2008 10:52

Okey, I will bend the arm on my sysop then. :)
Admin On:Image
My server:lgrfbs server / XASECO plugins
Image

Post Reply