Sign In Register

How can we help you today?

Start a new topic

ChallengeTurnTakenMessage being received after each LogChallengeEventRequest

 Hello


I'm receiving ChallengeTurnTakenMessage after each LogChallengeEventRequest I send. They are not actually consuming player turn unless I send this one, particular LogChallengeEventRequest that I have set as "Turn / Attempt Consumers" in my multiplayer challenge settings. I can live with that and write code that will work in that case, but gettings those messages seems counter-intuitive to me. Is that a right behaviour or maybe mistake is somewhere on my side?


Simple example, in case I was not clear enough:

- I have a multiplayer challenge called "testChallenge" that takes "takeTurn" event to consume player turn. Challenge is turn-based obviously.

- I have two events: "takeTurn" and "uselessEvent".

- I'm invoking event "uselessEvent". GS sends me a ChallengeTurnTakenMessage and turn is not consumed. I can still send requests using this player and get more ChallengeTurnTakenMessages.

- I'm invoking event "takeTurn". GS sends me a ChallengeTurnTakenMessage and turn is consumed. I cannot do anything more on this player.




5 people have this question

Sure, I have attached two files with screenshots of my multiplayer challenge settings and test event settings.

I've created 2 new test users on FB page just in case something was wrong with my previous ones. I have no cloud code for any request, response, user messages or global messages. There is also no cloud code for test event or add multiplayer data event (I'm not using this one here, just set it in multiplayer challenge settings to simulate "proper" settings).


Here is what I'm doing in test harness, step by step.

Step 1:
Logging in both users using FacebookConnectRequest only. Both requests got positive response.
Step 2:
Create challenge request:

{
 "@class": ".CreateChallengeRequest",
 "autoStartJoinedChallengeOnMaxPlayers": false,
 "challengeMessage": "",
 "challengeShortCode": "testChallenge",
 "endTime": "2016-03-15T14:15Z",
 "expiryTime": "2016-03-14T14:15Z",
 "maxAttempts": 0,
 "maxPlayers": 0,
 "minPlayers": 0,
 "silent": false,
 "usersToChallenge": [
  "56deb1fc9f0f9404b539bbe7"
 ]
}

 And got response:

{
 "@class": ".CreateChallengeResponse",
 "challengeInstanceId": "56deb2b218ead604a705837c"
}

 Step 3:
Got ChallengeIssuedMessage on second user:

{
 "@class": ".ChallengeIssuedMessage",
 "messageId": "56deb2b218ead604a705837f",
 "notification": true,
 "summary": "Dave Alaaeggjcbehb Fergiesky just challenged you at Test Challenge.",
 "who": "Dave Alaaeggjcbehb Fergiesky",
 "challenge": {
  "accepted": [
   {
    "externalIds": {
     "FB": "104102043319030"
    },
    "name": "Dave Alaaeggjcbehb Fergiesky",
    "id": "56deb1d018ead604a7055569"
   }
  ],
  "challenged": [
   {
    "externalIds": {
     "FB": "117833465276805"
    },
    "name": "Richard Alaaejdeeibja Huiberg",
    "id": "56deb1fc9f0f9404b539bbe7"
   }
  ],
  "challenger": {
   "externalIds": {
    "FB": "104102043319030"
   },
   "name": "Dave Alaaeggjcbehb Fergiesky",
   "id": "56deb1d018ead604a7055569"
  },
  "expiryDate": "2016-03-14T14:15Z",
  "maxTurns": 0,
  "turnCount": {
   "56deb1d018ead604a7055569": 0
  },
  "shortCode": "testChallenge",
  "scriptData": {},
  "challengeName": "Test Challenge",
  "endDate": "2016-03-15T14:15Z",
  "challengeId": "56deb2b218ead604a705837c",
  "state": "ISSUED"
 },
 "playerId": "56deb1fc9f0f9404b539bbe7"
}

 So I accept it using:

{
 "@class": ".AcceptChallengeRequest",
 "challengeInstanceId": "56deb2b218ead604a705837c",
 "message": ""
}

 Got this in response:

{
 "@class": ".AcceptChallengeResponse",
 "challengeInstanceId": "56deb2b218ead604a705837c"
}

 

{
 "@class": ".ChallengeStartedMessage",
 "messageId": "56deb2bf9f0f9404b539e06a",
 "notification": true,
 "summary": "Test Challenge is good to go.",
 "challenge": {
  "challengeId": "56deb2b218ead604a705837c",
  "scriptData": {},
  "shortCode": "testChallenge",
  "nextPlayer": "56deb1d018ead604a7055569",
  "maxTurns": 0,
  "turnCount": {
   "56deb1d018ead604a7055569": 0,
   "56deb1fc9f0f9404b539bbe7": 0
  },
  "startDate": "2016-03-08T11:08Z",
  "accepted": [
   {
    "externalIds": {
     "FB": "104102043319030"
    },
    "name": "Dave Alaaeggjcbehb Fergiesky",
    "id": "56deb1d018ead604a7055569"
   },
   {
    "externalIds": {
     "FB": "117833465276805"
    },
    "name": "Richard Alaaejdeeibja Huiberg",
    "id": "56deb1fc9f0f9404b539bbe7"
   }
  ],
  "challenged": [
   {
    "externalIds": {
     "FB": "117833465276805"
    },
    "name": "Richard Alaaejdeeibja Huiberg",
    "id": "56deb1fc9f0f9404b539bbe7"
   }
  ],
  "challenger": {
   "externalIds": {
    "FB": "104102043319030"
   },
   "name": "Dave Alaaeggjcbehb Fergiesky",
   "id": "56deb1d018ead604a7055569"
  },
  "expiryDate": "2016-03-14T14:15Z",
  "endDate": "2016-03-15T14:15Z",
  "challengeName": "Test Challenge",
  "state": "RUNNING"
 },
 "playerId": "56deb1fc9f0f9404b539bbe7"
}

 Step 4:
Turns out challenger got first turn, so I'm back to my first player and do this:


{
 "@class": ".LogChallengeEventRequest",
 "eventKey": "testEvent",
 "challengeInstanceId": "56deb2b218ead604a705837c"
}

 Getting this response:


{
 "@class": ".ChallengeTurnTakenMessage",
 "messageId": "56deb2d418ead604a7058ce3",
 "notification": true,
 "summary": "Dave Alaaeggjcbehb Fergiesky has taken their turn.",
 "who": "Dave Alaaeggjcbehb Fergiesky",
 "challenge": {
  "startDate": "2016-03-08T11:08Z",
  "accepted": [
   {
    "externalIds": {
     "FB": "104102043319030"
    },
    "name": "Dave Alaaeggjcbehb Fergiesky",
    "id": "56deb1d018ead604a7055569"
   },
   {
    "externalIds": {
     "FB": "117833465276805"
    },
    "name": "Richard Alaaejdeeibja Huiberg",
    "id": "56deb1fc9f0f9404b539bbe7"
   }
  ],
  "challenged": [
   {
    "externalIds": {
     "FB": "117833465276805"
    },
    "name": "Richard Alaaejdeeibja Huiberg",
    "id": "56deb1fc9f0f9404b539bbe7"
   }
  ],
  "challenger": {
   "externalIds": {
    "FB": "104102043319030"
   },
   "name": "Dave Alaaeggjcbehb Fergiesky",
   "id": "56deb1d018ead604a7055569"
  },
  "expiryDate": "2016-03-14T14:15Z",
  "nextPlayer": "56deb1d018ead604a7055569",
  "maxTurns": 0,
  "turnCount": {
   "56deb1d018ead604a7055569": 0,
   "56deb1fc9f0f9404b539bbe7": 0
  },
  "shortCode": "testChallenge",
  "scriptData": {},
  "challengeName": "Test Challenge",
  "endDate": "2016-03-15T14:15Z",
  "challengeId": "56deb2b218ead604a705837c",
  "state": "RUNNING"
 },
 "playerId": "56deb1d018ead604a7055569"
}

 

{
 "@class": ".LogChallengeEventResponse"
}

 Step 5:
Second player is getting the same ChallengeTurnTakenMessage, but when I try to do this:

{
 "@class": ".LogChallengeEventRequest",
 "eventKey": "testEvent",
 "challengeInstanceId": "56deb2b218ead604a705837c"
}

 I'm getting this response:

 

{
 "@class": ".LogChallengeEventResponse",
 "error": {
  "challengeInstanceId": "NOT_YOUR_TURN"
 }
}

 

png
(111 KB)
png

Hi Rafal,


This seems unusual, can you replicate this behaviour in the test harness and post the log please?

Thanks,


Oisin

Login to post a comment