I have the following code (insida java function) to create dynamic rooms, before i did not have them to be deleted but we want the
WHEN_EMPTY_AND_CREATOR_IS_GONE situation.
Even so when such condition happen is not removing them.
the roomId is a 5 number digit different than 0.
And even so it stays for days after everyone logs out, what i am doing wrong?
CreateRoomSettings cfg = new CreateRoomSettings();
//Room room = sender.getLastJoinedRoom();
cfg.setName(String.format("%d",roomId));
cfg.setGame(true);
cfg.setMaxUsers(CONST.MAX_PLAYER_ROOM);
cfg.setGroupId(groupRoom);
//cfg.setMaxSpectators(5);
cfg.setDynamic(true);
cfg.setAutoRemoveMode(SFSRoomRemoveMode.WHEN_EMPTY_AND_CREATOR_IS_GONE);
cfg.setUseWordsFilter(true);
CreateRoomSettings.RoomExtensionSettings ext = new CreateRoomSettings.RoomExtensionSettings(
CONST.SFSE.getName(), CONST.SFSE.getClass().getName());
cfg.setExtension(ext);
return SmartFoxServer.getInstance().getAPIManager().getSFSApi()
.createRoom(sender.getZone(), cfg, null);
(where CONST.SFSE is the extension)
So can anyone help on what i am doing wrong?
Room Self Delete not working
Re: Room Self Delete not working
when you call .createRoom(), the owner (3rd parameter) is `null`, which defaults to the server being the owner. You will need to pass an actual user in as that parameter to act as the "creator".
Re: Room Self Delete not working
Yes,
WHEN_EMPTY_AND_CREATOR_IS_GONE does not work when the owner of the Room is the server... as it's not possibile to determine when the creator of the Room "is gone" (the server does not leave )
WHEN_EMPTY_AND_CREATOR_IS_GONE does not work when the owner of the Room is the server... as it's not possibile to determine when the creator of the Room "is gone" (the server does not leave )
Re: Room Self Delete not working
Thanks did not notice that mistake, will now check if it works
Re: Room Self Delete not working
Yes thanks, was that the problem, will check in the future to pass the correct owner when something owner related is required.
Who is online
Users browsing this forum: No registered users and 105 guests