Skip to content

Commit 8efc0ea

Browse files
committed
Only set internal playerID on success
Fixes a bug where failing to start a guest session would wipe the PlayerID from PlayerPrefs, now we only set it on success
1 parent 77bf13f commit 8efc0ea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections;
33
using System.Collections.Generic;
44
using UnityEngine;
@@ -176,8 +176,11 @@ public static void StartGuestSession(Action<LootLockerGuestSessionResponse> onCo
176176
{
177177
CurrentPlatform = "guest";
178178

179-
PlayerPrefs.SetString("LootLockerGuestPlayerID", response.player_identifier);
180-
PlayerPrefs.Save();
179+
if (response.success)
180+
{
181+
PlayerPrefs.SetString("LootLockerGuestPlayerID", response.player_identifier);
182+
PlayerPrefs.Save();
183+
}
181184

182185
onComplete(response);
183186
});

0 commit comments

Comments
 (0)