Received AUTH_ERROR after trying to recover connection.

0 votes

Hi,

I am using Windows Phone SDK and here is a description of a problem I see:

I have online gameplay ongoing and connection resilency feature implemented. One of the devices receive callback onConnectDone in ConnectionRequestListener with a result being CONNECTION_ERROR_RECOVERABLE. So code holds on the gameplay and tries to recover. However, instead of recovering and receiving call to onConnectDone in the same listener with result SUCCESS, code receives result AUTH_ERROR.

How this can be?

According to the wiki this result means "The session id sent in the request was incorrect. This can happen if the client connects without initializing with the correct keys." or "indicates incorrect api and secret key pair". But the actual game was already connected to the server, so how come?

Any hints?

asked Jul 2, 2014 in AppWarp by kaszarek (21 points)

1 Answer

0 votes
Hey,

AUTH_ERROR also occurs whenever you have called recoverConnection() method, but the connection could not be recovered within the time you have specified through setRecoveryAllowance() method. This could happen if you have called recoverConnection() method after the recovery allowance time or the recover connection request reached the appwarp server after recovery allowance time has elapsed.

Whenever there is a break in connection, the AppWarp server retains that connection for the time specified through setRecoveryAllowance() method. If server receives a recover connection request within this time, the connection is recovered successfully but if the recover connection reaches server after the recovery allowance time has elapsed, the server treats this as an auth error as server has released that user and does not know who that user is.

So, please make sure you are calling recoverConnection() within recovery Allowance time.

Note : The maximum recovery allowance time that can be set is 2 minutes.
answered Jul 2, 2014 by Suyash Mohan (900 points)
Hello, I am having the exact same issue developing on Windows Runtime (Windows 8.1 and Windows Phone 8.1) and I am calling RecoverConnection() right when I receive the CONNECTION_ERROR_RECOVERABLE call back and my recovery allowance time is set to 120 seconds. The error message I am receiving is of type AUTH_ERROR.

UPDATE; I have tried using the RecoverConnectionWithSessioId method and this works for recovery so it definitely does seem like there is a bug in the RecoverConnection() method.

Side note: The method RecoverConnectionWithSessioId is mispelld in the SDK (it is missing the 'n' in "Session") and should probably be updated.
Hi,

Can you please download the latest SDK and then try running your game again. The latest version will also give you a ReasonCode in case of AUTH_ERROR. This will help us to understand why you are getting AUTH_ERROR.

Thanks for pointing the spelling mistake. We will correct it :)

Thanks
Alright so I have been doing a lot of testing and I've found I get an AUTH_ERROR if I try to recover right away after losing connection, but if I put in a wait for 1 second then recovery works so it seems like some small bug in the WinRT SDK.

I actually am having a lot of issues with the WinRT SDK that I've posted about on here and I haven't gotten any responses for a while so I would just like to know how the progress is going on these (especially the slow connection issues as this is pretty critical that AppWarp works even when the connection is slow but solid):

http://forum.shephertz.com/?qa=4979/getting-auth_error-connecting-quickly-after-disconnecting

http://forum.shephertz.com/?qa=5141/appwarp-winrt-slow-connection-issues

Thanks.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...