setSynchronous advice

Game development with Board Game Arena Studio
Post Reply
User avatar
tsaunat
Posts: 30
Joined: 28 April 2020, 05:10

setSynchronous advice

Post by tsaunat »

I'm using setSynchronous to create a client side delay for some gamestate activities that happen very fast on the server side. Namely round scoring, shuffle and deal for a card game. The difficulty is the round scoring can be variable depending on how many cards people have that score. This can kind of sort of create a race condition wherein the game tells you to play a card while it's still dealing.... which by itself is not a big deal, but in other circumstances if a player plays a card in that time period (while it's still dealing) usually due to one client being delayed for some reason, it will create errors because cards aren't where they are supposed to be.

The question is: is there a better way to handle client side delays than setSynchronous. what happens if it is set several times does it combine or overwrite? Could I calculate exactly the sync time that is needed each time and set it, but will it work reactively like that?
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: setSynchronous advice

Post by Tisaac »

You can set a variable time, check the docs again ;)
User avatar
tsaunat
Posts: 30
Joined: 28 April 2020, 05:10

Re: setSynchronous advice

Post by tsaunat »

Thanks, that really helped actually. I guess I didn't read as well as I should have.
Post Reply

Return to “Developers”