AppWarp connection issue while navigating to new page in Windows Phone 8 App

0 votes
Hi,

I am developing a multiplayer game for WIndows Phone 8 platform. I am using xaml/C#. Using AppWarp APIs, I am able to create a new room and join an existing room. The problem is that once the user is joined a room, the app navigate to a new page where the actual gameplay will start. But once the navigation happens, the AppWarp connection gets disconnected and the user drops out of the room. I read a similar issue in the forum but that was for Windows 8 and the new WinRT update resolves that problem. But the same is not avaialbe for WIndows Phone 8 SDK.
asked Jul 13, 2014 in AppWarp by chinmay.upadhyay (16 points)
How are you detecting that connection is getting disconnecting? Are you getting connection error in onConnectDone?

Also do remember when you are setting listeners and accessing them in a page, you will need to remove listeners and add again in the new page else your new page will not get callbacks from appwarp.
When I am navigating to new page, in WarpClient.GetInstance() object, I am getting ConnectionState = 0 which means its disconnected.
And I am using a class object to add the listeners and that object is declared globally, so it is available everywhere inside the app.
Are you getting onConnectDone too? What result are you getting in onConnectDone? Can you share your code snippet with us?
Yeah I am getting OnConnectionDone callback with Success result code. Below is the flow of the API calls that I have implemented in my game.
1. Connect(username)
2. OnConnectionDone - Got Success result code
3. CreateRoom
4. onCreateRoomDone callback - Received Success result code
5. JoinRoom
6. onJoinRoomDone callback - Success
7. SubscribeRoom
8. onSubscribeRoomDone callback - Success
9. Move to new UI page once 2 player has joined the room
10. UpdateRoomProperties - No callback. On debugging the code, I found out that while UpdateRoomProperties was being called, WarpClient.GetInstace() object's ConnectionState value was 0 (Disconnected).

Also, if I call the UpdateRoomProperties method without navigating to new page, it works perfectly.
Forgot to mention that I have added below listeners:
1. ConnectionRequestListener
2. RoomRequestListener
3. ZoneRequestListener
4. NotifyListener
5. ChatRequestListener

1 Answer

+1 vote
 
Best answer

Hey,

We have tried this scenerio on our side and every thing seems to work perfectly. Here I am attaching a sample that we have build to test it out. It uses multiple pages and does not get disconnected on changing pages.

https://www.dropbox.com/s/n1ohg2fnowcda6k/AppWarp_WP7_TestSDK.zip

1. Please make sure you are using the latest SDK.
2. Also try calling some other API other than UpdateRoomProperties to check if the problem is only with UpdateRoomProperties or Warpclient.
3. Also try waiting for few seconds on next page and see if you are again getting onConnectDone with connection error.

It would be more easy for us to help you if you can share your code snippet with us.

answered Jul 15, 2014 by Suyash Mohan (900 points)
selected Jul 15, 2014 by chinmay.upadhyay
Thanks for your quick reply. I found out the bug in my code. I was calling disconnect method in OnNavigatedFrom event because of that the connection was getting disconnected from server.
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
...