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

Post Reply
balasourav
Posts: 22
Joined: 25 Jul 2017, 07:44

send response without extends BaseClientRequestHandler

Post by balasourav »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: send response without extends BaseClientRequestHandler

Post by Lapo »

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: 22
Joined: 25 Jul 2017, 07:44

Re: send response without extends BaseClientRequestHandler

Post by balasourav »

Thanks Lapo. Thanks for your information.
Post Reply