Have a problem here where we're setting a room variable update on a room on the server end. Client (which is Unity C#) connects to this room and has a RoomVarUpdate listener attached.
However the RoomVar event is not detected on the clientside and the room var is not updated on the clientside either.
Here is the dynamic creation of the room:
Code: Select all
CreateSFSGameSettings roomSetting = new CreateSFSGameSettings();
roomSetting.setName(gameName);
roomSetting.setAutoRemoveMode(SFSRoomRemoveMode.WHEN_EMPTY);
roomSetting.setDynamic(true);
roomSetting.setGamePublic(true);
roomSetting.setLeaveLastJoinedRoom(true);
roomSetting.setGroupId("example");
roomSetting.setMaxUsers(6);
roomSetting.setHidden(false);
roomSetting.setMaxVariablesAllowed(2);
roomSetting.setMinPlayersToStartGame(1);
//roomSetting.setRoomSettings(EnumSet.noneOf(SFSRoomSettings.class)); // no permissions.
roomSetting.setRoomSettings(EnumSet.of(SFSRoomSettings.USER_ENTER_EVENT,
SFSRoomSettings.USER_EXIT_EVENT,
SFSRoomSettings.USER_VARIABLES_UPDATE_EVENT));
List<RoomVariable> roomVarsList = new ArrayList<RoomVariable>();
roomVarsList.add(new SFSRoomVariable("state", "INIT"));
roomSetting.setRoomVariables(roomVarsList);
try {
ISFSGameApi gameApi = SmartFoxServer.getInstance().getAPIManager().getGameApi();
tgtRoom = gameApi.createGame(ext.getParentZone(), roomSetting, null);
} catch(SFSCreateRoomException err) {
}
And then the variable is updated at a later time:
Code: Select all
ext.getParentRoom().setVariable(new SFSRoomVariable("state", "READY"));
When the players join the room, the first variable shows when that player enters the room. However, the second variable update doesn't appear to send to the clientside. I've checked all permissions and can't find anything related to this. Is there any reason for this ? If this is not possible , I'll have to send a custom event. thanks.