public class RoomAddedHandler extends BaseServerEventHandler {
@Override
public void handleServerEvent(ISFSEvent event) throws SFSException
{
MainZone gameExt = (MainZone) getParentExtension();
gameExt.trace("ssss");
}
}
The room are predfine and AdminTool and not generated from users.
is this event only fired when user creating rooms? if so when can i make sure a pre defined room is fully instantiated
hi guys im a little bit stuck on my project becuz of this . I predfined room using admintool and i can't seems to tell when they are fully instantiated.
The version of the method you are using attempts to send an update to the clients but at init() time the server is not even fully started up.
Use the full version of the method:
setRoomVariables(User user, Room targetRoom, List<RoomVariable> variables, boolean fireClientEvent, boolean fireServerEvent, boolean overrideOwnership)
and set the fireClientEvent and fireServerEvent to false
Lapo isn't it better in this scenario to do it through Room interface method setVariable instead? Isn't it exactly the same as setting it through api but without the events send?
public final class GameBoard {
public GameBoard (Main main)
{
roomStyle = new SFSRoomVariable("roomStyle","test" );
roomVariables.add(roomStyle);
this.main.getApi().setRoomVariables(null, this.main.getParentRoom(), roomVariables,false,false,true);
}