Extra SFSObject in ROOM_JOIN/USER_ENTER_ROOM

Post here your suggestions for new possible features in SmartFoxServer 2X.

Moderators: Lapo, Bax

mack
Posts: 8
Joined: 25 Feb 2015, 11:25

Extra SFSObject in ROOM_JOIN/USER_ENTER_ROOM

Postby mack » 21 May 2015, 08:12

Hi all,

It would be great to have a possibility to pass an extra object in server-side function (from SFSApi):

Code: Select all

public void joinRoom(User user,
                     Room roomToJoin,
                     java.lang.String password,
                     boolean asSpectator,
                     Room roomToLeave,
                     boolean fireClientEvent,
                     boolean fireServerEvent)
              throws SFSJoinRoomException


to be then handled on the client side from parameters, like it is in the SFSEvent.LOGIN and

Code: Select all

data   (ISFSObject) An object containing custom parameters returned by a custom login system, if any.


Best Regards
mack
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Extra SFSObject in ROOM_JOIN/USER_ENTER_ROOM

Postby Lapo » 21 May 2015, 09:01

Hi,
I am not sure to understand the use case for this.

In the LoginRequest the control is handed to the developer's Extension, so it makes sense to have custom parameters. In the JoinRoomRequest there is no such thing, so an extra object would have no useful function.

Can you clarify how this should work?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
mack
Posts: 8
Joined: 25 Feb 2015, 11:25

Re: Extra SFSObject in ROOM_JOIN/USER_ENTER_ROOM

Postby mack » 25 May 2015, 09:22

Hi,

The server-side decides who joins which room in response to the client request (eg. WantToPlayRequest).

We would like to synchronize some user data in ROOM_JOIN/USER_ENTER_ROOM responses to the client.

We would like to pass an extra object from server's extension (joinRoom(user, room, extraObject)) straight to the user's handler/dispatch function via ROOM_JOIN/USER_ENTER_ROOM.

Best Regards
mack
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Extra SFSObject in ROOM_JOIN/USER_ENTER_ROOM

Postby Lapo » 25 May 2015, 09:35

Thanks for the clarification.
The best way to do it is by sending a custom Extension reply.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “2X Features Wish List”

Who is online

Users browsing this forum: No registered users and 9 guests