Script callbacks

Moderator: NADEO

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

Script callbacks

Post by Eole »

The list of XmlRpc callbacks and methods available in the Nadeo scripts is now on GitHub :
https://doc.maniaplanet.com/dedicated-s ... pc-scripts
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Jojo_44
Posts: 500
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: Script callbacks

Post by Jojo_44 »

Yeah thanks :thumbsup:

I would like to see the common script callbacks as own callbacks from the dedicated server. Not going over the "Mainaplanet.ModeScriptCallbackArray" callback. Shouldn´t it be possible to use the normal "ManiaPlanet.BeginMatch/BeginMap" callbacks for this ?

best regards, Jojo
Image
my english sounds very unfriendly but it isn´t ;)
User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Script callbacks

Post by steeffeen »

i guess that's not the case because shootmania is so customizable that it's different in every mode
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    Jojo_44
    Posts: 500
    Joined: 12 Jul 2010, 15:58
    Location: Germany->Bavaria
    Contact:

    Re: Script callbacks

    Post by Jojo_44 »

    steeffeen wrote:i guess that's not the case because shootmania is so customizable that it's different in every mode
    The common script callbacks are in every mode (except elite to keep backwards compatibility), so in fact they are some kind of a standard. The current way is just a bit bad to handle for servercontrollers because every SM Plugin in fact needs to register for the "Mainaplanet.ModeScriptCallbackArray" callback from the server and then check with many if´s/switch statements what callback was called. In terms of performance just bad.

    regards, Jojo
    Image
    my english sounds very unfriendly but it isn´t ;)
    User avatar
    Jojo_44
    Posts: 500
    Joined: 12 Jul 2010, 15:58
    Location: Germany->Bavaria
    Contact:

    Re: Script callbacks

    Post by Jojo_44 »

    kremsy wrote:
    Jojo_44 wrote:
    steeffeen wrote:i guess that's not the case because shootmania is so customizable that it's different in every mode
    The common script callbacks are in every mode (except elite to keep backwards compatibility), so in fact they are some kind of a standard. The current way is just a bit bad to handle for servercontrollers because every SM Plugin in fact needs to register for the "Mainaplanet.ModeScriptCallbackArray" callback from the server and then check with many if´s/switch statements what callback was called. In terms of performance just bad.

    regards, Jojo
    You think one switch statement makes a bad performance?
    No ofc not. Look:

    Let´s say you want a function to be called when the Map ends. So in Xaseco2 (tm2) f.e. you register this function to be called when the callback "ManiaPlanet.EndMap" is called from the server. If you want the same for shootmania (f.e. in mpaseco) you register for the callback "Mainaplanet.ModeScriptCallbackArray" and check if the param1 is "MapEnd". But here it comes: "Mainaplanet.ModeScriptCallbackArray" is called also for every other single callback from SM Scripts which Eole posted. So your function is also triggered for "onShoot" f.e. too even if you just want "EndMap". So your function is in my view unnecessarily often called. You can now come and say: well a function call + a if statement are not that hard in terms of performance but remember how often the onShoot callback is called f.e. (+ all others) and you may have 10 functions or more registered for "Mainaplanet.ModeScriptCallbackArray". So you have hundreds of functions calls for nothing.

    regards, Jojo
    Image
    my english sounds very unfriendly but it isn´t ;)
    User avatar
    Eole
    Nadeo
    Nadeo
    Posts: 1265
    Joined: 26 Apr 2011, 21:08

    Re: Script callbacks

    Post by Eole »

    The callback is sent once all players have loaded the map. I can call it earlier but then, it's not certain that all players will have complete the transition from the previous map.

    There will be a new callback for Royal in the next update, giving the login of the round winner. It's sent just before the LibXmlRpc_EndRound callback:

    Code: Select all

    Name: "Royal_RoundWinner"
    Data: An array with the login of the player who won the round
    example: ["Login"]
    Note: This callback is sent just before the end of the round, when the round winner is determined
    
    Contribute to the ManiaPlanet documentation on GitHub
    A question about ManiaScript? Ask it here!
    Post Reply

    Return to “Dedicated Server”

    Who is online

    Users browsing this forum: No registered users and 1 guest