Skip to content

Commit fd5b1dd

Browse files
chore: Adding quick comment explaining player ID (#816)
* Update ConnectionMethod.cs * Update Assets/Scripts/ConnectionManagement/ConnectionMethod.cs
1 parent 5b40458 commit fd5b1dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Assets/Scripts/ConnectionManagement/ConnectionMethod.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ protected void SetConnectionPayload(string playerId, string playerName)
6666
m_ConnectionManager.NetworkManager.NetworkConfig.ConnectionData = payloadBytes;
6767
}
6868

69+
/// Using authentication, this makes sure your session is associated with your account and not your device. This means you could reconnect
70+
/// from a different device for example. A playerId is also a bit more permanent than player prefs. In a browser for example,
71+
/// player prefs can be cleared as easily as cookies.
72+
/// The forked flow here is for debug purposes and to make UGS optional in Boss Room. This way you can study the sample without
73+
/// setting up a UGS account. It's recommended to investigate your own initialization and IsSigned flows to see if you need
74+
/// those checks on your own and react accordingly. We offer here the option for offline access for debug purposes, but in your own game you
75+
/// might want to show an error popup and ask your player to connect to the internet.
6976
protected string GetPlayerId()
7077
{
7178
if (Services.Core.UnityServices.State != ServicesInitializationState.Initialized)

0 commit comments

Comments
 (0)