Merge pull request #147 from moelrobi/claude/peaceful-bardeen-ode7bj

Server: announcements to one player, card only, and custom chat commands
This commit is contained in:
zeex64 authored and GitHub committed 2026-10-09 23:03:16 -05:00
commit 1bd1d3437e
10 files changed
+218 -41

No files matched your search

+12 -1
View File
@@ -679,7 +679,18 @@ void Host::send_roster() {
if (m.party && std::none_of(p.members.begin(), p.members.end(),
[&](const Member &o) { return o.party == m.party && o.party_leader; }))
m.party_leader = true; // the first listed member of a party missing its leader
broadcast(p, true, false);
// An announcement for one player: everyone else's roster goes without it.
auto *only = announcement_for_ ? find(announcement_for_) : nullptr;
if (only && !only->handshaken) only = nullptr;
if (announcement_for_) {
const auto shown = p.announcement;
p.announcement = {};
broadcast(p, true, false, announcement_for_);
p.announcement = shown;
if (only) send_packet(*only, p, true, false);
} else {
broadcast(p, true, false);
}
roster_dirty_ = false;
last_roster_ = now_;
}