diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 675e91120..e664d52c6 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -143,6 +143,31 @@ void GMZeroCommands::Help(Entity* entity, const SystemAddress& sysAddr, const st } } +void SlashCommandHandler::SendAnnouncement(const std::string& title, const std::string& message) { + AMFArrayValue args; + + args.Insert("title", title); + args.Insert("message", message); + + GameMessages::SendUIMessageServerToAllClients("ToggleAnnounce", args); + + //Notify chat about it + CBITSTREAM; + BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GM_ANNOUNCE); + + bitStream.Write(title.size()); + for (auto character : title) { + bitStream.Write(character); + } + + bitStream.Write(message.size()); + for (auto character : message) { + bitStream.Write(character); + } + + Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false); +} + void SlashCommandHandler::Startup() { // Register Dev Commands Command SetGMLevelCommand{