Script callbacks

Moderator: NADEO

User avatar
Eole
Nadeo
Nadeo
Posts: 1225
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 04 Feb 2014, 14:43

I'm working on it. I couldn't reproduce your bug exactly, but found another one. I'll transfer this part of the code from the game modes to the warm-up library and rewrite a part of it. So we'll have a better standard between modes in the next release.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1721
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 04 Feb 2014, 17:08

Thank you sooo much, that would be awesome.

The bug is like, when you are in warmup state, the counter counts down, 60,59,58 and you extend now warmup with 10secs it should be continue counting down 68 67... but it doesnt. If you extend the time nothing changes as long as (the warmup counts down).

I also have another request is it possible to make a callback at the end of a Map which exactly says how long a Player did Play (without warmups and spectator times)?

And one question more ;). As I know there is an Autokick function in most of the scripts, is there a possability to make this generall and accessable for controllers, like receiving a Callback from the Script which the Controllers can Manage (force them to spec or kick them or whatever). Would be very nice if something is possible in that direction.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
w1lla
Posts: 2365
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: Script callbacks

Post by w1lla » 04 Feb 2014, 20:12

Is +0 also sent through a callback or only the +1,+2,+3 etc?

I mean this particular in Elite.
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs

User avatar
Eole
Nadeo
Nadeo
Posts: 1225
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 05 Feb 2014, 15:51

kremsy wrote: The bug is like, when you are in warmup state, the counter counts down, 60,59,58 and you extend now warmup with 10secs it should be continue counting down 68 67... but it doesnt. If you extend the time nothing changes as long as (the warmup counts down).
Fixed. There's also a new "WarmUp_GetStatus" method. When called it'll send back a "WarmUp_Status" callback saying if the mode use the WarmUp library or not.
kremsy wrote: I also have another request is it possible to make a callback at the end of a Map which exactly says how long a Player did Play (without warmups and spectator times)?

And one question more ;). As I know there is an Autokick function in most of the scripts, is there a possability to make this generall and accessable for controllers, like receiving a Callback from the Script which the Controllers can Manage (force them to spec or kick them or whatever). Would be very nice if something is possible in that direction.
I'll see what I can do if I have the time, but it's not at the top of the priority list.
w1lla wrote:Is +0 also sent through a callback or only the +1,+2,+3 etc?

I mean this particular in Elite.
The script can't detect a +0, so it's not possible to send a callback for this specific event at the time being.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1721
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 05 Feb 2014, 16:47

Thank you soooooo much!!!!!!!
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
jonthekiller
Translator
Translator
Posts: 4654
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: Script callbacks

Post by jonthekiller » 06 Feb 2014, 22:35

Eole wrote:
w1lla wrote:Is +0 also sent through a callback or only the +1,+2,+3 etc?

I mean this particular in Elite.
The script can't detect a +0, so it's not possible to send a callback for this specific event at the time being.
It's possible to add this in the big todo? :roll:
Image

User avatar
Eole
Nadeo
Nadeo
Posts: 1225
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 13 Feb 2014, 10:41

kremsy wrote:And one question more ;). As I know there is an Autokick function in most of the scripts, is there a possability to make this generall and accessable for controllers, like receiving a Callback from the Script which the Controllers can Manage (force them to spec or kick them or whatever). Would be very nice if something is possible in that direction.
I moved the AFK library into ModeBase.Script.txt so it will be available in all modes. There's a setting to turn on/off the library and a few callbacks and methods to control it. The library is turned off by default except in Royal, Battle and Siege.

Code: Select all

## Callbacks

##### LibAFK_IsAFK
* Data : An array with the login of the AFK player
* Example : ["Login"]
* Note : This callback is sent when the library detect an AFK player. It will be sent each time the library check AFK players until the player is removed from the Players array (spectator mode, kicked, ...).

##### LibAFK_Properties
* Data : An array with the properties of the AFK library
* Example : ["90000", "15000", "10000", "True"]
* Note : 
    * IdleTimeLimit -> Time after which a player is considered to be AFK
    * SpawnTimeLimit -> Time after spawn before which a player can't be considered to be AFK
    * CheckInterval -> Time between each AFK check
    * ForceSpec -> Let the library force the AFK player into spectator mode

## Methods

##### LibAFK_SetProperties
* Note : Set the properties of the AFK library. The parameters are in this order: IdleTimeLimit, SpawnTimeLimit, CheckInterval, ForceSpec.
* String : "LibAFK_SetProperties"
* Array : ["90000", "15000", "10000", "True"]

##### LibAFK_GetProperties
* Note : Get the properties of the AFK library. This will sent the `LibAFK_Properties` callback in return.
* String1 : "LibAFK_GetProperties"
* String2 : ""
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1721
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 13 Feb 2014, 13:55

Thank you very much, that looks really awesome!!!!

Does this also recognize Players who timed out and are still on the server (it's not possible to move them via the XMLRPC Methods to spec, so im wondering if these Method moves him automatically to spec when its activated).

And about the Time, is it in ms ?
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
Eole
Nadeo
Nadeo
Posts: 1225
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 13 Feb 2014, 15:14

kremsy wrote:Does this also recognize Players who timed out and are still on the server
No, the script suffer from the same problem at the moment.
kremsy wrote:And about the Time, is it in ms ?
Yes.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1721
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 14 Feb 2014, 09:34

Eole wrote:
kremsy wrote:Does this also recognize Players who timed out and are still on the server
No, the script suffer from the same problem at the moment.
kremsy wrote:And about the Time, is it in ms ?
Yes.
Okay thank you!!!

Yeah if the GetNetworkStats Method would be fixed it would be easy to handle timeouts ourselves but as long it isnt working there is no way :(.
http://forum.maniaplanet.com/viewtopic. ... g&start=10
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

Post Reply

Return to “Dedicated Server”

Who is online

Users browsing this forum: ItsPhenom and 2 guests