WIP: Test resilient in-world detection fallback #1

Closed
Dusk-92 wants to merge 34 commits from test/inworld-fallback-diagnostics into main
Showing only changes of commit 15e723c7eb - Show all commits
+10 -5
View File
@@ -830,12 +830,17 @@ static void publish_character_snapshot(void) {
json_quote_text((mask & SHARE_ZONE) ? snapshot.zone : "", safe_zone, sizeof(safe_zone)); json_quote_text((mask & SHARE_ZONE) ? snapshot.zone : "", safe_zone, sizeof(safe_zone));
json_quote_text((mask & SHARE_GUILD) ? snapshot.guild : "", safe_guild, sizeof(safe_guild)); json_quote_text((mask & SHARE_GUILD) ? snapshot.guild : "", safe_guild, sizeof(safe_guild));
if (!snapshot.in_world) { if (!snapshot.name[0]) {
if (!snapshot.name[0]) error_text = "name"; error_text = "name";
else if (!snapshot.zone[0]) error_text = "zone"; } else if (!snapshot.zone[0]) {
else if (snapshot.player_read_result == PLAYER_READ_NOT_ATTEMPTED) error_text = "zone";
} else if (snapshot.player_read_result == PLAYER_READ_NOT_ATTEMPTED) {
if (!snapshot.in_world)
error_text = snapshot.raw_in_world ? "settling" : "in_world_flag"; error_text = snapshot.raw_in_world ? "settling" : "in_world_flag";
else } else if (snapshot.player_read_result != PLAYER_READ_OK) {
/* Keep player-object diagnostics visible even when the legacy
* in-world flag is true. This makes partial snapshots diagnosable
* instead of reporting an empty error string. */
error_text = player_read_error(snapshot.player_read_result); error_text = player_read_error(snapshot.player_read_result);
} }