onMoveCompleted in Turnbase Game

0 votes

Hi all

I have a problem about Turnbased game

In demo : RummyServer Card,  I created client by cocos2dx 

when i call sendmove() , In Callback onMoveCompleted(AppWarp::move me)

sometimes there are respones ,sometimes there are none .

Example: 

AppWarp::Client::getInstance()->sendMove("{\"top\":\"%d\",\"cards\":[1,2,2,3,3]");

 
thanks and best regards
asked Jun 3, 2014 in AppWarpS2 by Linh Luu (25 points)

1 Answer

0 votes
The response from the server for sendMove is onSendMoveDone in the turn based room listener. The notification onMoveCompleted is only fired if the sendMove is successful. You need to ensure that onSendMoveDone contains a success result code. Only then you can expect onMoveCompleted event.

sendMove will fail if its not the user's turn or the game is in stopped state.
answered Jun 3, 2014 by dhruvc (1,099 points)
thanks for reply:D
but i checked   onSendMoveDone() is not respones :(  sometime  crash after sendmove()
Have you used setTurnBasedRoomRequestListener?
sorry to bother :(
onSendMoveDone contains a result code : 121
may be failed :(
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
...