feat(runtime): add integration hardening and diagnostics
This commit is contained in:
@@ -68,6 +68,7 @@ maze32_lobby_result_t maze32_lobby_restore(maze32_lobby_t* lobby, int connection
|
||||
void maze32_lobby_disconnect(maze32_lobby_t* lobby, int connection_id);
|
||||
maze32_lobby_result_t maze32_lobby_start(maze32_lobby_t* lobby, int connection_id, uint64_t now_ms);
|
||||
int maze32_lobby_activate_if_due(maze32_lobby_t* lobby, uint64_t now_ms);
|
||||
void maze32_lobby_reset_match(maze32_lobby_t* lobby);
|
||||
const maze32_session_t* maze32_lobby_session_for_connection(const maze32_lobby_t* lobby,
|
||||
int connection_id);
|
||||
unsigned int maze32_lobby_connected_observers(const maze32_lobby_t* lobby);
|
||||
|
||||
@@ -21,6 +21,7 @@ typedef enum {
|
||||
MAZE32_MESSAGE_START,
|
||||
MAZE32_MESSAGE_MOVE,
|
||||
MAZE32_MESSAGE_DROP_KEY,
|
||||
MAZE32_MESSAGE_RESTART,
|
||||
MAZE32_MESSAGE_HEARTBEAT,
|
||||
MAZE32_MESSAGE_SUGGEST_NAME,
|
||||
} maze32_message_type_t;
|
||||
|
||||
@@ -195,6 +195,16 @@ int maze32_lobby_activate_if_due(maze32_lobby_t* lobby, uint64_t now_ms) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void maze32_lobby_reset_match(maze32_lobby_t* lobby) {
|
||||
if (lobby == NULL) {
|
||||
return;
|
||||
}
|
||||
lobby->phase = MAZE32_LOBBY_WAITING;
|
||||
lobby->countdown_started_ms = 0U;
|
||||
lobby->activation_ms = 0U;
|
||||
lobby->revision++;
|
||||
}
|
||||
|
||||
const maze32_session_t* maze32_lobby_session_for_connection(const maze32_lobby_t* lobby,
|
||||
int connection_id) {
|
||||
if (lobby == NULL) {
|
||||
|
||||
@@ -190,6 +190,9 @@ static maze32_message_type_t message_type(const char* value) {
|
||||
if (strcmp(value, "drop_key") == 0) {
|
||||
return MAZE32_MESSAGE_DROP_KEY;
|
||||
}
|
||||
if (strcmp(value, "restart") == 0) {
|
||||
return MAZE32_MESSAGE_RESTART;
|
||||
}
|
||||
if (strcmp(value, "heartbeat") == 0) {
|
||||
return MAZE32_MESSAGE_HEARTBEAT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user