question

Ozden79 avatar image
Ozden79 asked

LoginWithPlayFab always returns timeout or null (http response has empty string)

Hi There,

I'm using the Cocos2D-x sdk on iOS and whenever I make a "LoginWithPlayFab" request, I get the response as timeout (httprequest response is always an empty string). In the dashboard, I can clearly see that my request has been processed and let's say the response is "AccountNotFound" but this result is not delivered to the client.

My implementation is pretty new and I have tried "RegisterPlayFabUser" before this issue which seems to be working pretty well.

Any help would be appreciated.

Thanks...

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image
1807605288 answered

If you are using our provided example project, you have to provide a testTitleData.json file so the title knows how to connect to PlayFab.

https://github.com/PlayFab/Cocos2d-xSDK#4-testtitledatajson-file-required-for-example-unit-test-project

If you're using our Getting Started Guide:

https://api.playfab.com/docs/getting-started/cocos2d-x-getting-started-guide

You may not be correctly setting your TitleId, which is again, the key piece of information we need so the title knows how to connect to PlayFab.

Before calling any APIs, set your titleID:
PlayFab::PlayFabSettings::titleId ="{Title id you created in game manager}";

For me, this looks like this:
PlayFab::PlayFabSettings::titleId ="144";

Without a titleID, the url that the SDK uses will be invalid. It seems that currently, our Cocos SDK will happily try to connect to some invalid URL and just time out waiting for it to respond.

Cocos not providing a good warning against this is our fault.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Can you provide the code snippet showing the request? The calls are made the same way at the bottom level, so if one is working, the other should be, technically.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ozden79 avatar image Ozden79 commented ·

//Login the User

LoginWithPlayFabRequest MyRequest;

MyRequest.Username = MyUserName;

MyRequest.Password = MyPassword;

PlayFabClientAPI::LoginWithPlayFab(MyRequest, CC_CALLBACK_2(MenuScene::OnLoginUserResult,this),CC_CALLBACK_2(MenuScene::OnLoginUserError, this));

It's pretty simple as you see. FYI, I checked the response on "PlayFabRequestHandler::DecodeRequest" and it's empty at there in the "request" object, so I believe your server doesn't send any response to the client.

0 Likes 0 ·
brendan avatar image brendan Ozden79 commented ·

No, the server is definitely responding - we're seeing it in all our tests. If you believe you're not getting a response, can you get a Wireshark capture (https://wiki.wireshark.org/SSL#SSL_dissection_in_Wireshark)?

0 Likes 0 ·
Ozden79 avatar image Ozden79 commented ·

I've attached the HTTP response header into this post as a file, sorry that it's not well formatted because I got it directly from Xcode debugger. It's something like this :

HTTP/1.1 400 bad request Access control allow credentials : true Content Type: application/json charset=utf-8 Access control allow methods : GET, POST Access control allow origin : * Date Sun 24 Sep 2017 17:05:11 GMT Access Control Allow headers : Content Type, Content Encoding, X, Authentication X,Authorization X,PlayFabSDK, X,ReportErrorAsSuccess, X SecretKey Content-Encoding:deflate

0 Likes 0 ·
playfaberror.txt (7.2 KiB)
brendan avatar image brendan Ozden79 commented ·

Thanks, but the body of that message is missing from your test - it would have been after the "Connection: keep-alive", and contained the error message detailing the problem with the request. Can you please try using Wireshark (the link above), so that you get a full capture containing the request as it was sent, along with the response?

0 Likes 0 ·
Ozden79 avatar image Ozden79 commented ·

Unfortunately, the wireshark option is beyond my knowledge, I've spent some time but couldn't set it up. One last thing I would like to show you is that even your example project gives the exact same error so I believe it's beyond on what I'm doing and something related with your SDK at least if not about the responding servers.

If there is an option to check it on your side, let me know or otherwise sadly I'll need to move onto another solution.

0 Likes 0 ·
brendan avatar image brendan Ozden79 commented ·

Sorry, but I've no way to determine what that screen shot means, relative to the responses from our service. If you can simply provide the actual calls you're making to the service, with the details of the parameters you're passing in, so that we can reproduce the errors locally, that would give us the ability to look into this.

0 Likes 0 ·
Ozden79 avatar image Ozden79 commented ·

That screenshot is taken from your own Cocos2D-X SDK example. Just download your own Cocos2D-X SDK, open the example iOS project on XCode and run it. Your example gives the error you see in the screenshot which is inline with the error I get. I believe you can use it determine what may be wrong.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.