mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
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:
@@ -178,8 +178,18 @@ namespace {
|
|||||||
auto* character = entity ? entity->GetCharacter() : nullptr;
|
auto* character = entity ? entity->GetCharacter() : nullptr;
|
||||||
if (!character) return 0;
|
if (!character) return 0;
|
||||||
character->ApplyNameModeration(approved);
|
character->ApplyNameModeration(approved);
|
||||||
Tell(entity, approved ? "Your new name \"" + name + "\" was approved. Other players will see it after you next change worlds."
|
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.");
|
: "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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user