Getting AUTH_ERROR When Connecting Very Quickly After Disconnecting (WinRT)

0 votes
Hello,

I am writing an application for Windows Runtime (Windows Phone 8.1 and Windows 8.1) using the AppWarp SDK and I am having trouble trying to allow players to leave a game and join another one very quickly. Basically I have a leave button which disconnects from AppWarp and then goes back to the main page where they can immediately press join again to connect and find a random game but after connecting, joinining a game, and disconnecting a few times in rapid succession I always get an AUTH_ERROR when I try to connect again and I have to wait for the Recovery Time set in my WarpClient before I can connect again. I am making sure that I receive the onDisconnectDone callback with a success code before I connect again as I have been printing every time I connect and disconnect and similar to this (though the exact number of times I can connect without error varies it is usually around 3-4 disconnects before it errors):

- Connecting...

- Connected Successfully

- Disconnected Successfully

- Connecting...

- Connected Successfully

- Disconnected Successfully

- Connecting...

- AUTH_ERROR

Since I have to wait for the recovery time before I can connect again it seems that for some reason my session is not ending properly when I disconnect and this is causing it to fail when I connect again. Every time I do connect successfully I also call GetRoomWithProperties then GetLiveRoomInfo then SubscribeRoom then JoinRoom and on the same room ID every time in case that helps pinpoint where the problem might be happening.

Also, when I disconnect, the other players in the room are getting an onUserLeftRoom notification as they should except the last time disconnect before the AUTH_ERROR occurs they get onUserPaused instead for some reason even though I am calling disconnect.

Lastly, the reason code I receive in the onConnectDone callback for the AUTH_ERROR is always Waiting for Paused User.
asked Dec 30, 2014 in AppWarp by feraask (45 points)
edited Dec 30, 2014 by feraask
Hi Feraask,
We have updated our WinRT SDK. In newer version we have solved this bug. You can get the new version here https://github.com/shephertz/AppWarpWinRT/tree/master/v_1.10.1

1 Answer

0 votes
Hi Feraask,

For switching across rooms, you don't need to end the seesion everytime you wish to leave  a room and join another one.So don't disconnect each time you wish to leave a room.Just use the LeaveRoom API and then the JoinRoom API for joining a new room.

At our side the connect and disconnect APIs when called simultaneously are working fine.There must be some minute problem with your code.Ideally you should not be getting the AUTH_ERROR.

 

Thanks

Kanika Mittal

AppWarp Team
answered Dec 30, 2014 by kanika mittal (50 points)
Okay so I have replaced all the async and await calls in my code with .Wait() similar to how the sample you provided does and I even removed the async from the Connect and Disconnect button click methods and I am still having the same connect disconnect issue as before. If I just keep connecting and disconnecting repeatedly in succession I still get the AUTH_ERROR waiting for paused user. Here is the new version of my code:
https://bitbucket.org/feraask/appwarptest_winrt/get/b55b1a8df6f3.zip

I have also tested this in the sample you have provided and I have the same issue. All I did was add WarpClient.setRecoveryAllowance(60) in the constructor for the MainPage and commented out these lines in the onConnectDone AUTH_ERROR callback because they would cause exceptions:

int sessionID = (int)DBManager.getDBData("SessionID");
Debug.WriteLine("Auth Error for paused user " + sessionID);
WarpClient.GetInstance().RecoverConnectionWithSessioId(sessionID, "rahul");

and the same issue still happens, here is a screenshot:
https://bitbucket.org/feraask/appwarptest_winrt/downloads/AppWarpWinRT%20Connection%20Error%20-%20ShepHertz%20Sample.png

Am I doing something wrong?
Is there any update on a possible fix for this issue?
Hi Feraask,

We are currently working on the issue and will get back to you as soon as it gets fixed up.

Thanks
Do you have any progress updates on how the fix for this issue is coming along?
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
...