Reintegration of inventory-based EQDictionary references

This commit is contained in:
Uleat
2018-07-05 21:05:26 -04:00
parent d2683022e1
commit c435a77813
91 changed files with 4474 additions and 4546 deletions
+36 -36
View File
@@ -1632,18 +1632,18 @@ namespace SoD
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
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);
OUT(bandoliers[r].Items[k].Icon);
OUT_str(bandoliers[r].Items[k].Name);
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
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;
eq->bandoliers[r].Items[k].Icon = 0;
eq->bandoliers[r].Items[k].Name[0] = '\0';
@@ -1653,13 +1653,13 @@ namespace SoD
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
for (r = 0; r < EQEmu::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 indexes diverge, with a client bias
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
for (r = EQEmu::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';
@@ -1947,8 +1947,8 @@ namespace SoD
eq->CharCount = emu->CharCount;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
FINISH_ENCODE();
return;
@@ -1960,7 +1960,7 @@ namespace SoD
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -1976,8 +1976,8 @@ namespace SoD
eq->CharCount = character_count;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
emu_ptr = __emu_buffer;
emu_ptr += sizeof(CharacterSelect_Struct);
@@ -3578,7 +3578,7 @@ namespace SoD
ibs.nodrop = item->NoDrop;
ibs.attune = item->Attuneable;
ibs.size = item->Size;
ibs.slots = SwapBits21and22(item->Slots);
ibs.slots = SwapBits21And22(item->Slots);
ibs.price = item->Price;
ibs.icon = item->Icon;
ibs.unknown1 = 1;
@@ -3668,7 +3668,7 @@ namespace SoD
isbs.augtype = item->AugType;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < invaug::ItemAugSize; ++index) {
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -3841,18 +3841,18 @@ namespace SoD
ob.write((const char*)&subitem_count, sizeof(uint32));
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
int SubSlotNumber = INVALID_INDEX;
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
else
SubSlotNumber = slot_id_in;
@@ -3870,16 +3870,16 @@ namespace SoD
{
uint32 SoDSlot = 0;
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (serverSlot >= EQEmu::invslot::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END)
SoDSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END)
else if (serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
else if (serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot == EQEmu::inventory::slotPowerSource)
SoDSlot = invslot::PossessionsPowerSource;
else if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
SoDSlot = invslot::slotPowerSource;
else
SoDSlot = serverSlot;
return SoDSlot;
@@ -3895,16 +3895,16 @@ namespace SoD
{
uint32 ServerSlot = 0;
if (sodSlot >= invslot::PossessionsAmmo && sodSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (sodSlot >= invslot::slotAmmo && sodSlot <= invslot::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
ServerSlot = sodSlot - 1;
else if (sodSlot >= invbag::GeneralBagsBegin && sodSlot <= invbag::CursorBagEnd)
else if (sodSlot >= invbag::GENERAL_BAGS_BEGIN && sodSlot <= invbag::CURSOR_BAG_END)
ServerSlot = sodSlot - 11;
else if (sodSlot >= invbag::BankBagsBegin && sodSlot <= invbag::BankBagsEnd)
else if (sodSlot >= invbag::BANK_BAGS_BEGIN && sodSlot <= invbag::BANK_BAGS_END)
ServerSlot = sodSlot - 1;
else if (sodSlot >= invbag::SharedBankBagsBegin && sodSlot <= invbag::SharedBankBagsEnd)
else if (sodSlot >= invbag::SHARED_BANK_BAGS_BEGIN && sodSlot <= invbag::SHARED_BANK_BAGS_END)
ServerSlot = sodSlot - 1;
else if (sodSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::inventory::slotPowerSource;
else if (sodSlot == invslot::slotPowerSource)
ServerSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
else
ServerSlot = sodSlot;
return ServerSlot;
@@ -3918,7 +3918,7 @@ namespace SoD
static inline void ServerToSoDSayLink(std::string& sodSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
sodSayLink = serverSayLink;
return;
}
@@ -3927,7 +3927,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
sodSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -3958,7 +3958,7 @@ namespace SoD
static inline void SoDToServerSayLink(std::string& serverSayLink, const std::string& sodSayLink)
{
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (sodSayLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sodSayLink.find('\x12') == std::string::npos)) {
serverSayLink = sodSayLink;
return;
}
@@ -3967,7 +3967,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;