Finishing up PR comments

This commit is contained in:
dannuic
2026-04-30 11:36:02 -06:00
parent eae065acb5
commit 8c59dda61f
12 changed files with 35 additions and 40 deletions
+2 -1
View File
@@ -32,13 +32,14 @@ concept AllConstChar = (std::is_convertible_v<Args, const char*> && ...);
class IMessage
{
public:
using FormattedArgs = std::array<const char*, 9>;
IMessage() = default;
virtual ~IMessage() = default;
// these two are the basic string message packets
virtual std::unique_ptr<EQApplicationPacket> Simple(uint32_t color, uint32_t id) const = 0;
virtual std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const std::array<const char*, 9>& args) const = 0;
const FormattedArgs& args) const = 0;
// These aren't technically messages, but they use the same format and are similar enough to include here
virtual std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
+2 -3
View File
@@ -31,13 +31,12 @@
#include "common/raid.h"
#include "common/rulesys.h"
#include "common/strings.h"
#include "zone/client.h"
#include "zone/mob.h"
#include <iostream>
#include <sstream>
#include "zone/client.h"
#include "zone/mob.h"
namespace SoD
{
+7 -9
View File
@@ -32,12 +32,11 @@
#include "common/raid.h"
#include "common/rulesys.h"
#include "common/strings.h"
#include "zone/mob.h"
#include "zone/string_ids.h"
#include <sstream>
#include "zone/mob.h"
namespace Titanium
{
@@ -3902,8 +3901,8 @@ std::unique_ptr<EQApplicationPacket> MessageComponent::Simple(uint32_t color, ui
return nullptr;
}
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(
uint32_t color, uint32_t id, const std::array<const char*, 9>& args) const
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(uint32_t color, uint32_t id,
const FormattedArgs& args) const
{
uint32_t string_id = ResolveID(id);
if (string_id > 0) {
@@ -3943,14 +3942,13 @@ std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpell(uint32_t m
}
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
const char* name,
const char* spell_link) const
const char* name, const char* spell_link) const
{
auto outapp = std::make_unique<EQApplicationPacket>(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(name) + 1);
auto ic = reinterpret_cast<InterruptCast_Struct*>(outapp->pBuffer);
ic->messageid = ResolveID(message);
ic->spawnid = spawn_id;
fmt::format_to_n(ic->message, strlen(name) + 1, "{}\0", name);
strcpy(ic->message, spell_link);
return outapp;
}
@@ -3967,11 +3965,11 @@ void MessageComponent::ResolveArguments(uint32_t id, std::array<const char*, 9>&
switch (id) {
case SPELL_FIZZLE:
case MISS_NOTE:
args[0] = nullptr; // drop spell link
args[0] = nullptr; // the 0th (and only) argument here is the spell link, not supported before TOB
break;
case SPELL_FIZZLE_OTHER:
case MISSED_NOTE_OTHER:
args[1] = nullptr; // drop spell link
args[1] = nullptr; // the 1st argument here is the spell link, not supported before TOB
break;
default:
break;
+1 -1
View File
@@ -50,7 +50,7 @@ public:
std::unique_ptr<EQApplicationPacket> Simple(uint32_t color, uint32_t id) const override;
std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const std::array<const char*, 9>& args) const override;
const FormattedArgs& args) const override;
std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
const char* spell_link) const override;
+9 -9
View File
@@ -34,8 +34,13 @@ Copyright (C) 2001-2026 EQEmu Development Team
#include "common/rulesys.h"
#include "common/path_manager.h"
#include "common/classes.h"
#include "common/packet_dump.h"
#include "common/races.h"
#include "common/raid.h"
#include "world/sof_char_create_data.h"
#include "zone/client.h"
#include "zone/mob.h"
#include "zone/string_ids.h"
#include <iostream>
#include <sstream>
@@ -44,12 +49,6 @@ Copyright (C) 2001-2026 EQEmu Development Team
#include <cinttypes>
#include <set>
#include "common/packet_dump.h"
#include "world/sof_char_create_data.h"
#include "zone/client.h"
#include "zone/mob.h"
#include "zone/string_ids.h"
namespace TOB
{
static const char* name = "TOB";
@@ -5566,7 +5565,7 @@ void MessageComponent::ResolveArguments(uint32_t id, std::array<const char*, 9>&
}
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(uint32_t color, uint32_t id,
const std::array<const char*, 9>& args) const
const FormattedArgs& args) const
{
uint32_t string_id = ResolveID(id);
if (string_id > 0) {
@@ -5605,7 +5604,7 @@ std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpell(uint32_t m
auto ic = reinterpret_cast<InterruptCast_Struct*>(outapp->pBuffer);
ic->messageid = ResolveID(message);
ic->spawnid = spawn_id;
fmt::format_to_n(ic->message, strlen(spell_link) + 1, "{}\0", spell_link);
strcpy(ic->message, spell_link);
outapp->priority = 5;
return outapp;
@@ -5620,7 +5619,8 @@ std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpellOther(Mob*
auto ic = reinterpret_cast<InterruptCast_Struct*>(outapp->pBuffer);
ic->messageid = ResolveID(message);
ic->spawnid = spawn_id;
fmt::format_to_n(ic->message, strlen(name) + strlen(spell_link) + 2, "{}\0{}\0", name, spell_link);
strcpy(ic->message, name);
strcpy(&ic->message[strlen(name) + 1], spell_link);
return outapp;
}
+1 -1
View File
@@ -49,7 +49,7 @@ public:
~MessageComponent() override = default;
std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
const std::array<const char*, 9>& args) const override;
const FormattedArgs& args) const override;
std::unique_ptr<EQApplicationPacket> InterruptSpell(uint32_t message, uint32_t spawn_id,
const char* spell_link) const override;
+1 -2
View File
@@ -33,13 +33,12 @@
#include "common/raid.h"
#include "common/rulesys.h"
#include "common/strings.h"
#include "zone/mob.h"
#include "cereal/types/vector.hpp"
#include <iostream>
#include <sstream>
#include "zone/mob.h"
namespace UF
{