Server sends this message right after client is logged in on the server (successful exchange of S2C::SIGN_REQUEST and C2S::SIGNATURE). This message reports on global game state and the time for the next state transition.
struct s2c_game_state_t {
char type; // MSG_S2C_GAME_STATE
char state; // Global game state
int timestamp; // Unix timestamp for the next state transition
}
There are three global game states:
const char GAME_NOT_STARTED = 0;
const char GAME_RUNNING = 1;
const char GAME_ONBOARDING = 2;
GAME_NOT_STARTED
Server has started, player may log into the server, by game onboarding isn't started yet. Timestamp indicates when onboarding into the game starts.
GAME_ONBOARDING
Server is ready to onboard clients into a game. Every client who wants to participate in a game must connect during onboarding phase and send C2S::JOIN message to be registered for participation. Joining the game after onboarding isn't possible, because currently game map is generated based on the players joined during onboarding. Client does not need to stay online for the whole time of onboarding. It is sufficient to join during onboarding phase, successfully send C2S::JOIN message and rejoin later either at the end of the onboarding or after the game starts.
GAME_RUNNING
Game is running! Client may send unit commands and accomplish game goals.