How to check from what extension the response comes from ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

How to check from what extension the response comes from ?

Postby genar » 08 Jan 2018, 17:08

Hey there !

When working with multiple extensions its hard to check from what type of extension the repsonse comes from. Till now i just send a custom string every time but that seems not to be the best way. Is there an easier way to do this ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to check from what extension the response comes from ?

Postby Lapo » 09 Jan 2018, 08:13

I am not sure I understand your question.
Normally it's not important what Extension replied to you, rather you need to know which request the reply is related to. And for this there exist event handlers.

Unless you're running the same command names in multiple extensions you should never have such ambiguity. If you are I'd suggest to rethink the strategy as implementing duplicates of the same command names in multiple Extension might indeed cause some confusion.

Another possibility is to just check the current context: if you have two identical commands in a Zone Extension and Room Extension you can still identify where it is coming from by checking if the Extension response is coming from a Room, rather than the Zone.
For this there is a specific parameter in your Extension response with the ID of the Room that sent the response.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: How to check from what extension the response comes from ?

Postby genar » 09 Jan 2018, 13:00

Maybe my question was a bit hard to understand but nevertheless you solved my iusse thanks ! :)

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 53 guests