Skip to content

Commit b0289a0

Browse files
Mikkel Sørensenkristijan-ujevic
authored andcommitted
Make it impossible to set the Player name to their identifier
1 parent 1bb477d commit b0289a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using LootLocker.LootLockerEnums;
88
using static LootLocker.LootLockerConfig;
99
using System.Linq;
10+
using static LootLocker.Requests.CurrentPlatform;
1011
#if UNITY_EDITOR
1112
using UnityEditor;
1213
#endif
@@ -1415,6 +1416,13 @@ public static void SetPlayerName(string name, Action<PlayerNameResponse> onCompl
14151416
return;
14161417
}
14171418

1419+
if (name.Contains(PlayerPrefs.GetString("LootLockerGuestPlayerID"), StringComparison.OrdinalIgnoreCase) && CurrentPlatform.Get() == Platforms.Guest)
1420+
{
1421+
onComplete?.Invoke(LootLockerResponseFactory.Error<PlayerNameResponse>(": Setting the Player name to the Identifier is not allowed"));
1422+
return;
1423+
}
1424+
1425+
14181426
PlayerNameRequest data = new PlayerNameRequest();
14191427
data.name = name;
14201428

0 commit comments

Comments
 (0)