I am creating a demo for the game same as UNO and in that I am in need for the "Skip and Reverse" functionality. Well, somehow skip functionality is managed by moveCompleted method, but can anyone let me know how can I reverse the turn order using s2 server?
Thank you in Advance
EDIT 1:
I am getting the S2 Server running and now I am unable to send the custom users turn.
Here is my server code
@Override
public void handleMoveRequest(IUser sender, String moveData, HandlingResult result){
try{
JSONObject data = new JSONObject(moveData);
int isSkip = data.getInt("skipTurn");
printf("MARINE : handleMoveRequest isSkipStatus: " + data.getInt("skipTurn"));
if (isSkip == 1){
if (gameRoom.getJoinedUsers().size() == 2){
skipTurnFor2Users(sender,moveData,result);
}
}
}catch(Exception e){
e.printStackTrace();
}
private void skipTurnFor2Users(IUser sender, String moveData, HandlingResult result){
if(sender.getName().equals(user1_name)){
this.setNextTurn(iMUser1);
gameRoom.setNextTurn(iMUser1);
this.sendMoveUpdate(iMUser1,moveData,sender.getName());
}
....
}
@Override
public boolean sendMoveUpdate(IUser nextTurn, String moveData, String sender){
printf("Send move Update Called " + moveData );
printf("\n Next Turn For User From Send Move Update " + nextTurn.getName() + "\n \n ");
return true;
}
I am getting the logs correctly from server but the values are not passed to client(Unity) Could you help me please