SmartFoxServer 2x RoomVariables IsGlobal

Hi guys,

i’m using SmartFoxServer 2x for my multiplayer game. I’ve created a custom Lobby, where users can create their own room and with a selected map (scene). So, that other users can join the map, they need the scene name.

I want to use RoomVariables to store the scene name in there, but i have the problem that there is now property or method, to set the room variable as global.

RoomVariable sceneName = new SFSRoomVariable("scene", _selectedMap);
        sceneName.IsPrivate = false;
        sceneName.IsPersistent = false;


        settings.Variables.Add(sceneName);

The properties IsPrivate and IsPersistent are available.

On this site: SmartFoxServer 2X documentation: server-variables are some examples, how to use RoomVariables. In the server-side section, they set the RoomVar as global. Is it only available on server-side?

What can i do, so set the RoomVariable as Global?

Thanks

Room variables are basically sent/shared data between client and server. If it’s changed on server or client side they will automatically update behind the scenes.
I wouldn’t suggest this approach for you problem though, as you need that data only for load time and storing it there forever all the times is not needed.
I suggest sending that string as any other sfs object packet.

I know smartfox uses room variables quite a lot for their examples, even for movement synchronization, but it’s just an example and mostly should not be used.