Why is CheckUserOnJoin missing from RoomOptions in C++?
Options
in Native
I am trying to follow the tutorials for the "Turnbased & Asynchronous Games" & "Room Persistence", but it seems like all documentation is in reference to your Unity SDK (and C# implementation of RoomOptions), and the C++ version of your classes do not have the same functionality.
class RoomOptions in RoomOptions.h in Windows SDK v4.1.4 (or 4.1.3.4)
does not work the same as
class RoomOptions in LoadBalancingPeer.cs in Unity3D-SDK_v4.1.1.2
Are the C++ classes/libraries out of date?
I am using Unreal Engine, and trying to get Room Persistence to work. I have looked into all of the associated C++ libraries included on your SDK page:
- Windows SDK v4.1.4, v4.1.3.4
- iOS SDK v4.1.4.0, v4.1.3.4
- Android NDK SDK v4.1.4.0, v4.1.3.4
class RoomOptions in RoomOptions.h in Windows SDK v4.1.4 (or 4.1.3.4)
does not work the same as
class RoomOptions in LoadBalancingPeer.cs in Unity3D-SDK_v4.1.1.2
Are the C++ classes/libraries out of date?
I am using Unreal Engine, and trying to get Room Persistence to work. I have looked into all of the associated C++ libraries included on your SDK page:
- Windows SDK v4.1.4, v4.1.3.4
- iOS SDK v4.1.4.0, v4.1.3.4
- Android NDK SDK v4.1.4.0, v4.1.3.4
0
Best Answers
-
Hi @EstonianGiant.
Yes, that option does not exist in the RoomOptions.
The C++ Clients always send true for the 'checkUserOnJoin' flag and there is no way to turn this off except for changing and recompiling the LoadBalancing-cpp source code.
This is by design as we don't see any reason to turn off this option.5 -
Hi @EstonianGiant.
setPlayerTtl(-1)
Negative values for the player TTL are not supported and interpreted as value 0.
The value .1 is a special exception in the .NET client, that is interpreted as 'infinite'.
However this special handling of -1 for the player TTL is currently only supported in the .NET client.
Please use INT_MAX instead:setPlayerTtl(INT_MAX)
INT_MAX is also treated as 'infinite' and supported by all clients.5
Answers
-
Hi @EstonianGiant,it seems like all documentation is in reference to your Unity SDK (and C# implementation of RoomOptions)
This is true indeed. Our code examples are in C#. We are aware of this and we would like to change this in the future and offer code examples in multiple programming languages.
By default "CheckUserOnJoin" is enabled (set totrue
) and there is no way to change this currently.
Do we need to set it tofalse
?0 -
What do you mean by default it's enabled? That member variable doesn't exist in RoomOptions.hJohnTube said:Hi @EstonianGiant,
By default "CheckUserOnJoin" is enabled (set totrue
) and there is no way to change this currently.
Do we need to set it tofalse
?
These are the only member variables.
private:
bool mIsVisible;
bool mIsOpen;
nByte mMaxPlayers;
Common::Hashtable mCustomRoomProperties;
Common::JVector mPropsListedInLobby;
Common::JString mLobbyName;
nByte mLobbyType;
int mPlayerTtl;
int mEmptyRoomTtl;
Do you mean on the server side?0 -
Hi @EstonianGiant.
Yes, that option does not exist in the RoomOptions.
The C++ Clients always send true for the 'checkUserOnJoin' flag and there is no way to turn this off except for changing and recompiling the LoadBalancing-cpp source code.
This is by design as we don't see any reason to turn off this option.5 -
Thanks for the reply.
I'm trying to setup my room as a "Persistent Room". As per your guide, I'm trying to set the PlayerTtl to "-1". But it doesn't seem to work.
I set the room options as follows:
ExitGames::LoadBalancing::RoomOptions().setMaxPlayers(3).setPlayerTtl(-1).setEmptyRoomTtl(10000)
But when I check the request log for my 'GameCreate' webhook, it shows me:
..."CreateOptions":{"MaxPlayers":3,"LobbyId":null,"LobbyType":0,"CustomProperties":{},"EmptyRoomTTL":10000,"PlayerTTL":0,CheckUserOnJoin":true, ....
Is there something I am missing to make this work in C++?
0 -
Hi @EstonianGiant.
setPlayerTtl(-1)
Negative values for the player TTL are not supported and interpreted as value 0.
The value .1 is a special exception in the .NET client, that is interpreted as 'infinite'.
However this special handling of -1 for the player TTL is currently only supported in the .NET client.
Please use INT_MAX instead:setPlayerTtl(INT_MAX)
INT_MAX is also treated as 'infinite' and supported by all clients.5 -
Thanks!0