mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
Updated class naming
This commit is contained in:
@@ -16,7 +16,7 @@ class Mob;
|
||||
class EQApplicationPacket;
|
||||
class Buffs_Struct;
|
||||
|
||||
namespace Buff {
|
||||
namespace ClientPatch {
|
||||
|
||||
class IBuff
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ class Client;
|
||||
class Mob;
|
||||
class EQApplicationPacket;
|
||||
|
||||
namespace Message {
|
||||
namespace ClientPatch {
|
||||
|
||||
template<typename... Args>
|
||||
concept AllConstChar = (std::is_convertible_v<Args, const char*> && ...);
|
||||
|
||||
@@ -36,32 +36,32 @@ struct ClientComponents
|
||||
{
|
||||
switch (version) {
|
||||
case Version::TOB:
|
||||
buffComponent = std::make_unique<Buff::TOB>();
|
||||
messageComponent = std::make_unique<Message::TOB>();
|
||||
buffComponent = std::make_unique<TOB::BuffComponent>();
|
||||
messageComponent = std::make_unique<TOB::MessageComponent>();
|
||||
break;
|
||||
case Version::RoF2:
|
||||
buffComponent = std::make_unique<Buff::UF>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<UF::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
case Version::RoF:
|
||||
buffComponent = std::make_unique<Buff::UF>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<UF::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
case Version::UF:
|
||||
buffComponent = std::make_unique<Buff::UF>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<UF::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
case Version::SoD:
|
||||
buffComponent = std::make_unique<Buff::SoD>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<SoD::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
case Version::SoF:
|
||||
buffComponent = std::make_unique<Buff::Titanium>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<Titanium::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
case Version::Titanium:
|
||||
buffComponent = std::make_unique<Buff::Titanium>();
|
||||
messageComponent = std::make_unique<Message::Titanium>();
|
||||
buffComponent = std::make_unique<Titanium::BuffComponent>();
|
||||
messageComponent = std::make_unique<Titanium::MessageComponent>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -69,8 +69,8 @@ struct ClientComponents
|
||||
}
|
||||
|
||||
const Version version;
|
||||
std::unique_ptr<Buff::IBuff> buffComponent;
|
||||
std::unique_ptr<Message::IMessage> messageComponent;
|
||||
std::unique_ptr<ClientPatch::IBuff> buffComponent;
|
||||
std::unique_ptr<ClientPatch::IMessage> messageComponent;
|
||||
};
|
||||
|
||||
// this array must be in the same order as the Version enum because it converts Version to index directly
|
||||
@@ -88,12 +88,14 @@ static const std::array<ClientComponents, EQ::versions::ClientVersionCount> s_pa
|
||||
}
|
||||
};
|
||||
|
||||
const std::unique_ptr<Buff::IBuff>& GetBuffComponent(Version version)
|
||||
template<>
|
||||
const std::unique_ptr<ClientPatch::IBuff>& GetComponent(Version version)
|
||||
{
|
||||
return s_patches.at(static_cast<uint32_t>(version)).buffComponent;
|
||||
}
|
||||
|
||||
const std::unique_ptr<Message::IMessage>& GetMessageComponent(Version version)
|
||||
template<>
|
||||
const std::unique_ptr<ClientPatch::IMessage>& GetComponent(Version version)
|
||||
{
|
||||
return s_patches.at(static_cast<uint32_t>(version)).messageComponent;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,26 @@
|
||||
#include "common/emu_versions.h"
|
||||
#include <memory>
|
||||
|
||||
namespace Buff { class IBuff; }
|
||||
namespace Message { class IMessage; }
|
||||
#include "zone/client.h"
|
||||
|
||||
namespace ClientPatch {
|
||||
class IBuff;
|
||||
class IMessage;
|
||||
}
|
||||
|
||||
// store all static functions for the different patches here
|
||||
// store all static functions for the different patches here, this can return nullptr for unsupported patches
|
||||
const std::unique_ptr<Buff::IBuff>& GetBuffComponent(EQ::versions::ClientVersion version);
|
||||
const std::unique_ptr<Message::IMessage>& GetMessageComponent(EQ::versions::ClientVersion version);
|
||||
template <typename Component>
|
||||
const std::unique_ptr<Component>& GetComponent(EQ::versions::ClientVersion version);
|
||||
|
||||
template <>
|
||||
const std::unique_ptr<ClientPatch::IBuff>& GetComponent(EQ::versions::ClientVersion version);
|
||||
|
||||
template <>
|
||||
const std::unique_ptr<ClientPatch::IMessage>& GetComponent(EQ::versions::ClientVersion version);
|
||||
|
||||
template <typename Component>
|
||||
static Component* GetClientComponent(const Client* client)
|
||||
{
|
||||
return GetComponent<Component>(client->GetClientVersion()).get();
|
||||
}
|
||||
|
||||
+15
-22
@@ -22,30 +22,23 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace RoF
|
||||
namespace RoF {
|
||||
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "rof_ops.h"
|
||||
};
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "rof_ops.h"
|
||||
};
|
||||
|
||||
} /*RoF*/
|
||||
|
||||
+15
-22
@@ -22,30 +22,23 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace RoF2
|
||||
namespace RoF2 {
|
||||
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "rof2_ops.h"
|
||||
};
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "rof2_ops.h"
|
||||
};
|
||||
|
||||
}; /*RoF2*/
|
||||
|
||||
@@ -4287,12 +4287,10 @@ namespace SoD
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
} /*SoD*/
|
||||
|
||||
namespace Buff {
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> SoD::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob,
|
||||
bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
{
|
||||
// SoD only supports target refresh, not self refresh packets
|
||||
if (opcode == OP_RefreshTargetBuffs) {
|
||||
@@ -4341,7 +4339,7 @@ std::unique_ptr<EQApplicationPacket> SoD::RefreshBuffs(EmuOpcode opcode, Mob* mo
|
||||
}
|
||||
|
||||
// 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC
|
||||
void SoD::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const
|
||||
void BuffComponent::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const
|
||||
{
|
||||
if (packet) {
|
||||
BuffIcon_Struct *buff = (BuffIcon_Struct*)packet->pBuffer;
|
||||
@@ -4358,4 +4356,4 @@ void SoD::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* sour
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Buff
|
||||
} /*SoD*/
|
||||
|
||||
+21
-32
@@ -22,45 +22,34 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace SoD
|
||||
{
|
||||
namespace SoD {
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "sod_ops.h"
|
||||
};
|
||||
|
||||
} /*SoD*/
|
||||
|
||||
namespace Buff {
|
||||
|
||||
class SoD : public Titanium
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
SoD() = default;
|
||||
~SoD() override = default;
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "sod_ops.h"
|
||||
};
|
||||
|
||||
class BuffComponent : public Titanium::BuffComponent
|
||||
{
|
||||
public:
|
||||
BuffComponent() = default;
|
||||
~BuffComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
|
||||
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const override;
|
||||
};
|
||||
|
||||
} // namespace Buff
|
||||
} /*SoD*/
|
||||
|
||||
+15
-22
@@ -22,30 +22,23 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace SoF
|
||||
namespace SoF {
|
||||
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "sof_ops.h"
|
||||
};
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "sof_ops.h"
|
||||
};
|
||||
|
||||
} /*SoF*/
|
||||
|
||||
+13
-20
@@ -23,27 +23,20 @@ class EQStreamIdentifier;
|
||||
|
||||
namespace TEMPLATE {
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
//magic macro to declare our opcodes
|
||||
#include "ss_declare.h"
|
||||
#include "TEMPLATE_ops.h"
|
||||
|
||||
};
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
//magic macro to declare our opcodes
|
||||
#include "ss_declare.h"
|
||||
#include "TEMPLATE_ops.h"
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
+10
-16
@@ -3921,10 +3921,8 @@ namespace Titanium
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
} /*Titanium*/
|
||||
|
||||
namespace Message {
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::Simple(uint32_t color, uint32_t id) const
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::Simple(uint32_t color, uint32_t id) const
|
||||
{
|
||||
uint32_t string_id = ResolveID(id);
|
||||
if (string_id > 0) {
|
||||
@@ -3940,7 +3938,7 @@ std::unique_ptr<EQApplicationPacket> Titanium::Simple(uint32_t color, uint32_t i
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::Formatted(
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(
|
||||
uint32_t color, uint32_t id, const std::array<const char*, 9>& args) const
|
||||
{
|
||||
uint32_t string_id = ResolveID(id);
|
||||
@@ -3968,7 +3966,7 @@ std::unique_ptr<EQApplicationPacket> Titanium::Formatted(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::InterruptSpell(uint32_t message, uint32_t spawn_id,
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpell(uint32_t message, uint32_t spawn_id,
|
||||
const char* spell_link) const
|
||||
{
|
||||
auto outapp = std::make_unique<EQApplicationPacket>(OP_InterruptCast, sizeof(InterruptCast_Struct));
|
||||
@@ -3980,7 +3978,7 @@ std::unique_ptr<EQApplicationPacket> Titanium::InterruptSpell(uint32_t message,
|
||||
return outapp;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
|
||||
const char* name,
|
||||
const char* spell_link) const
|
||||
{
|
||||
@@ -3993,14 +3991,14 @@ std::unique_ptr<EQApplicationPacket> Titanium::InterruptSpellOther(Mob* sender,
|
||||
}
|
||||
|
||||
// A value of 0 means that the string isn't mapped in this client, valid string ids start at 1
|
||||
uint32_t Titanium::ResolveID(uint32_t id) const
|
||||
uint32_t MessageComponent::ResolveID(uint32_t id) const
|
||||
{
|
||||
// passthrough — string IDs are defined at the base client level;
|
||||
// override in patches where IDs need remapping
|
||||
return id;
|
||||
}
|
||||
|
||||
void Titanium::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
|
||||
void MessageComponent::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
|
||||
{
|
||||
switch (id) {
|
||||
case SPELL_FIZZLE:
|
||||
@@ -4016,11 +4014,7 @@ void Titanium::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) c
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Message
|
||||
|
||||
namespace Buff {
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot,
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot,
|
||||
bool fade) const
|
||||
{
|
||||
auto outapp = std::make_unique<EQApplicationPacket>(OP_BuffDefinition, sizeof(SpellBuffPacket_Struct));
|
||||
@@ -4054,12 +4048,12 @@ std::unique_ptr<EQApplicationPacket> Titanium::BuffDefinition(Mob* mob, const Bu
|
||||
return outapp;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Titanium::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Titanium::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const {}
|
||||
void BuffComponent::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const {}
|
||||
|
||||
} // namespace Buff
|
||||
} /*Titanium*/
|
||||
|
||||
+24
-40
@@ -23,42 +23,30 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace Titanium
|
||||
{
|
||||
namespace Titanium {
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "titanium_ops.h"
|
||||
};
|
||||
|
||||
} /*Titanium*/
|
||||
|
||||
// out-going message packets
|
||||
namespace Message {
|
||||
|
||||
class Titanium : public IMessage
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
Titanium() = default;
|
||||
~Titanium() override = default;
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "titanium_ops.h"
|
||||
};
|
||||
|
||||
class MessageComponent : public ClientPatch::IMessage
|
||||
{
|
||||
public:
|
||||
MessageComponent() = default;
|
||||
~MessageComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Simple(uint32_t color, uint32_t id) const override;
|
||||
std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
|
||||
@@ -75,15 +63,11 @@ protected:
|
||||
virtual void ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const;
|
||||
};
|
||||
|
||||
} // namespace Message
|
||||
|
||||
namespace Buff {
|
||||
|
||||
class Titanium : public IBuff
|
||||
class BuffComponent : public ClientPatch::IBuff
|
||||
{
|
||||
public:
|
||||
Titanium() = default;
|
||||
~Titanium() override = default;
|
||||
BuffComponent() = default;
|
||||
~BuffComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot,
|
||||
bool fade) const override;
|
||||
@@ -92,5 +76,5 @@ public:
|
||||
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const override;
|
||||
};
|
||||
|
||||
} // namespace Buff
|
||||
} /*Titanium*/
|
||||
|
||||
|
||||
+34
-37
@@ -5478,16 +5478,13 @@ namespace TOB
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
} /*TOB*/
|
||||
|
||||
namespace Message {
|
||||
|
||||
struct TOBStringIDs
|
||||
{
|
||||
static constexpr uint32_t DisarmedTrap = 1458; // You successfully disarmed the trap
|
||||
};
|
||||
|
||||
uint32_t TOB::ResolveID(uint32_t id) const
|
||||
uint32_t MessageComponent::ResolveID(uint32_t id) const
|
||||
{
|
||||
switch (id) {
|
||||
case YOU_FLURRY:
|
||||
@@ -5531,11 +5528,11 @@ uint32_t TOB::ResolveID(uint32_t id) const
|
||||
case DISARMED_TRAP:
|
||||
return TOBStringIDs::DisarmedTrap;
|
||||
default:
|
||||
return Titanium::ResolveID(id);
|
||||
return Titanium::MessageComponent::ResolveID(id);
|
||||
}
|
||||
}
|
||||
|
||||
void TOB::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
|
||||
void MessageComponent::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
|
||||
{
|
||||
switch (id) {
|
||||
case SPELL_FIZZLE:
|
||||
@@ -5545,12 +5542,12 @@ void TOB::ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const
|
||||
// take all arguments (spell link)
|
||||
break;
|
||||
default:
|
||||
Titanium::ResolveArguments(id, args);
|
||||
Titanium::MessageComponent::ResolveArguments(id, args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> TOB::Formatted(uint32_t color, uint32_t id,
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::Formatted(uint32_t color, uint32_t id,
|
||||
const std::array<const char*, 9>& args) const
|
||||
{
|
||||
uint32_t string_id = ResolveID(id);
|
||||
@@ -5583,7 +5580,7 @@ std::unique_ptr<EQApplicationPacket> TOB::Formatted(uint32_t color, uint32_t id,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> TOB::InterruptSpell(uint32_t message, uint32_t spawn_id,
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpell(uint32_t message, uint32_t spawn_id,
|
||||
const char* spell_link) const
|
||||
{
|
||||
auto outapp = std::make_unique<EQApplicationPacket>(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(spell_link) + 1);
|
||||
@@ -5596,7 +5593,7 @@ std::unique_ptr<EQApplicationPacket> TOB::InterruptSpell(uint32_t message, uint3
|
||||
return outapp;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> TOB::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
|
||||
std::unique_ptr<EQApplicationPacket> MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id,
|
||||
const char* name,
|
||||
const char* spell_link) const
|
||||
{
|
||||
@@ -5610,21 +5607,19 @@ std::unique_ptr<EQApplicationPacket> TOB::InterruptSpellOther(Mob* sender, uint3
|
||||
return outapp;
|
||||
}
|
||||
|
||||
} // namespace Message
|
||||
|
||||
namespace Buff {
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> TOB::BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot, bool fade) const
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot, bool fade) const
|
||||
{
|
||||
auto packet = std::make_unique<EQApplicationPacket>(OP_BuffDefinition, sizeof(::TOB::structs::EQAffectPacket_Struct));
|
||||
auto affect = reinterpret_cast<::TOB::structs::EQAffectPacket_Struct*>(packet->pBuffer);
|
||||
auto packet = std::make_unique<EQApplicationPacket>(OP_BuffDefinition, sizeof(structs::EQAffectPacket_Struct));
|
||||
auto affect = reinterpret_cast<structs::EQAffectPacket_Struct*>(packet->pBuffer);
|
||||
|
||||
// base packet
|
||||
affect->entity_id = mob->GetID();
|
||||
affect->unknown004 = 0;
|
||||
affect->slot_id = ::TOB::ServerToTOBBuffSlot(slot);
|
||||
affect->slot_id = ServerToTOBBuffSlot(slot);
|
||||
affect->buff_fade = fade ? 1 : 2; // 1 is remove, 2 is modify, 3 is add (only seen 1 and 2 sent)
|
||||
|
||||
memset(&affect->affect, 0, sizeof(affect->affect));
|
||||
|
||||
// affect slots
|
||||
for (int affect_slot = 0; affect_slot < 6; ++affect_slot) {
|
||||
// all of this is unknown, just what we've seen
|
||||
@@ -5633,22 +5628,24 @@ std::unique_ptr<EQApplicationPacket> TOB::BuffDefinition(Mob* mob, const Buffs_S
|
||||
affect->affect.slots[affect_slot].value = 0; // this is always 0
|
||||
}
|
||||
|
||||
// affect info
|
||||
affect->affect.caster_id.Id = buff.casterid;
|
||||
affect->affect.caster_id.WorldId = RuleI(World, Id);
|
||||
affect->affect.caster_id.Reserved = 0;
|
||||
affect->affect.flags = 0;
|
||||
affect->affect.spell_id = buff.spellid;
|
||||
affect->affect.duration = buff.ticsremaining;
|
||||
affect->affect.initial_duration = buff.ticsremaining; // TODO: this isn't correct, it's the total duration
|
||||
affect->affect.hit_count = buff.hit_number;
|
||||
affect->affect.viral_timer = 0;
|
||||
affect->affect.modifier = static_cast<float>(buff.instrument_mod) / 10.f;
|
||||
affect->affect.y = static_cast<float>(buff.caston_y);
|
||||
affect->affect.x = static_cast<float>(buff.caston_x);
|
||||
affect->affect.z = static_cast<float>(buff.caston_z);
|
||||
affect->affect.type = 2;
|
||||
affect->affect.level = buff.casterlevel > 0 ? buff.casterlevel : mob->GetLevel();
|
||||
if (!fade) {
|
||||
// affect info
|
||||
affect->affect.caster_id.Id = buff.casterid;
|
||||
affect->affect.caster_id.WorldId = RuleI(World, Id);
|
||||
affect->affect.caster_id.Reserved = 0;
|
||||
affect->affect.flags = 0;
|
||||
affect->affect.spell_id = buff.spellid;
|
||||
affect->affect.duration = buff.ticsremaining;
|
||||
affect->affect.initial_duration = buff.ticsremaining; // TODO: this isn't correct, it's the total duration
|
||||
affect->affect.hit_count = buff.hit_number;
|
||||
affect->affect.viral_timer = 0;
|
||||
affect->affect.modifier = static_cast<float>(buff.instrument_mod) / 10.f;
|
||||
affect->affect.y = static_cast<float>(buff.caston_y);
|
||||
affect->affect.x = static_cast<float>(buff.caston_x);
|
||||
affect->affect.z = static_cast<float>(buff.caston_z);
|
||||
affect->affect.type = 2;
|
||||
affect->affect.level = buff.casterlevel > 0 ? buff.casterlevel : mob->GetLevel();
|
||||
}
|
||||
|
||||
//no idea if these are right; eqlib doesn't seem to know either
|
||||
if (buff.dot_rune > 0)
|
||||
@@ -5666,7 +5663,7 @@ std::unique_ptr<EQApplicationPacket> TOB::BuffDefinition(Mob* mob, const Buffs_S
|
||||
return packet;
|
||||
}
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> TOB::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
{
|
||||
Buffs_Struct* buffs = mob->GetBuffs();
|
||||
@@ -5710,7 +5707,7 @@ std::unique_ptr<EQApplicationPacket> TOB::RefreshBuffs(EmuOpcode opcode, Mob* mo
|
||||
}
|
||||
|
||||
// 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC
|
||||
void TOB::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const
|
||||
void BuffComponent::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const
|
||||
{
|
||||
if (packet) {
|
||||
unsigned char* type = &packet->pBuffer[packet->size - 2];
|
||||
@@ -5728,4 +5725,4 @@ void TOB::SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* sour
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Buff
|
||||
} /*TOB*/
|
||||
+24
-40
@@ -5,42 +5,30 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace TOB
|
||||
{
|
||||
namespace TOB {
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "tob_ops.h"
|
||||
|
||||
};
|
||||
|
||||
}; /*TOB*/
|
||||
|
||||
namespace Message {
|
||||
|
||||
class TOB : public Titanium
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
TOB() = default;
|
||||
~TOB() override = default;
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "tob_ops.h"
|
||||
};
|
||||
|
||||
class MessageComponent : public Titanium::MessageComponent
|
||||
{
|
||||
public:
|
||||
MessageComponent() = default;
|
||||
~MessageComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> Formatted(uint32_t color, uint32_t id,
|
||||
const std::array<const char*, 9>& args) const override;
|
||||
@@ -55,15 +43,11 @@ protected:
|
||||
void ResolveArguments(uint32_t id, std::array<const char*, 9>& args) const override;
|
||||
};
|
||||
|
||||
} // namespace Message
|
||||
|
||||
namespace Buff {
|
||||
|
||||
class TOB : public UF
|
||||
class BuffComponent : public UF::BuffComponent
|
||||
{
|
||||
public:
|
||||
TOB() = default;
|
||||
~TOB() override = default;
|
||||
BuffComponent() = default;
|
||||
~BuffComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket>
|
||||
BuffDefinition(Mob* mob, const Buffs_Struct& buff, int slot, bool fade) const override;
|
||||
@@ -72,4 +56,4 @@ public:
|
||||
void SetRefreshType(std::unique_ptr<EQApplicationPacket>& packet, Mob* source, Client* target) const override;
|
||||
};
|
||||
|
||||
} // namespace Buff
|
||||
}; /*TOB*/
|
||||
|
||||
@@ -5235,12 +5235,10 @@ namespace UF
|
||||
// we're a normal buff
|
||||
return index; // as long as we guard against bad slots server side, we should be fine
|
||||
}
|
||||
} /*UF*/
|
||||
|
||||
namespace Buff {
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> UF::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
std::unique_ptr<EQApplicationPacket> BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob,
|
||||
bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const
|
||||
{
|
||||
// UF introduced the self update buff packet
|
||||
|
||||
@@ -5286,4 +5284,4 @@ std::unique_ptr<EQApplicationPacket> UF::RefreshBuffs(EmuOpcode opcode, Mob* mob
|
||||
return outapp;
|
||||
}
|
||||
|
||||
} // namespace Buff
|
||||
} /*UF*/
|
||||
|
||||
+21
-32
@@ -22,44 +22,33 @@
|
||||
|
||||
class EQStreamIdentifier;
|
||||
|
||||
namespace UF
|
||||
{
|
||||
namespace UF {
|
||||
|
||||
//these are the only public member of this namespace.
|
||||
extern void Register(EQStreamIdentifier &into);
|
||||
extern void Reload();
|
||||
extern void Register(EQStreamIdentifier& into);
|
||||
extern void Reload();
|
||||
|
||||
|
||||
|
||||
//you should not directly access anything below..
|
||||
//I just dont feel like making a seperate header for it.
|
||||
|
||||
class Strategy : public StructStrategy {
|
||||
public:
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "uf_ops.h"
|
||||
};
|
||||
|
||||
}; /*UF*/
|
||||
|
||||
namespace Buff {
|
||||
|
||||
class UF : public SoD
|
||||
class Strategy : public StructStrategy
|
||||
{
|
||||
public:
|
||||
UF() = default;
|
||||
~UF() override = default;
|
||||
Strategy();
|
||||
|
||||
protected:
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "ss_declare.h"
|
||||
#include "uf_ops.h"
|
||||
};
|
||||
|
||||
class BuffComponent : public SoD::BuffComponent
|
||||
{
|
||||
public:
|
||||
BuffComponent() = default;
|
||||
~BuffComponent() override = default;
|
||||
|
||||
std::unique_ptr<EQApplicationPacket> RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove,
|
||||
bool buff_timers_suspended, const std::vector<uint32_t>& slots) const override;
|
||||
};
|
||||
|
||||
} // namespace Buff
|
||||
}; /*UF*/
|
||||
|
||||
Reference in New Issue
Block a user