I´m looking for the "correct" way to remove a user from a room (while joinging another one, in case this matters) using an extension.
I know I can use the removeUser method (in the SFSRoom class), and it works, but it doesn´t seem to fire any of the events I would expect (SFSEvent.ROOM_JOIN or SFSEvent.USER_ENTER_ROOM). So I guess this is not the way this is supposed to be done.
I´ve been looking for a way to send a JoinRoomRequest from an extension, but it doesn´t seem to exist in the Java Api (or I didn´t find it).
Can somebody please give me a nodge to the right direction?
How to remove a user from a room using an extension?
Always use the SFSApi class.
In this case you will use the leaveRoom() method:
http://docs2x.smartfoxserver.com/api-do ... FSApi.html
Make sure to read the docs abou the API too:
http://docs2x.smartfoxserver.com/Develo ... ension-api
In this case you will use the leaveRoom() method:
http://docs2x.smartfoxserver.com/api-do ... FSApi.html
Make sure to read the docs abou the API too:
http://docs2x.smartfoxserver.com/Develo ... ension-api
Yes, we adopted a different strategy where if a method is not useful it doesn't contain any comment, instead of filling the docs with warnings.
With this said if you read the above article it should clarify the way it works.
Essentially there's just 2 things in the framework: API and data classes.
Any time you need to perform an "action" you go searching for that action in the API (join room, create game, send public message)...
Data classes (Zone, Room, User...) are used as arguments return values by these API methods.
With this said if you read the above article it should clarify the way it works.
Essentially there's just 2 things in the framework: API and data classes.
Any time you need to perform an "action" you go searching for that action in the API (join room, create game, send public message)...
Data classes (Zone, Room, User...) are used as arguments return values by these API methods.