Compare commits

..
Author SHA1 Message Date
Stefan MaierandClaude Opus 5.5 62dee62eb6 A lobby the bots fill is open to a person on the LAN too
The bots make room for a person who joins, and the server browser's
listing counted their slots as free, but the LAN advertisement and the
join's check still asked for a free slot: with 15 bots and the host a
lobby of 16 was advertised closed, and a Quest on the LAN was refused
("attempted to join a closed game"). Both now count a bot's slot in a
lobby as a person's, as the listing does (network_game_server_room_for_person).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:59:49 +02:00
2 changed files with 22 additions and 2 deletions

No files matched your search

+4 -2
View File
@@ -717,7 +717,7 @@ desktop none is ever marked, the writes live behind the Android guard) */
static boolean network_game_server_bot_machines[MAXIMUM_NETWORK_MACHINE_COUNT];
#ifdef HALO_ANDROID
static short network_game_server_bot_machine_count(struct network_game_server *server);
static boolean network_game_server_room_for_person(struct network_game_server *server);
boolean network_game_server_room_for_person(struct network_game_server *server);
static void network_game_server_bot_makes_room(struct network_game_server *server);
#endif
@@ -4951,7 +4951,9 @@ static short network_game_server_bot_count(
/* whether a person can join: a free place, or in the lobby a bot's, which
leaves for them (network_game_server_bot_makes_room) */
static boolean network_game_server_room_for_person(
/* (as the server browser lists the game, its LAN advertisement and the
join's check: network_server_message_handler.c) */
boolean network_game_server_room_for_person(
struct network_game_server *server)
{
struct network_player *last;
@@ -245,6 +245,7 @@ symbols in this file:
*/
/* ---------- headers */
#include "cseries.h"
@@ -275,6 +276,13 @@ boolean map_share_handles_message(word const *message, word size);
void map_share_handle_message(long machine_index, word const *message, word size, boolean from_stream);
void network_distributed_handle_stream_message(long machine_index, word const *message, word size);
#ifdef HALO_ANDROID
/* a slot for a person, a bot's in a lobby counting (it makes room as they
join: network_server_manager.c) */
boolean network_game_server_room_for_person(struct network_game_server *server);
#endif
/* ---------- constants */
enum
@@ -1769,7 +1777,12 @@ static boolean network_game_server_handle_message_client_broadcast_game_search(
once it is over, nor in progress when no player can join it) */
if (network_game_server_get_state(server, NULL) == _network_game_server_state_ingame
? network_game_server_accepts_late_joins(server)
#ifdef HALO_ANDROID
/* (a lobby the bots fill is open: one makes room) */
: network_game_server_game_is_open(server) && network_game_server_room_for_person(server))
#else
: network_game_server_game_is_open(server) && network_game_has_free_player_slot(game))
#endif
{
advertisement.flags |= FLAG(_game_advertisement_open_bit);
}
@@ -1923,7 +1936,12 @@ static boolean network_game_server_handle_message_client_join_game_request(
fill it) is full: a machine that joined could add none, and held
the countdown for ever */
boolean full = network_game_server_get_state(server, NULL) == _network_game_server_state_pregame &&
#ifdef HALO_ANDROID
/* (a bot's slot is a person's: it makes room) */
!network_game_server_room_for_person(server);
#else
!network_game_has_free_player_slot(network_game_server_get_game(server));
#endif
/* port: its hardware id, as it tells it: hex only (anything else
left out), no more than its field; the host logs it, and refuses