Faking a PUBLIC_MESSAGE to just one user?

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

Moderators: Lapo, Bax

brendan7
Posts: 43
Joined: 10 Feb 2014, 17:40

Faking a PUBLIC_MESSAGE to just one user?

Postby brendan7 » 30 May 2016, 15:43

I am trying to "fake" a public_message event to just one user. This would be in a room that has multiple users (15+). I am using a SysControllerFilter to filter out certain public messages, using FilterAction.HALT. However, I would still like the "sender" to get the message.

Any good way to do this? I am trying to just update the extension code and not need client updates.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Faking a PUBLIC_MESSAGE to just one user?

Postby Lapo » 30 May 2016, 16:36

Hi,
so I send the message, this goes to the server and gets sent back to me but not to all the other people in the Room?

Is this correct?

Any good way to do this? I am trying to just update the extension code and not need client updates.

I don't think I am following this.
If you need to update your Extension why not just sending a request to the Extension, especially if no other user needs to be involved ...

Can you clarify?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
brendan7
Posts: 43
Joined: 10 Feb 2014, 17:40

Re: Faking a PUBLIC_MESSAGE to just one user?

Postby brendan7 » 30 May 2016, 18:47

Thanks for the quick response Lapo

I don't think I am following this.
If you need to update your Extension why not just sending a request to the Extension, especially if no other user needs to be involved ...


To send a new type of request to the extension, I would have to update the client code. I am trying to find a way to apply this filter to public_messages without any changes to the client code, so it can be backward compatible with all existing builds of the client. I know it probably isn't possible, but I'm really trying to find a way!

Ideally, I was looking for a way to send any "Event" down to the user in the extension code instead of an EXTENSION_RESPONSE. The SysControllerFilter would sometimes want to HALT the message, but send a PUBLIC_MESSAGE event back to only the "sending" user, so to them the messages look normal/unfiltered. Would there be a way to send an SFSObject to the user, and change the event type to PUBLIC_MESSAGE in the extension code?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Faking a PUBLIC_MESSAGE to just one user?

Postby Lapo » 31 May 2016, 07:29

Sorry, that's not possible.
The filter allows you to deny requests based on a custom logic but it cannot alter the response.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 99 guests