Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore)

This commit is contained in:
KimLS
2020-05-17 18:36:06 -07:00
parent 06104b624a
commit 2fbd5aaccc
198 changed files with 6111 additions and 6111 deletions
+111 -111
View File
@@ -43,7 +43,7 @@ namespace UF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToUFSlot(uint32 serverSlot);
@@ -59,8 +59,8 @@ namespace UF
// client to server say link converter
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToUFBuffSlot(int index);
static inline int UFToServerBuffSlot(int index);
@@ -144,9 +144,9 @@ namespace UF
return(r);
}
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
const EQ::versions::ClientVersion Strategy::ClientVersion() const
{
return EQEmu::versions::ClientVersion::UF;
return EQ::versions::ClientVersion::UF;
}
#include "ss_define.h"
@@ -501,24 +501,24 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
delete in;
return;
}
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("UF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -1268,14 +1268,14 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("UF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1693,7 +1693,7 @@ namespace UF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1725,7 +1725,7 @@ namespace UF
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1734,14 +1734,14 @@ namespace UF
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1797,7 +1797,7 @@ namespace UF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1806,7 +1806,7 @@ namespace UF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1818,13 +1818,13 @@ namespace UF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2196,7 +2196,7 @@ namespace UF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2755,7 +2755,7 @@ namespace UF
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
if (emu->size == 0)
{
@@ -2954,7 +2954,7 @@ namespace UF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -2990,7 +2990,7 @@ namespace UF
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
if (emu->equipment.Slot[k].Material > 99999) {
Equipment[k].Material = 63;
} else {
@@ -3000,7 +3000,7 @@ namespace UF
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
}
if (strlen(emu->title))
{
@@ -3498,7 +3498,7 @@ namespace UF
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
if (eq->spell[i] == 0)
emu->spell[i] = 0xFFFFFFFF;
else
@@ -3737,9 +3737,9 @@ namespace UF
return NextItemInstSerialNumber;
}
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQEmu::ItemData *item = inst->GetUnscaledItem();
const EQ::ItemData *item = inst->GetUnscaledItem();
UF::structs::ItemSerializationHeader hdr;
@@ -3783,7 +3783,7 @@ namespace UF
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const EQEmu::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQ::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ornaIcon = aug_weap->Icon;
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
@@ -3968,7 +3968,7 @@ namespace UF
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQEmu::item::ItemTypeFishingPole && item->SubType == 0) {
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
@@ -4116,30 +4116,30 @@ namespace UF
ob.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct));
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
EQ::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -4158,59 +4158,59 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
if (serverSlot <= EQ::invslot::slotGeneral8) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
UFSlot = serverSlot - 2;
}
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
UFSlot = serverSlot + 11;
}
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
UFSlot = serverSlot - 9;
}
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
UFSlot = serverSlot;
}
@@ -4223,11 +4223,11 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverCorpseSlot <= EQEmu::invslot::slotGeneral8 && serverCorpseSlot >= EQEmu::invslot::slotGeneral1) {
if (serverCorpseSlot <= EQ::invslot::slotGeneral8 && serverCorpseSlot >= EQ::invslot::slotGeneral1) {
UFSlot = serverCorpseSlot;
}
else if (serverCorpseSlot <= EQEmu::invslot::CORPSE_END && serverCorpseSlot >= EQEmu::invslot::slotCursor) {
else if (serverCorpseSlot <= EQ::invslot::CORPSE_END && serverCorpseSlot >= EQ::invslot::slotCursor) {
UFSlot = serverCorpseSlot - 2;
}
@@ -4238,7 +4238,7 @@ namespace UF
static inline uint32 UFToServerSlot(uint32 ufSlot)
{
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
if (ufSlot <= invslot::slotGeneral8) {
ServerSlot = ufSlot;
@@ -4303,7 +4303,7 @@ namespace UF
static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot)
{
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
if (ufCorpseSlot <= invslot::slotGeneral8 && ufCorpseSlot >= invslot::slotGeneral1) {
ServerSlot = ufCorpseSlot;
@@ -4320,7 +4320,7 @@ namespace UF
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
ufSayLink = serverSayLink;
return;
}
@@ -4329,7 +4329,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
ufSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4360,7 +4360,7 @@ namespace UF
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
{
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
serverSayLink = ufSayLink;
return;
}
@@ -4394,92 +4394,92 @@ namespace UF
}
}
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot)
{
switch (slot) {
case EQEmu::spells::CastingSlot::Gem1:
case EQ::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQEmu::spells::CastingSlot::Gem2:
case EQ::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQEmu::spells::CastingSlot::Gem3:
case EQ::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQEmu::spells::CastingSlot::Gem4:
case EQ::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQEmu::spells::CastingSlot::Gem5:
case EQ::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQEmu::spells::CastingSlot::Gem6:
case EQ::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQEmu::spells::CastingSlot::Gem7:
case EQ::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQEmu::spells::CastingSlot::Gem8:
case EQ::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQEmu::spells::CastingSlot::Gem9:
case EQ::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQEmu::spells::CastingSlot::Gem10:
case EQ::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQEmu::spells::CastingSlot::Gem11:
case EQ::spells::CastingSlot::Gem11:
return spells::CastingSlot::Gem11;
case EQEmu::spells::CastingSlot::Gem12:
case EQ::spells::CastingSlot::Gem12:
return spells::CastingSlot::Gem12;
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQEmu::spells::CastingSlot::Discipline:
case EQ::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQEmu::spells::CastingSlot::AltAbility:
case EQ::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQEmu::spells::CastingSlot::Gem1;
return EQ::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQEmu::spells::CastingSlot::Gem2;
return EQ::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQEmu::spells::CastingSlot::Gem3;
return EQ::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQEmu::spells::CastingSlot::Gem4;
return EQ::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQEmu::spells::CastingSlot::Gem5;
return EQ::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQEmu::spells::CastingSlot::Gem6;
return EQ::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQEmu::spells::CastingSlot::Gem7;
return EQ::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQEmu::spells::CastingSlot::Gem8;
return EQ::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQEmu::spells::CastingSlot::Gem9;
return EQ::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQEmu::spells::CastingSlot::Gem10;
return EQ::spells::CastingSlot::Gem10;
case spells::CastingSlot::Gem11:
return EQEmu::spells::CastingSlot::Gem11;
return EQ::spells::CastingSlot::Gem11;
case spells::CastingSlot::Gem12:
return EQEmu::spells::CastingSlot::Gem12;
return EQ::spells::CastingSlot::Gem12;
case spells::CastingSlot::Discipline:
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQEmu::spells::CastingSlot::Item;
return EQ::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQEmu::spells::CastingSlot::AltAbility;
return EQ::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
}
}
static inline int ServerToUFBuffSlot(int index)
{
// we're a disc
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -4488,11 +4488,11 @@ namespace UF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}