Pass extra params in server EventHandler
Posted: 06 Dec 2021, 16:18
Hi,
Is it possible to pass additional parameters from the server to the client when firing certain events? For example, is it possible to pass extra variables when a USER_JOIN_ROOM request is handled serverside?
Server:
and within JoinRoomHandler.class:
I want to send a few extra variables to the client (from server) when another user joins their room.
Is it possible to pass additional parameters from the server to the client when firing certain events? For example, is it possible to pass extra variables when a USER_JOIN_ROOM request is handled serverside?
Server:
Code: Select all
this.addEventHandler(SFSEventType.USER_JOIN_ROOM, JoinRoomHandler.class);Code: Select all
public class JoinRoomHandler extends BaseServerEventHandler
{
@Override
public void handleServerEvent(ISFSEvent event) throws SFSException
{
// Get event param
SFSRoom room = (SFSRoom) event.getParameter(SFSEventParam.ROOM);
// Pass extra data to process clientside SFSEvent event
...
}
}