Connection unrecoverable after receiving bad request from the response listeners

0 votes

Hi, I am developing my multiplayer game using appwarp html. The game consist of lobby that show the user on the available room and the total user online. I've using the getOnlineUsers() every 5 second interval to recevie the total user connected to the appwarp server. The problem come when the response listener return with a Bad Reqeust status. After receiving this bad reqeust status, the user will not be able to perform any API calls from appwarp, even the disconnect function, where the listener will always return with Bad Request.

Thanks.

asked Jan 19, 2017 in Html 5 by tingzheng94 (10 points)

1 Answer

0 votes

Hi,

Greetings from ShepHertz!!!!

You will be getting Bad Request in getOnlineUsers() API, because of User is disconnect from the server. So you need to connect again. In this case if you alse call disConnect APi you will get Bad Request because User is disconnected earlier.

If you are getting bad request in response you can check connection State if user is disconnected you need to call the connect API.

Let me know if it helps.

Thanks

Vishnu Garg

 

answered Jan 19, 2017 by Vishnu Garg (674 points)
Hi,
Is there any API provided by appwarp to check for connection state with appwarp? Because i cannot find any API related to the check connection in the API references.
Thanks
Yes, You can use getConnectionState API for the same.
I've tried to connect with appwarp again using the connect(username) API, but the listener still returninig the Bad Reqeust state
Hi,
Are you still facing this issue? If yes, could you please share a sample html in which we can reproduce this issue? It will help us to debug the problem.
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
...