send response without extends BaseClientRequestHandler

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

Moderators: Lapo, Bax

balasourav
Posts: 12
Joined: 25 Jul 2017, 07:44

send response without extends BaseClientRequestHandler

Postby balasourav » 06 Aug 2019, 10:59

I want to response to client without extends BaseClientRequestHandler in java.

for example
-----------

Code: Select all

public class Request_Handler extends BaseClientRequestHandler
{
   
   @Override
   public void handleClientRequest(User sender, ISFSObject params)
   {
       
        }
}

If i want to send values to client, I should extend the BaseClientRequestHandler. In One of my sender class i dont want to extend the "BaseClientRequestHandler" , what can i do. Anyother methods there to send response to client without extends "BaseClientRequestHandler".
User avatar
Lapo
Site Admin
Posts: 21119
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: send response without extends BaseClientRequestHandler

Postby Lapo » 06 Aug 2019, 17:17

Hi,
you don't need to extend BaseClientRequestHandler to send data to a client. BaseClientRequestHandler should be extended only to create a class that handles a specific request in your game.

Since your main Extension class exposes a public send() method you can get a reference to it and invoke it from there.
There's also another way. You can directly call the SFSApi.sendExtensionResponse() method.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
balasourav
Posts: 12
Joined: 25 Jul 2017, 07:44

Re: send response without extends BaseClientRequestHandler

Postby balasourav » 21 Aug 2019, 11:23

Thanks Lapo. Thanks for your information.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 16 guests