Page 1 of 1

Problem with creating game room on server side.

Posted: 30 Oct 2016, 15:17
by truongps
Hi,
I meet a problem with creating game room on server side. I cannot receive SFSEventType.USER_LEAVE_ROOM when I set roomSettings.setDynamic(true); What is the problem? I put all my code below. Please, give me a hand. Thank you.

Code: Select all

CreateRoomSettings roomSettings = new CreateRoomSettings();
      roomSettings.setName(UUID.randomUUID().toString());
      roomSettings.setMaxUsers(maxUser);
      roomSettings.setMaxSpectators(10);
      roomSettings.setGame(true);
      roomSettings.setAutoRemoveMode(SFSRoomRemoveMode.WHEN_EMPTY);
      roomSettings.setDynamic(true);
      roomSettings.setMaxVariablesAllowed(20);
      roomSettings.setGroupId(groupId);

      String extensionFolder = "abc";
      String extensionClassName = extension.getConfigProperties().getProperty("abc");
      RoomExtensionSettings roomExtensionSettings = new RoomExtensionSettings(extensionFolder, extensionClassName);
      roomSettings.setExtension(roomExtensionSettings);

Re: Problem with creating game room on server side.

Posted: 31 Oct 2016, 05:01
by coolboy714cp
Just guessing with little knowledge as I cannot view the docs at the moment, but where exactly are you listening for that event? Are you also using a zone extension already (don't know if it's possible to have both via extension code)?

Re: Problem with creating game room on server side.

Posted: 31 Oct 2016, 05:20
by truongps
Hi,
Thank you for your response.

I have 2 Extension, Zone and Room. I listen on Room, and when the last user leave room, I don't receive SFSEventType.USER_LEAVE_ROOM. But, I can receive this event, when I put it in Zone extension. Now, I fix it by move SFSEventType.USER_LEAVE_ROOM to Zone extension.

Thank you.

Re: Problem with creating game room on server side.

Posted: 31 Oct 2016, 05:32
by coolboy714cp
Glad I could help. :)