feat(moderation): a name decision shows as a popup to the player, as live did (issue 957)

When staff approve or reject a character name while the player is online, the player gets a private announcement
popup ("Name approved" / "Name not approved") as well as the chat line. Players who are offline still aren't told
at their next login. Check: approve and reject a pending name while its player is online.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 09:18:53 -05:00
parent 826dd9ee59
commit 57925d1e11

View File

@@ -178,8 +178,18 @@ namespace {
auto* character = entity ? entity->GetCharacter() : nullptr;
if (!character) return 0;
character->ApplyNameModeration(approved);
Tell(entity, approved ? "Your new name \"" + name + "\" was approved. Other players will see it after you next change worlds."
: "Your requested name \"" + name + "\" was not approved. You can pick another one at character select.");
const std::string text = approved ? "Your new name \"" + name + "\" was approved. Other players will see it after you next change worlds."
: "Your requested name \"" + name + "\" was not approved. You can pick another one at character select.";
// A private announcement popup, as live told the player, and the same text in chat
AMFArrayValue args;
args.Insert("title", std::string(approved ? "Name approved" : "Name not approved"));
args.Insert("message", text);
GameMessages::UIMessageServerToSingleClient uiMessage;
uiMessage.target = entity->GetObjectID();
uiMessage.strMessageName = "ToggleAnnounce";
uiMessage.args = std::move(args);
uiMessage.SendToClient(entity->GetSystemAddress());
Tell(entity, text);
return 1;
}