My issue is that sometimes a room is removed immeditaely after creation. I have server code that creates a room when a user enters the zone and then joins a user in it:
Code: Select all
try
{
room = getApi().createRoom(user.getZone(), lobbyConfig(user), user);
}
catch (SFSCreateRoomException e)
{
trace("Skipped lobby creation, room likely exists");
room = user.getZone().getRoomByName(user.getName()+"Lobby");
}
finally
{
getApi().joinRoom(user, room, null, false, null);
}
Here is the lobbyConfig() settings:
Code: Select all
public static CreateMMORoomSettings lobbyConfig(User user)
{
CreateMMORoomSettings cfg = new CreateMMORoomSettings();
// Room variables
List<RoomVariable> roomVars;
...
cfg.setName(user.getName() + "Lobby");
cfg.setHidden(true);
cfg.setDefaultAOI(new Vec3D(100,100,0));
cfg.setProximityListUpdateMillis(500);
cfg.setSendAOIEntryPoint(true);
cfg.setMaxVariablesAllowed(7);
cfg.setMaxUsers(8);
cfg.setDynamic(true);
cfg.setAutoRemoveMode(SFSRoomRemoveMode.WHEN_EMPTY);
cfg.setRoomVariables(roomVars);
return cfg;
}
When a user joins the server log usually looks like this:
Code: Select all
17:06:29,470 INFO [SFSWorker:Ext:3] managers.SFSRoomManager - Room created: { Zone: World }, [ MMORoom: PlayerLobby, Id: 160, Group: default, AOI: (100, 100, 0) ], type = MMORoom
17:06:29,470 INFO [SFSWorker:Ext:3] api.SFSApi - Room joined: [ MMORoom: PlayerLobby, Id: 160, Group: default, AOI: (100, 100, 0) ], { Zone: World }, ( User Name: Player, Id: 59, Priv: 1, Sess: 127.0.0.1:51195 ) , asSpect: false
However on some occasions, this happens instead:
Code: Select all
16:55:31,975 INFO [SFSWorker:Ext:2] managers.SFSRoomManager - Room created: { Zone: World }, [ MMORoom: PlayerLobby, Id: 158, Group: default, AOI: (100, 100, 0) ], type = MMORoom
16:55:31,975 INFO [SFSWorker:Ext:2] api.SFSApi - Room joined: [ MMORoom: PlayerLobby, Id: 158, Group: default, AOI: (100, 100, 0) ], { Zone: World }, ( User Name: Player, Id: 77, Priv: 1, Sess: 127.0.0.1:51146 ) , asSpect: false
16:55:31,977 INFO [pool-1-thread-4] managers.SFSRoomManager - Room removed: { Zone: World }, [ MMORoom: PlayerLobby, Id: 158, Group: default, AOI: (100, 100, 0) ], Duration: 2
Notice the room is removed almost right after creation. The "Duration" number is 2 (milliseconds?), which is extremely short. Is this possibly because the server is checking the room as WHEN_EMPTY and since no user is in the room at that moment it is removed?
My question is if there is a way to create and join a user in a room at the same time so the room doesn't evaluate as empty, or if there is an alternate way I can try to have them join the room without it being removed. I am assuming that is the issue, but if there may be something else causing this let me know.