Hey @Billy
Could you please show me where are you downloading the script? Might be an deprecated library, but i want to be sure anyway.
Carlos Z
Hey @Billy
Could you please show me where are you downloading the script? Might be an deprecated library, but i want to be sure anyway.
Carlos Z
Sure @thecil it was from https://ivanontech-academy.s3.eu-north-1.amazonaws.com/Enjin-course/EnjinRefactoredSDK-academy.unitypackage
Thanks
Did you manage to figure this one out? I have the same problem, thereās no documentation for Unity SDK API. I have no idea which functions there are outside of the ones @filip used in the course and so thereās no way in me being able to know how to authenticate to a specific User in C# Unity after logging in via email and password.
sort of. As per Improvement Suggestions - Discussion, I ended up downloading and using the more current SDK from the Asset Store. Then I figured out they seem to have done away with āin-Enjinā authentication in the SDK so you have to implement it yourself in your own code or some other server you run somewhere with some kind of user/email/password database. For the purposes of this course, you can just fake it and assume any old password is acceptable and then just grab the userās details from Enjin without ālogging them inā. My āloginā code for the newer SDK:
public static AccountManager instance;
// Start is called before the first frame update
void Start()
{
if (AccountManager.instance == null) {
AccountManager.instance = this;
}
StartPlatform(PLATFORM_URL, APP_ID, APP_SECRET); // New SDK init method
LoginAdmin();
}
// Update is called once per frame
void Update()
{
}
async public void LoginAdmin() {
adminIdentity = GetIdentity(9535); // My game Admin id
Debug.Log(adminIdentity.id);
}
async public void Login() {
string email = emailInput.GetComponent<InputField>().text;
string password = passwordInput.GetComponent<InputField>().text;
User user = GetUser(email); //Assume password ok and just get user details from Enjin SDK
Debug.Log(user.identities[0]);
userIdentity = user.identities[0];
Debug.Log(userIdentity.id);
SceneManager.LoadScene("MainScene");
}
HTH, cheers!
Awesome, Iāll get the new version of the SDK and authenticate this way. Thanks for the response!
I am having this error, and couldnāt find why
Did you log into the web site first before using the graphiql playground?
Yes of course i did sir
Hmm the error suggested otherwise. Did you do it in the same browser session, not incognito or anything like that? Same behaviour in another browser?
I could do it via the playground, but i think my problems are not over yet. I will follow your solution for my upcoming problems, hope theyāll still work @Billy