Submitted Moves Not Showing Up

When submitting moves using coronaCloud.submitMove, most of the time the 1st move in a match does not seem to take… I turned on debugging on the cloud code and no errors are generated. but when I go to get the moves using getRecentMoves I get a result with a blank table. Sometimes this works, and after you get past getting the first move recorded, the other moves get added fine.  So I know my get moves code is working,… But getting new ones going is not working but one in 20 tries.

Here is the log from the move submit that did not take:

Submitting a Move for Game:516488142d26bb74fc00000a

Corona Cloud:


Corona Cloud: – POST Call —

Corona Cloud: Post URL: https://api.coronalabs.com

Corona Cloud: Post Path: matches/516488142d26bb74fc00000a/move.json

Corona Cloud: Post Parameters: auth_token=9a7b0c5f79de02e584a6204398d62bfd47910f

54&target_user_id=mcreichle&content=eyJzY29yZVBsYXllcjIiOjAsImN1cnJlbnRUaWxlU2V0

OjI0LCJwbGF5ZWRUaWxlcyI6W3sidGlsZVR5cGUiOiJJIiwiZ3JpZFBvcyI6MTEyfSx7InRpbGVUeXBl

IjoiVCIsImdyaWRQb3MiOjExM30seyJ0aWxlVHlwZSI6IloiLCJncmlkUG9zIjoxMTF9XX1dLCJwbGF5

ZXIyIjpbXX19

Corona Cloud: ----------------

Corona Cloud:

Post Request: https://api.coronalabs.com/matches/516488142d26bb74fc00000a/move.j

son

Corona Cloud: Move Submitted: {"_id":“516488342d26bb74fc00001f”,“content”:"eyJzY

29yZVBsYXllcjIiOjAsImN1cnJlbnRUaWxlU2V0UGxheWVyMiI6W3sidmFsIjo0LCJ0aWxlIjoiWSJ9L

SI6IloiLCJncmlkUG9zIjoxMTF9XX1dLCJwbGF5ZXIyIjpbXX19",“created_at”:"2013-04-09T21

:29:24+00:00",“group_id”:null,“match_id”:“516488142d26bb74fc00000a”,“payload”:nu

ll,“sender_id”:“516488142d26bb74fc00000c”,“sent_at”:null,“target_user_id”:“mcreichle”,“updated_at”:“2013-04-09T21:29:24+00:00”,“user_alert”:null}

Here is the log from a move that was uploaded successfully:

Submitting a Move for Game:5162c4af46617ed7c4000016

Corona Cloud:


Corona Cloud: – POST Call —

Corona Cloud: Post URL: https://api.coronalabs.com

Corona Cloud: Post Path: matches/5162c4af46617ed7c4000016/move.json

Corona Cloud: Post Parameters: auth_token=e04f85020cd79fad262730f219b2abdcbc00bc

66&target_user_id=mswmcr&content=eyJzY29yZVBsYXllcjIiOjc0LCJjdXJyZW50VGlsZVNldFB

sYXllcjIiOlt7InZhbCI6MywidGlsZSI6IiMifSx7InRpbGUiOiIjIiwidmFsIjozfSx7InRpbGUiOiI

jIiwidmFsIjozfSx7InRpbGUiOiJaIiwidmFsIjoxMH0seyJ0aWxlIjoiIyIsInZhbCI6M30seyJ0aWx

lIjoiSyIsInZhbCI6NX0seyJ0aWxlIjoiQyIsInZhbCI6M30seyJ2YWwiOjEsInRpbGUiOiJMIn1dLCJ

UeXBlIjoiTyIsImdyaWRQb3MiOjg4fV19LHsibW92ZURhdGUiOjEzNjU1NDM2NjIsIndvcmRzIjpbeyJ

3b3JkU2NvcmUiOjcsIndvcmQiOiJCTyJ9XSwic2NvcmUiOjcsInBsYXllZFRpbGVzIjpbeyJ0aWxlVHl

wZSI6IkIiLCJncmlkUG9zIjo5Nn1dfV19fQ==

Corona Cloud: ----------------

Corona Cloud:

Post Request: https://api.coronalabs.com/matches/5162c4af46617ed7c4000016/move.j

son

Corona Cloud: Move Submitted: {"_id":“51648af12d26bbc724000004”,“content”:"eyJzY

29yZVBsYXllcjIiOjc0LCJjdXJyZW50VGlsZVNldFBsYXllcjIiOlt7InZhbCI6MywidGlsZSI6IiMif

Sx7InRpbGUiOiIjIiwidmFsIjozfSx7InRpbGUiOiIjIiwidmFsIjozfSx7InRpbGUiOiJaIiwidmFsI

joxMH0seyJ0aWxlIjoiIyIsInZhbCI6M30seyJ0aWxlIjoiSyIsInZhbCI6NX0seyJ0aWxlIjoiQyIsI

GVUeXBlIjoiRSIsImdyaWRQb3MiOjg5fSx7InRpbGVUeXBlIjoiTyIsImdyaWRQb3MiOjg4fV19LHsib

W92ZURhdGUiOjEzNjU1NDM2NjIsIndvcmRzIjpbeyJ3b3JkU2NvcmUiOjcsIndvcmQiOiJCTyJ9XSwic

2NvcmUiOjcsInBsYXllZFRpbGVzIjpbeyJ0aWxlVHlwZSI6IkIiLCJncmlkUG9zIjo5Nn1dfV19fQ=="

,“created_at”:“2013-04-09T21:41:05+00:00”,“group_id”:null,“match_id”:"5162c4af46

617ed7c4000016",“payload”:null,“sender_id”:“5162c4af46617ed7c400001a”,“sent_at”:

null,“target_user_id”:“mswmcr”,“updated_at”:“2013-04-09T21:41:05+00:00”,"user_al

ert":null}

The code to submit the move is really simple:

    coronaCloud.submitMove(gameBlob,nil,userName,gameID,nil)

Any insight?

Mike

Hi Mike,

I’ll get on this.

-Mohamed

Hi Mike,

Can I ask you remove target_user_id from your parameter and submit the move with just the required parameters, and try it again.

Thanks

-Mohamed

To add a little more data, here is the difference in the getRecentMoves Logs

Move Count seems to be right at 1… It just does not return the json submitted.  The match TURN_INDEX also switches to “1” as it should,

Unsuccessful getRecentMoves:

Existing Game Button Pressed:14

Entered Resume Game Function:51648d5b2d26bbc724000008

Corona Cloud:


Corona Cloud: – GET Call —

Corona Cloud: Get URL: https://api.coronalabs.com

Corona Cloud: Get Path: matches/51648d5b2d26bbc724000008/get_recent_moves.json

Corona Cloud: Get Parameters: auth_token=e04f85020cd79fad262730f219b2abdcbc00bc6

6&criteria=all&move_count=1

Corona Cloud: ----------------

Corona Cloud:

Get Request: https://api.coronalabs.com/matches/51648d5b2d26bbc724000008/get_rec

ent_moves.json?auth_token=e04f85020cd79fad262730f219b2abdcbc00bc66&criteria=all&

move_count=1

Corona Cloud: Recent Match Moves: []

Entered the multiPlayer Handler

GOT THE GAME MOVES

–>Match Turns = {};

Successfully getting a recent move:

Existing Game Button Pressed:16

Entered Resume Game Function:5162c4af46617ed7c4000016

Corona Cloud:


Corona Cloud: – GET Call —

Corona Cloud: Get URL: https://api.coronalabs.com

Corona Cloud: Get Path: matches/5162c4af46617ed7c4000016/get_recent_moves.json

Corona Cloud: Get Parameters: auth_token=9a7b0c5f79de02e584a6204398d62bfd47910f5

4&criteria=all&move_count=1

Corona Cloud: ----------------

Corona Cloud:

Get Request: https://api.coronalabs.com/matches/5162c4af46617ed7c4000016/get_rec

ent_moves.json?auth_token=9a7b0c5f79de02e584a6204398d62bfd47910f54&criteria=all&

move_count=1

Corona Cloud: Recent Match Moves: [{"_id":“51646bb82d26bbeb65000004”,“content”:"

eyJzY29yZVBsYXllcjIiOjYxLCJjdXJyZW50VGlsZVNldFBsYXllcjIiOlt7InRpbGUiOiIjIiwidmFs

IjozfSx7InZhbCI6MywidGlsZSI6IiMifSx7InZhbCI6MywidGlsZSI6IiMifSx7InZhbCI6MTAsInRp

eyJ0aWxlVHlwZSI6IlAiLCJncmlkUG9zIjoxMTd9XX0seyJtb3ZlRGF0ZSI6MTM2NTQ0MTEzNywid29y

ZHMiOlt7IndvcmRTY29yZSI6OSwid29yZCI6IkhFUiJ9XSwic2NvcmUiOjksInBsYXllZFRpbGVzIjpb

eyJ0aWxlVHlwZSI6IlIiLCJncmlkUG9zIjoxNDF9XX1dfX0=",“created_at”:"2013-04-09T19:27

:52+00:00",“group_id”:null,“match_id”:“5162c4af46617ed7c4000016”,“payload”:null,

“sender_id”:“5162c4af46617ed7c4000018”,“sent_at”:null,“target_user_id”:"mcreichl

e",“updated_at”:“2013-04-09T19:27:52+00:00”,“user_alert”:null}]

Corona Cloud: Decoding Content

Entered the multiPlayer Handler

GOT THE GAME MOVES

–>Match Turns = {

–>     [1] = {

–>             [“sender_id”] = “5162c4af46617ed7c4000018”;

–>             [“target_user_id”] = “mcreichle”;

–>             [“updated_at”] = “2013-04-09T19:27:52+00:00”;

Match details for non working game:

–>     [21] = {

–>             [“players”] = {

–>                     [1] = {

–>                             [“updated_at”] = “2013-04-09T21:28:59+00:00”;

–>                             ["_id"] = “5164881b2d26bb74fc000018”;

–>                             [“username”] = “dhostetler”;

–>                             [“state”] = “accepted”;

–>                             [“channel_id”] = “5164881b2d26bb74fc000017”;

–>                             [“user_id”] = “515068a46493294bc2000002”;

–>                     };

–>                     [2] = {

–>                             [“state”] = “accepted”;

–>                             [“username”] = “mcreichle”;

–>                             ["_id"] = “5164881b2d26bb74fc00001a”;

–>                             [“created_at”] = “2013-04-09T21:28:59+00:00”;

–>                             [“updated_at”] = “2013-04-09T21:28:59+00:00”;

–>                             [“channel_id”] = “5164881b2d26bb74fc000019”;

–>                             [“user_id”] = “5150563164932917a1000001”;

–>                     };

–>             };

–>             [“turn_updated_at”] = “2013-04-09T21:34:30+00:00”;

–>             ["_id"] = “5164881b2d26bb74fc000016”;

–>             [“created_at”] = “2013-04-09T21:28:59+00:00”;

–>             [“updated_at”] = “2013-04-09T21:34:30+00:00”;

–>             [“state”] = “started”;

–>             [“name”] = “16fb16de4”;

–>             [“turn_index”] = 1;

–>             [“creator_id”] = “515068a46493294bc2000002”;

–>             [“game_id”] = “514b3e0fb633541a0400001a”;

–>             [“is_random_match”] = true;

–>             [“match_type”] = “turn-based”;

–>     };

Match details for a working game:

–>     [16] = {

–>             [“players”] = {

–>                     [1] = {

–>                             [“updated_at”] = “2013-04-08T13:22:55+00:00”;

–>                             ["_id"] = “5162c4af46617ed7c4000018”;

–>                             [“username”] = “mcreichle”;

–>                             [“state”] = “accepted”;

–>                             [“channel_id”] = “5162c4af46617ed7c4000017”;

–>                             [“user_id”] = “5150563164932917a1000001”;

–>                     };

–>                     [2] = {

–>                             [“state”] = “accepted”;

–>                             [“username”] = “mswmcr”;

–>                             ["_id"] = “5162c4af46617ed7c400001a”;

–>                             [“created_at”] = “2013-04-08T13:22:55+00:00”;

–>                             [“updated_at”] = “2013-04-08T13:22:55+00:00”;

–>                             [“channel_id”] = “5162c4af46617ed7c4000019”;

–>                             [“user_id”] = “51506afe649329d75a000002”;

–>                     };

–>             };

–>             [“turn_updated_at”] = “2013-04-09T21:41:05+00:00”;

–>             ["_id"] = “5162c4af46617ed7c4000016”;

–>             [“created_at”] = “2013-04-08T13:22:55+00:00”;

–>             [“updated_at”] = “2013-04-09T21:41:05+00:00”;

–>             [“state”] = “started”;

–>             [“name”] = “f4209596a”;

–>             [“turn_index”] = 0;

–>             [“creator_id”] = “5150563164932917a1000001”;

–>             [“game_id”] = “514b3e0fb633541a0400001a”;

–>             [“is_random_match”] = true;

–>             [“match_type”] = “turn-based”;

will do

That seemed to make the difference… Any idea why?

Thanks for the very quick response!

Mike

I’ll get the team to look into this ASAP.

-Mohamed

Hi Mike,

I’ll get on this.

-Mohamed

Hi Mike,

Can I ask you remove target_user_id from your parameter and submit the move with just the required parameters, and try it again.

Thanks

-Mohamed

To add a little more data, here is the difference in the getRecentMoves Logs

Move Count seems to be right at 1… It just does not return the json submitted.  The match TURN_INDEX also switches to “1” as it should,

Unsuccessful getRecentMoves:

Existing Game Button Pressed:14

Entered Resume Game Function:51648d5b2d26bbc724000008

Corona Cloud:


Corona Cloud: – GET Call —

Corona Cloud: Get URL: https://api.coronalabs.com

Corona Cloud: Get Path: matches/51648d5b2d26bbc724000008/get_recent_moves.json

Corona Cloud: Get Parameters: auth_token=e04f85020cd79fad262730f219b2abdcbc00bc6

6&criteria=all&move_count=1

Corona Cloud: ----------------

Corona Cloud:

Get Request: https://api.coronalabs.com/matches/51648d5b2d26bbc724000008/get_rec

ent_moves.json?auth_token=e04f85020cd79fad262730f219b2abdcbc00bc66&criteria=all&

move_count=1

Corona Cloud: Recent Match Moves: []

Entered the multiPlayer Handler

GOT THE GAME MOVES

–>Match Turns = {};

Successfully getting a recent move:

Existing Game Button Pressed:16

Entered Resume Game Function:5162c4af46617ed7c4000016

Corona Cloud:


Corona Cloud: – GET Call —

Corona Cloud: Get URL: https://api.coronalabs.com

Corona Cloud: Get Path: matches/5162c4af46617ed7c4000016/get_recent_moves.json

Corona Cloud: Get Parameters: auth_token=9a7b0c5f79de02e584a6204398d62bfd47910f5

4&criteria=all&move_count=1

Corona Cloud: ----------------

Corona Cloud:

Get Request: https://api.coronalabs.com/matches/5162c4af46617ed7c4000016/get_rec

ent_moves.json?auth_token=9a7b0c5f79de02e584a6204398d62bfd47910f54&criteria=all&

move_count=1

Corona Cloud: Recent Match Moves: [{"_id":“51646bb82d26bbeb65000004”,“content”:"

eyJzY29yZVBsYXllcjIiOjYxLCJjdXJyZW50VGlsZVNldFBsYXllcjIiOlt7InRpbGUiOiIjIiwidmFs

IjozfSx7InZhbCI6MywidGlsZSI6IiMifSx7InZhbCI6MywidGlsZSI6IiMifSx7InZhbCI6MTAsInRp

eyJ0aWxlVHlwZSI6IlAiLCJncmlkUG9zIjoxMTd9XX0seyJtb3ZlRGF0ZSI6MTM2NTQ0MTEzNywid29y

ZHMiOlt7IndvcmRTY29yZSI6OSwid29yZCI6IkhFUiJ9XSwic2NvcmUiOjksInBsYXllZFRpbGVzIjpb

eyJ0aWxlVHlwZSI6IlIiLCJncmlkUG9zIjoxNDF9XX1dfX0=",“created_at”:"2013-04-09T19:27

:52+00:00",“group_id”:null,“match_id”:“5162c4af46617ed7c4000016”,“payload”:null,

“sender_id”:“5162c4af46617ed7c4000018”,“sent_at”:null,“target_user_id”:"mcreichl

e",“updated_at”:“2013-04-09T19:27:52+00:00”,“user_alert”:null}]

Corona Cloud: Decoding Content

Entered the multiPlayer Handler

GOT THE GAME MOVES

–>Match Turns = {

–>     [1] = {

–>             [“sender_id”] = “5162c4af46617ed7c4000018”;

–>             [“target_user_id”] = “mcreichle”;

–>             [“updated_at”] = “2013-04-09T19:27:52+00:00”;

Match details for non working game:

–>     [21] = {

–>             [“players”] = {

–>                     [1] = {

–>                             [“updated_at”] = “2013-04-09T21:28:59+00:00”;

–>                             ["_id"] = “5164881b2d26bb74fc000018”;

–>                             [“username”] = “dhostetler”;

–>                             [“state”] = “accepted”;

–>                             [“channel_id”] = “5164881b2d26bb74fc000017”;

–>                             [“user_id”] = “515068a46493294bc2000002”;

–>                     };

–>                     [2] = {

–>                             [“state”] = “accepted”;

–>                             [“username”] = “mcreichle”;

–>                             ["_id"] = “5164881b2d26bb74fc00001a”;

–>                             [“created_at”] = “2013-04-09T21:28:59+00:00”;

–>                             [“updated_at”] = “2013-04-09T21:28:59+00:00”;

–>                             [“channel_id”] = “5164881b2d26bb74fc000019”;

–>                             [“user_id”] = “5150563164932917a1000001”;

–>                     };

–>             };

–>             [“turn_updated_at”] = “2013-04-09T21:34:30+00:00”;

–>             ["_id"] = “5164881b2d26bb74fc000016”;

–>             [“created_at”] = “2013-04-09T21:28:59+00:00”;

–>             [“updated_at”] = “2013-04-09T21:34:30+00:00”;

–>             [“state”] = “started”;

–>             [“name”] = “16fb16de4”;

–>             [“turn_index”] = 1;

–>             [“creator_id”] = “515068a46493294bc2000002”;

–>             [“game_id”] = “514b3e0fb633541a0400001a”;

–>             [“is_random_match”] = true;

–>             [“match_type”] = “turn-based”;

–>     };

Match details for a working game:

–>     [16] = {

–>             [“players”] = {

–>                     [1] = {

–>                             [“updated_at”] = “2013-04-08T13:22:55+00:00”;

–>                             ["_id"] = “5162c4af46617ed7c4000018”;

–>                             [“username”] = “mcreichle”;

–>                             [“state”] = “accepted”;

–>                             [“channel_id”] = “5162c4af46617ed7c4000017”;

–>                             [“user_id”] = “5150563164932917a1000001”;

–>                     };

–>                     [2] = {

–>                             [“state”] = “accepted”;

–>                             [“username”] = “mswmcr”;

–>                             ["_id"] = “5162c4af46617ed7c400001a”;

–>                             [“created_at”] = “2013-04-08T13:22:55+00:00”;

–>                             [“updated_at”] = “2013-04-08T13:22:55+00:00”;

–>                             [“channel_id”] = “5162c4af46617ed7c4000019”;

–>                             [“user_id”] = “51506afe649329d75a000002”;

–>                     };

–>             };

–>             [“turn_updated_at”] = “2013-04-09T21:41:05+00:00”;

–>             ["_id"] = “5162c4af46617ed7c4000016”;

–>             [“created_at”] = “2013-04-08T13:22:55+00:00”;

–>             [“updated_at”] = “2013-04-09T21:41:05+00:00”;

–>             [“state”] = “started”;

–>             [“name”] = “f4209596a”;

–>             [“turn_index”] = 0;

–>             [“creator_id”] = “5150563164932917a1000001”;

–>             [“game_id”] = “514b3e0fb633541a0400001a”;

–>             [“is_random_match”] = true;

–>             [“match_type”] = “turn-based”;

will do

That seemed to make the difference… Any idea why?

Thanks for the very quick response!

Mike

I’ll get the team to look into this ASAP.

-Mohamed