How to disable automatic send list of Users to Client?

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

Moderators: Lapo, Bax

MrHaka
Posts: 4
Joined: 10 Apr 2017, 04:30

How to disable automatic send list of Users to Client?

Postby MrHaka » 10 Apr 2017, 07:53

Hi, I see that Smartfox Server sends list of Users to client automatically as default config.
If I have a room that contains 2k ~ 3k users same time (Eg: room lobby) and when a new user join room then server api will sends to that user all info about room as room name, room variables... and list of users (all) as binary data. So too much data has been sent to client that I don't need.
How to do disable it?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to disable automatic send list of Users to Client?

Postby Lapo » 10 Apr 2017, 09:36

If you don't need a list of users you probably don't need a Room either... how do users interact with each other?

Alternatively you may need an MMORoom which handles the user list based on the AoI (area of interest)
http://docs2x.smartfoxserver.com/Advanc ... /mmo-rooms

Let us know
Lapo
--
gotoAndPlay()
...addicted to flash games
MrHaka
Posts: 4
Joined: 10 Apr 2017, 04:30

Re: How to disable automatic send list of Users to Client?

Postby MrHaka » 13 Apr 2017, 04:16

Thanks!
I use room to general manager as a event room for user register. Each user only work with the server and has no interaction with other user, and the server can send info to all user in the Room. So i don't want the server send list of user, too much unnecessary data if the room contains a large users.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to disable automatic send list of Users to Client?

Postby Lapo » 13 Apr 2017, 07:22

If users don't interact with each others you can definitely avoid Rooms altogether.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: How to disable automatic send list of Users to Client?

Postby meanvel » 13 Apr 2017, 08:33

MrHaka wrote:Thanks!
I use room to general manager as a event room for user register. Each user only work with the server and has no interaction with other user, and the server can send info to all user in the Room. So i don't want the server send list of user, too much unnecessary data if the room contains a large users.


You can use a zone extension for all that... For example... Below, I get all user data using a Zone extension after login... No rooms required.

Code: Select all

    private function onLogin(e:SFSEvent):void {
        trace("Logged in");
       
        //Get user data - Goes to Zone extension!
        var sfsDataObj:ISFSObject = SFSObject.newInstance();
        sfsDataObj.putInt("dbId", Game.Main.userId);
        sfs.send(new ExtensionRequest(GET_MY_DATA, sfsDataObj));
   }
   
   
   
   //Handle data from Zone extension...
       private function onExtensionResponse(e:SFSEvent):void {
        var Response:String = e.params.cmd;

        var rawData:ISFSObject = e.params.params as ISFSObject;
        var Data:ISFSObject = rawData.getSFSArray("Data").getSFSObject(0);
       
        //Etc...
        }


You don't need to have a lobby either... Just send a extension request to your Zone to find your player a suitable game or mmo room and join them directly to it. People want to play immediately and don't want to hassle with lobbies.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 113 guests