I am developing a 4 player turn-based multiplayer game using firebase as a backend and Unity as a front end. I Would like to give 20 sec for each player to move his turn. otherwise, the cloud function wants to move a random move for that player. that's why I write an X-function and call it with set-timeout after every move made player.
X-function: this function will check the player moved or not and if the player not moved, then choose a random move.
but the issue in the firebase cloud function is the maximum value for time out is 540 sec. if some of the players continually not moving then it will take more than 540sec. so that cloud-function is suspended.
can you suggest a better way to manage the timer for a turn-based player?