Page 1 of 1

Groups are not working

Posted: 06 Jan 2012, 21:18
by imteractive
Hi all,

I'm trying to evaluate SFS2X to use on a large Facebook game we're going to develop. However I'm having some quite serious problems with groups which are essential for us.

I create a group (group1) using the Zone Configurator, save and restart the server. Everything is OK according to the console log:

Code: Select all

20:50:28,727 INFO  [main] managers.SFSZoneManager     - Creating room: (default) The Lobby
20:50:28,727 INFO  [main] api.SFSApi     - Room created: [ Room: The Lobby, Id: 3, Group: default, isGame: false ]
20:50:28,727 INFO  [main] managers.SFSZoneManager     - Creating room: (group1) GameRoom
20:50:28,728 INFO  [main] api.SFSApi     - Room created: [ Room: GameRoom, Id: 4, Group: group1, isGame: false ]
20:50:28,728 INFO  [main] managers.SFSZoneManager


But then when doing something like:

Code: Select all

public function get roomList() : Array
{
   return _smartFoxServer.getRoomListFromGroup("group1");
}


I get an empty array. I also get an error saying the group doesn't exist if I try to subscribe it.

Can someone please help?

Posted: 06 Jan 2012, 21:30
by rjgtav
Hi.

You're trying to get the rooms of that group from the client correct? If so, please make sure that that groupId is in the Default Room Groups setting of that zone's configuration. Please remember that if the client isn't subscribed to that room group, it won't get any updates from it or and the room list.

Posted: 06 Jan 2012, 22:13
by imteractive
Thanks rjgtav,

That solved the problem!

BTW, I noticed that the IRoomManager info on http://docs2x.smartfoxserver.com/api-docs/asdoc/ is not updated with all methods. Do you know if there's a place with a more up-to-date API docs?

Posted: 06 Jan 2012, 22:52
by rjgtav
Well, those are the most updated docs... What methods are you referring to that are not in there?

Posted: 07 Jan 2012, 12:22
by imteractive
Take for example IRoomManager. This is what I have on my SWC:

Code: Select all

public interface IRoomManager
   {
      public function addGroup(groupId : String) : void;

      public function addRoom(room : Room, addGroupIfMissing : Boolean = true) : void;

      public function changeRoomCapacity(room : Room, maxUsers : int, maxSpect : int) : void;

      public function changeRoomName(room : Room, newName : String) : void;

      public function changeRoomPasswordState(room : Room, isPassProtected : Boolean) : void;

      public function containsGroup(groupId : String) : Boolean;

      public function containsRoom(idOrName : *) : Boolean;

      public function containsRoomInGroup(idOrName : *, groupId : String) : Boolean;

      public function getJoinedRooms() : Array;

      public function getRoomById(id : int) : Room;

      public function getRoomByName(name : String) : Room;

      public function getRoomCount() : int;

      public function getRoomGroups() : Array;

      public function getRoomList() : Array;

      public function getRoomListFromGroup(groupId : String) : Array;

      public function getUserRooms(user : User) : Array;

      public function get ownerZone() : String;

      public function removeGroup(groupId : String) : void;

      public function removeRoom(room : Room) : void;

      public function removeRoomById(id : int) : void;

      public function removeRoomByName(name : String) : void;

      public function removeUser(user : User) : void;

      public function replaceRoom(room : Room, addToGroupIfMissing : Boolean = true) : Room;

      public function get smartFox() : SmartFox;
   }


On the docs only has 11 of those methods.

Posted: 08 Jan 2012, 17:47
by rjgtav
The other methods you're referring to that aren't documented are methods that aren't to be used by us (developers), they're used by the API in order to work properly. Please use just the methods that are documented.

Posted: 09 Jan 2012, 12:34
by imteractive
Oh OK! Didn't know that.

Thanks for the information! ;)