feat: add player Names Throughout the Game UI
This commit is contained in:
+3
-2
@@ -268,11 +268,12 @@ bool http_api_handle(http_api_t *api, const http_api_request_t *request, http_ap
|
||||
uint8_t spectators = 0;
|
||||
for (uint8_t index = kPlayerCapacity; index < kSessionCapacity; ++index) spectators += sessions->entries[index].occupied;
|
||||
response_write(response, 200U, "{\"ok\":true,\"phase\":\"%s\",\"gameId\":%" PRIu32 ",\"version\":%" PRIu32
|
||||
",\"player1Available\":%s,\"player2Available\":%s,\"spectatorsAvailable\":%u}",
|
||||
",\"player1Available\":%s,\"player2Available\":%s,\"player1Name\":\"%s\",\"player2Name\":\"%s\",\"spectatorsAvailable\":%u}",
|
||||
phase_text(lifecycle->game.state.phase), lifecycle->game.state.game_id, version,
|
||||
sessions->entries[0].occupied ? "false" : "true", sessions->entries[1].occupied ? "false" : "true",
|
||||
sessions->entries[0].occupied ? sessions->entries[0].name : "", sessions->entries[1].occupied ? sessions->entries[1].name : "",
|
||||
(unsigned int)(kSpectatorCapacity - spectators));
|
||||
return response->body_length <= 192U;
|
||||
return response->body_length <= 384U;
|
||||
}
|
||||
if (request->route == HTTP_API_ROUTE_HEALTH && request->method == HTTP_API_GET) {
|
||||
response_write(response, 200U, "{\"ok\":true,\"uptimeMs\":%" PRIu32 ",\"wifiState\":\"%s\",\"freeHeapBytes\":%" PRIu32
|
||||
|
||||
Reference in New Issue
Block a user