Problem with PlayFab (SOLVED)

in browser that URL takes HTTP ERROR 404

But all works fine if we do html5 build.

Ok, so the server is reachable. The 404 is probably caused by the browser doing a GET while that url expects a POST.

And it works when doing an HTML5 build? Strange…

yep, in hamster the same problem. Works in browser but not works in dmengine (windows bundle too).

These Error I’ll get very often, thats why I implemented the “RETRY” Button (instead of PLAY) in my game. Sometimes it works, sometimes not. after 1 or 2 more tries it works. Its like a timeout.

There are definitely problems with playfab and defold.

Very often there is no login possible. Sometimes after login and updating highscores the connection is also lost.

debug output while trying to login:

DEBUG:SCRIPT: PF loginname = 688194289677-1506715084
INFO:DLIB: SSDP: Started on address 192.168.178.20
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 637434176366-1506715087
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 628745872218-1506715090
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 695232198612-1506715093
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 643152389569-1506715099
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 673495369544-1506715108
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 675329747257-1506715119
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 668838742725-1506715121
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)
DEBUG:SCRIPT: MENU: LMB
DEBUG:SCRIPT: PF loginname = 739346275192-1506715123
ERROR:SCRIPT: HTTP request to 'https://XXXX.playfabapi.com//Client/LoginWithCustomID' failed (http result: -1  socket result: -5)

-5 is CONNRESET (connection reset). This can happen for several reasons:

  • the peer deliberately reset the connection
  • the peer closed the connection while he still had unread data pending
  • you had sent data to a connection that had already been closed by the peer
  • you had pending write data and the TCP retries have timed out
  • TCP keepalive detected a lost connection.

So the question is if this is something that happens only for you on a single network or if it is a general problem. I’ve tried my PlatFab example project and haven’t seen any issues with Defold and the PlayFab SDK.

Hm…

Wondering.

Thats the custom-login who has called:

local function Pf_CustomLogin(id)
	if not id then
    math.randomseed(os.clock() + os.time() + math.random(1000))
    local temp = ""
    for c=1, 12 do
      temp = temp .. math.random(9)
    end
    temp = temp .. "-"..  tostring(os.time())
		id = temp
	end
  pprint("PF loginname = " .. id)
	local PfRequest = {
        TitleId = PlayFabClientApi.settings.titleId,
        CustomId = id,
        CreateAccount = true
    }
    -- Call API
    PlayFabClientApi.LoginWithCustomID(PfRequest, Pf_LoginSuccess, Pf_FailureLogin)
end

If I try the game online (HTML5) it seems to work fine.

In editor or win-bundle (local) there are connection problems. Strange. There is no firewall etc at all (deactivated). Other games and services dont have any problems.

I have the same problem in normal build as well.

yep.

Have you guys reached out to PlayFab and asked on their support forums? -5 indicates RESULT_CONNRESET. I wonder if you perhaps could debug this using an https proxy and wireshark or something like that?

1 Like

I sent them an e-mail asking them to check up on these issues.

I’m implementing PlayFab in a project right now so may have more info if I see the issues too.

Thanks for the email, and hi all! For help using PlayFab, I’d recommend using our forums, since that’s what we actively monitor for questions.

For this issue, I’d say the problem is the extra “/” in the URL (making the URL invalid). So the call isn’t actually getting out to us at all, it looks like. @Pkeod: Any idea what would cause that in Defold?

2 Likes

I took a look at the code and the code making the HTTP request looks like this:

Note the above is for Corona, but more or less the same code applies for Defold in PlayFabHttps_Defold.lua which can be found inside the PlayFabClientSdk.zip here https://github.com/PlayFab/LuaSdk/tree/master/Defold. BTW Where is the source code for PlayFabHttps_Defold!?

And it’s called like this:

As you can see there’s one ‘/’ added in PlayFabHttps_LuaSec.lua and one in the beginning of each urlPath passed into the function itself.

I created a post on the PlayFab forum: https://community.playfab.com/questions/16287/issue-with-url-creation-in-the-luasdk.html

This has been resolved in the PlayFab SDK now:

Please give it a try and verify that it works.

hmm, https://github.com/PlayFab/LuaSdk/ Latest commit 8742d94 23 days ago

1 Like

It looks like a small change to fix this if you edit your local copy

1 Like

Ah, they’ve probably not yet released a new version with the fix included. Not sure about their release process but it might be delayed until after x-mas sometime.

Solved in 1.2.162

3 Likes