Aseco: popup message command usage (?)

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
nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Aseco: popup message command usage (?)

Post by nocturne » 17 Jan 2008 17:18

I'm wondering how to use 'SendDisplayServerMessageToLogin' to have a popup with a 'Continue' button to continue the function and a 'Cancel' button to end the function (return;).

The usage is for /kick and /ban commands for a votescript (aseco), which I hope to have a 'warning' box stating that continuing will result i the occurrence being fully logged, and offer the chance to opt out.

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

Re: Aseco: popup message command usage (?)

Post by Xymph » 17 Jan 2008 19:08

nocturne wrote:I'm wondering how to use 'SendDisplayServerMessageToLogin' to have a popup with a 'Continue' button to continue the function and a 'Cancel' button to end the function (return;).

The usage is for /kick and /ban commands for a votescript (aseco), which I hope to have a 'warning' box stating that continuing will result i the occurrence being fully logged, and offer the chance to opt out.
You didn't mention it but I presume you're talking about TMN and Aseco v0.93, since popups/windows work entirely different on TMU with its ManiaLink stuff.

You can send a popup to a user with something like this:

Code: Select all

$aseco->client->query('SendDisplayServerMessageToLogin', $player->login, $message, 'Cancel', 'Continue', 0);
but the catch is, there is only one function to handle responses from pressing those buttons, event_multi_message() in includes/rasp.funcs.php, and that's fully geared towards the various list popups and handling the multi-page functionality there. It is also fully autonomous, i.e. this function doesn't return any results back to the chat command that invoked the popup.

So basically what you're looking for isn't possible in the current framework, unless you'd define a new type of popup that includes a callback function which event_multi_message() would invoke with a button is clicked. That takes a fair amount of surgery I guess.
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

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Aseco: popup message command usage (?)

Post by nocturne » 18 Jan 2008 10:57

listcallbacks.html :

Code: Select all

TrackMania.PlayerServerMessageAnswer(int PlayerUid, string Login, int Answer);
Answer: 0 -> no answer (timeout...), 1 or 2 -> answer from the player
There is the PlayerServerMessageAnswer callback, but I'm not entirely sure how to use it...

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

Re: Aseco: popup message command usage (?)

Post by Xymph » 18 Jan 2008 11:59

nocturne wrote:listcallbacks.html :

Code: Select all

TrackMania.PlayerServerMessageAnswer(int PlayerUid, string Login, int Answer);
Answer: 0 -> no answer (timeout...), 1 or 2 -> answer from the player
There is the PlayerServerMessageAnswer callback, but I'm not entirely sure how to use it...
That's the one yes, but did you even read my previous post? :P I said:
Xymph wrote:but the catch is, there is only one function to handle responses from pressing those buttons, event_multi_message() in includes/rasp.funcs.php, and that's fully geared towards the various list popups and handling the multi-page functionality there. It is also fully autonomous, i.e. this function doesn't return any results back to the chat command that invoked the popup.
So you can check that function for an example on how to use the callback too. :roll:
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

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Aseco: popup message command usage (?)

Post by nocturne » 18 Jan 2008 12:28

Code: Select all

Aseco::registerEvent('onPlayerServerMessageAnswer', 'event_multi_message');
Should of just done a file search, hehe. :oops:

So basically, I'd have the chat function which would end in the message, and then a onPlayerServerMessageAnswer function to finish up the command. Will there be any complication with the other displays like /list, and in that case would I have to edit original event_multi_message function to accept the right messages?

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

Re: Aseco: popup message command usage (?)

Post by Xymph » 18 Jan 2008 12:57

nocturne wrote:

Code: Select all

Aseco::registerEvent('onPlayerServerMessageAnswer', 'event_multi_message');
Should of just done a file search, hehe. :oops:

So basically, I'd have the chat function which would end in the message, and then a onPlayerServerMessageAnswer function to finish up the command. Will there be any complication with the other displays like /list, and in that case would I have to edit original event_multi_message function to accept the right messages?
That's what I meant above: it's very easy to mess up the proper functioning of the multi-page popups that this event_multi_message function handles, and could be quite tricky to use the PlayerServerMessageAnswer event for something else. I don't really know, but I do know that Forever will use the much more flexible ManiaLink system for which AsecoTMU already has a nice framework where you can probably do this sort of thing more easily, so it may not be worth the trouble anymore.

Then again, we may have to wait forever until Forever appears... :roll: :lol:
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

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Aseco: popup message command usage (?)

Post by nocturne » 20 Jan 2008 09:52

Well, I figured out how to do it via editing the message function and adding some global loops and catch strings, but it's a lot of work and really not worth the effort...

Thanks for the help anyways, Xymph.

Post Reply