Problem with creating game room on server side.

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

truongps
Posts: 32
Joined: 27 Sep 2015, 17:06

Problem with creating game room on server side.

Postby truongps » 30 Oct 2016, 15:17

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);
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Problem with creating game room on server side.

Postby coolboy714cp » 31 Oct 2016, 05:01

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)?
truongps
Posts: 32
Joined: 27 Sep 2015, 17:06

Re: Problem with creating game room on server side.

Postby truongps » 31 Oct 2016, 05:20

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.
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Problem with creating game room on server side.

Postby coolboy714cp » 31 Oct 2016, 05:32

Glad I could help. :)

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 69 guests