Problems CreateRoomRequest Android Tris example

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

Moderators: Lapo, Bax

alexgrao
Posts: 2
Joined: 18 Jul 2017, 09:22

Problems CreateRoomRequest Android Tris example

Postby alexgrao » 18 Jul 2017, 09:55

Hi. I'm starting with SFS2X and i've encountered problems with android tris example creating rooms dinamically on client-side.

Code: Select all

public void createGameRoom(String roomName) {
      if (roomName.length() > 0) {
         RoomExtension extension = new RoomExtension(EXTENSION_ID, EXTENSIONS_CLASS);
         RoomSettings settings = new RoomSettings(roomName);
         settings.setGroupId([i]GAME_ROOMS_GROUP_NAME[/i]);
         settings.setGame(true);
         settings.setMaxUsers(2);
         settings.setMaxSpectators(0);
         settings.setExtension(extension);
         sfsClient.send(new CreateRoomRequest(settings, true ,sfsClient.getLastJoinedRoom()));
      }
   }



The client is sending well, but when the server answers the corresponding listener doesnt work (sfsClient.addEventListener(SFSEvent.ROOM_ADD, this);)


I have configured the group name for GAME_ROOMS_GROUP_NAME in the remote administrator, I have also added to extensions/tris folder the TrisExtension.jar extension.

I do not know what's failing, can u help me plz?. Chat is running OK, but the app fails when i press the button for create the room.
Thanks!
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problems CreateRoomRequest Android Tris example

Postby Lapo » 18 Jul 2017, 10:17

Hi,
you can check a couple of things:

1) Via the AdminTool > Zone Monitor you can verify if the Room has been created
2) You should check the server side logs for potential errors

If the Room is indeed created but no events are received at the client side, there's likely a problem with your code. If it's not a 1000 lines long please post here the entire thing or at least the section where you add the listeners and the code of the listener itself.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
alexgrao
Posts: 2
Joined: 18 Jul 2017, 09:22

Re: Problems CreateRoomRequest Android Tris example

Postby alexgrao » 18 Jul 2017, 10:27

Solved! Watching logs of server i realized that my problem was the length of the room name! :lol: :lol:
Really thanks for the fast answer!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 94 guests