diff --git a/world/console.cpp b/world/console.cpp index 2fcc878bf..b86757c45 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -1330,6 +1330,42 @@ void ConsoleWorldWideMove( ); } +void ConsoleWWMarquee( + EQ::Net::ConsoleServerConnection* connection, + const std::string& command, + const std::vector& args +) +{ + if (args.size() < 2) { + connection->SendLine("Usage: wwmarquee "); + return; + } + + const uint32 type = Strings::IsNumber(args[0]) ? Strings::ToUnsignedInt(args[0]) : 0; + std::string message = Strings::Join(std::vector(args.begin() + 1, args.end()), " "); + if (message.empty()) { + connection->SendLine("Message cannot be empty."); + return; + } + + auto pack = new ServerPacket(ServerOP_WWMarquee, sizeof(WWMarquee_Struct)); + auto* wwm = (WWMarquee_Struct*)pack->pBuffer; + + wwm->type = type; + wwm->priority = 510; + wwm->fade_in = 0; + wwm->fade_out = 0; + wwm->duration = 5000; + wwm->min_status = AccountStatus::Player; + wwm->max_status = AccountStatus::Player; + + strn0cpy(wwm->message, message.c_str(), sizeof(wwm->message)); + + zoneserver_list.SendPacket(pack); + safe_delete(pack); + + connection->SendLine(fmt::format("Sent world marquee type {}: {}", type, message)); +} /** * @param console @@ -1367,6 +1403,12 @@ void RegisterConsoleFunctions(std::unique_ptr& console) console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("worldshutdown", 200, "worldshutdown", std::bind(ConsoleWorldShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("wwcast", 50, "wwcast [spell_id] [min_status] [max_status] - min_status and max_status are optional", std::bind(ConsoleWorldWideCastSpell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall( + "wwmarquee", + 50, + "wwmarquee ", + std::bind(ConsoleWWMarquee, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) + ); console->RegisterCall("wwmove", 50, "wwmove [instance_id|zone_short_name] [min_status] [max_status] - min_status and max_status are optional, instance_id and zone_short_name are interchangeable", std::bind(ConsoleWorldWideMove, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("zonebootup", 150, "zonebootup [zone_server_id] [zone_short_name]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zone_short_name]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 978630f09..6df196e1d 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -3140,7 +3140,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) case ServerOP_WWMarquee: { auto s = (WWMarquee_Struct*) pack->pBuffer; - for (const auto& c : entity_list.GetClientList()) { if ( c.second->Admin() >= s->min_status &&