client got global Room information but not yet joining room.

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

Moderators: Lapo, Bax

crimsonfantasy
Posts: 13
Joined: 21 Feb 2018, 03:02

client got global Room information but not yet joining room.

Postby crimsonfantasy » 23 Mar 2018, 06:38

Hi,
Client get global Room information but not yet joining room.
What is global room information? Such as game type, a small description that wrote by host of room.
Player can see them at lobby.
I current use a map, key is room name, value is a complex SFSObject, and put the map in the Room variable of Room.
is there a better and elegant way to put these data?
Thanks.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client got global Room information but not yet joining room.

Postby Lapo » 23 Mar 2018, 09:00

Hi,
I am not sure what you mean by "global room information".

When you login into a Zone you get the list of Rooms in the default Room Group (there can be many groups, if you create them, by default there's only one).

The Room list describes each available Room with a set of properties such as the Room "type", the size of the Room, etc...
If you want to attach a description or other custom properties you can do it by using RoomVariables when you create the Rooms.

Is this what you where asking?
In any case I would highly recommend to read the documentation. A good starting point for learning about Rooms is here:
http://docs2x.smartfoxserver.com/Develo ... chitecture

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
crimsonfantasy
Posts: 13
Joined: 21 Feb 2018, 03:02

Re: client got global Room information but not yet joining room.

Postby crimsonfantasy » 23 Mar 2018, 09:54

I discovered that client API can not got Room Variable from target room A if client API did not join Room A.
I mean that is it possible got Room Variable if client not join any room.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client got global Room information but not yet joining room.

Postby Lapo » 23 Mar 2018, 14:23

Well, it depends on the Room Variables.
You can create global Room Variables (where global is an attribute of the variable that you can activate) and it will be available without joining the Room.

The global flag is available on Room Variables only from server side.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 22 guests