Hi all, new here.
Following the steps, I've created a custom class m80User.
I have been using the AuthenticatePlatform call to Auto create a user account and associate it with a combu user. Which works fine. Next step was to add my custom user class <m80User> in this case.
On success, I try to cast CombuManager.localUser as M80User but it remains Null. Am I missing something here? I am sure after I get more familiar with the code base, it will become more apparent but the custom User example I followed is for standard account creation flow. I need to do the same for AuthenticatePlatform flow.
CombuManager.localUser.AuthenticatePlatform<M80User>(platformName, platformID, (bool success, string error) => { if (success) { Debug.Log("Login success: ID " + CombuManager.localUser.id); M80User user = CombuManager.localUser as M80User; RequestInventoryData(); } else { Debug.Log("Login failed: " + error); }
Β
You're right, please edit the method AuthenticatePlatform<T> in the Unity script User.cs inside the callback after the check onΒ success (it should be lines 1021-1022) and change it to this:
_authenticated = true; T user = new T (); user.FromJson(result["message"].ToString()); CombuManager.instance.SetLocalUser(user);
This change will be applied to the next incoming update as well, thank you for the report.
FRANCESCO CROCETTI @ SKARED CREATIONS
Correct me if I am wrong but I think it should be like this, otherwise Authenticated will always be false.
T user = new T(); user._authenticated = true; user.FromJson(result["message"].ToString()); CombuManager.instance.SetLocalUser(user);
@sgeorged yes indeed πΒ
FRANCESCO CROCETTI @ SKARED CREATIONS