Using bgaPerformAction with a Array as a arg
Posted: 08 July 2024, 08:12
Hi there,
I'm having an issue I'd like help with please. I'm trying to pass an array through the bgaPerformAction method but getting the error:
Bad argument type: dice_array should be a value from the enumeration (5_7_apep)
Can arrays not be passed through? I cannot find an answer anywhere...
If I cannot, then guessing I should send through a string with implode?
Thanks for the help.
Code below
I'm having an issue I'd like help with please. I'm trying to pass an array through the bgaPerformAction method but getting the error:
Bad argument type: dice_array should be a value from the enumeration (5_7_apep)
Can arrays not be passed through? I cannot find an answer anywhere...
If I cannot, then guessing I should send through a string with implode?
Thanks for the help.
Code below
Code: Select all
onConfirm: function ( evt ) {
console.log('onConfirm');
dojo.stopEvent (evt);
if (this.diceToPlay > 0) {
this.showMessage("You still need to place a die", 'info');
}
else {
console.log("Confirm Succesful");
// clear the Dice shown
arrayLength = this.placedDieThisTurn.length;
this.clearRolledDie();
console.log("Array Length = " + arrayLength);
if (! this.checkAction('playedTwoDiceSetup')) { //some shit here went wrong!!!
console.log("RETURN HAPPENED");
return;
}
//send placed die to AJAX called back to php
console.log("AJAX " + this.diceToPlace);
this.bgaPerformAction('playedTwoDiceSetup',
{dice_array: this.placedDieThisTurn, die_type:this.diceToPlace},
{lock:true});
console.log("playedTwoDiceSetup completed??");
};
},