I'm developing a multiplayer turn-based card game. In certain scenarios, the clients are required to perform an animation before moving on with the game. For example, the server informs the clients to animate dealing cards to all players. This animation takes around 5 seconds. Afterwards, the server informs a client to make a move, with a timer showing how long they have to play.
How can the server wait for the animation to finish before moving on and starting a timer and informing a client to play? The timer obviously needs to start after the animations are complete.
I've thought of the following:
1) Hardcode the animation durations on the server side and delay sending out the next message to the clients until after the duration of the animation.
2) Have the clients inform the server when an animation is complete.
..but I feel that there should be a better way.
Is there any other way to do this?