Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Login is failing after Unity update #73

Closed
loicteixeira opened this issue May 29, 2017 · 7 comments
Closed

Login is failing after Unity update #73

loicteixeira opened this issue May 29, 2017 · 7 comments
Labels

Comments

@loicteixeira
Copy link
Owner

loicteixeira commented May 29, 2017

Trying to log via the UI will display Wrong username and/or token. (see video).

Unity v2017.1.0b5, GJAPI v2.1.2.

@loicteixeira
Copy link
Owner Author

loicteixeira commented May 29, 2017

Technically the window will show the Wrong username and/or token. message, regardless of the error.

One way to learn a bit more about the underlying issue, would be to replace this with:

if (response.success)
{
	Manager.Instance.CurrentUser = this;
	Get();
}
else
{
	Debug.Log(response.json);
}

Edit: Actually, upon closer inspection, if the call isn't successful, it should already print the message to the console so the error might not be on the server but somewhere else in the code.

@TheFossett
Copy link

There is another problem where sometimes you are able to upload a guest score to the first leaderboard you made but it doesn't work 100% of the time.
This problem could still tie in with the current problem not to sure :/

Hope this helps :)
Spencer Fossett

@DanielJMus
Copy link
Contributor

Hey lads, I just fixed this.

I noticed that the Debug.LogError for the www.error was a blank message, upon reading the documentation for Www.error I noticed that they pointed this out.

In Response.cs at line 83, simply change:

if (www.error != null)

at the top of the Response function to:

if (www.error != null && !string.IsNullOrEmpty(www.error))

Hope this helps out, I haven't used Github before so I'm not too sure how to use it, so hopefully this comment will help others out and get passed on to be fixed in the source code.

@loicteixeira
Copy link
Owner Author

Hi @DanielJMus, thanks for your help and detailed explanation.

If you're interested in learning more about Git, GitHub and open source contribution, feel free to follow this guide to submit a fix (you can skip Submit a feature proposal and stop after Submit a pull request (PR)). Basically you make a copy of this repository under your own account (so you have write rights), make a fix and then request me to pull your fix into my repository.

No pressure though, I'm happy to do it myself and include this in the next patch.

@DanielJMus
Copy link
Contributor

Thanks @loicteixeira, I created a pull request, and thank you for the guide!

@mgeorgedeveloper
Copy link

if (!string.IsNullOrEmpty(www.error)) will work OK. No need for the extra null check before string.IsNullOrEmpty.

@loicteixeira
Copy link
Owner Author

loicteixeira commented Jul 16, 2017

Thanks @DanielJMus for the contribution (I'll merge it next week) and thanks @mgeorgedeveloper for the very pertinent suggestion (I'll update the code accordingly)!

Edit: PR #74

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants