database write delay ?

Game development with Board Game Arena Studio
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Re: database write delay ?

Post by Benoit314 »

I checked this morning and you're right, you can access values in args. I wrongly assumed your code was inside OnEnteringState.

If args.token_type equals to null and not undefined, I suppose something went wrong with your query the first time. I would add some self::trace near your query to check it.
User avatar
RicardoRix
Posts: 2541
Joined: 29 April 2012, 23:43

Re: database write delay ?

Post by RicardoRix »

Code: Select all

$sql = "UPDATE token SET token_specialpower_counter='-10' WHERE token_id='".$part_token['id']."
This formatting doesn't look quite right at the end. Looks like it's missing the final single quote, in fact there is an erroneous double quote at the end not terminated.

I would avoid using type as a field name, that's a sql keyword. I also prefer to use AS in the query as well to make it more readable, or even better don't rename the fields, it you don't like the field names then why start with them.
User avatar
DrKarotte
Posts: 279
Joined: 22 September 2015, 23:42

Re: database write delay ?

Post by DrKarotte »

OK, sorry, I am not sure about this. I now would log the args in the enteringState function and check if the same effect happens there, too.
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: database write delay ?

Post by tchobello »

RicardoRix wrote: 31 May 2020, 15:57

Code: Select all

$sql = "UPDATE token SET token_specialpower_counter='-10' WHERE token_id='".$part_token['id']."
This formatting doesn't look quite right at the end. Looks like it's missing the final single quote, in fact there is an erroneous double quote at the end not terminated.

I would avoid using type as a field name, that's a sql keyword. I also prefer to use AS in the query as well to make it more readable, or even better don't rename the fields, it you don't like the field names then why start with them.
yep, sorry, I did erase the end while copying it here

Code: Select all

$sql = "UPDATE token SET token_specialpower_counter='-10' WHERE token_id='".$part_token['id']."'";
about the field names, you may ask sourisdudesert, who have made all this work using ' token_type type' a hundred times...
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: database write delay ?

Post by Tisaac »

And what if you try to log 'this.gamedatas.gamestate.args' instead of 'args' ?
User avatar
hersh
Posts: 76
Joined: 12 December 2013, 23:49

Re: database write delay ?

Post by hersh »

do you have

Code: Select all

if(this.isCurrentPlayerActive()) 
inside onUpdateActionButtons?

+1 to DrKarotte suggestion. If I recall onUpdateActionButtons can be called multiple times.
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: database write delay ?

Post by tchobello »

I've tried all you've suggested...

I still have the problem...

I need to hit F5 for the variable to be recognized.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: database write delay ?

Post by Tisaac »

That weird, can you give the name of the studio project so I can try to look at it ?
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: database write delay ?

Post by tchobello »

dungeontwisterext
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: database write delay ?

Post by Tisaac »

Thanks but I can't ask for read access, maybe you have to do something to allow other developpers to ask ?
Post Reply

Return to “Developers”