How to make current joined room Hidden (Client Side)?

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

Moderators: Lapo, Bax

UlterR
Posts: 20
Joined: 15 Jan 2017, 18:05

How to make current joined room Hidden (Client Side)?

Postby UlterR » 23 Mar 2017, 14:02

So I want to make the room current user is joining hidden from client side. How could I do that?

Thanks in advance
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make current joined room Hidden (Client Side)?

Postby Lapo » 23 Mar 2017, 14:26

Hi,
it depends how hidden it should be :)
If you need to of hide it from the client UI then it's just a matter of simple client logic.

Should it be more hidden than that? If so can you clarify how it should work?
Lapo
--
gotoAndPlay()
...addicted to flash games
UlterR
Posts: 20
Joined: 15 Jan 2017, 18:05

Re: How to make current joined room Hidden (Client Side)?

Postby UlterR » 23 Mar 2017, 17:34

well what i'm confused is which command i should use in client (C# unity) :(
I already saved the room object but even if I change that object's setting, it doesn't change the actual room inside the server

hidden as in ishidden = true;
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make current joined room Hidden (Client Side)?

Postby Lapo » 24 Mar 2017, 10:30

I am confused too.
I am not sure what you're trying to accomplish here...

You said you want to hide a Room... in other words you don't want the User to see it in the list of available Rooms, is this correct?
If so, the simplest way to do it is simply not showing it :)

If you're looking into something more advanced please clarify...

I already saved the room object but even if I change that object's setting, it doesn't change the actual room inside the server

I am not sure what you mean by this?
What settings are you changing exactly on the server side?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
UlterR
Posts: 20
Joined: 15 Jan 2017, 18:05

Re: How to make current joined room Hidden (Client Side)?

Postby UlterR » 24 Mar 2017, 11:41

Well the goal is to hide rooms that already started the game from appearing, when a client retrieved room list

So what i'm thinking is to change the ishidden variable owned by that room to true, but i don't know how to do that

i read in the documentation of room architecture, there's room variable ishidden
name: the unique name of the variable
isPrivate: if set, the R.V. can only be modified or deleted exclusively by its creator (optional, default is false)
isPersistent: by default a user created R.V. is removed from the Room when the user leaves it. If this flag is turned on, the R.V. will persist until the user logs out or disconnects (optional, default is false)
isGlobal: by default R.V. updates are sent to all users in the Room. A global R.V. is also updated outside of the Room to all users in the same Room Group (optional, default is false)
isHidden: if set the R.V. will be available on the serve- side only and never transmitted on the client side (optional, default is false)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make current joined room Hidden (Client Side)?

Postby Lapo » 24 Mar 2017, 15:27

No, that's not the way.
The "isHidden" flag can be used to mark some Rooms as hidden when they are created, but this is presumed not to change.

In your case you want this situation to be dynamic, so you should implement it differently.
A simple way would be to simply check the number of players and if the Room is full you hide it. If the Room allows the game to start when the it's not full then you could use a global Room Variable called "gameStarted" or similar... and set it to true when the game starts.

Users will receive updates about the variable changes and you will be able to hide/unhide the Room.

Makes sense?
Lapo

--

gotoAndPlay()

...addicted to flash games
UlterR
Posts: 20
Joined: 15 Jan 2017, 18:05

Re: How to make current joined room Hidden (Client Side)?

Postby UlterR » 24 Mar 2017, 17:53

Oh ok thanks a lot for explaining :)
So the global variable (i.e. "GameStarted") is added when the room is created and will be accessed later?

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 49 guests