After some digging I found that:
Objective c:
GS.m line 247 & line 297 -->
Only check "connectUrl" when @".AuthenticatedConnectResponse", so it ignore the Redirect command.
C++:
GS.cpp line 139 -->
Check "connectUrl" for each message, so it re-establishes the connection, and cannot find the server.
Here is the log of C++ SDK:
------------------------------
[GameSparks]: WebSocket callback: {"@class":".RedirectCommand","connectUrl":"wss://preview-live.gamesparks.net/ws/120246XkdgNG"}
[GameSparks]: Received new connection url from gamesparks backend. Establishing new connection now.
[GameSparks]: Create new connection
GameSparks is not available.
easywsclient: connecting: host=preview-live.gamesparks.net port=443 path=/ws/120246XkdgNG
[GameSparks]: WebSocket closed
[GameSparks]: Received websocket error: DNS Lookup failed
[GameSparks]: Got websocket error. Please make sure, that you've setup you credentials.
[GameSparks]: Backing off for one seconds
[GameSparks]: Create new connection
easywsclient: connecting: host=preview-live.gamesparks.net port=443 path=/ws/120246XkdgNG
[GameSparks]: Received websocket error: DNS Lookup failed
[GameSparks]: Got websocket error. Please make sure, that you've setup you credentials.
[GameSparks]: Backing off for one seconds
[GameSparks]: Create new connection
------------------------------
Hi
Thanks for the fixing.
I wanna confirm if the behaviour of Objective-C SDK correct. since it would ignore the redirect command.
I may need to use objective SDK also, so just wanna make sure of it.
Thanks,
Jo
Hi There,
I have similar issue with the lastest version, but the same.
When I call update using cocos2d ui thread, it never call RedirectCommand.
But when new a thread to call the update GS, it always call RedirectCommand every 5~10 min.
What's wrong with it? Any one help me?
Jo Huang
Hi
I tried C++ SDK in cocos2d-x, and found some thing wrong. I'm sure if it's server-side issue or not.
1. Connected and authenticated
2. Wait for maybe 5 to 10 minutes, the console show a "Redirect Command" and point to "preview-live.gamesparks.net", and then the websocket client couldn't found the server, and keeps showing "DNS lookup fail". And the app is stuck in retry-fail loop.
I tested Objective-c SDK, too. It received the same command but seemed ignored it.
Please help.
Thanks,
Jo