mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
commit
3ebbcd84d4
@ -24,7 +24,7 @@
|
|||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// EQEmu::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
// EQ::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
||||||
|
|
||||||
#ifndef EQEMU_COMMON_ANY_H
|
#ifndef EQEMU_COMMON_ANY_H
|
||||||
#define EQEMU_COMMON_ANY_H
|
#define EQEMU_COMMON_ANY_H
|
||||||
@ -32,7 +32,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class Any
|
class Any
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
uint32 EstimateDeflateBuffer(uint32 len) {
|
uint32 EstimateDeflateBuffer(uint32 len) {
|
||||||
z_stream zstream;
|
z_stream zstream;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
uint32 EstimateDeflateBuffer(uint32 len);
|
uint32 EstimateDeflateBuffer(uint32 len);
|
||||||
uint32 DeflateData(const char *buffer, uint32 len, char *out_buffer, uint32 out_len_max);
|
uint32 DeflateData(const char *buffer, uint32 len, char *out_buffer, uint32 out_len_max);
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Clamp(const T &value, const T &lower, const T &upper)
|
T Clamp(const T &value, const T &lower, const T &upper)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -751,7 +751,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This only for new Character creation storing */
|
/* This only for new Character creation storing */
|
||||||
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv) {
|
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv) {
|
||||||
uint32 charid = 0;
|
uint32 charid = 0;
|
||||||
char zone[50];
|
char zone[50];
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
@ -779,8 +779,8 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
|||||||
|
|
||||||
/* Insert starting inventory... */
|
/* Insert starting inventory... */
|
||||||
std::string invquery;
|
std::string invquery;
|
||||||
for (int16 i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invbag::BANK_BAGS_END;) {
|
for (int16 i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invbag::BANK_BAGS_END;) {
|
||||||
const EQEmu::ItemInstance* newinv = inv->GetItem(i);
|
const EQ::ItemInstance* newinv = inv->GetItem(i);
|
||||||
if (newinv) {
|
if (newinv) {
|
||||||
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
||||||
charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor());
|
charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor());
|
||||||
@ -788,16 +788,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
|||||||
auto results = QueryDatabase(invquery);
|
auto results = QueryDatabase(invquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == EQEmu::invslot::slotCursor) {
|
if (i == EQ::invslot::slotCursor) {
|
||||||
i = EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
i = EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (i == EQEmu::invbag::CURSOR_BAG_END) {
|
else if (i == EQ::invbag::CURSOR_BAG_END) {
|
||||||
i = EQEmu::invslot::BANK_BEGIN;
|
i = EQ::invslot::BANK_BEGIN;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (i == EQEmu::invslot::BANK_END) {
|
else if (i == EQ::invslot::BANK_END) {
|
||||||
i = EQEmu::invbag::BANK_BAGS_BEGIN;
|
i = EQ::invbag::BANK_BAGS_BEGIN;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
class MySQLRequestResult;
|
class MySQLRequestResult;
|
||||||
class Client;
|
class Client;
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class InventoryProfile;
|
class InventoryProfile;
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
||||||
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
|
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
|
||||||
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
|
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
|
||||||
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv);
|
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv);
|
||||||
bool UpdateName(const char* oldname, const char* newname);
|
bool UpdateName(const char* oldname, const char* newname);
|
||||||
|
|
||||||
/* General Information Queries */
|
/* General Information Queries */
|
||||||
|
|||||||
@ -189,7 +189,7 @@ namespace Convert {
|
|||||||
/*002*/ uint32 HP;
|
/*002*/ uint32 HP;
|
||||||
/*006*/ uint32 Mana;
|
/*006*/ uint32 Mana;
|
||||||
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
|
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||||
/*510*/ uint32 Items[EQEmu::textures::materialCount];
|
/*510*/ uint32 Items[EQ::textures::materialCount];
|
||||||
/*546*/ char Name[64];
|
/*546*/ char Name[64];
|
||||||
/*610*/
|
/*610*/
|
||||||
};
|
};
|
||||||
@ -230,9 +230,9 @@ namespace Convert {
|
|||||||
/*0304*/ uint8 ability_time_minutes;
|
/*0304*/ uint8 ability_time_minutes;
|
||||||
/*0305*/ uint8 ability_time_hours; //place holder
|
/*0305*/ uint8 ability_time_hours; //place holder
|
||||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||||
/*0312*/ uint32 item_material[EQEmu::textures::materialCount]; // Item texture/material of worn/held items
|
/*0312*/ uint32 item_material[EQ::textures::materialCount]; // Item texture/material of worn/held items
|
||||||
/*0348*/ uint8 unknown0348[44];
|
/*0348*/ uint8 unknown0348[44];
|
||||||
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::materialCount];
|
/*0392*/ Convert::Color_Struct item_tint[EQ::textures::materialCount];
|
||||||
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
|
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||||
/*2352*/ char servername[32]; // length probably not right
|
/*2352*/ char servername[32]; // length probably not right
|
||||||
@ -1396,7 +1396,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
|||||||
if (rquery != ""){ results = QueryDatabase(rquery); }
|
if (rquery != ""){ results = QueryDatabase(rquery); }
|
||||||
/* Run Material Color Convert */
|
/* Run Material Color Convert */
|
||||||
first_entry = 0; rquery = "";
|
first_entry = 0; rquery = "";
|
||||||
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++){
|
for (i = EQ::textures::textureBegin; i < EQ::textures::materialCount; i++){
|
||||||
if (pp->item_tint[i].color > 0){
|
if (pp->item_tint[i].color > 0){
|
||||||
if (first_entry != 1){
|
if (first_entry != 1){
|
||||||
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
|
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#include "deity.h"
|
#include "deity.h"
|
||||||
|
|
||||||
|
|
||||||
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
|
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
|
||||||
{
|
{
|
||||||
switch (deity_type) {
|
switch (deity_type) {
|
||||||
case DeityBertoxxulous:
|
case DeityBertoxxulous:
|
||||||
@ -63,7 +63,7 @@ EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityTyp
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
|
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
|
||||||
{
|
{
|
||||||
switch (deity_type_bit) {
|
switch (deity_type_bit) {
|
||||||
case bit_DeityAgnostic:
|
case bit_DeityAgnostic:
|
||||||
@ -105,7 +105,7 @@ EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBi
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::deity::DeityName(DeityType deity_type)
|
const char* EQ::deity::DeityName(DeityType deity_type)
|
||||||
{
|
{
|
||||||
switch (deity_type) {
|
switch (deity_type) {
|
||||||
case DeityBertoxxulous:
|
case DeityBertoxxulous:
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace deity {
|
namespace deity {
|
||||||
enum DeityType {
|
enum DeityType {
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
|
||||||
|
|
||||||
int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
|
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
||||||
static const int16 local_array[] = {
|
static const int16 local_array[] = {
|
||||||
POSSESSIONS_SIZE,
|
POSSESSIONS_SIZE,
|
||||||
BANK_SIZE,
|
BANK_SIZE,
|
||||||
@ -55,7 +55,7 @@ int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
|
|||||||
return local_array[inv_type];
|
return local_array[inv_type];
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
const char* EQ::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
||||||
switch (category_id) {
|
switch (category_id) {
|
||||||
case catVideo:
|
case catVideo:
|
||||||
return "Video";
|
return "Video";
|
||||||
@ -87,7 +87,7 @@ const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category_name) {
|
EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name) {
|
||||||
if (!category_name)
|
if (!category_name)
|
||||||
return catOther;
|
return catOther;
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category
|
|||||||
return catOther;
|
return catOther;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
|
const char *EQ::constants::GetStanceName(StanceType stance_type) {
|
||||||
switch (stance_type) {
|
switch (stance_type) {
|
||||||
case stanceUnknown:
|
case stanceUnknown:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
@ -146,9 +146,9 @@ const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
||||||
if (stance_type >= EQEmu::constants::stancePassive && stance_type <= EQEmu::constants::stanceBurnAE)
|
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
|
||||||
return (stance_type - EQEmu::constants::stancePassive);
|
return (stance_type - EQ::constants::stancePassive);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// local definitions are the result of using hybrid-client or server-only values and methods
|
// local definitions are the result of using hybrid-client or server-only values and methods
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
using RoF2::IINVALID;
|
using RoF2::IINVALID;
|
||||||
using RoF2::INULL;
|
using RoF2::INULL;
|
||||||
@ -193,7 +193,7 @@ namespace EQEmu
|
|||||||
} // namespace invaug
|
} // namespace invaug
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
const EQEmu::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQEmu::versions::ClientVersion::Titanium;
|
const EQ::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQ::versions::ClientVersion::Titanium;
|
||||||
|
|
||||||
using RoF2::constants::EXPANSION;
|
using RoF2::constants::EXPANSION;
|
||||||
using RoF2::constants::EXPANSION_BIT;
|
using RoF2::constants::EXPANSION_BIT;
|
||||||
@ -332,6 +332,6 @@ namespace EQEmu
|
|||||||
|
|
||||||
/* hack list to prevent circular references
|
/* hack list to prevent circular references
|
||||||
|
|
||||||
eq_limits.h:EQEmu::inventory::LookupEntry::InventoryTypeSize[n];
|
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
|
||||||
|
|
||||||
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
|
bool EQ::versions::IsValidClientVersion(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
||||||
return false;
|
return false;
|
||||||
@ -29,7 +29,7 @@ bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
|
EQ::versions::ClientVersion EQ::versions::ValidateClientVersion(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
|
||||||
return ClientVersion::Unknown;
|
return ClientVersion::Unknown;
|
||||||
@ -37,7 +37,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVers
|
|||||||
return client_version;
|
return client_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
|
const char* EQ::versions::ClientVersionName(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
switch (client_version) {
|
switch (client_version) {
|
||||||
case ClientVersion::Unknown:
|
case ClientVersion::Unknown:
|
||||||
@ -61,7 +61,7 @@ const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
|
uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
switch (client_version) {
|
switch (client_version) {
|
||||||
case ClientVersion::Titanium:
|
case ClientVersion::Titanium:
|
||||||
@ -81,7 +81,7 @@ uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion cli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
|
EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
|
||||||
{
|
{
|
||||||
switch (client_version_bit) {
|
switch (client_version_bit) {
|
||||||
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
|
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
|
||||||
@ -101,7 +101,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
|
bool EQ::versions::IsValidMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
||||||
return false;
|
return false;
|
||||||
@ -109,7 +109,7 @@ bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
|
bool EQ::versions::IsValidPCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
||||||
return false;
|
return false;
|
||||||
@ -117,7 +117,7 @@ bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
bool EQ::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
||||||
return false;
|
return false;
|
||||||
@ -125,7 +125,7 @@ bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
bool EQ::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
||||||
return false;
|
return false;
|
||||||
@ -133,7 +133,7 @@ bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ValidateMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
@ -141,7 +141,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_v
|
|||||||
return mob_version;
|
return mob_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ValidatePCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
@ -149,7 +149,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob
|
|||||||
return mob_version;
|
return mob_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ValidateNonPCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
@ -157,7 +157,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion
|
|||||||
return mob_version;
|
return mob_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
@ -165,7 +165,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVers
|
|||||||
return mob_version;
|
return mob_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
|
const char* EQ::versions::MobVersionName(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
switch (mob_version) {
|
switch (mob_version) {
|
||||||
case MobVersion::Unknown:
|
case MobVersion::Unknown:
|
||||||
@ -217,7 +217,7 @@ const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
|
EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
switch (mob_version) {
|
switch (mob_version) {
|
||||||
case MobVersion::Unknown:
|
case MobVersion::Unknown:
|
||||||
@ -240,7 +240,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
|
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
switch (client_version) {
|
switch (client_version) {
|
||||||
case ClientVersion::Unknown:
|
case ClientVersion::Unknown:
|
||||||
@ -263,7 +263,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(Cl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
switch (mob_version) {
|
switch (mob_version) {
|
||||||
case MobVersion::Titanium:
|
case MobVersion::Titanium:
|
||||||
@ -283,7 +283,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
|
EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
switch (mob_version) {
|
switch (mob_version) {
|
||||||
case MobVersion::OfflineTitanium:
|
case MobVersion::OfflineTitanium:
|
||||||
@ -303,7 +303,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
|
EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
|
||||||
{
|
{
|
||||||
switch (mob_version) {
|
switch (mob_version) {
|
||||||
case MobVersion::OfflineTitanium:
|
case MobVersion::OfflineTitanium:
|
||||||
@ -323,7 +323,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClie
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
|
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
|
||||||
{
|
{
|
||||||
switch (client_version) {
|
switch (client_version) {
|
||||||
case ClientVersion::Titanium:
|
case ClientVersion::Titanium:
|
||||||
@ -343,7 +343,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::expansions::ExpansionName(Expansion expansion)
|
const char* EQ::expansions::ExpansionName(Expansion expansion)
|
||||||
{
|
{
|
||||||
switch (expansion) {
|
switch (expansion) {
|
||||||
case Expansion::EverQuest:
|
case Expansion::EverQuest:
|
||||||
@ -393,12 +393,12 @@ const char* EQEmu::expansions::ExpansionName(Expansion expansion)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* EQEmu::expansions::ExpansionName(uint32 expansion_bit)
|
const char* EQ::expansions::ExpansionName(uint32 expansion_bit)
|
||||||
{
|
{
|
||||||
return ExpansionName(ConvertExpansionBitToExpansion(expansion_bit));
|
return ExpansionName(ConvertExpansionBitToExpansion(expansion_bit));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
||||||
{
|
{
|
||||||
switch (expansion) {
|
switch (expansion) {
|
||||||
case Expansion::RoK:
|
case Expansion::RoK:
|
||||||
@ -446,7 +446,7 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
|
EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
|
||||||
{
|
{
|
||||||
switch (expansion_bit) {
|
switch (expansion_bit) {
|
||||||
case bitRoK:
|
case bitRoK:
|
||||||
@ -494,7 +494,7 @@ EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(u
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
||||||
{
|
{
|
||||||
switch (expansion) {
|
switch (expansion) {
|
||||||
case Expansion::RoK:
|
case Expansion::RoK:
|
||||||
@ -542,17 +542,17 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::expansions::Expansion EQEmu::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
|
EQ::expansions::Expansion EQ::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
return EQEmu::constants::StaticLookup(client_version)->Expansion;
|
return EQ::constants::StaticLookup(client_version)->Expansion;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
|
uint32 EQ::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
return EQEmu::constants::StaticLookup(client_version)->ExpansionBit;
|
return EQ::constants::StaticLookup(client_version)->ExpansionBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
|
uint32 EQ::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
return EQEmu::constants::StaticLookup(client_version)->ExpansionsMask;
|
return EQ::constants::StaticLookup(client_version)->ExpansionsMask;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace versions {
|
namespace versions {
|
||||||
enum class ClientVersion : uint32 {
|
enum class ClientVersion : uint32 {
|
||||||
|
|||||||
@ -318,7 +318,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
|
|||||||
**
|
**
|
||||||
** (indexed by 'Skill' of SkillUseTypes)
|
** (indexed by 'Skill' of SkillUseTypes)
|
||||||
*/
|
*/
|
||||||
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
static const uint8 SkillDamageTypes[EQ::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
||||||
{
|
{
|
||||||
/*1HBlunt*/ 0,
|
/*1HBlunt*/ 0,
|
||||||
/*1HSlashing*/ 1,
|
/*1HSlashing*/ 1,
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
static bool global_dictionary_init = false;
|
static bool global_dictionary_init = false;
|
||||||
void EQEmu::InitializeDynamicLookups() {
|
void EQ::InitializeDynamicLookups() {
|
||||||
if (global_dictionary_init == true)
|
if (global_dictionary_init == true)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -37,12 +37,12 @@ void EQEmu::InitializeDynamicLookups() {
|
|||||||
global_dictionary_init = true;
|
global_dictionary_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||||
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||||
static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
|
static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::versions::ClientVersionCount] =
|
||||||
{
|
{
|
||||||
/*[ClientVersion::Unknown] =*/
|
/*[ClientVersion::Unknown] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
ClientUnknown::constants::EXPANSION,
|
ClientUnknown::constants::EXPANSION,
|
||||||
ClientUnknown::constants::EXPANSION_BIT,
|
ClientUnknown::constants::EXPANSION_BIT,
|
||||||
ClientUnknown::constants::EXPANSIONS_MASK,
|
ClientUnknown::constants::EXPANSIONS_MASK,
|
||||||
@ -50,7 +50,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
ClientUnknown::INULL
|
ClientUnknown::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Client62] =*/
|
/*[ClientVersion::Client62] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
Client62::constants::EXPANSION,
|
Client62::constants::EXPANSION,
|
||||||
Client62::constants::EXPANSION_BIT,
|
Client62::constants::EXPANSION_BIT,
|
||||||
Client62::constants::EXPANSIONS_MASK,
|
Client62::constants::EXPANSIONS_MASK,
|
||||||
@ -58,7 +58,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
Client62::INULL
|
Client62::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Titanium] =*/
|
/*[ClientVersion::Titanium] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
Titanium::constants::EXPANSION,
|
Titanium::constants::EXPANSION,
|
||||||
Titanium::constants::EXPANSION_BIT,
|
Titanium::constants::EXPANSION_BIT,
|
||||||
Titanium::constants::EXPANSIONS_MASK,
|
Titanium::constants::EXPANSIONS_MASK,
|
||||||
@ -66,7 +66,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
Titanium::constants::SAY_LINK_BODY_SIZE
|
Titanium::constants::SAY_LINK_BODY_SIZE
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoF] =*/
|
/*[ClientVersion::SoF] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
SoF::constants::EXPANSION,
|
SoF::constants::EXPANSION,
|
||||||
SoF::constants::EXPANSION_BIT,
|
SoF::constants::EXPANSION_BIT,
|
||||||
SoF::constants::EXPANSIONS_MASK,
|
SoF::constants::EXPANSIONS_MASK,
|
||||||
@ -74,7 +74,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
SoF::constants::SAY_LINK_BODY_SIZE
|
SoF::constants::SAY_LINK_BODY_SIZE
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoD] =*/
|
/*[ClientVersion::SoD] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
SoD::constants::EXPANSION,
|
SoD::constants::EXPANSION,
|
||||||
SoD::constants::EXPANSION_BIT,
|
SoD::constants::EXPANSION_BIT,
|
||||||
SoD::constants::EXPANSIONS_MASK,
|
SoD::constants::EXPANSIONS_MASK,
|
||||||
@ -82,7 +82,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
SoD::constants::SAY_LINK_BODY_SIZE
|
SoD::constants::SAY_LINK_BODY_SIZE
|
||||||
),
|
),
|
||||||
/*[ClientVersion::UF] =*/
|
/*[ClientVersion::UF] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
UF::constants::EXPANSION,
|
UF::constants::EXPANSION,
|
||||||
UF::constants::EXPANSION_BIT,
|
UF::constants::EXPANSION_BIT,
|
||||||
UF::constants::EXPANSIONS_MASK,
|
UF::constants::EXPANSIONS_MASK,
|
||||||
@ -90,7 +90,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
UF::constants::SAY_LINK_BODY_SIZE
|
UF::constants::SAY_LINK_BODY_SIZE
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF] =*/
|
/*[ClientVersion::RoF] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
RoF::constants::EXPANSION,
|
RoF::constants::EXPANSION,
|
||||||
RoF::constants::EXPANSION_BIT,
|
RoF::constants::EXPANSION_BIT,
|
||||||
RoF::constants::EXPANSIONS_MASK,
|
RoF::constants::EXPANSIONS_MASK,
|
||||||
@ -98,7 +98,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
RoF::constants::SAY_LINK_BODY_SIZE
|
RoF::constants::SAY_LINK_BODY_SIZE
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF2] =*/
|
/*[ClientVersion::RoF2] =*/
|
||||||
EQEmu::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
RoF2::constants::EXPANSION,
|
RoF2::constants::EXPANSION,
|
||||||
RoF2::constants::EXPANSION_BIT,
|
RoF2::constants::EXPANSION_BIT,
|
||||||
RoF2::constants::EXPANSIONS_MASK,
|
RoF2::constants::EXPANSIONS_MASK,
|
||||||
@ -108,7 +108,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
|
|||||||
};
|
};
|
||||||
|
|
||||||
static bool constants_dictionary_init = false;
|
static bool constants_dictionary_init = false;
|
||||||
void EQEmu::constants::InitializeDynamicLookups() {
|
void EQ::constants::InitializeDynamicLookups() {
|
||||||
if (constants_dictionary_init == true)
|
if (constants_dictionary_init == true)
|
||||||
return;
|
return;
|
||||||
constants_dictionary_init = true;
|
constants_dictionary_init = true;
|
||||||
@ -119,7 +119,7 @@ void EQEmu::constants::InitializeDynamicLookups() {
|
|||||||
// use static references for now
|
// use static references for now
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
const EQ::constants::LookupEntry* EQ::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||||
{
|
{
|
||||||
if (gm_flag)
|
if (gm_flag)
|
||||||
return DynamicGMLookup(client_version);
|
return DynamicGMLookup(client_version);
|
||||||
@ -127,7 +127,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::C
|
|||||||
return DynamicNonGMLookup(client_version);
|
return DynamicNonGMLookup(client_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
|
const EQ::constants::LookupEntry* EQ::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
client_version = versions::ValidateClientVersion(client_version);
|
client_version = versions::ValidateClientVersion(client_version);
|
||||||
if (constants_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
if (constants_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
||||||
@ -136,7 +136,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versio
|
|||||||
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions::ClientVersion client_version)
|
const EQ::constants::LookupEntry* EQ::constants::DynamicGMLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
client_version = versions::ValidateClientVersion(client_version);
|
client_version = versions::ValidateClientVersion(client_version);
|
||||||
if (constants_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
if (constants_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
||||||
@ -145,18 +145,18 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions:
|
|||||||
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
return &constants_static_lookup_entries[static_cast<int>(client_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::constants::LookupEntry* EQEmu::constants::StaticLookup(versions::ClientVersion client_version)
|
const EQ::constants::LookupEntry* EQ::constants::StaticLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
return &constants_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
return &constants_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
|
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
|
||||||
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
|
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
|
||||||
static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu::versions::MobVersionCount] =
|
static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::versions::MobVersionCount] =
|
||||||
{
|
{
|
||||||
/*[MobVersion::Unknown] =*/
|
/*[MobVersion::Unknown] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||||
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
|
||||||
@ -182,8 +182,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::Client62] =*/
|
/*[MobVersion::Client62] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||||
Client62::INULL, Client62::INULL, Client62::INULL,
|
Client62::INULL, Client62::INULL, Client62::INULL,
|
||||||
@ -209,9 +209,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::Titanium] =*/
|
/*[MobVersion::Titanium] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
|
||||||
Titanium::invtype::TRADE_SIZE, Titanium::invtype::WORLD_SIZE, Titanium::invtype::LIMBO_SIZE,
|
Titanium::invtype::TRADE_SIZE, Titanium::invtype::WORLD_SIZE, Titanium::invtype::LIMBO_SIZE,
|
||||||
Titanium::invtype::TRIBUTE_SIZE, Titanium::INULL, Titanium::invtype::GUILD_TRIBUTE_SIZE,
|
Titanium::invtype::TRIBUTE_SIZE, Titanium::INULL, Titanium::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
Titanium::invtype::MERCHANT_SIZE, Titanium::INULL, Titanium::invtype::CORPSE_SIZE,
|
Titanium::invtype::MERCHANT_SIZE, Titanium::INULL, Titanium::invtype::CORPSE_SIZE,
|
||||||
@ -236,9 +236,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
Titanium::inventory::AllowOverLevelEquipment
|
Titanium::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::SoF] =*/
|
/*[MobVersion::SoF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
|
||||||
SoF::invtype::TRADE_SIZE, SoF::invtype::WORLD_SIZE, SoF::invtype::LIMBO_SIZE,
|
SoF::invtype::TRADE_SIZE, SoF::invtype::WORLD_SIZE, SoF::invtype::LIMBO_SIZE,
|
||||||
SoF::invtype::TRIBUTE_SIZE, SoF::INULL, SoF::invtype::GUILD_TRIBUTE_SIZE,
|
SoF::invtype::TRIBUTE_SIZE, SoF::INULL, SoF::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
SoF::invtype::MERCHANT_SIZE, SoF::INULL, SoF::invtype::CORPSE_SIZE,
|
SoF::invtype::MERCHANT_SIZE, SoF::INULL, SoF::invtype::CORPSE_SIZE,
|
||||||
@ -263,9 +263,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
SoF::inventory::AllowOverLevelEquipment
|
SoF::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::SoD] =*/
|
/*[MobVersion::SoD] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
|
||||||
SoD::invtype::TRADE_SIZE, SoD::invtype::WORLD_SIZE, SoD::invtype::LIMBO_SIZE,
|
SoD::invtype::TRADE_SIZE, SoD::invtype::WORLD_SIZE, SoD::invtype::LIMBO_SIZE,
|
||||||
SoD::invtype::TRIBUTE_SIZE, SoD::INULL, SoD::invtype::GUILD_TRIBUTE_SIZE,
|
SoD::invtype::TRIBUTE_SIZE, SoD::INULL, SoD::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
SoD::invtype::MERCHANT_SIZE, SoD::INULL, SoD::invtype::CORPSE_SIZE,
|
SoD::invtype::MERCHANT_SIZE, SoD::INULL, SoD::invtype::CORPSE_SIZE,
|
||||||
@ -290,9 +290,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
SoD::inventory::AllowOverLevelEquipment
|
SoD::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::UF] =*/
|
/*[MobVersion::UF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
|
||||||
UF::invtype::TRADE_SIZE, UF::invtype::WORLD_SIZE, UF::invtype::LIMBO_SIZE,
|
UF::invtype::TRADE_SIZE, UF::invtype::WORLD_SIZE, UF::invtype::LIMBO_SIZE,
|
||||||
UF::invtype::TRIBUTE_SIZE, UF::INULL, UF::invtype::GUILD_TRIBUTE_SIZE,
|
UF::invtype::TRIBUTE_SIZE, UF::INULL, UF::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
UF::invtype::MERCHANT_SIZE, UF::INULL, UF::invtype::CORPSE_SIZE,
|
UF::invtype::MERCHANT_SIZE, UF::INULL, UF::invtype::CORPSE_SIZE,
|
||||||
@ -317,9 +317,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
UF::inventory::AllowOverLevelEquipment
|
UF::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::RoF] =*/
|
/*[MobVersion::RoF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
|
||||||
RoF::invtype::TRADE_SIZE, RoF::invtype::WORLD_SIZE, RoF::invtype::LIMBO_SIZE,
|
RoF::invtype::TRADE_SIZE, RoF::invtype::WORLD_SIZE, RoF::invtype::LIMBO_SIZE,
|
||||||
RoF::invtype::TRIBUTE_SIZE, RoF::invtype::TROPHY_TRIBUTE_SIZE, RoF::invtype::GUILD_TRIBUTE_SIZE,
|
RoF::invtype::TRIBUTE_SIZE, RoF::invtype::TROPHY_TRIBUTE_SIZE, RoF::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
RoF::invtype::MERCHANT_SIZE, RoF::invtype::DELETED_SIZE, RoF::invtype::CORPSE_SIZE,
|
RoF::invtype::MERCHANT_SIZE, RoF::invtype::DELETED_SIZE, RoF::invtype::CORPSE_SIZE,
|
||||||
@ -344,9 +344,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
RoF::inventory::AllowOverLevelEquipment
|
RoF::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::RoF2] =*/
|
/*[MobVersion::RoF2] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
|
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
|
||||||
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
|
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
|
||||||
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
|
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
|
||||||
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
|
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
|
||||||
@ -371,9 +371,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
RoF2::inventory::AllowOverLevelEquipment
|
RoF2::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPC] =*/
|
/*[MobVersion::NPC] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||||
EntityLimits::NPC::invtype::TRADE_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
EntityLimits::NPC::invtype::TRADE_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||||
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
|
||||||
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -389,8 +389,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::NPC::INULL,
|
EntityLimits::NPC::INULL,
|
||||||
EntityLimits::NPC::INULL,
|
EntityLimits::NPC::INULL,
|
||||||
EntityLimits::NPC::INULL,
|
EntityLimits::NPC::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -398,9 +398,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPCMerchant] =*/
|
/*[MobVersion::NPCMerchant] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||||
EntityLimits::NPCMerchant::invtype::TRADE_SIZE, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
EntityLimits::NPCMerchant::invtype::TRADE_SIZE, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||||
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
|
||||||
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -416,8 +416,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::NPCMerchant::INULL,
|
EntityLimits::NPCMerchant::INULL,
|
||||||
EntityLimits::NPCMerchant::INULL,
|
EntityLimits::NPCMerchant::INULL,
|
||||||
EntityLimits::NPCMerchant::INULL,
|
EntityLimits::NPCMerchant::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -425,9 +425,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::Merc] =*/
|
/*[MobVersion::Merc] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||||
EntityLimits::Merc::invtype::TRADE_SIZE, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
EntityLimits::Merc::invtype::TRADE_SIZE, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||||
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
|
||||||
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -443,8 +443,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::Merc::INULL,
|
EntityLimits::Merc::INULL,
|
||||||
EntityLimits::Merc::INULL,
|
EntityLimits::Merc::INULL,
|
||||||
EntityLimits::Merc::INULL,
|
EntityLimits::Merc::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -452,9 +452,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::Bot] =*/
|
/*[MobVersion::Bot] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||||
EntityLimits::Bot::invtype::TRADE_SIZE, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
EntityLimits::Bot::invtype::TRADE_SIZE, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||||
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
|
||||||
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -470,8 +470,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::Bot::invslot::CURSOR_BITMASK,
|
EntityLimits::Bot::invslot::CURSOR_BITMASK,
|
||||||
EntityLimits::Bot::invslot::POSSESSIONS_BITMASK,
|
EntityLimits::Bot::invslot::POSSESSIONS_BITMASK,
|
||||||
EntityLimits::Bot::INULL,
|
EntityLimits::Bot::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
EQEmu::invaug::SOCKET_COUNT, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
EQ::invaug::SOCKET_COUNT, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -479,9 +479,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::ClientPet] =*/
|
/*[MobVersion::ClientPet] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||||
EntityLimits::ClientPet::invtype::TRADE_SIZE, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
EntityLimits::ClientPet::invtype::TRADE_SIZE, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||||
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
|
||||||
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -497,8 +497,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::ClientPet::INULL,
|
EntityLimits::ClientPet::INULL,
|
||||||
EntityLimits::ClientPet::INULL,
|
EntityLimits::ClientPet::INULL,
|
||||||
EntityLimits::ClientPet::INULL,
|
EntityLimits::ClientPet::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -506,9 +506,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPCPet] =*/
|
/*[MobVersion::NPCPet] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||||
EntityLimits::NPCPet::invtype::TRADE_SIZE, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
EntityLimits::NPCPet::invtype::TRADE_SIZE, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||||
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
|
||||||
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -524,8 +524,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::NPCPet::INULL,
|
EntityLimits::NPCPet::INULL,
|
||||||
EntityLimits::NPCPet::INULL,
|
EntityLimits::NPCPet::INULL,
|
||||||
EntityLimits::NPCPet::INULL,
|
EntityLimits::NPCPet::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -533,9 +533,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::MercPet] =*/
|
/*[MobVersion::MercPet] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||||
EntityLimits::MercPet::invtype::TRADE_SIZE, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
EntityLimits::MercPet::invtype::TRADE_SIZE, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||||
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
|
||||||
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -551,8 +551,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::MercPet::INULL,
|
EntityLimits::MercPet::INULL,
|
||||||
EntityLimits::MercPet::INULL,
|
EntityLimits::MercPet::INULL,
|
||||||
EntityLimits::MercPet::INULL,
|
EntityLimits::MercPet::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -560,9 +560,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::BotPet] =*/
|
/*[MobVersion::BotPet] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||||
EntityLimits::BotPet::invtype::TRADE_SIZE, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
EntityLimits::BotPet::invtype::TRADE_SIZE, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||||
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
|
||||||
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, /*InvTypeCorpseSize,*/
|
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, /*InvTypeCorpseSize,*/
|
||||||
@ -578,8 +578,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
EntityLimits::BotPet::INULL,
|
EntityLimits::BotPet::INULL,
|
||||||
EntityLimits::BotPet::INULL,
|
EntityLimits::BotPet::INULL,
|
||||||
EntityLimits::BotPet::INULL,
|
EntityLimits::BotPet::INULL,
|
||||||
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
|
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
|
||||||
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
|
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -587,8 +587,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineTitanium] =*/
|
/*[MobVersion::OfflineTitanium] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
||||||
Titanium::invtype::TRADE_SIZE, Titanium::INULL, Titanium::INULL,
|
Titanium::invtype::TRADE_SIZE, Titanium::INULL, Titanium::INULL,
|
||||||
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
Titanium::INULL, Titanium::INULL, Titanium::INULL,
|
||||||
@ -614,8 +614,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineSoF] =*/
|
/*[MobVersion::OfflineSoF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
SoF::INULL, SoF::INULL, SoF::INULL,
|
SoF::INULL, SoF::INULL, SoF::INULL,
|
||||||
SoF::invtype::TRADE_SIZE, SoF::INULL, SoF::INULL,
|
SoF::invtype::TRADE_SIZE, SoF::INULL, SoF::INULL,
|
||||||
SoF::INULL, SoF::INULL, SoF::INULL,
|
SoF::INULL, SoF::INULL, SoF::INULL,
|
||||||
@ -641,8 +641,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineSoD] =*/
|
/*[MobVersion::OfflineSoD] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
SoD::INULL, SoD::INULL, SoD::INULL,
|
SoD::INULL, SoD::INULL, SoD::INULL,
|
||||||
SoD::invtype::TRADE_SIZE, SoD::INULL, SoD::INULL,
|
SoD::invtype::TRADE_SIZE, SoD::INULL, SoD::INULL,
|
||||||
SoD::INULL, SoD::INULL, SoD::INULL,
|
SoD::INULL, SoD::INULL, SoD::INULL,
|
||||||
@ -668,8 +668,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineUF] =*/
|
/*[MobVersion::OfflineUF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
UF::INULL, UF::INULL, UF::INULL,
|
UF::INULL, UF::INULL, UF::INULL,
|
||||||
UF::invtype::TRADE_SIZE, UF::INULL, UF::INULL,
|
UF::invtype::TRADE_SIZE, UF::INULL, UF::INULL,
|
||||||
UF::INULL, UF::INULL, UF::INULL,
|
UF::INULL, UF::INULL, UF::INULL,
|
||||||
@ -695,8 +695,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineRoF] =*/
|
/*[MobVersion::OfflineRoF] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
RoF::INULL, RoF::INULL, RoF::INULL,
|
RoF::INULL, RoF::INULL, RoF::INULL,
|
||||||
RoF::invtype::TRADE_SIZE, RoF::INULL, RoF::INULL,
|
RoF::invtype::TRADE_SIZE, RoF::INULL, RoF::INULL,
|
||||||
RoF::INULL, RoF::INULL, RoF::INULL,
|
RoF::INULL, RoF::INULL, RoF::INULL,
|
||||||
@ -722,8 +722,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineRoF2] =*/
|
/*[MobVersion::OfflineRoF2] =*/
|
||||||
EQEmu::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
||||||
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
|
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
|
||||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
||||||
@ -751,7 +751,7 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
|
|||||||
};
|
};
|
||||||
|
|
||||||
static bool inventory_dictionary_init = false;
|
static bool inventory_dictionary_init = false;
|
||||||
void EQEmu::inventory::InitializeDynamicLookups() {
|
void EQ::inventory::InitializeDynamicLookups() {
|
||||||
if (inventory_dictionary_init == true)
|
if (inventory_dictionary_init == true)
|
||||||
return;
|
return;
|
||||||
inventory_dictionary_init = true;
|
inventory_dictionary_init = true;
|
||||||
@ -774,9 +774,9 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
|
|
||||||
const uint32 dynamic_check_mask =
|
const uint32 dynamic_check_mask =
|
||||||
(
|
(
|
||||||
EQEmu::expansions::bitPoR |
|
EQ::expansions::bitPoR |
|
||||||
EQEmu::expansions::bitTBS |
|
EQ::expansions::bitTBS |
|
||||||
EQEmu::expansions::bitHoT
|
EQ::expansions::bitHoT
|
||||||
);
|
);
|
||||||
|
|
||||||
// if all of the above expansion bits are present, then static references will suffice
|
// if all of the above expansion bits are present, then static references will suffice
|
||||||
@ -784,7 +784,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Dynamic Lookups (promotive methodology) (all mob versions allowed)
|
// Dynamic Lookups (promotive methodology) (all mob versions allowed)
|
||||||
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
|
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
|
||||||
// no need to dynamic this condition since it is the lowest compatibility standard
|
// no need to dynamic this condition since it is the lowest compatibility standard
|
||||||
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
||||||
continue;
|
continue;
|
||||||
@ -803,21 +803,21 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
inventory_dynamic_nongm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
inventory_dynamic_nongm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
||||||
inventory_dynamic_nongm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
inventory_dynamic_nongm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
||||||
|
|
||||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
|
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
|
||||||
// update bank size
|
// update bank size
|
||||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
|
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
|
||||||
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = SoF::invtype::BANK_SIZE;
|
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = SoF::invtype::BANK_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
|
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
|
||||||
// update power source
|
// update power source
|
||||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitTBS)
|
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitTBS)
|
||||||
inventory_dynamic_nongm_lookup_entries[iter]->EquipmentBitmask = SoF::invslot::EQUIPMENT_BITMASK;
|
inventory_dynamic_nongm_lookup_entries[iter]->EquipmentBitmask = SoF::invslot::EQUIPMENT_BITMASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
|
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
|
||||||
// update general size
|
// update general size
|
||||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitHoT)
|
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitHoT)
|
||||||
inventory_dynamic_nongm_lookup_entries[iter]->GeneralBitmask = RoF::invslot::GENERAL_BITMASK;
|
inventory_dynamic_nongm_lookup_entries[iter]->GeneralBitmask = RoF::invslot::GENERAL_BITMASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dynamic GM Lookups (demotive methodology) (client-linked mob versions only)
|
// Dynamic GM Lookups (demotive methodology) (client-linked mob versions only)
|
||||||
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
|
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
|
||||||
// no need to dynamic this condition since it is the lowest compatibility standard
|
// no need to dynamic this condition since it is the lowest compatibility standard
|
||||||
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
|
||||||
continue;
|
continue;
|
||||||
@ -869,13 +869,13 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
|
||||||
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
|
||||||
|
|
||||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
|
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
|
||||||
// update bank size
|
// update bank size
|
||||||
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
|
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
|
||||||
inventory_dynamic_gm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE;
|
inventory_dynamic_gm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
|
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
|
||||||
// update power source
|
// update power source
|
||||||
switch (iter) {
|
switch (iter) {
|
||||||
case versions::bitUF:
|
case versions::bitUF:
|
||||||
@ -890,7 +890,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
|
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
|
||||||
// update general size
|
// update general size
|
||||||
switch (iter) {
|
switch (iter) {
|
||||||
case versions::bitUF:
|
case versions::bitUF:
|
||||||
@ -927,7 +927,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
|
|||||||
// only client versions that require a change from their static definitions have been given a dynamic (gm) lookup entry
|
// only client versions that require a change from their static definitions have been given a dynamic (gm) lookup entry
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
const EQ::inventory::LookupEntry* EQ::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||||
{
|
{
|
||||||
if (gm_flag)
|
if (gm_flag)
|
||||||
return DynamicGMLookup(mob_version);
|
return DynamicGMLookup(mob_version);
|
||||||
@ -935,7 +935,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::M
|
|||||||
return DynamicNonGMLookup(mob_version);
|
return DynamicNonGMLookup(mob_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
|
const EQ::inventory::LookupEntry* EQ::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
mob_version = versions::ValidateMobVersion(mob_version);
|
mob_version = versions::ValidateMobVersion(mob_version);
|
||||||
if (inventory_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
if (inventory_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
||||||
@ -944,7 +944,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versio
|
|||||||
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions::MobVersion mob_version)
|
const EQ::inventory::LookupEntry* EQ::inventory::DynamicGMLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
mob_version = versions::ValidateMobVersion(mob_version);
|
mob_version = versions::ValidateMobVersion(mob_version);
|
||||||
if (inventory_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
if (inventory_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
||||||
@ -953,107 +953,107 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions:
|
|||||||
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::inventory::LookupEntry* EQEmu::inventory::StaticLookup(versions::MobVersion mob_version)
|
const EQ::inventory::LookupEntry* EQ::inventory::StaticLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
return &inventory_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
return &inventory_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
|
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
|
||||||
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
|
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
|
||||||
static const EQEmu::behavior::LookupEntry behavior_static_lookup_entries[EQEmu::versions::MobVersionCount] =
|
static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versions::MobVersionCount] =
|
||||||
{
|
{
|
||||||
/*[MobVersion::Unknown] =*/
|
/*[MobVersion::Unknown] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
/*[MobVersion::Client62] =*/
|
/*[MobVersion::Client62] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
/*[MobVersion::Titanium] =*/
|
/*[MobVersion::Titanium] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
Titanium::behavior::CoinHasWeight
|
Titanium::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::SoF] =*/
|
/*[MobVersion::SoF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
SoF::behavior::CoinHasWeight
|
SoF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::SoD] =*/
|
/*[MobVersion::SoD] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
SoD::behavior::CoinHasWeight
|
SoD::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::UF] =*/
|
/*[MobVersion::UF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
UF::behavior::CoinHasWeight
|
UF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::RoF] =*/
|
/*[MobVersion::RoF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF::behavior::CoinHasWeight
|
RoF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::RoF2] =*/
|
/*[MobVersion::RoF2] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF2::behavior::CoinHasWeight
|
RoF2::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPC] =*/
|
/*[MobVersion::NPC] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPCMerchant] =*/
|
/*[MobVersion::NPCMerchant] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::Merc] =*/
|
/*[MobVersion::Merc] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::Bot] =*/
|
/*[MobVersion::Bot] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::ClientPet] =*/
|
/*[MobVersion::ClientPet] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::NPCPet] =*/
|
/*[MobVersion::NPCPet] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::MercPet] =*/
|
/*[MobVersion::MercPet] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::BotPet] =*/
|
/*[MobVersion::BotPet] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQEmu::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineTitanium] =*/
|
/*[MobVersion::OfflineTitanium] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
Titanium::behavior::CoinHasWeight
|
Titanium::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineSoF] =*/
|
/*[MobVersion::OfflineSoF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
SoF::behavior::CoinHasWeight
|
SoF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineSoD] =*/
|
/*[MobVersion::OfflineSoD] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
SoD::behavior::CoinHasWeight
|
SoD::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineUF] =*/
|
/*[MobVersion::OfflineUF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
UF::behavior::CoinHasWeight
|
UF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineRoF] =*/
|
/*[MobVersion::OfflineRoF] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF::behavior::CoinHasWeight
|
RoF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineRoF2] =*/
|
/*[MobVersion::OfflineRoF2] =*/
|
||||||
EQEmu::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF2::behavior::CoinHasWeight
|
RoF2::behavior::CoinHasWeight
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool behavior_dictionary_init = false;
|
static bool behavior_dictionary_init = false;
|
||||||
void EQEmu::behavior::InitializeDynamicLookups() {
|
void EQ::behavior::InitializeDynamicLookups() {
|
||||||
if (behavior_dictionary_init == true)
|
if (behavior_dictionary_init == true)
|
||||||
return;
|
return;
|
||||||
behavior_dictionary_init = true;
|
behavior_dictionary_init = true;
|
||||||
@ -1064,7 +1064,7 @@ void EQEmu::behavior::InitializeDynamicLookups() {
|
|||||||
// use static references for now
|
// use static references for now
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
const EQ::behavior::LookupEntry* EQ::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
|
||||||
{
|
{
|
||||||
if (gm_flag)
|
if (gm_flag)
|
||||||
return DynamicGMLookup(mob_version);
|
return DynamicGMLookup(mob_version);
|
||||||
@ -1072,7 +1072,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::Mob
|
|||||||
return DynamicNonGMLookup(mob_version);
|
return DynamicNonGMLookup(mob_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
|
const EQ::behavior::LookupEntry* EQ::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
mob_version = versions::ValidateMobVersion(mob_version);
|
mob_version = versions::ValidateMobVersion(mob_version);
|
||||||
if (behavior_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
if (behavior_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
|
||||||
@ -1081,7 +1081,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions
|
|||||||
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::MobVersion mob_version)
|
const EQ::behavior::LookupEntry* EQ::behavior::DynamicGMLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
mob_version = versions::ValidateMobVersion(mob_version);
|
mob_version = versions::ValidateMobVersion(mob_version);
|
||||||
if (behavior_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
if (behavior_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
|
||||||
@ -1090,17 +1090,17 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::M
|
|||||||
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::behavior::LookupEntry* EQEmu::behavior::StaticLookup(versions::MobVersion mob_version)
|
const EQ::behavior::LookupEntry* EQ::behavior::StaticLookup(versions::MobVersion mob_version)
|
||||||
{
|
{
|
||||||
return &behavior_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
return &behavior_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||||
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
|
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
|
||||||
static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
|
static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::ClientVersionCount] =
|
||||||
{
|
{
|
||||||
/*[ClientVersion::Unknown] =*/
|
/*[ClientVersion::Unknown] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
ClientUnknown::INULL,
|
ClientUnknown::INULL,
|
||||||
ClientUnknown::INULL,
|
ClientUnknown::INULL,
|
||||||
ClientUnknown::INULL,
|
ClientUnknown::INULL,
|
||||||
@ -1113,7 +1113,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
ClientUnknown::INULL
|
ClientUnknown::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Client62] =*/
|
/*[ClientVersion::Client62] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
Client62::INULL,
|
Client62::INULL,
|
||||||
Client62::INULL,
|
Client62::INULL,
|
||||||
Client62::INULL,
|
Client62::INULL,
|
||||||
@ -1126,7 +1126,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
Client62::INULL
|
Client62::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Titanium] =*/
|
/*[ClientVersion::Titanium] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
Titanium::spells::SPELL_ID_MAX,
|
Titanium::spells::SPELL_ID_MAX,
|
||||||
Titanium::spells::SPELLBOOK_SIZE,
|
Titanium::spells::SPELLBOOK_SIZE,
|
||||||
Titanium::spells::SPELL_GEM_COUNT,
|
Titanium::spells::SPELL_GEM_COUNT,
|
||||||
@ -1139,7 +1139,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
Titanium::spells::MERC_BUFFS
|
Titanium::spells::MERC_BUFFS
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoF] =*/
|
/*[ClientVersion::SoF] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
SoF::spells::SPELL_ID_MAX,
|
SoF::spells::SPELL_ID_MAX,
|
||||||
SoF::spells::SPELLBOOK_SIZE,
|
SoF::spells::SPELLBOOK_SIZE,
|
||||||
SoF::spells::SPELL_GEM_COUNT,
|
SoF::spells::SPELL_GEM_COUNT,
|
||||||
@ -1152,7 +1152,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
SoF::spells::MERC_BUFFS
|
SoF::spells::MERC_BUFFS
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoD] =*/
|
/*[ClientVersion::SoD] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
SoD::spells::SPELL_ID_MAX,
|
SoD::spells::SPELL_ID_MAX,
|
||||||
SoD::spells::SPELLBOOK_SIZE,
|
SoD::spells::SPELLBOOK_SIZE,
|
||||||
SoD::spells::SPELL_GEM_COUNT,
|
SoD::spells::SPELL_GEM_COUNT,
|
||||||
@ -1165,7 +1165,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
SoD::spells::MERC_BUFFS
|
SoD::spells::MERC_BUFFS
|
||||||
),
|
),
|
||||||
/*[ClientVersion::UF] =*/
|
/*[ClientVersion::UF] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
UF::spells::SPELL_ID_MAX,
|
UF::spells::SPELL_ID_MAX,
|
||||||
UF::spells::SPELLBOOK_SIZE,
|
UF::spells::SPELLBOOK_SIZE,
|
||||||
UF::spells::SPELL_GEM_COUNT,
|
UF::spells::SPELL_GEM_COUNT,
|
||||||
@ -1178,7 +1178,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
UF::spells::MERC_BUFFS
|
UF::spells::MERC_BUFFS
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF] =*/
|
/*[ClientVersion::RoF] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
RoF::spells::SPELL_ID_MAX,
|
RoF::spells::SPELL_ID_MAX,
|
||||||
RoF::spells::SPELLBOOK_SIZE,
|
RoF::spells::SPELLBOOK_SIZE,
|
||||||
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
||||||
@ -1191,7 +1191,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
RoF::spells::MERC_BUFFS
|
RoF::spells::MERC_BUFFS
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF2] =*/
|
/*[ClientVersion::RoF2] =*/
|
||||||
EQEmu::spells::LookupEntry(
|
EQ::spells::LookupEntry(
|
||||||
RoF2::spells::SPELL_ID_MAX,
|
RoF2::spells::SPELL_ID_MAX,
|
||||||
RoF2::spells::SPELLBOOK_SIZE,
|
RoF2::spells::SPELLBOOK_SIZE,
|
||||||
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
||||||
@ -1206,7 +1206,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
|
|||||||
};
|
};
|
||||||
|
|
||||||
static bool spells_dictionary_init = false;
|
static bool spells_dictionary_init = false;
|
||||||
void EQEmu::spells::InitializeDynamicLookups() {
|
void EQ::spells::InitializeDynamicLookups() {
|
||||||
if (spells_dictionary_init == true)
|
if (spells_dictionary_init == true)
|
||||||
return;
|
return;
|
||||||
spells_dictionary_init = true;
|
spells_dictionary_init = true;
|
||||||
@ -1217,7 +1217,7 @@ void EQEmu::spells::InitializeDynamicLookups() {
|
|||||||
// use static references for now
|
// use static references for now
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
const EQ::spells::LookupEntry* EQ::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
|
||||||
{
|
{
|
||||||
if (gm_flag)
|
if (gm_flag)
|
||||||
return DynamicGMLookup(client_version);
|
return DynamicGMLookup(client_version);
|
||||||
@ -1225,7 +1225,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientV
|
|||||||
return DynamicNonGMLookup(client_version);
|
return DynamicNonGMLookup(client_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
|
const EQ::spells::LookupEntry* EQ::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
client_version = versions::ValidateClientVersion(client_version);
|
client_version = versions::ValidateClientVersion(client_version);
|
||||||
if (spells_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
if (spells_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
|
||||||
@ -1234,7 +1234,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::Cl
|
|||||||
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::ClientVersion client_version)
|
const EQ::spells::LookupEntry* EQ::spells::DynamicGMLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
client_version = versions::ValidateClientVersion(client_version);
|
client_version = versions::ValidateClientVersion(client_version);
|
||||||
if (spells_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
if (spells_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
|
||||||
@ -1243,7 +1243,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::Clien
|
|||||||
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
return &spells_static_lookup_entries[static_cast<int>(client_version)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::spells::LookupEntry* EQEmu::spells::StaticLookup(versions::ClientVersion client_version)
|
const EQ::spells::LookupEntry* EQ::spells::StaticLookup(versions::ClientVersion client_version)
|
||||||
{
|
{
|
||||||
return &spells_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
return &spells_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,13 +31,13 @@
|
|||||||
#include "../common/patches/rof2_limits.h"
|
#include "../common/patches/rof2_limits.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
void InitializeDynamicLookups();
|
void InitializeDynamicLookups();
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
struct LookupEntry {
|
struct LookupEntry {
|
||||||
EQEmu::expansions::Expansion Expansion;
|
EQ::expansions::Expansion Expansion;
|
||||||
uint32 ExpansionBit;
|
uint32 ExpansionBit;
|
||||||
uint32 ExpansionsMask;
|
uint32 ExpansionsMask;
|
||||||
int16 CharacterCreationLimit;
|
int16 CharacterCreationLimit;
|
||||||
@ -45,7 +45,7 @@ namespace EQEmu
|
|||||||
|
|
||||||
LookupEntry(const LookupEntry *lookup_entry) { }
|
LookupEntry(const LookupEntry *lookup_entry) { }
|
||||||
LookupEntry(
|
LookupEntry(
|
||||||
EQEmu::expansions::Expansion Expansion,
|
EQ::expansions::Expansion Expansion,
|
||||||
uint32 ExpansionBit,
|
uint32 ExpansionBit,
|
||||||
uint32 ExpansionsMask,
|
uint32 ExpansionsMask,
|
||||||
int16 CharacterCreationLimit,
|
int16 CharacterCreationLimit,
|
||||||
@ -111,7 +111,7 @@ namespace EQEmu
|
|||||||
|
|
||||||
union {
|
union {
|
||||||
InventoryTypeSize_Struct InventoryTypeSize;
|
InventoryTypeSize_Struct InventoryTypeSize;
|
||||||
int16 InventoryTypeSizeArray[25]; // should reflect EQEmu::invtype::TYPE_COUNT referenced in emu_constants.h
|
int16 InventoryTypeSizeArray[25]; // should reflect EQ::invtype::TYPE_COUNT referenced in emu_constants.h
|
||||||
};
|
};
|
||||||
|
|
||||||
uint64 EquipmentBitmask;
|
uint64 EquipmentBitmask;
|
||||||
@ -244,9 +244,9 @@ namespace ClientUnknown
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
|
||||||
|
|
||||||
} // namespace constants
|
} // namespace constants
|
||||||
|
|
||||||
@ -258,9 +258,9 @@ namespace Client62
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
|
||||||
|
|
||||||
} // namespace constants
|
} // namespace constants
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,7 @@ struct LDoNTrapTemplate
|
|||||||
|
|
||||||
// All clients translate the character select information to some degree
|
// All clients translate the character select information to some degree
|
||||||
|
|
||||||
struct CharSelectEquip : EQEmu::textures::Texture_Struct, EQEmu::textures::Tint_Struct {};
|
struct CharSelectEquip : EQ::textures::Texture_Struct, EQ::textures::Tint_Struct {};
|
||||||
|
|
||||||
// RoF2-based hybrid struct
|
// RoF2-based hybrid struct
|
||||||
struct CharacterSelectEntry_Struct
|
struct CharacterSelectEntry_Struct
|
||||||
@ -144,7 +144,7 @@ struct CharacterSelectEntry_Struct
|
|||||||
uint16 Instance;
|
uint16 Instance;
|
||||||
uint8 Gender;
|
uint8 Gender;
|
||||||
uint8 Face;
|
uint8 Face;
|
||||||
CharSelectEquip Equip[EQEmu::textures::materialCount];
|
CharSelectEquip Equip[EQ::textures::materialCount];
|
||||||
uint8 Unknown15; // Seen FF
|
uint8 Unknown15; // Seen FF
|
||||||
uint8 Unknown19; // Seen FF
|
uint8 Unknown19; // Seen FF
|
||||||
uint32 DrakkinTattoo;
|
uint32 DrakkinTattoo;
|
||||||
@ -253,7 +253,7 @@ struct Spawn_Struct {
|
|||||||
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
|
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
|
||||||
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
|
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
|
||||||
/*0194*/ uint8 unknown0194[3];
|
/*0194*/ uint8 unknown0194[3];
|
||||||
/*0197*/ EQEmu::TextureProfile equipment;
|
/*0197*/ EQ::TextureProfile equipment;
|
||||||
/*0233*/ float runspeed; // Speed when running
|
/*0233*/ float runspeed; // Speed when running
|
||||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||||
/*0238*/ uint32 guildID; // Current guild
|
/*0238*/ uint32 guildID; // Current guild
|
||||||
@ -284,7 +284,7 @@ union
|
|||||||
/*0340*/ uint32 spawnId; // Spawn Id
|
/*0340*/ uint32 spawnId; // Spawn Id
|
||||||
/*0344*/ float bounding_radius; // used in melee, overrides calc
|
/*0344*/ float bounding_radius; // used in melee, overrides calc
|
||||||
/*0347*/ uint8 IsMercenary;
|
/*0347*/ uint8 IsMercenary;
|
||||||
/*0348*/ EQEmu::TintProfile equipment_tint;
|
/*0348*/ EQ::TintProfile equipment_tint;
|
||||||
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
||||||
/*0385*/
|
/*0385*/
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ struct BandolierItem_Struct
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[EQEmu::profile::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[EQ::profile::BANDOLIER_ITEM_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
//len = 72
|
//len = 72
|
||||||
@ -750,7 +750,7 @@ struct PotionBeltItem_Struct
|
|||||||
//len = 288
|
//len = 288
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[EQEmu::profile::POTION_BELT_SIZE];
|
PotionBeltItem_Struct Items[EQ::profile::POTION_BELT_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MovePotionToBelt_Struct
|
struct MovePotionToBelt_Struct
|
||||||
@ -841,7 +841,7 @@ struct SuspendedMinion_Struct
|
|||||||
/*002*/ uint32 HP;
|
/*002*/ uint32 HP;
|
||||||
/*006*/ uint32 Mana;
|
/*006*/ uint32 Mana;
|
||||||
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||||
/*510*/ EQEmu::TextureMaterialProfile Items;
|
/*510*/ EQ::TextureMaterialProfile Items;
|
||||||
/*546*/ char Name[64];
|
/*546*/ char Name[64];
|
||||||
/*610*/
|
/*610*/
|
||||||
};
|
};
|
||||||
@ -933,7 +933,7 @@ struct PlayerProfile_Struct
|
|||||||
/*0245*/ uint8 guildbanker;
|
/*0245*/ uint8 guildbanker;
|
||||||
/*0246*/ uint8 unknown0246[6]; //
|
/*0246*/ uint8 unknown0246[6]; //
|
||||||
/*0252*/ uint32 intoxication;
|
/*0252*/ uint32 intoxication;
|
||||||
/*0256*/ uint32 spellSlotRefresh[EQEmu::spells::SPELL_GEM_COUNT]; //in ms
|
/*0256*/ uint32 spellSlotRefresh[EQ::spells::SPELL_GEM_COUNT]; //in ms
|
||||||
/*0292*/ uint32 abilitySlotRefresh;
|
/*0292*/ uint32 abilitySlotRefresh;
|
||||||
/*0296*/ uint8 haircolor; // Player hair color
|
/*0296*/ uint8 haircolor; // Player hair color
|
||||||
/*0297*/ uint8 beardcolor; // Player beard color
|
/*0297*/ uint8 beardcolor; // Player beard color
|
||||||
@ -946,9 +946,9 @@ struct PlayerProfile_Struct
|
|||||||
/*0304*/ uint8 ability_time_minutes;
|
/*0304*/ uint8 ability_time_minutes;
|
||||||
/*0305*/ uint8 ability_time_hours; //place holder
|
/*0305*/ uint8 ability_time_hours; //place holder
|
||||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||||
/*0312*/ EQEmu::TextureMaterialProfile item_material; // Item texture/material of worn/held items
|
/*0312*/ EQ::TextureMaterialProfile item_material; // Item texture/material of worn/held items
|
||||||
/*0348*/ uint8 unknown0348[44];
|
/*0348*/ uint8 unknown0348[44];
|
||||||
/*0392*/ EQEmu::TintProfile item_tint;
|
/*0392*/ EQ::TintProfile item_tint;
|
||||||
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||||
/*2352*/ char servername[32]; // length probably not right
|
/*2352*/ char servername[32]; // length probably not right
|
||||||
@ -972,9 +972,9 @@ struct PlayerProfile_Struct
|
|||||||
/*2505*/ uint8 unknown2541[47]; // ?
|
/*2505*/ uint8 unknown2541[47]; // ?
|
||||||
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
|
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
|
||||||
/*2580*/ uint8 unknown2616[4];
|
/*2580*/ uint8 unknown2616[4];
|
||||||
/*2584*/ uint32 spell_book[EQEmu::spells::SPELLBOOK_SIZE];
|
/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE];
|
||||||
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
|
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
|
||||||
/*4632*/ uint32 mem_spells[EQEmu::spells::SPELL_GEM_COUNT];
|
/*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT];
|
||||||
/*4668*/ uint8 unknown4704[32]; //
|
/*4668*/ uint8 unknown4704[32]; //
|
||||||
/*4700*/ float y; // Player y position
|
/*4700*/ float y; // Player y position
|
||||||
/*4704*/ float x; // Player x position
|
/*4704*/ float x; // Player x position
|
||||||
@ -1050,7 +1050,7 @@ struct PlayerProfile_Struct
|
|||||||
/*7212*/ uint32 tribute_points;
|
/*7212*/ uint32 tribute_points;
|
||||||
/*7216*/ uint32 unknown7252;
|
/*7216*/ uint32 unknown7252;
|
||||||
/*7220*/ uint32 tribute_active; //1=active
|
/*7220*/ uint32 tribute_active; //1=active
|
||||||
/*7224*/ Tribute_Struct tributes[EQEmu::invtype::TRIBUTE_SIZE];
|
/*7224*/ Tribute_Struct tributes[EQ::invtype::TRIBUTE_SIZE];
|
||||||
/*7264*/ Disciplines_Struct disciplines;
|
/*7264*/ Disciplines_Struct disciplines;
|
||||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||||
/*7744*/ char unknown7780[160];
|
/*7744*/ char unknown7780[160];
|
||||||
@ -1077,7 +1077,7 @@ struct PlayerProfile_Struct
|
|||||||
/*12800*/ uint32 expAA;
|
/*12800*/ uint32 expAA;
|
||||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||||
/*12808*/ uint8 unknown12844[36];
|
/*12808*/ uint8 unknown12844[36];
|
||||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::profile::BANDOLIERS_SIZE];
|
/*12844*/ Bandolier_Struct bandoliers[EQ::profile::BANDOLIERS_SIZE];
|
||||||
/*14124*/ uint8 unknown14160[4506];
|
/*14124*/ uint8 unknown14160[4506];
|
||||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||||
/*19240*/ uint32 timeentitledonaccount;
|
/*19240*/ uint32 timeentitledonaccount;
|
||||||
@ -1095,16 +1095,16 @@ struct PlayerProfile_Struct
|
|||||||
/*19568*/
|
/*19568*/
|
||||||
|
|
||||||
// All player profile packets are translated and this overhead is ignored in out-bound packets
|
// All player profile packets are translated and this overhead is ignored in out-bound packets
|
||||||
PlayerProfile_Struct() : m_player_profile_version(EQEmu::versions::MobVersion::Unknown) { }
|
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
|
||||||
|
|
||||||
EQEmu::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
|
EQ::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
|
||||||
void SetPlayerProfileVersion(EQEmu::versions::MobVersion mob_version) { m_player_profile_version = EQEmu::versions::ValidateMobVersion(mob_version); }
|
void SetPlayerProfileVersion(EQ::versions::MobVersion mob_version) { m_player_profile_version = EQ::versions::ValidateMobVersion(mob_version); }
|
||||||
void SetPlayerProfileVersion(EQEmu::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQEmu::versions::ConvertClientVersionToMobVersion(client_version)); }
|
void SetPlayerProfileVersion(EQ::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQ::versions::ConvertClientVersionToMobVersion(client_version)); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// No need for gm flag since pp already has one
|
// No need for gm flag since pp already has one
|
||||||
// No need for lookup pointer since this struct is not tied to any one system
|
// No need for lookup pointer since this struct is not tied to any one system
|
||||||
EQEmu::versions::MobVersion m_player_profile_version;
|
EQ::versions::MobVersion m_player_profile_version;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1215,7 +1215,7 @@ struct WearChange_Struct {
|
|||||||
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
|
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
|
||||||
/*014*/ uint32 hero_forge_model; // New to VoA
|
/*014*/ uint32 hero_forge_model; // New to VoA
|
||||||
/*018*/ uint32 unknown18; // New to RoF
|
/*018*/ uint32 unknown18; // New to RoF
|
||||||
/*022*/ EQEmu::textures::Tint_Struct color;
|
/*022*/ EQ::textures::Tint_Struct color;
|
||||||
/*026*/ uint8 wear_slot_id;
|
/*026*/ uint8 wear_slot_id;
|
||||||
/*027*/
|
/*027*/
|
||||||
};
|
};
|
||||||
@ -2123,7 +2123,7 @@ struct AdventureLeaderboard_Struct
|
|||||||
/*struct Item_Shop_Struct {
|
/*struct Item_Shop_Struct {
|
||||||
uint16 merchantid;
|
uint16 merchantid;
|
||||||
uint8 itemtype;
|
uint8 itemtype;
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
uint8 iss_unknown001[6];
|
uint8 iss_unknown001[6];
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
@ -2149,7 +2149,7 @@ struct Illusion_Struct { //size: 256 - SoF
|
|||||||
/*092*/ uint32 drakkin_heritage; //
|
/*092*/ uint32 drakkin_heritage; //
|
||||||
/*096*/ uint32 drakkin_tattoo; //
|
/*096*/ uint32 drakkin_tattoo; //
|
||||||
/*100*/ uint32 drakkin_details; //
|
/*100*/ uint32 drakkin_details; //
|
||||||
/*104*/ EQEmu::TintProfile armor_tint; //
|
/*104*/ EQ::TintProfile armor_tint; //
|
||||||
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
||||||
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
||||||
/*142*/ uint8 unknown138[114]; //
|
/*142*/ uint8 unknown138[114]; //
|
||||||
@ -3489,8 +3489,8 @@ struct SelectTributeReply_Struct {
|
|||||||
|
|
||||||
struct TributeInfo_Struct {
|
struct TributeInfo_Struct {
|
||||||
uint32 active; //0 == inactive, 1 == active
|
uint32 active; //0 == inactive, 1 == active
|
||||||
uint32 tributes[EQEmu::invtype::TRIBUTE_SIZE]; //-1 == NONE
|
uint32 tributes[EQ::invtype::TRIBUTE_SIZE]; //-1 == NONE
|
||||||
uint32 tiers[EQEmu::invtype::TRIBUTE_SIZE]; //all 00's
|
uint32 tiers[EQ::invtype::TRIBUTE_SIZE]; //all 00's
|
||||||
uint32 tribute_master_id;
|
uint32 tribute_master_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4401,7 +4401,7 @@ struct AnnoyingZoneUnknown_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct LoadSpellSet_Struct {
|
struct LoadSpellSet_Struct {
|
||||||
uint32 spell[EQEmu::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
|
uint32 spell[EQ::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
|
||||||
uint32 unknown; //there seems to be an extra field in this packet...
|
uint32 unknown; //there seems to be an extra field in this packet...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ public:
|
|||||||
virtual MatchState CheckSignature(const Signature *sig) { return MatchFailed; }
|
virtual MatchState CheckSignature(const Signature *sig) { return MatchFailed; }
|
||||||
virtual EQStreamState GetState() = 0;
|
virtual EQStreamState GetState() = 0;
|
||||||
virtual void SetOpcodeManager(OpcodeManager **opm) = 0;
|
virtual void SetOpcodeManager(OpcodeManager **opm) = 0;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
|
virtual const EQ::versions::ClientVersion ClientVersion() const { return EQ::versions::ClientVersion::Unknown; }
|
||||||
virtual Stats GetStats() const = 0;
|
virtual Stats GetStats() const = 0;
|
||||||
virtual void ResetStats() = 0;
|
virtual void ResetStats() = 0;
|
||||||
virtual EQStreamManagerInterface* GetManager() const = 0;
|
virtual EQStreamManagerInterface* GetManager() const = 0;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ std::string EQStreamProxy::Describe() const {
|
|||||||
return(m_structs->Describe());
|
return(m_structs->Describe());
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
|
const EQ::versions::ClientVersion EQStreamProxy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return m_structs->ClientVersion();
|
return m_structs->ClientVersion();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public:
|
|||||||
virtual void RemoveData();
|
virtual void RemoveData();
|
||||||
virtual bool CheckState(EQStreamState state);
|
virtual bool CheckState(EQStreamState state);
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
virtual EQStreamState GetState();
|
virtual EQStreamState GetState();
|
||||||
virtual void SetOpcodeManager(OpcodeManager **opm);
|
virtual void SetOpcodeManager(OpcodeManager **opm);
|
||||||
virtual Stats GetStats() const;
|
virtual Stats GetStats() const;
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "eqemu_exception.h"
|
#include "eqemu_exception.h"
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
Exception::Exception(const char* name, const std::string& description, const char* file, long line)
|
Exception::Exception(const char* name, const std::string& description, const char* file, long line)
|
||||||
: line_(line),
|
: line_(line),
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
//! EQEmu Exception Class
|
//! EQEmu Exception Class
|
||||||
/*!
|
/*!
|
||||||
@ -104,7 +104,7 @@ namespace EQEmu
|
|||||||
} // EQEmu
|
} // EQEmu
|
||||||
|
|
||||||
#ifndef EQ_EXCEPT
|
#ifndef EQ_EXCEPT
|
||||||
#define EQ_EXCEPT(n, d) throw EQEmu::Exception(n, d, __FILE__, __LINE__)
|
#define EQ_EXCEPT(n, d) throw EQ::Exception(n, d, __FILE__, __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace EQ {
|
|||||||
class Task
|
class Task
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::function<void(const EQEmu::Any&)> ResolveFn;
|
typedef std::function<void(const EQ::Any&)> ResolveFn;
|
||||||
typedef std::function<void(const std::exception&)> RejectFn;
|
typedef std::function<void(const std::exception&)> RejectFn;
|
||||||
typedef std::function<void()> FinallyFn;
|
typedef std::function<void()> FinallyFn;
|
||||||
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
|
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
|
||||||
@ -19,7 +19,7 @@ namespace EQ {
|
|||||||
RejectFn on_catch;
|
RejectFn on_catch;
|
||||||
FinallyFn on_finally;
|
FinallyFn on_finally;
|
||||||
bool has_result;
|
bool has_result;
|
||||||
EQEmu::Any result;
|
EQ::Any result;
|
||||||
bool has_error;
|
bool has_error;
|
||||||
std::exception error;
|
std::exception error;
|
||||||
};
|
};
|
||||||
@ -63,7 +63,7 @@ namespace EQ {
|
|||||||
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
|
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
|
||||||
TaskBaton *baton = (TaskBaton*)req->data;
|
TaskBaton *baton = (TaskBaton*)req->data;
|
||||||
|
|
||||||
baton->fn([baton](const EQEmu::Any& result) {
|
baton->fn([baton](const EQ::Any& result) {
|
||||||
baton->has_error = false;
|
baton->has_error = false;
|
||||||
baton->has_result = true;
|
baton->has_result = true;
|
||||||
baton->result = result;
|
baton->result = result;
|
||||||
|
|||||||
@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
|
|||||||
uint16 old_pet_hp; /* Not Used */
|
uint16 old_pet_hp; /* Not Used */
|
||||||
uint16 old_pet_mana; /* Not Used */
|
uint16 old_pet_mana; /* Not Used */
|
||||||
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
||||||
EQEmu::TextureMaterialProfile pet_items; /* Not Used */
|
EQ::TextureMaterialProfile pet_items; /* Not Used */
|
||||||
char merc_name[64]; /* Used */
|
char merc_name[64]; /* Used */
|
||||||
|
|
||||||
uint32 aa_effects; /* Used */
|
uint32 aa_effects; /* Used */
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "eqemu_exception.h"
|
#include "eqemu_exception.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
|
|
||||||
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
||||||
allocator for (shared memory), we assume all keys are unsigned int
|
allocator for (shared memory), we assume all keys are unsigned int
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "eqemu_exception.h"
|
#include "eqemu_exception.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
|
|
||||||
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
|
||||||
allocator for (shared memory), we assume all keys are unsigned int, values are a pointer and size
|
allocator for (shared memory), we assume all keys are unsigned int, values are a pointer and size
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
std::list<EQEmu::ItemInstance*> dirty_inst;
|
std::list<EQ::ItemInstance*> dirty_inst;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -48,50 +48,50 @@ ItemInstQueue::~ItemInstQueue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Put item onto back of queue
|
// Put item onto back of queue
|
||||||
void ItemInstQueue::push(EQEmu::ItemInstance* inst)
|
void ItemInstQueue::push(EQ::ItemInstance* inst)
|
||||||
{
|
{
|
||||||
m_list.push_back(inst);
|
m_list.push_back(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put item onto front of queue
|
// Put item onto front of queue
|
||||||
void ItemInstQueue::push_front(EQEmu::ItemInstance* inst)
|
void ItemInstQueue::push_front(EQ::ItemInstance* inst)
|
||||||
{
|
{
|
||||||
m_list.push_front(inst);
|
m_list.push_front(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove item from front of queue
|
// Remove item from front of queue
|
||||||
EQEmu::ItemInstance* ItemInstQueue::pop()
|
EQ::ItemInstance* ItemInstQueue::pop()
|
||||||
{
|
{
|
||||||
if (m_list.empty())
|
if (m_list.empty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
EQEmu::ItemInstance* inst = m_list.front();
|
EQ::ItemInstance* inst = m_list.front();
|
||||||
m_list.pop_front();
|
m_list.pop_front();
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove item from back of queue
|
// Remove item from back of queue
|
||||||
EQEmu::ItemInstance* ItemInstQueue::pop_back()
|
EQ::ItemInstance* ItemInstQueue::pop_back()
|
||||||
{
|
{
|
||||||
if (m_list.empty())
|
if (m_list.empty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
EQEmu::ItemInstance* inst = m_list.back();
|
EQ::ItemInstance* inst = m_list.back();
|
||||||
m_list.pop_back();
|
m_list.pop_back();
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look at item at front of queue
|
// Look at item at front of queue
|
||||||
EQEmu::ItemInstance* ItemInstQueue::peek_front() const
|
EQ::ItemInstance* ItemInstQueue::peek_front() const
|
||||||
{
|
{
|
||||||
return (m_list.empty()) ? nullptr : m_list.front();
|
return (m_list.empty()) ? nullptr : m_list.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// class EQEmu::InventoryProfile
|
// class EQ::InventoryProfile
|
||||||
//
|
//
|
||||||
EQEmu::InventoryProfile::~InventoryProfile()
|
EQ::InventoryProfile::~InventoryProfile()
|
||||||
{
|
{
|
||||||
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
|
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
|
||||||
safe_delete(iter->second);
|
safe_delete(iter->second);
|
||||||
@ -119,18 +119,18 @@ EQEmu::InventoryProfile::~InventoryProfile()
|
|||||||
m_trade.clear();
|
m_trade.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
|
void EQ::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
|
||||||
m_mob_version = versions::ValidateMobVersion(inventory_version);
|
m_mob_version = versions::ValidateMobVersion(inventory_version);
|
||||||
SetGMInventory(m_gm_inventory);
|
SetGMInventory(m_gm_inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::SetGMInventory(bool gmi_flag) {
|
void EQ::InventoryProfile::SetGMInventory(bool gmi_flag) {
|
||||||
m_gm_inventory = gmi_flag;
|
m_gm_inventory = gmi_flag;
|
||||||
|
|
||||||
m_lookup = inventory::DynamicLookup(m_mob_version, gmi_flag);
|
m_lookup = inventory::DynamicLookup(m_mob_version, gmi_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::CleanDirty() {
|
void EQ::InventoryProfile::CleanDirty() {
|
||||||
auto iter = dirty_inst.begin();
|
auto iter = dirty_inst.begin();
|
||||||
while (iter != dirty_inst.end()) {
|
while (iter != dirty_inst.end()) {
|
||||||
delete (*iter);
|
delete (*iter);
|
||||||
@ -139,14 +139,14 @@ void EQEmu::InventoryProfile::CleanDirty() {
|
|||||||
dirty_inst.clear();
|
dirty_inst.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::MarkDirty(ItemInstance *inst) {
|
void EQ::InventoryProfile::MarkDirty(ItemInstance *inst) {
|
||||||
if (inst) {
|
if (inst) {
|
||||||
dirty_inst.push_back(inst);
|
dirty_inst.push_back(inst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve item at specified slot; returns false if item not found
|
// Retrieve item at specified slot; returns false if item not found
|
||||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
|
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id) const
|
||||||
{
|
{
|
||||||
ItemInstance* result = nullptr;
|
ItemInstance* result = nullptr;
|
||||||
|
|
||||||
@ -219,31 +219,31 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve item at specified position within bag
|
// Retrieve item at specified position within bag
|
||||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
|
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
|
||||||
{
|
{
|
||||||
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
|
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put an item snto specified slot
|
// Put an item snto specified slot
|
||||||
int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||||
{
|
{
|
||||||
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invbag::GENERAL_BAGS_END && slot_id >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((slot_id - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
|
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||||
if ((slot_id - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
|
if ((slot_id - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invbag::BANK_BAGS_END && slot_id >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
auto temp_slot = (slot_id - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank)
|
if (temp_slot >= m_lookup->InventoryTypeSize.Bank)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up item already in slot (if exists)
|
// Clean up item already in slot (if exists)
|
||||||
@ -259,17 +259,17 @@ int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
|||||||
return _PutItem(slot_id, inst.Clone());
|
return _PutItem(slot_id, inst.Clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 EQEmu::InventoryProfile::PushCursor(const ItemInstance &inst) {
|
int16 EQ::InventoryProfile::PushCursor(const ItemInstance &inst) {
|
||||||
m_cursor.push(inst.Clone());
|
m_cursor.push(inst.Clone());
|
||||||
return invslot::slotCursor;
|
return invslot::slotCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetCursorItem() {
|
EQ::ItemInstance* EQ::InventoryProfile::GetCursorItem() {
|
||||||
return m_cursor.peek_front();
|
return m_cursor.peek_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Swap items in inventory
|
// Swap items in inventory
|
||||||
bool EQEmu::InventoryProfile::SwapItem(
|
bool EQ::InventoryProfile::SwapItem(
|
||||||
int16 source_slot,
|
int16 source_slot,
|
||||||
int16 destination_slot,
|
int16 destination_slot,
|
||||||
SwapItemFailState &fail_state,
|
SwapItemFailState &fail_state,
|
||||||
@ -280,54 +280,54 @@ bool EQEmu::InventoryProfile::SwapItem(
|
|||||||
) {
|
) {
|
||||||
fail_state = swapInvalid;
|
fail_state = swapInvalid;
|
||||||
|
|
||||||
if (source_slot <= EQEmu::invslot::POSSESSIONS_END && source_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (source_slot <= EQ::invslot::POSSESSIONS_END && source_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64) 1 << source_slot) & m_lookup->PossessionsBitmask) == 0) {
|
if ((((uint64) 1 << source_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (source_slot <= EQEmu::invbag::GENERAL_BAGS_END && source_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (source_slot <= EQ::invbag::GENERAL_BAGS_END && source_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((source_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((source_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (source_slot <= EQEmu::invslot::BANK_END && source_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (source_slot <= EQ::invslot::BANK_END && source_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
if ((source_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
if ((source_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (source_slot <= EQEmu::invbag::BANK_BAGS_END && source_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (source_slot <= EQ::invbag::BANK_BAGS_END && source_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
auto temp_slot = (source_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
auto temp_slot = (source_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destination_slot <= EQEmu::invslot::POSSESSIONS_END && destination_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (destination_slot <= EQ::invslot::POSSESSIONS_END && destination_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << destination_slot) & m_lookup->PossessionsBitmask) == 0) {
|
if ((((uint64)1 << destination_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (destination_slot <= EQEmu::invbag::GENERAL_BAGS_END && destination_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (destination_slot <= EQ::invbag::GENERAL_BAGS_END && destination_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((destination_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((destination_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (destination_slot <= EQEmu::invslot::BANK_END && destination_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (destination_slot <= EQ::invslot::BANK_END && destination_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
if ((destination_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
if ((destination_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (destination_slot <= EQEmu::invbag::BANK_BAGS_END && destination_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (destination_slot <= EQ::invbag::BANK_BAGS_END && destination_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
auto temp_slot = (destination_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
|
auto temp_slot = (destination_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
|
||||||
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
|
||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
@ -399,7 +399,7 @@ bool EQEmu::InventoryProfile::SwapItem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove item from inventory (with memory delete)
|
// Remove item from inventory (with memory delete)
|
||||||
bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
||||||
// Pop item out of inventory map (or queue)
|
// Pop item out of inventory map (or queue)
|
||||||
ItemInstance *item_to_delete = PopItem(slot_id);
|
ItemInstance *item_to_delete = PopItem(slot_id);
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Checks All items in a bag for No Drop
|
// Checks All items in a bag for No Drop
|
||||||
bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
bool EQ::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
||||||
{
|
{
|
||||||
ItemInstance* inst = GetItem(slot_id);
|
ItemInstance* inst = GetItem(slot_id);
|
||||||
if (!inst)
|
if (!inst)
|
||||||
@ -445,7 +445,7 @@ bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
|
|||||||
|
|
||||||
// Remove item from bucket without memory delete
|
// Remove item from bucket without memory delete
|
||||||
// Returns item pointer if full delete was successful
|
// Returns item pointer if full delete was successful
|
||||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
|
EQ::ItemInstance* EQ::InventoryProfile::PopItem(int16 slot_id)
|
||||||
{
|
{
|
||||||
ItemInstance* p = nullptr;
|
ItemInstance* p = nullptr;
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
|
bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
|
||||||
|
|
||||||
if (ItemToTry->Stackable) {
|
if (ItemToTry->Stackable) {
|
||||||
|
|
||||||
@ -592,7 +592,7 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
|||||||
|
|
||||||
//This function has a flaw in that it only returns the last stack that it looked at
|
//This function has a flaw in that it only returns the last stack that it looked at
|
||||||
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
|
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
|
||||||
int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
||||||
{
|
{
|
||||||
int16 slot_id = INVALID_INDEX;
|
int16 slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
@ -642,7 +642,7 @@ int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 whe
|
|||||||
}
|
}
|
||||||
|
|
||||||
//this function has the same quantity flaw mentioned above in HasItem()
|
//this function has the same quantity flaw mentioned above in HasItem()
|
||||||
int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
|
int16 EQ::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
|
||||||
{
|
{
|
||||||
int16 slot_id = INVALID_INDEX;
|
int16 slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
@ -688,7 +688,7 @@ int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 whe
|
|||||||
return slot_id;
|
return slot_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
int16 EQ::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
||||||
{
|
{
|
||||||
int16 slot_id = INVALID_INDEX;
|
int16 slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
|||||||
|
|
||||||
// Locate an available inventory slot
|
// Locate an available inventory slot
|
||||||
// Returns slot_id when there's one available, else SLOT_INVALID
|
// Returns slot_id when there's one available, else SLOT_INVALID
|
||||||
int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
|
int16 EQ::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
|
||||||
{
|
{
|
||||||
// Check basic inventory
|
// Check basic inventory
|
||||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||||
@ -786,7 +786,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is a mix of HasSpaceForItem and FindFreeSlot..due to existing coding behavior, it was better to add a new helper function...
|
// This is a mix of HasSpaceForItem and FindFreeSlot..due to existing coding behavior, it was better to add a new helper function...
|
||||||
int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
|
int16 EQ::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
|
||||||
// Do not arbitrarily use this function..it is designed for use with Client::ResetTrade() and Client::FinishTrade().
|
// Do not arbitrarily use this function..it is designed for use with Client::ResetTrade() and Client::FinishTrade().
|
||||||
// If you have a need, use it..but, understand it is not a suitable replacement for InventoryProfile::FindFreeSlot().
|
// If you have a need, use it..but, understand it is not a suitable replacement for InventoryProfile::FindFreeSlot().
|
||||||
//
|
//
|
||||||
@ -924,7 +924,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Opposite of below: Get parent bag slot_id from a slot inside of bag
|
// Opposite of below: Get parent bag slot_id from a slot inside of bag
|
||||||
int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
|
int16 EQ::InventoryProfile::CalcSlotId(int16 slot_id) {
|
||||||
int16 parent_slot_id = INVALID_INDEX;
|
int16 parent_slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
// this is not a bag range... using this risks over-writing existing items
|
// this is not a bag range... using this risks over-writing existing items
|
||||||
@ -952,7 +952,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate slot_id for an item within a bag
|
// Calculate slot_id for an item within a bag
|
||||||
int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
||||||
if (!InventoryProfile::SupportsContainers(bagslot_id))
|
if (!InventoryProfile::SupportsContainers(bagslot_id))
|
||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
|
|
||||||
@ -977,7 +977,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
|||||||
return slot_id;
|
return slot_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
uint8 EQ::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
||||||
uint8 index = 0;
|
uint8 index = 0;
|
||||||
|
|
||||||
// this is not a bag range... using this risks over-writing existing items
|
// this is not a bag range... using this risks over-writing existing items
|
||||||
@ -1006,7 +1006,7 @@ uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
int16 EQ::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
||||||
{
|
{
|
||||||
switch (material)
|
switch (material)
|
||||||
{
|
{
|
||||||
@ -1033,7 +1033,7 @@ int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
uint8 EQ::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
||||||
{
|
{
|
||||||
switch (equipslot)
|
switch (equipslot)
|
||||||
{
|
{
|
||||||
@ -1061,7 +1061,7 @@ uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
|
bool EQ::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
|
||||||
|
|
||||||
if (!ItemToTry || !Container)
|
if (!ItemToTry || !Container)
|
||||||
return false;
|
return false;
|
||||||
@ -1078,7 +1078,7 @@ bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, c
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
bool EQ::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||||
{
|
{
|
||||||
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
|
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
|
||||||
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
||||||
@ -1095,7 +1095,7 @@ bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
bool EQ::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||||
{
|
{
|
||||||
// does this have the same criteria as 'SupportsClickCasting' above? (bag clicking per client)
|
// does this have the same criteria as 'SupportsClickCasting' above? (bag clicking per client)
|
||||||
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
||||||
@ -1112,7 +1112,7 @@ bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test whether a given slot can support a container item
|
// Test whether a given slot can support a container item
|
||||||
bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
|
bool EQ::InventoryProfile::SupportsContainers(int16 slot_id)
|
||||||
{
|
{
|
||||||
if ((slot_id == invslot::slotCursor) ||
|
if ((slot_id == invslot::slotCursor) ||
|
||||||
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
|
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
|
||||||
@ -1126,7 +1126,7 @@ bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
int EQ::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
||||||
if (!inst)
|
if (!inst)
|
||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
|
|
||||||
@ -1162,7 +1162,7 @@ int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
|||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
uint8 EQ::InventoryProfile::FindBrightestLightType()
|
||||||
{
|
{
|
||||||
uint8 brightest_light_type = 0;
|
uint8 brightest_light_type = 0;
|
||||||
|
|
||||||
@ -1213,7 +1213,7 @@ uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
|||||||
return brightest_light_type;
|
return brightest_light_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpEntireInventory() {
|
void EQ::InventoryProfile::dumpEntireInventory() {
|
||||||
|
|
||||||
dumpWornItems();
|
dumpWornItems();
|
||||||
dumpInventory();
|
dumpInventory();
|
||||||
@ -1223,29 +1223,29 @@ void EQEmu::InventoryProfile::dumpEntireInventory() {
|
|||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpWornItems() {
|
void EQ::InventoryProfile::dumpWornItems() {
|
||||||
std::cout << "Worn items:" << std::endl;
|
std::cout << "Worn items:" << std::endl;
|
||||||
dumpItemCollection(m_worn);
|
dumpItemCollection(m_worn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpInventory() {
|
void EQ::InventoryProfile::dumpInventory() {
|
||||||
std::cout << "Inventory items:" << std::endl;
|
std::cout << "Inventory items:" << std::endl;
|
||||||
dumpItemCollection(m_inv);
|
dumpItemCollection(m_inv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpBankItems() {
|
void EQ::InventoryProfile::dumpBankItems() {
|
||||||
|
|
||||||
std::cout << "Bank items:" << std::endl;
|
std::cout << "Bank items:" << std::endl;
|
||||||
dumpItemCollection(m_bank);
|
dumpItemCollection(m_bank);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpSharedBankItems() {
|
void EQ::InventoryProfile::dumpSharedBankItems() {
|
||||||
|
|
||||||
std::cout << "Shared Bank items:" << std::endl;
|
std::cout << "Shared Bank items:" << std::endl;
|
||||||
dumpItemCollection(m_shbank);
|
dumpItemCollection(m_shbank);
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
|
int EQ::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
|
||||||
for (auto iter = collection.begin(); iter != collection.end(); ++iter) {
|
for (auto iter = collection.begin(); iter != collection.end(); ++iter) {
|
||||||
ItemInstance *t_inst = iter->second;
|
ItemInstance *t_inst = iter->second;
|
||||||
if (t_inst == inst) {
|
if (t_inst == inst) {
|
||||||
@ -1261,10 +1261,10 @@ int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
|
void EQ::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
|
||||||
{
|
{
|
||||||
for (auto it = collection.cbegin(); it != collection.cend(); ++it) {
|
for (auto it = collection.cbegin(); it != collection.cend(); ++it) {
|
||||||
auto inst = it->second;
|
auto inst = it->second;
|
||||||
@ -1278,7 +1278,7 @@ void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInsta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
|
void EQ::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
|
||||||
{
|
{
|
||||||
if (!inst || !inst->IsClassBag())
|
if (!inst || !inst->IsClassBag())
|
||||||
return;
|
return;
|
||||||
@ -1297,14 +1297,14 @@ void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Retrieves item within an inventory bucket
|
// Internal Method: Retrieves item within an inventory bucket
|
||||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
|
EQ::ItemInstance* EQ::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
|
||||||
{
|
{
|
||||||
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
|
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
|
||||||
if (slot_id - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
if (slot_id - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1319,7 +1319,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, Ite
|
|||||||
|
|
||||||
// Internal Method: "put" item into bucket, without regard for what is currently in bucket
|
// Internal Method: "put" item into bucket, without regard for what is currently in bucket
|
||||||
// Assumes item has already been allocated
|
// Assumes item has already been allocated
|
||||||
int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||||
{
|
{
|
||||||
// What happens here when we _PutItem(MainCursor)? Bad things..really bad things...
|
// What happens here when we _PutItem(MainCursor)? Bad things..really bad things...
|
||||||
//
|
//
|
||||||
@ -1356,7 +1356,7 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
|||||||
result = slot_id;
|
result = slot_id;
|
||||||
}
|
}
|
||||||
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
||||||
if (slot_id - EQEmu::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
|
if (slot_id - EQ::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
|
||||||
m_bank[slot_id] = inst;
|
m_bank[slot_id] = inst;
|
||||||
result = slot_id;
|
result = slot_id;
|
||||||
}
|
}
|
||||||
@ -1389,17 +1389,17 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Checks an inventory bucket for a particular item
|
// Internal Method: Checks an inventory bucket for a particular item
|
||||||
int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
|
int16 EQ::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
|
||||||
{
|
{
|
||||||
uint32 quantity_found = 0;
|
uint32 quantity_found = 0;
|
||||||
|
|
||||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1440,7 +1440,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||||
int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
int16 EQ::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
||||||
{
|
{
|
||||||
// The downfall of this (these) queue procedure is that callers presume that when an item is
|
// The downfall of this (these) queue procedure is that callers presume that when an item is
|
||||||
// found, it is presented as being available on the cursor. In cases of a parity check, this
|
// found, it is presented as being available on the cursor. In cases of a parity check, this
|
||||||
@ -1491,17 +1491,17 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Checks an inventory bucket for a particular item
|
// Internal Method: Checks an inventory bucket for a particular item
|
||||||
int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
|
int16 EQ::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
|
||||||
{
|
{
|
||||||
uint32 quantity_found = 0;
|
uint32 quantity_found = 0;
|
||||||
|
|
||||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1532,7 +1532,7 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& buc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||||
int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
int16 EQ::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
|
||||||
{
|
{
|
||||||
uint32 quantity_found = 0;
|
uint32 quantity_found = 0;
|
||||||
|
|
||||||
@ -1566,15 +1566,15 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, u
|
|||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
|
int16 EQ::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
|
||||||
{
|
{
|
||||||
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
|
||||||
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
|
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
|
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
|
||||||
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1611,11 +1611,11 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal Method: Checks an inventory queue type bucket for a particular item
|
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||||
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
||||||
{
|
{
|
||||||
for (auto iter = iqueue.cbegin(); iter != iqueue.cend(); ++iter) {
|
for (auto iter = iqueue.cbegin(); iter != iqueue.cend(); ++iter) {
|
||||||
auto inst = *iter;
|
auto inst = *iter;
|
||||||
@ -1654,5 +1654,5 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,30 +52,30 @@ public:
|
|||||||
// Public Methods
|
// Public Methods
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
inline std::list<EQEmu::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
inline std::list<EQ::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
||||||
inline std::list<EQEmu::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
inline std::list<EQ::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
||||||
|
|
||||||
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
|
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
|
||||||
inline bool empty() { return m_list.empty(); }
|
inline bool empty() { return m_list.empty(); }
|
||||||
|
|
||||||
void push(EQEmu::ItemInstance* inst);
|
void push(EQ::ItemInstance* inst);
|
||||||
void push_front(EQEmu::ItemInstance* inst);
|
void push_front(EQ::ItemInstance* inst);
|
||||||
EQEmu::ItemInstance* pop();
|
EQ::ItemInstance* pop();
|
||||||
EQEmu::ItemInstance* pop_back();
|
EQ::ItemInstance* pop_back();
|
||||||
EQEmu::ItemInstance* peek_front() const;
|
EQ::ItemInstance* peek_front() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
// Protected Members
|
// Protected Members
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
std::list<EQEmu::ItemInstance*> m_list;
|
std::list<EQ::ItemInstance*> m_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ########################################
|
// ########################################
|
||||||
// Class: EQEmu::InventoryProfile
|
// Class: EQ::InventoryProfile
|
||||||
// Character inventory
|
// Character inventory
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class InventoryProfile
|
class InventoryProfile
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
|
|
||||||
|
|
||||||
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
switch (slot_index) {
|
switch (slot_index) {
|
||||||
case invslot::slotHead:
|
case invslot::slotHead:
|
||||||
@ -48,7 +48,7 @@ int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
|
int8 EQ::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
|
||||||
{
|
{
|
||||||
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
|
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
|
||||||
return textures::textureInvalid;
|
return textures::textureInvalid;
|
||||||
@ -56,7 +56,7 @@ int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& i
|
|||||||
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
|
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
int16 EQ::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
||||||
{
|
{
|
||||||
switch (texture_index) {
|
switch (texture_index) {
|
||||||
case textures::armorHead:
|
case textures::armorHead:
|
||||||
@ -82,7 +82,7 @@ int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsValidSlot() const
|
bool EQ::InventorySlot::IsValidSlot() const
|
||||||
{
|
{
|
||||||
if (_typeless)
|
if (_typeless)
|
||||||
return false;
|
return false;
|
||||||
@ -100,7 +100,7 @@ bool EQEmu::InventorySlot::IsValidSlot() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsDeleteSlot() const
|
bool EQ::InventorySlot::IsDeleteSlot() const
|
||||||
{
|
{
|
||||||
if (_typeless)
|
if (_typeless)
|
||||||
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||||
@ -108,7 +108,7 @@ bool EQEmu::InventorySlot::IsDeleteSlot() const
|
|||||||
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
if (slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END)
|
if (slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END)
|
||||||
return false;
|
return false;
|
||||||
@ -116,7 +116,7 @@ bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsGeneralIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
|
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
|
||||||
return false;
|
return false;
|
||||||
@ -124,7 +124,7 @@ bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsCursorIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
if (slot_index == invslot::slotCursor)
|
if (slot_index == invslot::slotCursor)
|
||||||
return true;
|
return true;
|
||||||
@ -132,7 +132,7 @@ bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
if (slot_index == invslot::slotPrimary || slot_index == invslot::slotSecondary || slot_index == invslot::slotRange)
|
if (slot_index == invslot::slotPrimary || slot_index == invslot::slotSecondary || slot_index == invslot::slotRange)
|
||||||
return true;
|
return true;
|
||||||
@ -140,7 +140,7 @@ bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
switch (slot_index) {
|
switch (slot_index) {
|
||||||
case invslot::slotHead:
|
case invslot::slotHead:
|
||||||
@ -158,7 +158,7 @@ bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
bool EQ::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||||
{
|
{
|
||||||
switch (slot_index) {
|
switch (slot_index) {
|
||||||
case invslot::slotHead:
|
case invslot::slotHead:
|
||||||
@ -174,7 +174,7 @@ bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
bool EQ::InventorySlot::IsEquipmentSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -185,7 +185,7 @@ bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
|||||||
return IsEquipmentIndex(_slot_index);
|
return IsEquipmentIndex(_slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsGeneralSlot() const
|
bool EQ::InventorySlot::IsGeneralSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -196,7 +196,7 @@ bool EQEmu::InventorySlot::IsGeneralSlot() const
|
|||||||
return IsGeneralIndex(_socket_index);
|
return IsGeneralIndex(_socket_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsCursorSlot() const
|
bool EQ::InventorySlot::IsCursorSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -207,7 +207,7 @@ bool EQEmu::InventorySlot::IsCursorSlot() const
|
|||||||
return IsCursorIndex(_slot_index);
|
return IsCursorIndex(_slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsWeaponSlot() const
|
bool EQ::InventorySlot::IsWeaponSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -218,7 +218,7 @@ bool EQEmu::InventorySlot::IsWeaponSlot() const
|
|||||||
return IsWeaponIndex(_slot_index);
|
return IsWeaponIndex(_slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsTextureSlot() const
|
bool EQ::InventorySlot::IsTextureSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -229,7 +229,7 @@ bool EQEmu::InventorySlot::IsTextureSlot() const
|
|||||||
return IsTextureIndex(_slot_index);
|
return IsTextureIndex(_slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsTintableSlot() const
|
bool EQ::InventorySlot::IsTintableSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||||
return false;
|
return false;
|
||||||
@ -240,7 +240,7 @@ bool EQEmu::InventorySlot::IsTintableSlot() const
|
|||||||
return IsTintableIndex(_slot_index);
|
return IsTintableIndex(_slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsSlot() const
|
bool EQ::InventorySlot::IsSlot() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||||
return false;
|
return false;
|
||||||
@ -254,7 +254,7 @@ bool EQEmu::InventorySlot::IsSlot() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsSlotSocket() const
|
bool EQ::InventorySlot::IsSlotSocket() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||||
return false;
|
return false;
|
||||||
@ -268,7 +268,7 @@ bool EQEmu::InventorySlot::IsSlotSocket() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsContainer() const
|
bool EQ::InventorySlot::IsContainer() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||||
return false;
|
return false;
|
||||||
@ -282,7 +282,7 @@ bool EQEmu::InventorySlot::IsContainer() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::IsContainerSocket() const
|
bool EQ::InventorySlot::IsContainerSocket() const
|
||||||
{
|
{
|
||||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||||
return false;
|
return false;
|
||||||
@ -296,12 +296,12 @@ bool EQEmu::InventorySlot::IsContainerSocket() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InventorySlot EQEmu::InventorySlot::ToTopOwner() const
|
EQ::InventorySlot EQ::InventorySlot::ToTopOwner() const
|
||||||
{
|
{
|
||||||
return InventorySlot(_type_index, _slot_index);
|
return InventorySlot(_type_index, _slot_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
|
EQ::InventorySlot EQ::InventorySlot::ToOwner() const
|
||||||
{
|
{
|
||||||
if (IsSlot() || IsSlotSocket() || IsContainer())
|
if (IsSlot() || IsSlotSocket() || IsContainer())
|
||||||
return InventorySlot(_type_index, _slot_index);
|
return InventorySlot(_type_index, _slot_index);
|
||||||
@ -312,17 +312,17 @@ EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
|
|||||||
return InventorySlot();
|
return InventorySlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string EQEmu::InventorySlot::ToString() const
|
const std::string EQ::InventorySlot::ToString() const
|
||||||
{
|
{
|
||||||
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string EQEmu::InventorySlot::ToName() const
|
const std::string EQ::InventorySlot::ToName() const
|
||||||
{
|
{
|
||||||
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::InventorySlot::SetInvalidSlot()
|
void EQ::InventorySlot::SetInvalidSlot()
|
||||||
{
|
{
|
||||||
_type_index = invtype::TYPE_INVALID;
|
_type_index = invtype::TYPE_INVALID;
|
||||||
_slot_index = invslot::SLOT_INVALID;
|
_slot_index = invslot::SLOT_INVALID;
|
||||||
@ -330,7 +330,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
|||||||
_socket_index = invaug::SOCKET_INVALID;
|
_socket_index = invaug::SOCKET_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
|
//bool EQ::InventorySlot::IsBonusIndex(int16 slot_index)
|
||||||
//{
|
//{
|
||||||
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
|
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
|
||||||
// return true;
|
// return true;
|
||||||
@ -338,7 +338,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
|||||||
// return false;
|
// return false;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//bool EQEmu::InventorySlot::IsBonusSlot() const
|
//bool EQ::InventorySlot::IsBonusSlot() const
|
||||||
//{
|
//{
|
||||||
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||||
// return false;
|
// return false;
|
||||||
@ -346,7 +346,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
|
|||||||
// return IsBonusIndex(_slot_index);
|
// return IsBonusIndex(_slot_index);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQEmu::InventorySlot& rhs)
|
bool inventory_slot_typeless_lessthan(const EQ::InventorySlot& lhs, const EQ::InventorySlot& rhs)
|
||||||
{
|
{
|
||||||
if (lhs.SlotIndex() < rhs.SlotIndex())
|
if (lhs.SlotIndex() < rhs.SlotIndex())
|
||||||
return true;
|
return true;
|
||||||
@ -360,7 +360,7 @@ bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQE
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
|
bool EQ::InventorySlot::operator<(const InventorySlot& rhs) const
|
||||||
{
|
{
|
||||||
if (Typeless() || rhs.Typeless())
|
if (Typeless() || rhs.Typeless())
|
||||||
return inventory_slot_typeless_lessthan(*this, rhs);
|
return inventory_slot_typeless_lessthan(*this, rhs);
|
||||||
@ -380,7 +380,7 @@ bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
|
bool EQ::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
|
||||||
{
|
{
|
||||||
if (lhs.Typeless() || rhs.Typeless())
|
if (lhs.Typeless() || rhs.Typeless())
|
||||||
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
|
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class InventorySlot;
|
class InventorySlot;
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#include "eqemu_exception.h"
|
#include "eqemu_exception.h"
|
||||||
#include "eqemu_config.h"
|
#include "eqemu_config.h"
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
struct IPCMutex::Implementation {
|
struct IPCMutex::Implementation {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
HANDLE mut_;
|
HANDLE mut_;
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
|
|
||||||
//! Interprocess Named Binary Semaphore (Mutex)
|
//! Interprocess Named Binary Semaphore (Mutex)
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
//#include "deity.h"
|
//#include "deity.h"
|
||||||
|
|
||||||
|
|
||||||
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
||||||
{
|
{
|
||||||
switch (aug_type) {
|
switch (aug_type) {
|
||||||
case AugTypeGeneralSingleStat:
|
case AugTypeGeneralSingleStat:
|
||||||
@ -95,7 +95,7 @@ uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
uint8 EQ::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
||||||
{
|
{
|
||||||
switch (aug_type_bit) {
|
switch (aug_type_bit) {
|
||||||
case bit_AugTypeGeneralSingleStat:
|
case bit_AugTypeGeneralSingleStat:
|
||||||
@ -167,7 +167,7 @@ uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
bool EQ::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
||||||
{
|
{
|
||||||
if (!(Races & GetPlayerRaceBit(race_id)))
|
if (!(Races & GetPlayerRaceBit(race_id)))
|
||||||
return false;
|
return false;
|
||||||
@ -178,37 +178,37 @@ bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsClassCommon() const
|
bool EQ::ItemData::IsClassCommon() const
|
||||||
{
|
{
|
||||||
return (ItemClass == item::ItemClassCommon);
|
return (ItemClass == item::ItemClassCommon);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsClassBag() const
|
bool EQ::ItemData::IsClassBag() const
|
||||||
{
|
{
|
||||||
return (ItemClass == item::ItemClassBag);
|
return (ItemClass == item::ItemClassBag);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsClassBook() const
|
bool EQ::ItemData::IsClassBook() const
|
||||||
{
|
{
|
||||||
return (ItemClass == item::ItemClassBook);
|
return (ItemClass == item::ItemClassBook);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsType1HWeapon() const
|
bool EQ::ItemData::IsType1HWeapon() const
|
||||||
{
|
{
|
||||||
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing) || (ItemType == item::ItemTypeMartial));
|
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing) || (ItemType == item::ItemTypeMartial));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsType2HWeapon() const
|
bool EQ::ItemData::IsType2HWeapon() const
|
||||||
{
|
{
|
||||||
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
|
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::IsTypeShield() const
|
bool EQ::ItemData::IsTypeShield() const
|
||||||
{
|
{
|
||||||
return (ItemType == item::ItemTypeShield);
|
return (ItemType == item::ItemTypeShield);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
|
bool EQ::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
|
||||||
{
|
{
|
||||||
if (!l_item || !r_item)
|
if (!l_item || !r_item)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace item {
|
namespace item {
|
||||||
enum ItemClass {
|
enum ItemClass {
|
||||||
|
|||||||
@ -54,9 +54,9 @@ static inline int32 GetNextItemInstSerialNumber() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// class EQEmu::ItemInstance
|
// class EQ::ItemInstance
|
||||||
//
|
//
|
||||||
EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||||
m_use_type = ItemInstNormal;
|
m_use_type = ItemInstNormal;
|
||||||
if(item) {
|
if(item) {
|
||||||
m_item = new ItemData(*item);
|
m_item = new ItemData(*item);
|
||||||
@ -87,7 +87,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
|||||||
m_new_id_file = 0;
|
m_new_id_file = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
|
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
|
||||||
m_use_type = ItemInstNormal;
|
m_use_type = ItemInstNormal;
|
||||||
m_item = db->GetItem(item_id);
|
m_item = db->GetItem(item_id);
|
||||||
if(m_item) {
|
if(m_item) {
|
||||||
@ -121,7 +121,7 @@ EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 char
|
|||||||
m_new_id_file = 0;
|
m_new_id_file = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||||
m_use_type = use_type;
|
m_use_type = use_type;
|
||||||
m_item = nullptr;
|
m_item = nullptr;
|
||||||
m_charges = 0;
|
m_charges = 0;
|
||||||
@ -143,8 +143,8 @@ EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
|||||||
m_new_id_file = 0;
|
m_new_id_file = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make a copy of an EQEmu::ItemInstance object
|
// Make a copy of an EQ::ItemInstance object
|
||||||
EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
|
EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||||
{
|
{
|
||||||
m_use_type=copy.m_use_type;
|
m_use_type=copy.m_use_type;
|
||||||
if(copy.m_item)
|
if(copy.m_item)
|
||||||
@ -202,7 +202,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clean up container contents
|
// Clean up container contents
|
||||||
EQEmu::ItemInstance::~ItemInstance()
|
EQ::ItemInstance::~ItemInstance()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
safe_delete(m_item);
|
safe_delete(m_item);
|
||||||
@ -211,7 +211,7 @@ EQEmu::ItemInstance::~ItemInstance()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Query item type
|
// Query item type
|
||||||
bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
|
bool EQ::ItemInstance::IsType(item::ItemClass item_class) const
|
||||||
{
|
{
|
||||||
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
|
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
|
||||||
|
|
||||||
@ -225,23 +225,23 @@ bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
|
|||||||
return (m_item->ItemClass == item_class);
|
return (m_item->ItemClass == item_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsClassCommon() const
|
bool EQ::ItemInstance::IsClassCommon() const
|
||||||
{
|
{
|
||||||
return (m_item && m_item->IsClassCommon());
|
return (m_item && m_item->IsClassCommon());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsClassBag() const
|
bool EQ::ItemInstance::IsClassBag() const
|
||||||
{
|
{
|
||||||
return (m_item && m_item->IsClassBag());
|
return (m_item && m_item->IsClassBag());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsClassBook() const
|
bool EQ::ItemInstance::IsClassBook() const
|
||||||
{
|
{
|
||||||
return (m_item && m_item->IsClassBook());
|
return (m_item && m_item->IsClassBook());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is item stackable?
|
// Is item stackable?
|
||||||
bool EQEmu::ItemInstance::IsStackable() const
|
bool EQ::ItemInstance::IsStackable() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
@ -249,7 +249,7 @@ bool EQEmu::ItemInstance::IsStackable() const
|
|||||||
return m_item->Stackable;
|
return m_item->Stackable;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsCharged() const
|
bool EQ::ItemInstance::IsCharged() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
@ -261,7 +261,7 @@ bool EQEmu::ItemInstance::IsCharged() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Can item be equipped?
|
// Can item be equipped?
|
||||||
bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
bool EQ::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
||||||
{
|
{
|
||||||
if (!m_item || (m_item->Slots == 0))
|
if (!m_item || (m_item->Slots == 0))
|
||||||
return false;
|
return false;
|
||||||
@ -270,18 +270,18 @@ bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Can equip at this slot?
|
// Can equip at this slot?
|
||||||
bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
|
bool EQ::ItemInstance::IsEquipable(int16 slot_id) const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END)
|
if (slot_id < EQ::invslot::EQUIPMENT_BEGIN || slot_id > EQ::invslot::EQUIPMENT_END)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ((m_item->Slots & (1 << slot_id)) != 0);
|
return ((m_item->Slots & (1 << slot_id)) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsAugmentable() const
|
bool EQ::ItemInstance::IsAugmentable() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
@ -294,7 +294,7 @@ bool EQEmu::ItemInstance::IsAugmentable() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
bool EQ::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -306,10 +306,10 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (index <= EQEmu::invslot::EQUIPMENT_END);
|
return (index <= EQ::invslot::EQUIPMENT_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
@ -324,7 +324,7 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
|||||||
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
|
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
|
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return false;
|
return false;
|
||||||
@ -336,7 +336,7 @@ bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve item inside container
|
// Retrieve item inside container
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
|
EQ::ItemInstance* EQ::ItemInstance::GetItem(uint8 index) const
|
||||||
{
|
{
|
||||||
auto it = m_contents.find(index);
|
auto it = m_contents.find(index);
|
||||||
if (it != m_contents.end()) {
|
if (it != m_contents.end()) {
|
||||||
@ -346,7 +346,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
|
uint32 EQ::ItemInstance::GetItemID(uint8 slot) const
|
||||||
{
|
{
|
||||||
ItemInstance *item = GetItem(slot);
|
ItemInstance *item = GetItem(slot);
|
||||||
if (item)
|
if (item)
|
||||||
@ -355,7 +355,7 @@ uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
void EQ::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
||||||
{
|
{
|
||||||
// Clean up item already in slot (if exists)
|
// Clean up item already in slot (if exists)
|
||||||
DeleteItem(index);
|
DeleteItem(index);
|
||||||
@ -365,7 +365,7 @@ void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove item inside container
|
// Remove item inside container
|
||||||
void EQEmu::ItemInstance::DeleteItem(uint8 index)
|
void EQ::ItemInstance::DeleteItem(uint8 index)
|
||||||
{
|
{
|
||||||
ItemInstance* inst = PopItem(index);
|
ItemInstance* inst = PopItem(index);
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
@ -373,7 +373,7 @@ void EQEmu::ItemInstance::DeleteItem(uint8 index)
|
|||||||
|
|
||||||
// Remove item from container without memory delete
|
// Remove item from container without memory delete
|
||||||
// Hands over memory ownership to client of this function call
|
// Hands over memory ownership to client of this function call
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
|
EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index)
|
||||||
{
|
{
|
||||||
auto iter = m_contents.find(index);
|
auto iter = m_contents.find(index);
|
||||||
if (iter != m_contents.end()) {
|
if (iter != m_contents.end()) {
|
||||||
@ -386,7 +386,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove all items from container
|
// Remove all items from container
|
||||||
void EQEmu::ItemInstance::Clear()
|
void EQ::ItemInstance::Clear()
|
||||||
{
|
{
|
||||||
// Destroy container contents
|
// Destroy container contents
|
||||||
for (auto iter = m_contents.begin(); iter != m_contents.end(); ++iter) {
|
for (auto iter = m_contents.begin(); iter != m_contents.end(); ++iter) {
|
||||||
@ -396,7 +396,7 @@ void EQEmu::ItemInstance::Clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove all items from container
|
// Remove all items from container
|
||||||
void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
void EQ::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
||||||
{
|
{
|
||||||
// TODO: This needs work...
|
// TODO: This needs work...
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::ItemInstance::FirstOpenSlot() const
|
uint8 EQ::ItemInstance::FirstOpenSlot() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return INVALID_INDEX;
|
return INVALID_INDEX;
|
||||||
@ -472,7 +472,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
|
|||||||
return (i < slots) ? i : INVALID_INDEX;
|
return (i < slots) ? i : INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 EQEmu::ItemInstance::GetTotalItemCount() const
|
uint8 EQ::ItemInstance::GetTotalItemCount() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return 0;
|
return 0;
|
||||||
@ -486,7 +486,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
|
|||||||
return item_count;
|
return item_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsNoneEmptyContainer()
|
bool EQ::ItemInstance::IsNoneEmptyContainer()
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassBag())
|
if (!m_item || !m_item->IsClassBag())
|
||||||
return false;
|
return false;
|
||||||
@ -500,7 +500,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve augment inside item
|
// Retrieve augment inside item
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
|
EQ::ItemInstance* EQ::ItemInstance::GetAugment(uint8 slot) const
|
||||||
{
|
{
|
||||||
if (m_item && m_item->IsClassCommon())
|
if (m_item && m_item->IsClassCommon())
|
||||||
return GetItem(slot);
|
return GetItem(slot);
|
||||||
@ -508,7 +508,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
|
EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
|
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
|
||||||
if (ornamentationAugtype == 0) { return nullptr; }
|
if (ornamentationAugtype == 0) { return nullptr; }
|
||||||
@ -533,7 +533,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
||||||
// Not a Hero Forge item.
|
// Not a Hero Forge item.
|
||||||
if (m_ornament_hero_model == 0 || material_slot < 0)
|
if (m_ornament_hero_model == 0 || material_slot < 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -546,7 +546,7 @@ uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
|
|||||||
return (m_ornament_hero_model * 100) + material_slot;
|
return (m_ornament_hero_model * 100) + material_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
|
bool EQ::ItemInstance::UpdateOrnamentationInfo() {
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
|
|||||||
return ornamentSet;
|
return ornamentSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
|
bool EQ::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
|
||||||
if (!ItemToTry || !Container) return false;
|
if (!ItemToTry || !Container) return false;
|
||||||
|
|
||||||
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
|
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
|
||||||
@ -629,7 +629,7 @@ bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
|
uint32 EQ::ItemInstance::GetAugmentItemID(uint8 slot) const
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return 0;
|
return 0;
|
||||||
@ -638,7 +638,7 @@ uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add an augment to the item
|
// Add an augment to the item
|
||||||
void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return;
|
return;
|
||||||
@ -646,7 +646,7 @@ void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
|
|||||||
PutItem(slot, augment);
|
PutItem(slot, augment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
|
void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
|
||||||
{
|
{
|
||||||
if (item_id == 0) { return; }
|
if (item_id == 0) { return; }
|
||||||
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
|
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
|
||||||
@ -659,7 +659,7 @@ void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove augment from item and destroy it
|
// Remove augment from item and destroy it
|
||||||
void EQEmu::ItemInstance::DeleteAugment(uint8 index)
|
void EQ::ItemInstance::DeleteAugment(uint8 index)
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return;
|
return;
|
||||||
@ -668,7 +668,7 @@ void EQEmu::ItemInstance::DeleteAugment(uint8 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove augment from item and return it
|
// Remove augment from item and return it
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
|
EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index)
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -676,7 +676,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
|
|||||||
return PopItem(index);
|
return PopItem(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsAugmented()
|
bool EQ::ItemInstance::IsAugmented()
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return false;
|
return false;
|
||||||
@ -690,7 +690,7 @@ bool EQEmu::ItemInstance::IsAugmented()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Has attack/delay?
|
// Has attack/delay?
|
||||||
bool EQEmu::ItemInstance::IsWeapon() const
|
bool EQ::ItemInstance::IsWeapon() const
|
||||||
{
|
{
|
||||||
if (!m_item || !m_item->IsClassCommon())
|
if (!m_item || !m_item->IsClassCommon())
|
||||||
return false;
|
return false;
|
||||||
@ -701,7 +701,7 @@ bool EQEmu::ItemInstance::IsWeapon() const
|
|||||||
return ((m_item->Damage != 0) && (m_item->Delay != 0));
|
return ((m_item->Damage != 0) && (m_item->Delay != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsAmmo() const
|
bool EQ::ItemInstance::IsAmmo() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
@ -717,7 +717,7 @@ bool EQEmu::ItemInstance::IsAmmo() const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
|
const EQ::ItemData* EQ::ItemInstance::GetItem() const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -728,13 +728,13 @@ const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
|
|||||||
return m_item;
|
return m_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::ItemData* EQEmu::ItemInstance::GetUnscaledItem() const
|
const EQ::ItemData* EQ::ItemInstance::GetUnscaledItem() const
|
||||||
{
|
{
|
||||||
// No operator calls and defaults to nullptr
|
// No operator calls and defaults to nullptr
|
||||||
return m_item;
|
return m_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string EQEmu::ItemInstance::GetCustomDataString() const {
|
std::string EQ::ItemInstance::GetCustomDataString() const {
|
||||||
std::string ret_val;
|
std::string ret_val;
|
||||||
auto iter = m_custom_data.begin();
|
auto iter = m_custom_data.begin();
|
||||||
while (iter != m_custom_data.end()) {
|
while (iter != m_custom_data.end()) {
|
||||||
@ -753,7 +753,7 @@ std::string EQEmu::ItemInstance::GetCustomDataString() const {
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
|
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
|
||||||
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
|
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
|
||||||
if (iter != m_custom_data.end()) {
|
if (iter != m_custom_data.end()) {
|
||||||
return iter->second;
|
return iter->second;
|
||||||
@ -762,49 +762,49 @@ std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, std::string value) {
|
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
|
||||||
DeleteCustomData(identifier);
|
DeleteCustomData(identifier);
|
||||||
m_custom_data[identifier] = value;
|
m_custom_data[identifier] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, int value) {
|
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
|
||||||
DeleteCustomData(identifier);
|
DeleteCustomData(identifier);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << value;
|
ss << value;
|
||||||
m_custom_data[identifier] = ss.str();
|
m_custom_data[identifier] = ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, float value) {
|
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
|
||||||
DeleteCustomData(identifier);
|
DeleteCustomData(identifier);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << value;
|
ss << value;
|
||||||
m_custom_data[identifier] = ss.str();
|
m_custom_data[identifier] = ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::SetCustomData(std::string identifier, bool value) {
|
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
|
||||||
DeleteCustomData(identifier);
|
DeleteCustomData(identifier);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << value;
|
ss << value;
|
||||||
m_custom_data[identifier] = ss.str();
|
m_custom_data[identifier] = ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::DeleteCustomData(std::string identifier) {
|
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
|
||||||
auto iter = m_custom_data.find(identifier);
|
auto iter = m_custom_data.find(identifier);
|
||||||
if (iter != m_custom_data.end()) {
|
if (iter != m_custom_data.end()) {
|
||||||
m_custom_data.erase(iter);
|
m_custom_data.erase(iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone a type of EQEmu::ItemInstance object
|
// Clone a type of EQ::ItemInstance object
|
||||||
// c++ doesn't allow a polymorphic copy constructor,
|
// c++ doesn't allow a polymorphic copy constructor,
|
||||||
// so we have to resort to a polymorphic Clone()
|
// so we have to resort to a polymorphic Clone()
|
||||||
EQEmu::ItemInstance* EQEmu::ItemInstance::Clone() const
|
EQ::ItemInstance* EQ::ItemInstance::Clone() const
|
||||||
{
|
{
|
||||||
// Pseudo-polymorphic copy constructor
|
// Pseudo-polymorphic copy constructor
|
||||||
return new ItemInstance(*this);
|
return new ItemInstance(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
bool EQ::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
||||||
if (!m_item) { return false; }
|
if (!m_item) { return false; }
|
||||||
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
|
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
|
||||||
else if (m_item->Slots & (1 << slot_id)) { return true; }
|
else if (m_item->Slots & (1 << slot_id)) { return true; }
|
||||||
@ -812,7 +812,7 @@ bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
|||||||
else { return false; }
|
else { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
|
bool EQ::ItemInstance::IsDroppable(bool recurse) const
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return false;
|
return false;
|
||||||
@ -838,7 +838,7 @@ bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
|
void EQ::ItemInstance::Initialize(SharedDatabase *db) {
|
||||||
// if there's no actual item, don't do anything
|
// if there's no actual item, don't do anything
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return;
|
return;
|
||||||
@ -855,7 +855,7 @@ void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::ScaleItem() {
|
void EQ::ItemInstance::ScaleItem() {
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -939,18 +939,18 @@ void EQEmu::ItemInstance::ScaleItem() {
|
|||||||
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
|
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ItemInstance::EvolveOnAllKills() const {
|
bool EQ::ItemInstance::EvolveOnAllKills() const {
|
||||||
return (m_evolveInfo && m_evolveInfo->AllKills);
|
return (m_evolveInfo && m_evolveInfo->AllKills);
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 EQEmu::ItemInstance::GetMaxEvolveLvl() const {
|
int8 EQ::ItemInstance::GetMaxEvolveLvl() const {
|
||||||
if (m_evolveInfo)
|
if (m_evolveInfo)
|
||||||
return m_evolveInfo->MaxLvl;
|
return m_evolveInfo->MaxLvl;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
||||||
uint32 kills = -1; // default to -1 (max uint32 value) because this value is usually divided by, so we don't want to ever return zero.
|
uint32 kills = -1; // default to -1 (max uint32 value) because this value is usually divided by, so we don't want to ever return zero.
|
||||||
if (m_evolveInfo)
|
if (m_evolveInfo)
|
||||||
if (currentlevel != m_evolveInfo->MaxLvl)
|
if (currentlevel != m_evolveInfo->MaxLvl)
|
||||||
@ -962,24 +962,24 @@ uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
|||||||
return kills;
|
return kills;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::SetTimer(std::string name, uint32 time) {
|
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
|
||||||
Timer t(time);
|
Timer t(time);
|
||||||
t.Start(time, false);
|
t.Start(time, false);
|
||||||
m_timers[name] = t;
|
m_timers[name] = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::StopTimer(std::string name) {
|
void EQ::ItemInstance::StopTimer(std::string name) {
|
||||||
auto iter = m_timers.find(name);
|
auto iter = m_timers.find(name);
|
||||||
if(iter != m_timers.end()) {
|
if(iter != m_timers.end()) {
|
||||||
m_timers.erase(iter);
|
m_timers.erase(iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ItemInstance::ClearTimers() {
|
void EQ::ItemInstance::ClearTimers() {
|
||||||
m_timers.clear();
|
m_timers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
|
int EQ::ItemInstance::GetItemArmorClass(bool augments) const
|
||||||
{
|
{
|
||||||
int ac = 0;
|
int ac = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -993,7 +993,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
|
|||||||
return ac;
|
return ac;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
|
int EQ::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
|
||||||
{
|
{
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -1035,7 +1035,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
|
|||||||
return magic + fire + cold + poison + disease + chromatic + prismatic + physical + corruption;
|
return magic + fire + cold + poison + disease + chromatic + prismatic + physical + corruption;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
|
int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
|
||||||
{
|
{
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1056,7 +1056,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
|
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1077,7 +1077,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
int EQ::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
||||||
{
|
{
|
||||||
int level = 0;
|
int level = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1099,7 +1099,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
|
int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
|
||||||
{
|
{
|
||||||
int level = 0;
|
int level = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1121,7 +1121,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
|
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1137,7 +1137,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
|
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1153,7 +1153,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
||||||
{
|
{
|
||||||
int body = 0;
|
int body = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1174,7 +1174,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
|||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
||||||
{
|
{
|
||||||
int race = 0;
|
int race = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1195,7 +1195,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
|||||||
return race;
|
return race;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1212,7 +1212,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1229,7 +1229,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemMagical(bool augments) const
|
int EQ::ItemInstance::GetItemMagical(bool augments) const
|
||||||
{
|
{
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -1245,7 +1245,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHP(bool augments) const
|
int EQ::ItemInstance::GetItemHP(bool augments) const
|
||||||
{
|
{
|
||||||
int hp = 0;
|
int hp = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1259,7 +1259,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
|
|||||||
return hp;
|
return hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemMana(bool augments) const
|
int EQ::ItemInstance::GetItemMana(bool augments) const
|
||||||
{
|
{
|
||||||
int mana = 0;
|
int mana = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1273,7 +1273,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
|
|||||||
return mana;
|
return mana;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemEndur(bool augments) const
|
int EQ::ItemInstance::GetItemEndur(bool augments) const
|
||||||
{
|
{
|
||||||
int endur = 0;
|
int endur = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1287,7 +1287,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
|
|||||||
return endur;
|
return endur;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemAttack(bool augments) const
|
int EQ::ItemInstance::GetItemAttack(bool augments) const
|
||||||
{
|
{
|
||||||
int atk = 0;
|
int atk = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1301,7 +1301,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
|
|||||||
return atk;
|
return atk;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemStr(bool augments) const
|
int EQ::ItemInstance::GetItemStr(bool augments) const
|
||||||
{
|
{
|
||||||
int str = 0;
|
int str = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1315,7 +1315,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemSta(bool augments) const
|
int EQ::ItemInstance::GetItemSta(bool augments) const
|
||||||
{
|
{
|
||||||
int sta = 0;
|
int sta = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1329,7 +1329,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
|
|||||||
return sta;
|
return sta;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemDex(bool augments) const
|
int EQ::ItemInstance::GetItemDex(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1343,7 +1343,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemAgi(bool augments) const
|
int EQ::ItemInstance::GetItemAgi(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1357,7 +1357,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemInt(bool augments) const
|
int EQ::ItemInstance::GetItemInt(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1371,7 +1371,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemWis(bool augments) const
|
int EQ::ItemInstance::GetItemWis(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1385,7 +1385,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemCha(bool augments) const
|
int EQ::ItemInstance::GetItemCha(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1399,7 +1399,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemMR(bool augments) const
|
int EQ::ItemInstance::GetItemMR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1413,7 +1413,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemFR(bool augments) const
|
int EQ::ItemInstance::GetItemFR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1427,7 +1427,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemCR(bool augments) const
|
int EQ::ItemInstance::GetItemCR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1441,7 +1441,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemPR(bool augments) const
|
int EQ::ItemInstance::GetItemPR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1455,7 +1455,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemDR(bool augments) const
|
int EQ::ItemInstance::GetItemDR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1469,7 +1469,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
|
int EQ::ItemInstance::GetItemCorrup(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1483,7 +1483,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicStr(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1497,7 +1497,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicSta(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1511,7 +1511,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicDex(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1525,7 +1525,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicAgi(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1539,7 +1539,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicInt(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1553,7 +1553,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicWis(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1567,7 +1567,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicCha(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1581,7 +1581,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicMR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1595,7 +1595,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicFR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1609,7 +1609,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicCR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1623,7 +1623,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicPR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1637,7 +1637,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicDR(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1651,7 +1651,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
int EQ::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
@ -1665,7 +1665,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQEmu::ItemInstance::GetItemHaste(bool augments) const
|
int EQ::ItemInstance::GetItemHaste(bool augments) const
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class EvolveInfo; // Stores information about an evolving item family
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
|
||||||
// Specifies usage type for item inside EQEmu::ItemInstance
|
// Specifies usage type for item inside EQ::ItemInstance
|
||||||
enum ItemInstTypes
|
enum ItemInstTypes
|
||||||
{
|
{
|
||||||
ItemInstNormal = 0,
|
ItemInstNormal = 0,
|
||||||
@ -54,11 +54,11 @@ typedef enum {
|
|||||||
class SharedDatabase;
|
class SharedDatabase;
|
||||||
|
|
||||||
// ########################################
|
// ########################################
|
||||||
// Class: EQEmu::ItemInstance
|
// Class: EQ::ItemInstance
|
||||||
// Base class for an instance of an item
|
// Base class for an instance of an item
|
||||||
// An item instance encapsulates item data + data specific
|
// An item instance encapsulates item data + data specific
|
||||||
// to an item instance (includes dye, augments, charges, etc)
|
// to an item instance (includes dye, augments, charges, etc)
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class InventoryProfile;
|
class InventoryProfile;
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ namespace EQEmu
|
|||||||
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||||
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||||
|
|
||||||
std::map<std::string, Timer>& GetTimers() { return m_timers; }
|
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
|
||||||
void SetTimer(std::string name, uint32 time);
|
void SetTimer(std::string name, uint32 time);
|
||||||
void StopTimer(std::string name);
|
void StopTimer(std::string name);
|
||||||
void ClearTimers();
|
void ClearTimers();
|
||||||
@ -316,13 +316,13 @@ namespace EQEmu
|
|||||||
// Items inside of this item (augs or contents);
|
// Items inside of this item (augs or contents);
|
||||||
std::map<uint8, ItemInstance*> m_contents; // Zero-based index: min=0, max=9
|
std::map<uint8, ItemInstance*> m_contents; // Zero-based index: min=0, max=9
|
||||||
std::map<std::string, std::string> m_custom_data;
|
std::map<std::string, std::string> m_custom_data;
|
||||||
std::map<std::string, Timer> m_timers;
|
std::map<std::string, ::Timer> m_timers;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class EvolveInfo {
|
class EvolveInfo {
|
||||||
public:
|
public:
|
||||||
friend class EQEmu::ItemInstance;
|
friend class EQ::ItemInstance;
|
||||||
//temporary
|
//temporary
|
||||||
uint16 LvlKills[9];
|
uint16 LvlKills[9];
|
||||||
uint32 FirstItem;
|
uint32 FirstItem;
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
|
||||||
{
|
{
|
||||||
switch (light_type) {
|
switch (light_type) {
|
||||||
case LightTypeGlobeOfStars:
|
case LightTypeGlobeOfStars:
|
||||||
@ -55,7 +55,7 @@ uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
bool EQ::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
||||||
{
|
{
|
||||||
static const uint8 light_levels[LightTypeCount] = {
|
static const uint8 light_levels[LightTypeCount] = {
|
||||||
LightLevelUnlit, /* LightTypeNone */
|
LightLevelUnlit, /* LightTypeNone */
|
||||||
@ -82,17 +82,17 @@ bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
|
|||||||
return (light_levels[left_type] > light_levels[right_type]);
|
return (light_levels[left_type] > light_levels[right_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::LightSource_Struct::LightSource_Struct()
|
EQ::LightSource_Struct::LightSource_Struct()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::LightSource_Struct::Clear()
|
void EQ::LightSource_Struct::Clear()
|
||||||
{
|
{
|
||||||
memset(&Slot, 0, (sizeof(uint8) * lightsource::LightCount));
|
memset(&Slot, 0, (sizeof(uint8) * lightsource::LightCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::LightSourceProfile::Clear()
|
void EQ::LightSourceProfile::Clear()
|
||||||
{
|
{
|
||||||
Type.Clear();
|
Type.Clear();
|
||||||
Level.Clear();
|
Level.Clear();
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace lightsource {
|
namespace lightsource {
|
||||||
enum LightSlot {
|
enum LightSlot {
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#include "memory_buffer.h"
|
#include "memory_buffer.h"
|
||||||
|
|
||||||
|
|
||||||
EQEmu::MemoryBuffer::MemoryBuffer()
|
EQ::MemoryBuffer::MemoryBuffer()
|
||||||
{
|
{
|
||||||
buffer_ = nullptr;
|
buffer_ = nullptr;
|
||||||
size_ = 0;
|
size_ = 0;
|
||||||
@ -29,7 +29,7 @@ EQEmu::MemoryBuffer::MemoryBuffer()
|
|||||||
write_pos_ = 0;
|
write_pos_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
|
EQ::MemoryBuffer::MemoryBuffer(size_t sz)
|
||||||
{
|
{
|
||||||
buffer_ = nullptr;
|
buffer_ = nullptr;
|
||||||
size_ = 0;
|
size_ = 0;
|
||||||
@ -39,7 +39,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
|
|||||||
Resize(sz);
|
Resize(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
EQ::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
||||||
{
|
{
|
||||||
if(other.capacity_) {
|
if(other.capacity_) {
|
||||||
buffer_ = new uchar[other.capacity_];
|
buffer_ = new uchar[other.capacity_];
|
||||||
@ -54,7 +54,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
|
|||||||
read_pos_ = other.read_pos_;
|
read_pos_ = other.read_pos_;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
EQ::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
||||||
{
|
{
|
||||||
uchar *tbuf = other.buffer_;
|
uchar *tbuf = other.buffer_;
|
||||||
size_t tsz = other.size_;
|
size_t tsz = other.size_;
|
||||||
@ -75,7 +75,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
|
|||||||
read_pos_ = tread_pos;
|
read_pos_ = tread_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
|
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(const MemoryBuffer &other)
|
||||||
{
|
{
|
||||||
if(this == &other) {
|
if(this == &other) {
|
||||||
return *this;
|
return *this;
|
||||||
@ -100,7 +100,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
|
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(MemoryBuffer &&other)
|
||||||
{
|
{
|
||||||
uchar *tbuf = other.buffer_;
|
uchar *tbuf = other.buffer_;
|
||||||
size_t tsz = other.size_;
|
size_t tsz = other.size_;
|
||||||
@ -122,7 +122,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
EQ::MemoryBuffer& EQ::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
||||||
{
|
{
|
||||||
if(!rhs.buffer_) {
|
if(!rhs.buffer_) {
|
||||||
return *this;
|
return *this;
|
||||||
@ -142,52 +142,52 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::MemoryBuffer::~MemoryBuffer()
|
EQ::MemoryBuffer::~MemoryBuffer()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
uchar& EQEmu::MemoryBuffer::operator[](size_t pos)
|
uchar& EQ::MemoryBuffer::operator[](size_t pos)
|
||||||
{
|
{
|
||||||
return buffer_[pos];
|
return buffer_[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
const uchar& EQEmu::MemoryBuffer::operator[](size_t pos) const
|
const uchar& EQ::MemoryBuffer::operator[](size_t pos) const
|
||||||
{
|
{
|
||||||
return buffer_[pos];
|
return buffer_[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::MemoryBuffer::Empty()
|
bool EQ::MemoryBuffer::Empty()
|
||||||
{
|
{
|
||||||
return size_ == 0;
|
return size_ == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::MemoryBuffer::Empty() const
|
bool EQ::MemoryBuffer::Empty() const
|
||||||
{
|
{
|
||||||
return size_ == 0;
|
return size_ == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t EQEmu::MemoryBuffer::Size()
|
size_t EQ::MemoryBuffer::Size()
|
||||||
{
|
{
|
||||||
return size_;
|
return size_;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t EQEmu::MemoryBuffer::Size() const
|
size_t EQ::MemoryBuffer::Size() const
|
||||||
{
|
{
|
||||||
return size_;
|
return size_;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t EQEmu::MemoryBuffer::Capacity()
|
size_t EQ::MemoryBuffer::Capacity()
|
||||||
{
|
{
|
||||||
return capacity_;
|
return capacity_;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t EQEmu::MemoryBuffer::Capacity() const
|
size_t EQ::MemoryBuffer::Capacity() const
|
||||||
{
|
{
|
||||||
return capacity_;
|
return capacity_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Resize(size_t sz)
|
void EQ::MemoryBuffer::Resize(size_t sz)
|
||||||
{
|
{
|
||||||
if(!buffer_) {
|
if(!buffer_) {
|
||||||
size_t new_size = sz + 64;
|
size_t new_size = sz + 64;
|
||||||
@ -213,7 +213,7 @@ void EQEmu::MemoryBuffer::Resize(size_t sz)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Clear()
|
void EQ::MemoryBuffer::Clear()
|
||||||
{
|
{
|
||||||
if(buffer_) {
|
if(buffer_) {
|
||||||
delete[] buffer_;
|
delete[] buffer_;
|
||||||
@ -226,14 +226,14 @@ void EQEmu::MemoryBuffer::Clear()
|
|||||||
read_pos_ = 0;
|
read_pos_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Zero()
|
void EQ::MemoryBuffer::Zero()
|
||||||
{
|
{
|
||||||
if(buffer_) {
|
if(buffer_) {
|
||||||
memset(buffer_, 0, capacity_);
|
memset(buffer_, 0, capacity_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
|
void EQ::MemoryBuffer::Write(const char *val, size_t len)
|
||||||
{
|
{
|
||||||
size_t size_needed = write_pos_ + len;
|
size_t size_needed = write_pos_ + len;
|
||||||
Resize(size_needed);
|
Resize(size_needed);
|
||||||
@ -242,20 +242,20 @@ void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
|
|||||||
write_pos_ += len;
|
write_pos_ += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Read(uchar *buf, size_t len)
|
void EQ::MemoryBuffer::Read(uchar *buf, size_t len)
|
||||||
{
|
{
|
||||||
memcpy(buf, &buffer_[read_pos_], len);
|
memcpy(buf, &buffer_[read_pos_], len);
|
||||||
read_pos_ += len;
|
read_pos_ += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::MemoryBuffer::Read(char *str)
|
void EQ::MemoryBuffer::Read(char *str)
|
||||||
{
|
{
|
||||||
size_t len = strlen((const char*)&buffer_[read_pos_]);
|
size_t len = strlen((const char*)&buffer_[read_pos_]);
|
||||||
memcpy(str, &buffer_[read_pos_], len);
|
memcpy(str, &buffer_[read_pos_], len);
|
||||||
read_pos_ += len;
|
read_pos_ += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
|
void EQ::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
|
||||||
{
|
{
|
||||||
auto last_pos = tellp();
|
auto last_pos = tellp();
|
||||||
seekp(position);
|
seekp(position);
|
||||||
@ -263,7 +263,7 @@ void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str,
|
|||||||
seekp(last_pos);
|
seekp(last_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
uchar* EQEmu::OutBuffer::detach()
|
uchar* EQ::OutBuffer::detach()
|
||||||
{
|
{
|
||||||
size_t buffer_size = tellp();
|
size_t buffer_size = tellp();
|
||||||
if (buffer_size == 0)
|
if (buffer_size == 0)
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class MemoryBuffer {
|
class MemoryBuffer {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
|
|
||||||
struct MemoryMappedFile::Implementation {
|
struct MemoryMappedFile::Implementation {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
|
|
||||||
//! Memory Backed Shared Memory
|
//! Memory Backed Shared Memory
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@ -1103,7 +1103,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
InternalBufferedSend(p);
|
InternalBufferedSend(p);
|
||||||
entry.second.last_sent = now;
|
entry.second.last_sent = now;
|
||||||
entry.second.times_resent++;
|
entry.second.times_resent++;
|
||||||
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||||
resends++;
|
resends++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1132,7 +1132,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
InternalBufferedSend(p);
|
InternalBufferedSend(p);
|
||||||
entry.second.last_sent = now;
|
entry.second.last_sent = now;
|
||||||
entry.second.times_resent++;
|
entry.second.times_resent++;
|
||||||
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
|
||||||
resends++;
|
resends++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1184,7 +1184,7 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
|
|||||||
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
|
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
|
||||||
{
|
{
|
||||||
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
|
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
|
||||||
m_outgoing_budget = EQEmu::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
|
m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
|
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
|
||||||
@ -1405,7 +1405,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
|||||||
sent.last_sent = Clock::now();
|
sent.last_sent = Clock::now();
|
||||||
sent.first_sent = Clock::now();
|
sent.first_sent = Clock::now();
|
||||||
sent.times_resent = 0;
|
sent.times_resent = 0;
|
||||||
sent.resend_delay = EQEmu::Clamp(
|
sent.resend_delay = EQ::Clamp(
|
||||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||||
m_owner->m_options.resend_delay_min,
|
m_owner->m_options.resend_delay_min,
|
||||||
m_owner->m_options.resend_delay_max);
|
m_owner->m_options.resend_delay_max);
|
||||||
@ -1437,7 +1437,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
|||||||
sent.last_sent = Clock::now();
|
sent.last_sent = Clock::now();
|
||||||
sent.first_sent = Clock::now();
|
sent.first_sent = Clock::now();
|
||||||
sent.times_resent = 0;
|
sent.times_resent = 0;
|
||||||
sent.resend_delay = EQEmu::Clamp(
|
sent.resend_delay = EQ::Clamp(
|
||||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||||
m_owner->m_options.resend_delay_min,
|
m_owner->m_options.resend_delay_min,
|
||||||
m_owner->m_options.resend_delay_max);
|
m_owner->m_options.resend_delay_max);
|
||||||
@ -1461,7 +1461,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
|||||||
sent.last_sent = Clock::now();
|
sent.last_sent = Clock::now();
|
||||||
sent.first_sent = Clock::now();
|
sent.first_sent = Clock::now();
|
||||||
sent.times_resent = 0;
|
sent.times_resent = 0;
|
||||||
sent.resend_delay = EQEmu::Clamp(
|
sent.resend_delay = EQ::Clamp(
|
||||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||||
m_owner->m_options.resend_delay_min,
|
m_owner->m_options.resend_delay_min,
|
||||||
m_owner->m_options.resend_delay_max);
|
m_owner->m_options.resend_delay_max);
|
||||||
|
|||||||
@ -318,7 +318,7 @@ namespace EQ
|
|||||||
void Attach(uv_loop_t *loop);
|
void Attach(uv_loop_t *loop);
|
||||||
void Detach();
|
void Detach();
|
||||||
|
|
||||||
EQEmu::Random m_rand;
|
EQ::Random m_rand;
|
||||||
uv_timer_t m_timer;
|
uv_timer_t m_timer;
|
||||||
uv_udp_t m_socket;
|
uv_udp_t m_socket;
|
||||||
uv_loop_t *m_attached;
|
uv_loop_t *m_attached;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ namespace RoF
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
static Strategy struct_strategy;
|
||||||
|
|
||||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||||
|
|
||||||
// server to client inventory location converters
|
// server to client inventory location converters
|
||||||
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 server_slot);
|
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 server_slot);
|
||||||
@ -65,8 +65,8 @@ namespace RoF
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink);
|
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
|
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
|
||||||
|
|
||||||
static inline int ServerToRoFBuffSlot(int index);
|
static inline int ServerToRoFBuffSlot(int index);
|
||||||
static inline int RoFToServerBuffSlot(int index);
|
static inline int RoFToServerBuffSlot(int index);
|
||||||
@ -147,9 +147,9 @@ namespace RoF
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return EQEmu::versions::ClientVersion::RoF;
|
return EQ::versions::ClientVersion::RoF;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ss_define.h"
|
#include "ss_define.h"
|
||||||
@ -193,7 +193,7 @@ namespace RoF
|
|||||||
|
|
||||||
eq->unknown000 = 1;
|
eq->unknown000 = 1;
|
||||||
OUT(npcid);
|
OUT(npcid);
|
||||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQ::invtype::typePossessions);
|
||||||
OUT(charges);
|
OUT(charges);
|
||||||
OUT(sell_price);
|
OUT(sell_price);
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ namespace RoF
|
|||||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||||
|
|
||||||
OUT(merchant_entity_id);
|
OUT(merchant_entity_id);
|
||||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
|
||||||
OUT(charges);
|
OUT(charges);
|
||||||
OUT(cost);
|
OUT(cost);
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ namespace RoF
|
|||||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||||
|
|
||||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
|
||||||
OUT(success);
|
OUT(success);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
@ -502,7 +502,7 @@ namespace RoF
|
|||||||
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
||||||
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
||||||
|
|
||||||
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||||
|
|
||||||
OUT(spell_id);
|
OUT(spell_id);
|
||||||
eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot);
|
eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot);
|
||||||
@ -570,24 +570,24 @@ namespace RoF
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
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",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)&item_count, sizeof(uint32));
|
ob.write((const char*)&item_count, sizeof(uint32));
|
||||||
|
|
||||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||||
if (ob.tellp() == last_pos)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("RoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
LogNetcode("RoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||||
|
|
||||||
@ -1513,14 +1513,14 @@ namespace RoF
|
|||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
||||||
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
ob.write((const char*)__emu_buffer, 4);
|
||||||
|
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||||
if (ob.tellp() == last_pos) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("RoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("RoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -1957,7 +1957,7 @@ namespace RoF
|
|||||||
|
|
||||||
outapp->WriteUInt32(22); // Equipment count
|
outapp->WriteUInt32(22); // Equipment count
|
||||||
|
|
||||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
@ -1977,9 +1977,9 @@ namespace RoF
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
|
||||||
|
|
||||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
@ -1988,7 +1988,7 @@ namespace RoF
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
|
||||||
|
|
||||||
for (int r = 0; r < 7; r++)
|
for (int r = 0; r < 7; r++)
|
||||||
{
|
{
|
||||||
@ -1998,7 +1998,7 @@ namespace RoF
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
|
||||||
|
|
||||||
for (int r = 0; r < 7; r++)
|
for (int r = 0; r < 7; r++)
|
||||||
{
|
{
|
||||||
@ -2127,7 +2127,7 @@ namespace RoF
|
|||||||
|
|
||||||
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
||||||
|
|
||||||
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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
outapp->WriteUInt32(emu->spell_book[r]);
|
outapp->WriteUInt32(emu->spell_book[r]);
|
||||||
@ -2136,33 +2136,33 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
outapp->WriteUInt32(emu->spell_book[r]);
|
outapp->WriteUInt32(emu->spell_book[r]);
|
||||||
else
|
else
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// invalidate the rest of the spellbook slots
|
||||||
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // first 12
|
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // first 12
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->mem_spells[r]);
|
outapp->WriteUInt32(emu->mem_spells[r]);
|
||||||
}
|
}
|
||||||
// zeroes for the rest of the slots -- the other 4 which don't work at all!
|
// zeroes for the rest of the slots -- the other 4 which don't work at all!
|
||||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
|
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(13); // gem refresh count
|
outapp->WriteUInt32(13); // gem refresh count
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
|
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
||||||
}
|
}
|
||||||
@ -2251,7 +2251,7 @@ namespace RoF
|
|||||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// Copy bandoliers where server and client indices converge
|
||||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||||
outapp->WriteString(emu->bandoliers[r].Name);
|
outapp->WriteString(emu->bandoliers[r].Name);
|
||||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||||
@ -2266,7 +2266,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// Nullify bandoliers where server and client indices diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
@ -2278,7 +2278,7 @@ namespace RoF
|
|||||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// Copy potion belt where server and client indices converge
|
||||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||||
if (emu->potionbelt.Items[r].Icon) {
|
if (emu->potionbelt.Items[r].Icon) {
|
||||||
@ -2290,7 +2290,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// Nullify potion belt where server and client indices diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
@ -2412,9 +2412,9 @@ namespace RoF
|
|||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||||
@ -2949,7 +2949,7 @@ namespace RoF
|
|||||||
eq_cse->Gender = emu_cse->Gender;
|
eq_cse->Gender = emu_cse->Gender;
|
||||||
eq_cse->Face = emu_cse->Face;
|
eq_cse->Face = emu_cse->Face;
|
||||||
|
|
||||||
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
|
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
|
||||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
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].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||||
@ -3066,7 +3066,7 @@ namespace RoF
|
|||||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||||
|
|
||||||
OUT(npcid);
|
OUT(npcid);
|
||||||
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
|
||||||
//OUT(itemslot);
|
//OUT(itemslot);
|
||||||
OUT(quantity);
|
OUT(quantity);
|
||||||
OUT(price);
|
OUT(price);
|
||||||
@ -3980,7 +3980,7 @@ namespace RoF
|
|||||||
|
|
||||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
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);
|
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||||
@ -3989,7 +3989,7 @@ namespace RoF
|
|||||||
|
|
||||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
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++) {
|
||||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||||
@ -3997,7 +3997,7 @@ namespace RoF
|
|||||||
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4714,7 +4714,7 @@ namespace RoF
|
|||||||
|
|
||||||
IN(item_id);
|
IN(item_id);
|
||||||
int r;
|
int r;
|
||||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
|
||||||
IN(augments[r]);
|
IN(augments[r]);
|
||||||
}
|
}
|
||||||
IN(link_hash);
|
IN(link_hash);
|
||||||
@ -4739,7 +4739,7 @@ namespace RoF
|
|||||||
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
||||||
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, 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)
|
if (eq->spell[i] == 0)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
@ -5091,9 +5091,9 @@ namespace RoF
|
|||||||
return NextItemInstSerialNumber;
|
return NextItemInstSerialNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||||
{
|
{
|
||||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||||
|
|
||||||
RoF::structs::ItemSerializationHeader hdr;
|
RoF::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -5156,7 +5156,7 @@ namespace RoF
|
|||||||
uint32 hero_model = 0;
|
uint32 hero_model = 0;
|
||||||
|
|
||||||
if (inst->GetOrnamentationIDFile()) {
|
if (inst->GetOrnamentationIDFile()) {
|
||||||
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||||
|
|
||||||
char tmp[30];
|
char tmp[30];
|
||||||
memset(tmp, 0x0, 30);
|
memset(tmp, 0x0, 30);
|
||||||
@ -5356,6 +5356,12 @@ namespace RoF
|
|||||||
itbs.no_transfer = item->NoTransfer;
|
itbs.no_transfer = item->NoTransfer;
|
||||||
itbs.expendablearrow = item->ExpendableArrow;
|
itbs.expendablearrow = item->ExpendableArrow;
|
||||||
|
|
||||||
|
// Done to hack older clients to label expendable fishing poles as such
|
||||||
|
// July 28th, 2018 patch
|
||||||
|
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||||
|
itbs.expendablearrow = 1;
|
||||||
|
}
|
||||||
|
|
||||||
itbs.unknown8 = 0;
|
itbs.unknown8 = 0;
|
||||||
itbs.unknown9 = 0;
|
itbs.unknown9 = 0;
|
||||||
itbs.unknown10 = 0;
|
itbs.unknown10 = 0;
|
||||||
@ -5511,28 +5517,28 @@ namespace RoF
|
|||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
ob.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||||
uint32 subitem_count = 0;
|
uint32 subitem_count = 0;
|
||||||
|
|
||||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||||
|
|
||||||
// moved outside of loop since it is not modified within that scope
|
// 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::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
|
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else
|
else
|
||||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||||
|
|
||||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -5558,77 +5564,77 @@ namespace RoF
|
|||||||
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
||||||
RoFSlot.Unknown01 = INULL;
|
RoFSlot.Unknown01 = INULL;
|
||||||
|
|
||||||
uint32 temp_slot = (uint32) EQEmu::invslot::SLOT_INVALID;
|
uint32 temp_slot = (uint32) EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||||
RoFSlot.Type = invtype::typePossessions;
|
RoFSlot.Type = invtype::typePossessions;
|
||||||
RoFSlot.Slot = server_slot;
|
RoFSlot.Slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
temp_slot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
temp_slot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
|
|
||||||
RoFSlot.Type = invtype::typePossessions;
|
RoFSlot.Type = invtype::typePossessions;
|
||||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQ::invbag::SLOT_COUNT);
|
||||||
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeTribute;
|
RoFSlot.Type = invtype::typeTribute;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeGuildTribute;
|
RoFSlot.Type = invtype::typeGuildTribute;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
RoFSlot.Type = invtype::typeWorld;
|
RoFSlot.Type = invtype::typeWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeBank;
|
RoFSlot.Type = invtype::typeBank;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
temp_slot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
|
temp_slot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
|
||||||
|
|
||||||
RoFSlot.Type = invtype::typeBank;
|
RoFSlot.Type = invtype::typeBank;
|
||||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeSharedBank;
|
RoFSlot.Type = invtype::typeSharedBank;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
temp_slot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
|
temp_slot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||||
|
|
||||||
RoFSlot.Type = invtype::typeSharedBank;
|
RoFSlot.Type = invtype::typeSharedBank;
|
||||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeTrade;
|
RoFSlot.Type = invtype::typeTrade;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
temp_slot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
|
temp_slot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
|
||||||
|
|
||||||
RoFSlot.Type = invtype::typeTrade;
|
RoFSlot.Type = invtype::typeTrade;
|
||||||
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
|
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
|
||||||
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
RoFSlot.Type = invtype::typeWorld;
|
RoFSlot.Type = invtype::typeWorld;
|
||||||
RoFSlot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
|
RoFSlot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(Logs::Detail,
|
Log(Logs::Detail,
|
||||||
@ -5677,7 +5683,7 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
uint32 RoFSlot = invslot::SLOT_INVALID;
|
uint32 RoFSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
|
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
|
||||||
RoFSlot = server_corpse_slot;
|
RoFSlot = server_corpse_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5694,18 +5700,18 @@ namespace RoF
|
|||||||
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
|
||||||
RoFSlot.Unknown01 = INULL;
|
RoFSlot.Unknown01 = INULL;
|
||||||
|
|
||||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_type == EQEmu::invtype::typePossessions) {
|
if (server_type == EQ::invtype::typePossessions) {
|
||||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||||
RoFSlot.Slot = server_slot;
|
RoFSlot.Slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
|
|
||||||
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5726,12 +5732,12 @@ namespace RoF
|
|||||||
rof_slot.AugIndex,
|
rof_slot.AugIndex,
|
||||||
rof_slot.Unknown02,
|
rof_slot.Unknown02,
|
||||||
rof_slot.Unknown01,
|
rof_slot.Unknown01,
|
||||||
EQEmu::invslot::SLOT_INVALID);
|
EQ::invslot::SLOT_INVALID);
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
switch (rof_slot.Type) {
|
switch (rof_slot.Type) {
|
||||||
@ -5741,10 +5747,10 @@ namespace RoF
|
|||||||
server_slot = rof_slot.Slot;
|
server_slot = rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5753,10 +5759,10 @@ namespace RoF
|
|||||||
case invtype::typeBank: {
|
case invtype::typeBank: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5765,10 +5771,10 @@ namespace RoF
|
|||||||
case invtype::typeSharedBank: {
|
case invtype::typeSharedBank: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5777,10 +5783,10 @@ namespace RoF
|
|||||||
case invtype::typeTrade: {
|
case invtype::typeTrade: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5788,32 +5794,32 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
case invtype::typeWorld: {
|
case invtype::typeWorld: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
||||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeLimbo: {
|
case invtype::typeLimbo: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
||||||
server_slot = EQEmu::invslot::slotCursor;
|
server_slot = EQ::invslot::slotCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeTribute: {
|
case invtype::typeTribute: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeGuildTribute: {
|
case invtype::typeGuildTribute: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -5847,10 +5853,10 @@ namespace RoF
|
|||||||
|
|
||||||
static inline uint32 RoFToServerCorpseSlot(structs::InventorySlot_Struct rof_corpse_slot)
|
static inline uint32 RoFToServerCorpseSlot(structs::InventorySlot_Struct rof_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (rof_corpse_slot.Type != invtype::typeCorpse || rof_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
if (rof_corpse_slot.Type != invtype::typeCorpse || rof_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SLOT_INVALID;
|
server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@ -5872,7 +5878,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32 RoFToServerCorpseMainSlot(uint32 rof_corpse_slot) {
|
static inline uint32 RoFToServerCorpseMainSlot(uint32 rof_corpse_slot) {
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (rof_corpse_slot <= invslot::CORPSE_END && rof_corpse_slot >= invslot::CORPSE_BEGIN) {
|
if (rof_corpse_slot <= invslot::CORPSE_END && rof_corpse_slot >= invslot::CORPSE_BEGIN) {
|
||||||
server_slot = rof_corpse_slot;
|
server_slot = rof_corpse_slot;
|
||||||
@ -5898,12 +5904,12 @@ namespace RoF
|
|||||||
rof_slot.AugIndex,
|
rof_slot.AugIndex,
|
||||||
rof_type,
|
rof_type,
|
||||||
rof_slot.Unknown01,
|
rof_slot.Unknown01,
|
||||||
EQEmu::invslot::SLOT_INVALID);
|
EQ::invslot::SLOT_INVALID);
|
||||||
|
|
||||||
return (uint32) EQEmu::invslot::SLOT_INVALID;
|
return (uint32) EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
switch (rof_type) {
|
switch (rof_type) {
|
||||||
@ -5913,10 +5919,10 @@ namespace RoF
|
|||||||
server_slot = rof_slot.Slot;
|
server_slot = rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5925,10 +5931,10 @@ namespace RoF
|
|||||||
case invtype::typeBank: {
|
case invtype::typeBank: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5937,10 +5943,10 @@ namespace RoF
|
|||||||
case invtype::typeSharedBank: {
|
case invtype::typeSharedBank: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5949,10 +5955,10 @@ namespace RoF
|
|||||||
case invtype::typeTrade: {
|
case invtype::typeTrade: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
|
||||||
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
|
||||||
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5960,32 +5966,32 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
case invtype::typeWorld: {
|
case invtype::typeWorld: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
|
||||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeLimbo: {
|
case invtype::typeLimbo: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
|
||||||
server_slot = EQEmu::invslot::slotCursor;
|
server_slot = EQ::invslot::slotCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeTribute: {
|
case invtype::typeTribute: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeGuildTribute: {
|
case invtype::typeGuildTribute: {
|
||||||
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -6018,7 +6024,7 @@ namespace RoF
|
|||||||
|
|
||||||
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink)
|
static inline void ServerToRoFSayLink(std::string& rofSayLink, 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)) {
|
||||||
rofSayLink = serverSayLink;
|
rofSayLink = serverSayLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6027,7 +6033,7 @@ namespace RoF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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) {
|
||||||
rofSayLink.append(segments[segment_iter]);
|
rofSayLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -6057,7 +6063,7 @@ namespace RoF
|
|||||||
|
|
||||||
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
|
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
|
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
|
||||||
serverSayLink = rofSayLink;
|
serverSayLink = rofSayLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6089,80 +6095,80 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot)
|
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Gem10:
|
case EQ::spells::CastingSlot::Gem10:
|
||||||
return spells::CastingSlot::Gem10;
|
return spells::CastingSlot::Gem10;
|
||||||
case EQEmu::spells::CastingSlot::Gem11:
|
case EQ::spells::CastingSlot::Gem11:
|
||||||
return spells::CastingSlot::Gem11;
|
return spells::CastingSlot::Gem11;
|
||||||
case EQEmu::spells::CastingSlot::Gem12:
|
case EQ::spells::CastingSlot::Gem12:
|
||||||
return spells::CastingSlot::Gem12;
|
return spells::CastingSlot::Gem12;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
|
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Gem10:
|
case spells::CastingSlot::Gem10:
|
||||||
return EQEmu::spells::CastingSlot::Gem10;
|
return EQ::spells::CastingSlot::Gem10;
|
||||||
case spells::CastingSlot::Gem11:
|
case spells::CastingSlot::Gem11:
|
||||||
return EQEmu::spells::CastingSlot::Gem11;
|
return EQ::spells::CastingSlot::Gem11;
|
||||||
case spells::CastingSlot::Gem12:
|
case spells::CastingSlot::Gem12:
|
||||||
return EQEmu::spells::CastingSlot::Gem12;
|
return EQ::spells::CastingSlot::Gem12;
|
||||||
case spells::CastingSlot::Discipline:
|
case spells::CastingSlot::Discipline:
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6171,12 +6177,12 @@ namespace RoF
|
|||||||
static inline int ServerToRoFBuffSlot(int index)
|
static inline int ServerToRoFBuffSlot(int index)
|
||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -6185,11 +6191,11 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace RoF
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -46,7 +46,7 @@ namespace RoF2
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
static Strategy struct_strategy;
|
||||||
|
|
||||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
|
||||||
|
|
||||||
// server to client inventory location converters
|
// server to client inventory location converters
|
||||||
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 server_slot);
|
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 server_slot);
|
||||||
@ -66,8 +66,8 @@ namespace RoF2
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink);
|
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
|
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
|
||||||
|
|
||||||
static inline int ServerToRoF2BuffSlot(int index);
|
static inline int ServerToRoF2BuffSlot(int index);
|
||||||
static inline int RoF2ToServerBuffSlot(int index);
|
static inline int RoF2ToServerBuffSlot(int index);
|
||||||
@ -151,9 +151,9 @@ namespace RoF2
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return EQEmu::versions::ClientVersion::RoF2;
|
return EQ::versions::ClientVersion::RoF2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ss_define.h"
|
#include "ss_define.h"
|
||||||
@ -263,7 +263,7 @@ namespace RoF2
|
|||||||
|
|
||||||
eq->unknown000 = 1;
|
eq->unknown000 = 1;
|
||||||
OUT(npcid);
|
OUT(npcid);
|
||||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQ::invtype::typePossessions);
|
||||||
OUT(charges);
|
OUT(charges);
|
||||||
OUT(sell_price);
|
OUT(sell_price);
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ namespace RoF2
|
|||||||
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
|
||||||
|
|
||||||
OUT(merchant_entity_id);
|
OUT(merchant_entity_id);
|
||||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
|
||||||
OUT(charges);
|
OUT(charges);
|
||||||
OUT(cost);
|
OUT(cost);
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ namespace RoF2
|
|||||||
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
|
||||||
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
|
||||||
|
|
||||||
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
|
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
|
||||||
OUT(success);
|
OUT(success);
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
@ -571,7 +571,7 @@ namespace RoF2
|
|||||||
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
ENCODE_LENGTH_EXACT(CastSpell_Struct);
|
||||||
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
|
||||||
|
|
||||||
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||||
|
|
||||||
OUT(spell_id);
|
OUT(spell_id);
|
||||||
eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot);
|
eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot);
|
||||||
@ -639,24 +639,24 @@ namespace RoF2
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
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",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)&item_count, sizeof(uint32));
|
ob.write((const char*)&item_count, sizeof(uint32));
|
||||||
|
|
||||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||||
if (ob.tellp() == last_pos)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("RoF2::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
LogNetcode("RoF2::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||||
|
|
||||||
@ -1562,14 +1562,14 @@ namespace RoF2
|
|||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
|
||||||
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
ob.write((const char*)__emu_buffer, 4);
|
||||||
|
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||||
if (ob.tellp() == last_pos) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("RoF2::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("RoF2::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -2014,7 +2014,7 @@ namespace RoF2
|
|||||||
|
|
||||||
outapp->WriteUInt32(22); // Equipment count
|
outapp->WriteUInt32(22); // Equipment count
|
||||||
|
|
||||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
@ -2034,9 +2034,9 @@ namespace RoF2
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
|
||||||
|
|
||||||
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
|
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
@ -2045,7 +2045,7 @@ namespace RoF2
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
|
||||||
|
|
||||||
for (int r = 0; r < 7; r++)
|
for (int r = 0; r < 7; r++)
|
||||||
{
|
{
|
||||||
@ -2055,7 +2055,7 @@ namespace RoF2
|
|||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
|
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
|
||||||
|
|
||||||
for (int r = 0; r < 7; r++)
|
for (int r = 0; r < 7; r++)
|
||||||
{
|
{
|
||||||
@ -2184,7 +2184,7 @@ namespace RoF2
|
|||||||
|
|
||||||
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
|
||||||
|
|
||||||
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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
outapp->WriteUInt32(emu->spell_book[r]);
|
outapp->WriteUInt32(emu->spell_book[r]);
|
||||||
@ -2193,33 +2193,33 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
outapp->WriteUInt32(emu->spell_book[r]);
|
outapp->WriteUInt32(emu->spell_book[r]);
|
||||||
else
|
else
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// invalidate the rest of the spellbook slots
|
||||||
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // write first 12
|
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // write first 12
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->mem_spells[r]);
|
outapp->WriteUInt32(emu->mem_spells[r]);
|
||||||
}
|
}
|
||||||
// zeroes for the rest of the slots the other 4, which actually don't work on the client at all :D
|
// zeroes for the rest of the slots the other 4, which actually don't work on the client at all :D
|
||||||
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
|
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(0xFFFFFFFFU);
|
outapp->WriteUInt32(0xFFFFFFFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(13); // gem refresh counts
|
outapp->WriteUInt32(13); // gem refresh counts
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
|
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
|
||||||
}
|
}
|
||||||
@ -2308,7 +2308,7 @@ namespace RoF2
|
|||||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// Copy bandoliers where server and client indices converge
|
||||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||||
outapp->WriteString(emu->bandoliers[r].Name);
|
outapp->WriteString(emu->bandoliers[r].Name);
|
||||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||||
@ -2323,7 +2323,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// Nullify bandoliers where server and client indices diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
@ -2335,7 +2335,7 @@ namespace RoF2
|
|||||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// Copy potion belt where server and client indices converge
|
||||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||||
if (emu->potionbelt.Items[r].Icon) {
|
if (emu->potionbelt.Items[r].Icon) {
|
||||||
@ -2347,7 +2347,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// Nullify potion belt where server and client indices diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
@ -2464,9 +2464,9 @@ namespace RoF2
|
|||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
|
||||||
|
|
||||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
|
||||||
{
|
{
|
||||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||||
@ -3015,7 +3015,7 @@ namespace RoF2
|
|||||||
eq_cse->Gender = emu_cse->Gender;
|
eq_cse->Gender = emu_cse->Gender;
|
||||||
eq_cse->Face = emu_cse->Face;
|
eq_cse->Face = emu_cse->Face;
|
||||||
|
|
||||||
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
|
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
|
||||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
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].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||||
@ -3114,7 +3114,7 @@ namespace RoF2
|
|||||||
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
|
||||||
|
|
||||||
OUT(npcid);
|
OUT(npcid);
|
||||||
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
|
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
|
||||||
//OUT(itemslot);
|
//OUT(itemslot);
|
||||||
OUT(quantity);
|
OUT(quantity);
|
||||||
OUT(price);
|
OUT(price);
|
||||||
@ -4183,7 +4183,7 @@ namespace RoF2
|
|||||||
|
|
||||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
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);
|
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||||
@ -4192,7 +4192,7 @@ namespace RoF2
|
|||||||
|
|
||||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
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++) {
|
||||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||||
@ -4200,7 +4200,7 @@ namespace RoF2
|
|||||||
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
|
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4911,7 +4911,7 @@ namespace RoF2
|
|||||||
|
|
||||||
IN(item_id);
|
IN(item_id);
|
||||||
int r;
|
int r;
|
||||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
|
||||||
IN(augments[r]);
|
IN(augments[r]);
|
||||||
}
|
}
|
||||||
IN(link_hash);
|
IN(link_hash);
|
||||||
@ -4936,7 +4936,7 @@ namespace RoF2
|
|||||||
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
||||||
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, 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)
|
if (eq->spell[i] == 0)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
@ -5346,9 +5346,9 @@ namespace RoF2
|
|||||||
return NextItemInstSerialNumber;
|
return NextItemInstSerialNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
|
||||||
{
|
{
|
||||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||||
|
|
||||||
RoF2::structs::ItemSerializationHeader hdr;
|
RoF2::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -5411,7 +5411,7 @@ namespace RoF2
|
|||||||
uint32 hero_model = 0;
|
uint32 hero_model = 0;
|
||||||
|
|
||||||
if (inst->GetOrnamentationIDFile()) {
|
if (inst->GetOrnamentationIDFile()) {
|
||||||
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
|
||||||
|
|
||||||
char tmp[30];
|
char tmp[30];
|
||||||
memset(tmp, 0x0, 30);
|
memset(tmp, 0x0, 30);
|
||||||
@ -5611,6 +5611,12 @@ namespace RoF2
|
|||||||
itbs.no_transfer = item->NoTransfer;
|
itbs.no_transfer = item->NoTransfer;
|
||||||
itbs.expendablearrow = item->ExpendableArrow;
|
itbs.expendablearrow = item->ExpendableArrow;
|
||||||
|
|
||||||
|
// Done to hack older clients to label expendable fishing poles as such
|
||||||
|
// July 28th, 2018 patch
|
||||||
|
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||||
|
itbs.expendablearrow = 1;
|
||||||
|
}
|
||||||
|
|
||||||
itbs.unknown8 = 0;
|
itbs.unknown8 = 0;
|
||||||
itbs.unknown9 = 0;
|
itbs.unknown9 = 0;
|
||||||
itbs.unknown10 = 0;
|
itbs.unknown10 = 0;
|
||||||
@ -5776,28 +5782,28 @@ namespace RoF2
|
|||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||||
uint32 subitem_count = 0;
|
uint32 subitem_count = 0;
|
||||||
|
|
||||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||||
|
|
||||||
// moved outside of loop since it is not modified within that scope
|
// 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::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
|
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else
|
else
|
||||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||||
|
|
||||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -5822,77 +5828,77 @@ namespace RoF2
|
|||||||
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
||||||
RoF2Slot.Unknown01 = INULL;
|
RoF2Slot.Unknown01 = INULL;
|
||||||
|
|
||||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||||
RoF2Slot.Type = invtype::typePossessions;
|
RoF2Slot.Type = invtype::typePossessions;
|
||||||
RoF2Slot.Slot = server_slot;
|
RoF2Slot.Slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
|
|
||||||
RoF2Slot.Type = invtype::typePossessions;
|
RoF2Slot.Type = invtype::typePossessions;
|
||||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeTribute;
|
RoF2Slot.Type = invtype::typeTribute;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeGuildTribute;
|
RoF2Slot.Type = invtype::typeGuildTribute;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
RoF2Slot.Type = invtype::typeWorld;
|
RoF2Slot.Type = invtype::typeWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeBank;
|
RoF2Slot.Type = invtype::typeBank;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
|
||||||
|
|
||||||
RoF2Slot.Type = invtype::typeBank;
|
RoF2Slot.Type = invtype::typeBank;
|
||||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeSharedBank;
|
RoF2Slot.Type = invtype::typeSharedBank;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||||
|
|
||||||
RoF2Slot.Type = invtype::typeSharedBank;
|
RoF2Slot.Type = invtype::typeSharedBank;
|
||||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeTrade;
|
RoF2Slot.Type = invtype::typeTrade;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
|
||||||
|
|
||||||
RoF2Slot.Type = invtype::typeTrade;
|
RoF2Slot.Type = invtype::typeTrade;
|
||||||
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
|
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
|
||||||
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
RoF2Slot.Type = invtype::typeWorld;
|
RoF2Slot.Type = invtype::typeWorld;
|
||||||
RoF2Slot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
|
RoF2Slot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(Logs::Detail, Logs::Netcode, "Convert Server Slot %i to RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i)",
|
Log(Logs::Detail, Logs::Netcode, "Convert Server Slot %i to RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i)",
|
||||||
@ -5924,7 +5930,7 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
uint32 RoF2Slot = invslot::SLOT_INVALID;
|
uint32 RoF2Slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
|
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
|
||||||
RoF2Slot = server_corpse_slot;
|
RoF2Slot = server_corpse_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5941,18 +5947,18 @@ namespace RoF2
|
|||||||
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
|
||||||
RoF2Slot.Unknown01 = INULL;
|
RoF2Slot.Unknown01 = INULL;
|
||||||
|
|
||||||
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_type == EQEmu::invtype::typePossessions) {
|
if (server_type == EQ::invtype::typePossessions) {
|
||||||
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
|
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
|
||||||
RoF2Slot.Slot = server_slot;
|
RoF2Slot.Slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
|
|
||||||
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
|
||||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5966,12 +5972,12 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
||||||
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i) to Server Slot %i",
|
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i) to Server Slot %i",
|
||||||
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
|
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
uint32 temp_slot = invslot::SLOT_INVALID;
|
uint32 temp_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
switch (rof2_slot.Type) {
|
switch (rof2_slot.Type) {
|
||||||
@ -5983,10 +5989,10 @@ namespace RoF2
|
|||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
temp_slot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
temp_slot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5995,12 +6001,12 @@ namespace RoF2
|
|||||||
case invtype::typeBank: {
|
case invtype::typeBank: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6009,12 +6015,12 @@ namespace RoF2
|
|||||||
case invtype::typeSharedBank: {
|
case invtype::typeSharedBank: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6023,12 +6029,12 @@ namespace RoF2
|
|||||||
case invtype::typeTrade: {
|
case invtype::typeTrade: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6036,32 +6042,32 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
case invtype::typeWorld: {
|
case invtype::typeWorld: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
||||||
server_slot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
||||||
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeLimbo: {
|
case invtype::typeLimbo: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
||||||
server_slot = EQEmu::invslot::slotCursor;
|
server_slot = EQ::invslot::slotCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeTribute: {
|
case invtype::typeTribute: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeGuildTribute: {
|
case invtype::typeGuildTribute: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||||
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -6087,10 +6093,10 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline uint32 RoF2ToServerCorpseSlot(structs::InventorySlot_Struct rof2_corpse_slot)
|
static inline uint32 RoF2ToServerCorpseSlot(structs::InventorySlot_Struct rof2_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (rof2_corpse_slot.Type != invtype::typeCorpse || rof2_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof2_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
if (rof2_corpse_slot.Type != invtype::typeCorpse || rof2_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof2_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
|
||||||
ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@ -6105,7 +6111,7 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline uint32 RoF2ToServerCorpseMainSlot(uint32 rof2_corpse_slot)
|
static inline uint32 RoF2ToServerCorpseMainSlot(uint32 rof2_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (rof2_corpse_slot <= invslot::CORPSE_END && rof2_corpse_slot >= invslot::CORPSE_BEGIN) {
|
if (rof2_corpse_slot <= invslot::CORPSE_END && rof2_corpse_slot >= invslot::CORPSE_BEGIN) {
|
||||||
ServerSlot = rof2_corpse_slot;
|
ServerSlot = rof2_corpse_slot;
|
||||||
@ -6120,12 +6126,12 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
|
||||||
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Typeless Slot [%i, %i, %i] (implied type: %i, unk1: %i) to Server Slot %i",
|
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Typeless Slot [%i, %i, %i] (implied type: %i, unk1: %i) to Server Slot %i",
|
||||||
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
|
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
|
||||||
|
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||||
uint32 TempSlot = invslot::SLOT_INVALID;
|
uint32 TempSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
switch (rof2_type) {
|
switch (rof2_type) {
|
||||||
@ -6137,10 +6143,10 @@ namespace RoF2
|
|||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
|
||||||
return EQEmu::invslot::SLOT_INVALID;
|
return EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
TempSlot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
TempSlot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
|
||||||
ServerSlot = EQEmu::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
ServerSlot = EQ::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6149,12 +6155,12 @@ namespace RoF2
|
|||||||
case invtype::typeBank: {
|
case invtype::typeBank: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
ServerSlot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
ServerSlot = EQEmu::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
ServerSlot = EQ::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6163,12 +6169,12 @@ namespace RoF2
|
|||||||
case invtype::typeSharedBank: {
|
case invtype::typeSharedBank: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
ServerSlot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
ServerSlot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
ServerSlot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6177,12 +6183,12 @@ namespace RoF2
|
|||||||
case invtype::typeTrade: {
|
case invtype::typeTrade: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
|
||||||
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
|
||||||
ServerSlot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
|
||||||
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
|
||||||
ServerSlot = EQEmu::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
ServerSlot = EQ::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6190,32 +6196,32 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
case invtype::typeWorld: {
|
case invtype::typeWorld: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
|
||||||
ServerSlot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
|
||||||
ServerSlot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
ServerSlot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeLimbo: {
|
case invtype::typeLimbo: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
|
||||||
ServerSlot = EQEmu::invslot::slotCursor;
|
ServerSlot = EQ::invslot::slotCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeTribute: {
|
case invtype::typeTribute: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
|
||||||
ServerSlot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case invtype::typeGuildTribute: {
|
case invtype::typeGuildTribute: {
|
||||||
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
|
||||||
ServerSlot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
ServerSlot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -6241,7 +6247,7 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline void ServerToRoF2SayLink(std::string &rof2_saylink, const std::string &server_saylink)
|
static inline void ServerToRoF2SayLink(std::string &rof2_saylink, const std::string &server_saylink)
|
||||||
{
|
{
|
||||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||||
rof2_saylink = server_saylink;
|
rof2_saylink = server_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6250,7 +6256,7 @@ namespace RoF2
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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) {
|
||||||
rof2_saylink.append(segments[segment_iter]);
|
rof2_saylink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -6273,7 +6279,7 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink)
|
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
|
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
|
||||||
server_saylink = rof2_saylink;
|
server_saylink = rof2_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6303,80 +6309,80 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot)
|
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Gem10:
|
case EQ::spells::CastingSlot::Gem10:
|
||||||
return spells::CastingSlot::Gem10;
|
return spells::CastingSlot::Gem10;
|
||||||
case EQEmu::spells::CastingSlot::Gem11:
|
case EQ::spells::CastingSlot::Gem11:
|
||||||
return spells::CastingSlot::Gem11;
|
return spells::CastingSlot::Gem11;
|
||||||
case EQEmu::spells::CastingSlot::Gem12:
|
case EQ::spells::CastingSlot::Gem12:
|
||||||
return spells::CastingSlot::Gem12;
|
return spells::CastingSlot::Gem12;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
|
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Gem10:
|
case spells::CastingSlot::Gem10:
|
||||||
return EQEmu::spells::CastingSlot::Gem10;
|
return EQ::spells::CastingSlot::Gem10;
|
||||||
case spells::CastingSlot::Gem11:
|
case spells::CastingSlot::Gem11:
|
||||||
return EQEmu::spells::CastingSlot::Gem11;
|
return EQ::spells::CastingSlot::Gem11;
|
||||||
case spells::CastingSlot::Gem12:
|
case spells::CastingSlot::Gem12:
|
||||||
return EQEmu::spells::CastingSlot::Gem12;
|
return EQ::spells::CastingSlot::Gem12;
|
||||||
case spells::CastingSlot::Discipline:
|
case spells::CastingSlot::Discipline:
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6385,12 +6391,12 @@ namespace RoF2
|
|||||||
static inline int ServerToRoF2BuffSlot(int index)
|
static inline int ServerToRoF2BuffSlot(int index)
|
||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -6399,11 +6405,11 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace RoF2
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace RoF2
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = false;
|
const bool ConcatenateInvTypeLimbo = false;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace RoF2
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -118,7 +118,7 @@ namespace RoF2
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -196,7 +196,7 @@ namespace RoF2
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -208,7 +208,7 @@ namespace RoF2
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -220,7 +220,7 @@ namespace RoF2
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
|
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
|
||||||
// Unknown1 = 0,
|
// Unknown1 = 0,
|
||||||
@ -249,7 +249,7 @@ namespace RoF2
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -261,11 +261,11 @@ namespace RoF2
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
@ -274,21 +274,21 @@ namespace RoF2
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const bool CoinHasWeight = false;
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
|
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -190,7 +190,7 @@ struct TintProfile
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ struct Texture_Struct
|
|||||||
// Texture_Struct Primary;
|
// Texture_Struct Primary;
|
||||||
// Texture_Struct Secondary;
|
// Texture_Struct Secondary;
|
||||||
// };
|
// };
|
||||||
// Texture_Struct Slot[EQEmu::textures::TextureCount];
|
// Texture_Struct Slot[EQ::textures::TextureCount];
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// TextureProfile();
|
// TextureProfile();
|
||||||
@ -1113,7 +1113,7 @@ union
|
|||||||
/*00184*/ Texture_Struct equipment[22]; // Total Slots
|
/*00184*/ Texture_Struct equipment[22]; // Total Slots
|
||||||
};
|
};
|
||||||
/*00624*/ uint32 equip2_count; // Seen 9
|
/*00624*/ uint32 equip2_count; // Seen 9
|
||||||
/*00628*/ Texture_Struct equipment2[EQEmu::textures::materialCount]; // Appears to be Visible slots, but all 0s
|
/*00628*/ Texture_Struct equipment2[EQ::textures::materialCount]; // Appears to be Visible slots, but all 0s
|
||||||
/*00808*/ uint32 tint_count; // Seen 9
|
/*00808*/ uint32 tint_count; // Seen 9
|
||||||
/*00812*/ TintProfile item_tint; // RR GG BB 00
|
/*00812*/ TintProfile item_tint; // RR GG BB 00
|
||||||
/*00848*/ uint32 tint_count2; // Seen 9
|
/*00848*/ uint32 tint_count2; // Seen 9
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace RoF
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = false;
|
const bool ConcatenateInvTypeLimbo = false;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace RoF
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -116,7 +116,7 @@ namespace RoF
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -194,7 +194,7 @@ namespace RoF
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -206,7 +206,7 @@ namespace RoF
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -218,7 +218,7 @@ namespace RoF
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
enum ItemPacketType : int {
|
||||||
ItemPacketMerchant = 100,
|
ItemPacketMerchant = 100,
|
||||||
@ -240,7 +240,7 @@ namespace RoF
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -252,11 +252,11 @@ namespace RoF
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
@ -265,21 +265,21 @@ namespace RoF
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const bool CoinHasWeight = false;
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -190,7 +190,7 @@ struct TintProfile
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ struct Texture_Struct
|
|||||||
// Texture_Struct Primary;
|
// Texture_Struct Primary;
|
||||||
// Texture_Struct Secondary;
|
// Texture_Struct Secondary;
|
||||||
// };
|
// };
|
||||||
// Texture_Struct Slot[EQEmu::textures::TextureCount];
|
// Texture_Struct Slot[EQ::textures::TextureCount];
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// TextureProfile();
|
// TextureProfile();
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace SoD
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
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
|
// server to client inventory location converters
|
||||||
static inline uint32 ServerToSoDSlot(uint32 server_slot);
|
static inline uint32 ServerToSoDSlot(uint32 server_slot);
|
||||||
@ -59,8 +59,8 @@ namespace SoD
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink);
|
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
|
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
|
||||||
|
|
||||||
static inline int ServerToSoDBuffSlot(int index);
|
static inline int ServerToSoDBuffSlot(int index);
|
||||||
static inline int SoDToServerBuffSlot(int index);
|
static inline int SoDToServerBuffSlot(int index);
|
||||||
@ -144,9 +144,9 @@ namespace SoD
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return EQEmu::versions::ClientVersion::SoD;
|
return EQ::versions::ClientVersion::SoD;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ss_define.h"
|
#include "ss_define.h"
|
||||||
@ -381,24 +381,24 @@ namespace SoD
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
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",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)&item_count, sizeof(uint32));
|
ob.write((const char*)&item_count, sizeof(uint32));
|
||||||
|
|
||||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
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)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("SoD::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
LogNetcode("SoD::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||||
|
|
||||||
@ -1060,14 +1060,14 @@ namespace SoD
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
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) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("SoD::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("SoD::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -1463,7 +1463,7 @@ namespace SoD
|
|||||||
OUT(hairstyle);
|
OUT(hairstyle);
|
||||||
OUT(beard);
|
OUT(beard);
|
||||||
// OUT(unknown00178[10]);
|
// 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].Material = emu->item_material.Slot[r].Material;
|
||||||
eq->equipment.Slot[r].Unknown1 = 0;
|
eq->equipment.Slot[r].Unknown1 = 0;
|
||||||
eq->equipment.Slot[r].EliteMaterial = 0;
|
eq->equipment.Slot[r].EliteMaterial = 0;
|
||||||
@ -1493,7 +1493,7 @@ namespace SoD
|
|||||||
OUT(face);
|
OUT(face);
|
||||||
// OUT(unknown02264[47]);
|
// 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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
@ -1502,14 +1502,14 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
else
|
else
|
||||||
eq->spell_book[r] = 0xFFFFFFFFU;
|
eq->spell_book[r] = 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// 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]);
|
// OUT(unknown4184[128]);
|
||||||
@ -1553,7 +1553,7 @@ namespace SoD
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// 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);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++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].ID);
|
||||||
@ -1562,7 +1562,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// 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';
|
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
|
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].ID = 0;
|
||||||
@ -1574,13 +1574,13 @@ namespace SoD
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// 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].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// 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].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -1923,7 +1923,7 @@ namespace SoD
|
|||||||
eq_cse->HairColor = emu_cse->HairColor;
|
eq_cse->HairColor = emu_cse->HairColor;
|
||||||
eq_cse->Face = emu_cse->Face;
|
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].Material = emu_cse->Equip[equip_index].Material;
|
||||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||||
@ -2484,7 +2484,7 @@ namespace SoD
|
|||||||
float SpawnSize = emu->size;
|
float SpawnSize = emu->size;
|
||||||
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
|
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)
|
if (emu->size == 0)
|
||||||
{
|
{
|
||||||
@ -2681,7 +2681,7 @@ namespace SoD
|
|||||||
|
|
||||||
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
|
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);
|
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
|
||||||
@ -2708,13 +2708,13 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
|
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++) {
|
||||||
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
Equipment[k].Material = emu->equipment.Slot[k].Material;
|
||||||
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
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))
|
if (strlen(emu->title))
|
||||||
{
|
{
|
||||||
@ -3146,7 +3146,7 @@ namespace SoD
|
|||||||
|
|
||||||
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
||||||
emu->spell[i] = eq->spell[i];
|
emu->spell[i] = eq->spell[i];
|
||||||
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
@ -3440,9 +3440,9 @@ namespace SoD
|
|||||||
return NextItemInstSerialNumber;
|
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();
|
||||||
|
|
||||||
SoD::structs::ItemSerializationHeader hdr;
|
SoD::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -3631,6 +3631,12 @@ namespace SoD
|
|||||||
itbs.no_transfer = item->NoTransfer;
|
itbs.no_transfer = item->NoTransfer;
|
||||||
itbs.expendablearrow = item->ExpendableArrow;
|
itbs.expendablearrow = item->ExpendableArrow;
|
||||||
|
|
||||||
|
// Done to hack older clients to label expendable fishing poles as such
|
||||||
|
// July 28th, 2018 patch
|
||||||
|
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||||
|
itbs.expendablearrow = 1;
|
||||||
|
}
|
||||||
|
|
||||||
ob.write((const char*)&itbs, sizeof(SoD::structs::ItemTertiaryBodyStruct));
|
ob.write((const char*)&itbs, sizeof(SoD::structs::ItemTertiaryBodyStruct));
|
||||||
|
|
||||||
// Effect Structures Broken down to allow variable length strings for effect names
|
// Effect Structures Broken down to allow variable length strings for effect names
|
||||||
@ -3751,30 +3757,30 @@ namespace SoD
|
|||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(SoD::structs::ItemQuaternaryBodyStruct));
|
ob.write((const char*)&iqbs, sizeof(SoD::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||||
uint32 subitem_count = 0;
|
uint32 subitem_count = 0;
|
||||||
|
|
||||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||||
|
|
||||||
// moved outside of loop since it is not modified within that scope
|
// 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)
|
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
|
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
|
||||||
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else
|
else
|
||||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||||
|
|
||||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3793,59 +3799,59 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
uint32 SoDSlot = invslot::SLOT_INVALID;
|
uint32 SoDSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
|
if (serverSlot <= EQ::invslot::slotGeneral8) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
|
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
|
||||||
SoDSlot = serverSlot - 2;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot + 11;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot - 9;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot + 1;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot + 1;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = 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) {
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3858,11 +3864,11 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
uint32 SoDSlot = invslot::SLOT_INVALID;
|
uint32 SoDSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
|
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
|
||||||
SoDSlot = server_corpse_slot;
|
SoDSlot = server_corpse_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
|
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
|
||||||
SoDSlot = server_corpse_slot - 2;
|
SoDSlot = server_corpse_slot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3873,7 +3879,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline uint32 SoDToServerSlot(uint32 sod_slot)
|
static inline uint32 SoDToServerSlot(uint32 sod_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (sod_slot <= invslot::slotGeneral8) {
|
if (sod_slot <= invslot::slotGeneral8) {
|
||||||
server_slot = sod_slot;
|
server_slot = sod_slot;
|
||||||
@ -3938,7 +3944,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline uint32 SoDToServerCorpseSlot(uint32 sod_corpse_slot)
|
static inline uint32 SoDToServerCorpseSlot(uint32 sod_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (sod_corpse_slot <= invslot::slotGeneral8 && sod_corpse_slot >= invslot::slotGeneral1) {
|
if (sod_corpse_slot <= invslot::slotGeneral8 && sod_corpse_slot >= invslot::slotGeneral1) {
|
||||||
server_slot = sod_corpse_slot;
|
server_slot = sod_corpse_slot;
|
||||||
@ -3955,7 +3961,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline void ServerToSoDSayLink(std::string &sod_saylink, const std::string &server_saylink)
|
static inline void ServerToSoDSayLink(std::string &sod_saylink, const std::string &server_saylink)
|
||||||
{
|
{
|
||||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||||
sod_saylink = server_saylink;
|
sod_saylink = server_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3964,7 +3970,7 @@ namespace SoD
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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) {
|
||||||
sod_saylink.append(segments[segment_iter]);
|
sod_saylink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -3995,7 +4001,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink)
|
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
|
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
|
||||||
server_saylink = sod_saylink;
|
server_saylink = sod_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4029,84 +4035,84 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot)
|
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Gem10:
|
case EQ::spells::CastingSlot::Gem10:
|
||||||
return spells::CastingSlot::Gem10;
|
return spells::CastingSlot::Gem10;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
|
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Gem10:
|
case spells::CastingSlot::Gem10:
|
||||||
return EQEmu::spells::CastingSlot::Gem10;
|
return EQ::spells::CastingSlot::Gem10;
|
||||||
case spells::CastingSlot::Discipline:
|
case spells::CastingSlot::Discipline:
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
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 ServerToSoDBuffSlot(int index)
|
static inline int ServerToSoDBuffSlot(int index)
|
||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -4115,11 +4121,11 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace SoD
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace SoD
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = true;
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace SoD
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -106,7 +106,7 @@ namespace SoD
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -205,7 +205,7 @@ namespace SoD
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -237,7 +237,7 @@ namespace SoD
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -249,7 +249,7 @@ namespace SoD
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
enum ItemPacketType : int {
|
||||||
ItemPacketMerchant = 100,
|
ItemPacketMerchant = 100,
|
||||||
@ -267,7 +267,7 @@ namespace SoD
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -279,11 +279,11 @@ namespace SoD
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoD;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoD;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoD;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitSoD;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoD;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoD;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
@ -292,21 +292,21 @@ namespace SoD
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const bool CoinHasWeight = false;
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -149,7 +149,7 @@ struct TintProfile
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ struct TextureProfile
|
|||||||
Texture_Struct Primary;
|
Texture_Struct Primary;
|
||||||
Texture_Struct Secondary;
|
Texture_Struct Secondary;
|
||||||
};
|
};
|
||||||
Texture_Struct Slot[EQEmu::textures::materialCount];
|
Texture_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
TextureProfile();
|
TextureProfile();
|
||||||
@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
|
|||||||
/*0000*/ uint8 Beard; //
|
/*0000*/ uint8 Beard; //
|
||||||
/*0001*/ uint8 HairColor; //
|
/*0001*/ uint8 HairColor; //
|
||||||
/*0000*/ uint8 Face; //
|
/*0000*/ uint8 Face; //
|
||||||
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
|
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
|
||||||
/*0000*/ uint32 PrimaryIDFile; //
|
/*0000*/ uint32 PrimaryIDFile; //
|
||||||
/*0000*/ uint32 SecondaryIDFile; //
|
/*0000*/ uint32 SecondaryIDFile; //
|
||||||
/*0000*/ uint8 Unknown15; // 0xff
|
/*0000*/ uint8 Unknown15; // 0xff
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace SoF
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
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
|
// server to client inventory location converters
|
||||||
static inline uint32 ServerToSoFSlot(uint32 server_slot);
|
static inline uint32 ServerToSoFSlot(uint32 server_slot);
|
||||||
@ -59,8 +59,8 @@ namespace SoF
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink);
|
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
|
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
|
||||||
|
|
||||||
static inline int ServerToSoFBuffSlot(int index);
|
static inline int ServerToSoFBuffSlot(int index);
|
||||||
static inline int SoFToServerBuffSlot(int index);
|
static inline int SoFToServerBuffSlot(int index);
|
||||||
@ -142,9 +142,9 @@ namespace SoF
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return EQEmu::versions::ClientVersion::SoF;
|
return EQ::versions::ClientVersion::SoF;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ss_define.h"
|
#include "ss_define.h"
|
||||||
@ -361,24 +361,24 @@ namespace SoF
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
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",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)&item_count, sizeof(uint32));
|
ob.write((const char*)&item_count, sizeof(uint32));
|
||||||
|
|
||||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
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)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("SoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
LogNetcode("SoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||||
|
|
||||||
@ -855,14 +855,14 @@ namespace SoF
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
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) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("SoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("SoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -956,7 +956,7 @@ namespace SoF
|
|||||||
|
|
||||||
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
|
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
|
||||||
if (emu->scribing == 3)
|
if (emu->scribing == 3)
|
||||||
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||||
else
|
else
|
||||||
OUT(slot);
|
OUT(slot);
|
||||||
OUT(spell_id);
|
OUT(spell_id);
|
||||||
@ -1130,7 +1130,7 @@ namespace SoF
|
|||||||
OUT(hairstyle);
|
OUT(hairstyle);
|
||||||
OUT(beard);
|
OUT(beard);
|
||||||
// OUT(unknown00178[10]);
|
// 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].Material = emu->item_material.Slot[r].Material;
|
||||||
eq->equipment.Slot[r].Unknown1 = 0;
|
eq->equipment.Slot[r].Unknown1 = 0;
|
||||||
eq->equipment.Slot[r].EliteMaterial = 0;
|
eq->equipment.Slot[r].EliteMaterial = 0;
|
||||||
@ -1160,7 +1160,7 @@ namespace SoF
|
|||||||
OUT(face);
|
OUT(face);
|
||||||
// OUT(unknown02264[47]);
|
// 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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
@ -1169,14 +1169,14 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
else
|
else
|
||||||
eq->spell_book[r] = 0xFFFFFFFFU;
|
eq->spell_book[r] = 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// 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]);
|
// OUT(unknown4184[128]);
|
||||||
@ -1223,7 +1223,7 @@ namespace SoF
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// 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);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++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].ID);
|
||||||
@ -1232,7 +1232,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// 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';
|
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
|
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].ID = 0;
|
||||||
@ -1244,13 +1244,13 @@ namespace SoF
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// 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].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// 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].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -1593,7 +1593,7 @@ namespace SoF
|
|||||||
eq_cse->HairColor = emu_cse->HairColor;
|
eq_cse->HairColor = emu_cse->HairColor;
|
||||||
eq_cse->Face = emu_cse->Face;
|
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].Material = emu_cse->Equip[equip_index].Material;
|
||||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||||
@ -2015,7 +2015,7 @@ namespace SoF
|
|||||||
eq->deity = emu->deity;
|
eq->deity = emu->deity;
|
||||||
eq->drakkin_heritage = emu->drakkin_heritage;
|
eq->drakkin_heritage = emu->drakkin_heritage;
|
||||||
eq->gender = emu->gender;
|
eq->gender = emu->gender;
|
||||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||||
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
|
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
|
||||||
eq->equipment.Slot[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
eq->equipment.Slot[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
|
||||||
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
||||||
@ -2081,7 +2081,7 @@ namespace SoF
|
|||||||
strcpy(eq->name, emu->name);
|
strcpy(eq->name, emu->name);
|
||||||
eq->petOwnerId = emu->petOwnerId;
|
eq->petOwnerId = emu->petOwnerId;
|
||||||
eq->pvp = 0; // 0 = non-pvp colored name, 1 = red pvp name
|
eq->pvp = 0; // 0 = non-pvp colored name, 1 = red pvp name
|
||||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||||
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
|
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
|
||||||
}
|
}
|
||||||
eq->anon = emu->anon;
|
eq->anon = emu->anon;
|
||||||
@ -2300,7 +2300,7 @@ namespace SoF
|
|||||||
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
|
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
|
||||||
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
|
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
|
||||||
|
|
||||||
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
|
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
|
||||||
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
|
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
@ -2556,7 +2556,7 @@ namespace SoF
|
|||||||
|
|
||||||
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
||||||
IN(spell[i]);
|
IN(spell[i]);
|
||||||
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
|
|
||||||
IN(unknown);
|
IN(unknown);
|
||||||
@ -2838,9 +2838,9 @@ namespace SoF
|
|||||||
return NextItemInstSerialNumber;
|
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();
|
||||||
|
|
||||||
SoF::structs::ItemSerializationHeader hdr;
|
SoF::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -3028,6 +3028,12 @@ namespace SoF
|
|||||||
itbs.no_transfer = item->NoTransfer;
|
itbs.no_transfer = item->NoTransfer;
|
||||||
itbs.expendablearrow = item->ExpendableArrow;
|
itbs.expendablearrow = item->ExpendableArrow;
|
||||||
|
|
||||||
|
// Done to hack older clients to label expendable fishing poles as such
|
||||||
|
// July 28th, 2018 patch
|
||||||
|
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||||
|
itbs.expendablearrow = 1;
|
||||||
|
}
|
||||||
|
|
||||||
ob.write((const char*)&itbs, sizeof(SoF::structs::ItemTertiaryBodyStruct));
|
ob.write((const char*)&itbs, sizeof(SoF::structs::ItemTertiaryBodyStruct));
|
||||||
|
|
||||||
// Effect Structures Broken down to allow variable length strings for effect names
|
// Effect Structures Broken down to allow variable length strings for effect names
|
||||||
@ -3147,30 +3153,30 @@ namespace SoF
|
|||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(SoF::structs::ItemQuaternaryBodyStruct));
|
ob.write((const char*)&iqbs, sizeof(SoF::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
|
EQ::OutBuffer::pos_type count_pos = ob.tellp();
|
||||||
uint32 subitem_count = 0;
|
uint32 subitem_count = 0;
|
||||||
|
|
||||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||||
|
|
||||||
// moved outside of loop since it is not modified within that scope
|
// 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)
|
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
|
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
|
||||||
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else
|
else
|
||||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||||
|
|
||||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3189,59 +3195,59 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
uint32 sof_slot = invslot::SLOT_INVALID;
|
uint32 sof_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_slot <= EQEmu::invslot::slotGeneral8) {
|
if (server_slot <= EQ::invslot::slotGeneral8) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::CORPSE_END && server_slot >= EQEmu::invslot::slotCursor) {
|
else if (server_slot <= EQ::invslot::CORPSE_END && server_slot >= EQ::invslot::slotCursor) {
|
||||||
sof_slot = server_slot - 2;
|
sof_slot = server_slot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 11;
|
sof_slot = server_slot + 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
sof_slot = server_slot - 9;
|
sof_slot = server_slot - 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 1;
|
sof_slot = server_slot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot + 1;
|
sof_slot = server_slot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
sof_slot = server_slot;
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3254,11 +3260,11 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
uint32 SoFSlot = invslot::SLOT_INVALID;
|
uint32 SoFSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
|
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
|
||||||
SoFSlot = server_corpse_slot;
|
SoFSlot = server_corpse_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
|
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
|
||||||
SoFSlot = server_corpse_slot - 2;
|
SoFSlot = server_corpse_slot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3273,7 +3279,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline uint32 SoFToServerSlot(uint32 sof_slot)
|
static inline uint32 SoFToServerSlot(uint32 sof_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (sof_slot <= invslot::slotGeneral8) {
|
if (sof_slot <= invslot::slotGeneral8) {
|
||||||
server_slot = sof_slot;
|
server_slot = sof_slot;
|
||||||
@ -3338,7 +3344,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline uint32 SoFToServerCorpseSlot(uint32 sof_corpse_slot)
|
static inline uint32 SoFToServerCorpseSlot(uint32 sof_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (sof_corpse_slot <= invslot::slotGeneral8 && sof_corpse_slot >= invslot::slotGeneral1) {
|
if (sof_corpse_slot <= invslot::slotGeneral8 && sof_corpse_slot >= invslot::slotGeneral1) {
|
||||||
server_slot = sof_corpse_slot;
|
server_slot = sof_corpse_slot;
|
||||||
@ -3359,7 +3365,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline void ServerToSoFSayLink(std::string &sof_saylink, const std::string &server_saylink)
|
static inline void ServerToSoFSayLink(std::string &sof_saylink, const std::string &server_saylink)
|
||||||
{
|
{
|
||||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||||
sof_saylink = server_saylink;
|
sof_saylink = server_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3368,7 +3374,7 @@ namespace SoF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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) {
|
||||||
sof_saylink.append(segments[segment_iter]);
|
sof_saylink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -3399,7 +3405,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink)
|
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
|
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
|
||||||
server_saylink = sof_saylink;
|
server_saylink = sof_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3433,84 +3439,84 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot) {
|
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::PotionBelt;
|
return spells::CastingSlot::PotionBelt;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
|
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Ability:
|
case spells::CastingSlot::Ability:
|
||||||
return EQEmu::spells::CastingSlot::Ability;
|
return EQ::spells::CastingSlot::Ability;
|
||||||
// Tit uses 10 for item and discipline casting, but items have a valid location
|
// Tit uses 10 for item and discipline casting, but items have a valid location
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
if (item_location == INVALID_INDEX)
|
if (item_location == INVALID_INDEX)
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
else
|
else
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::PotionBelt:
|
case spells::CastingSlot::PotionBelt:
|
||||||
return EQEmu::spells::CastingSlot::PotionBelt;
|
return EQ::spells::CastingSlot::PotionBelt;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
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 ServerToSoFBuffSlot(int index) {
|
static inline int ServerToSoFBuffSlot(int index) {
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -3519,11 +3525,11 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace SoF
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace SoF
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = true;
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace SoF
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -106,7 +106,7 @@ namespace SoF
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -205,7 +205,7 @@ namespace SoF
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -237,7 +237,7 @@ namespace SoF
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -249,7 +249,7 @@ namespace SoF
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
enum ItemPacketType : int {
|
||||||
ItemPacketMerchant = 100,
|
ItemPacketMerchant = 100,
|
||||||
@ -267,7 +267,7 @@ namespace SoF
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -279,11 +279,11 @@ namespace SoF
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoF;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoF;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoF;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitSoF;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoF;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoF;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
@ -292,21 +292,21 @@ namespace SoF
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const bool CoinHasWeight = true;
|
const bool CoinHasWeight = true;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -168,7 +168,7 @@ struct TintProfile
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ struct TextureProfile
|
|||||||
Texture_Struct Primary;
|
Texture_Struct Primary;
|
||||||
Texture_Struct Secondary;
|
Texture_Struct Secondary;
|
||||||
};
|
};
|
||||||
Texture_Struct Slot[EQEmu::textures::materialCount];
|
Texture_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
TextureProfile();
|
TextureProfile();
|
||||||
@ -214,7 +214,7 @@ struct CharacterSelectEntry_Struct
|
|||||||
/*0000*/ uint8 Beard; //
|
/*0000*/ uint8 Beard; //
|
||||||
/*0001*/ uint8 HairColor; //
|
/*0001*/ uint8 HairColor; //
|
||||||
/*0000*/ uint8 Face; //
|
/*0000*/ uint8 Face; //
|
||||||
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
|
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
|
||||||
/*0000*/ uint32 PrimaryIDFile; //
|
/*0000*/ uint32 PrimaryIDFile; //
|
||||||
/*0000*/ uint32 SecondaryIDFile; //
|
/*0000*/ uint32 SecondaryIDFile; //
|
||||||
/*0000*/ uint8 Unknown15; // 0xff
|
/*0000*/ uint8 Unknown15; // 0xff
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace Titanium
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
static Strategy struct_strategy;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
// server to client inventory location converters
|
// server to client inventory location converters
|
||||||
static inline int16 ServerToTitaniumSlot(uint32 server_slot);
|
static inline int16 ServerToTitaniumSlot(uint32 server_slot);
|
||||||
@ -58,8 +58,8 @@ namespace Titanium
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink);
|
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
|
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
|
||||||
|
|
||||||
static inline int ServerToTitaniumBuffSlot(int index);
|
static inline int ServerToTitaniumBuffSlot(int index);
|
||||||
static inline int TitaniumToServerBuffSlot(int index);
|
static inline int TitaniumToServerBuffSlot(int index);
|
||||||
@ -143,9 +143,9 @@ namespace Titanium
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
|
const EQ::versions::ClientVersion Strategy::ClientVersion() const
|
||||||
{
|
{
|
||||||
return EQEmu::versions::ClientVersion::Titanium;
|
return EQ::versions::ClientVersion::Titanium;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "ss_define.h"
|
#include "ss_define.h"
|
||||||
@ -320,22 +320,22 @@ namespace Titanium
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int itemcount = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int itemcount = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (itemcount == 0 || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
if (itemcount == 0 || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
|
||||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
//do the transform...
|
//do the transform...
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
for (int r = 0; r < itemcount; r++, eq++) {
|
for (int r = 0; r < itemcount; r++, eq++) {
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
|
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
|
||||||
if (ob.tellp() == last_pos)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("Titanium::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
LogNetcode("Titanium::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
||||||
|
|
||||||
@ -796,14 +796,14 @@ namespace Titanium
|
|||||||
OUT(TargetID);
|
OUT(TargetID);
|
||||||
OUT(playerid);
|
OUT(playerid);
|
||||||
|
|
||||||
for (int i = EQEmu::invslot::slotCharm; i <= EQEmu::invslot::slotWaist; ++i) {
|
for (int i = EQ::invslot::slotCharm; i <= EQ::invslot::slotWaist; ++i) {
|
||||||
strn0cpy(eq->itemnames[i], emu->itemnames[i], sizeof(eq->itemnames[i]));
|
strn0cpy(eq->itemnames[i], emu->itemnames[i], sizeof(eq->itemnames[i]));
|
||||||
OUT(itemicons[i]);
|
OUT(itemicons[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// move ammo down to last element in titanium array
|
// move ammo down to last element in titanium array
|
||||||
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQEmu::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
|
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQ::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
|
||||||
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQEmu::invslot::slotAmmo];
|
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQ::invslot::slotAmmo];
|
||||||
|
|
||||||
strn0cpy(eq->text, emu->text, sizeof(eq->text));
|
strn0cpy(eq->text, emu->text, sizeof(eq->text));
|
||||||
|
|
||||||
@ -832,14 +832,14 @@ namespace Titanium
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
ob.write((const char*)__emu_buffer, 4);
|
||||||
|
|
||||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
|
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
|
||||||
if (ob.tellp() == last_pos) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("Titanium::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("Titanium::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -909,7 +909,7 @@ namespace Titanium
|
|||||||
|
|
||||||
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
|
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
|
||||||
if (emu->scribing == 3)
|
if (emu->scribing == 3)
|
||||||
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
|
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
|
||||||
else
|
else
|
||||||
OUT(slot);
|
OUT(slot);
|
||||||
OUT(spell_id);
|
OUT(spell_id);
|
||||||
@ -1009,7 +1009,7 @@ namespace Titanium
|
|||||||
OUT(hairstyle);
|
OUT(hairstyle);
|
||||||
OUT(beard);
|
OUT(beard);
|
||||||
// OUT(unknown00178[10]);
|
// OUT(unknown00178[10]);
|
||||||
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
|
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
|
||||||
OUT(item_material.Slot[r].Material);
|
OUT(item_material.Slot[r].Material);
|
||||||
OUT(item_tint.Slot[r].Color);
|
OUT(item_tint.Slot[r].Color);
|
||||||
}
|
}
|
||||||
@ -1032,7 +1032,7 @@ namespace Titanium
|
|||||||
OUT(face);
|
OUT(face);
|
||||||
// OUT(unknown02264[47]);
|
// 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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
@ -1041,14 +1041,14 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
else
|
else
|
||||||
eq->spell_book[r] = 0xFFFFFFFFU;
|
eq->spell_book[r] = 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// 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[448]);
|
// OUT(unknown4184[448]);
|
||||||
@ -1092,7 +1092,7 @@ namespace Titanium
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// 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);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++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].ID);
|
||||||
@ -1101,7 +1101,7 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// 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';
|
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
|
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].ID = 0;
|
||||||
@ -1113,13 +1113,13 @@ namespace Titanium
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// 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].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// 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].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -1349,14 +1349,14 @@ namespace Titanium
|
|||||||
if (eq->Race[char_index] > 473)
|
if (eq->Race[char_index] > 473)
|
||||||
eq->Race[char_index] = 1;
|
eq->Race[char_index] = 1;
|
||||||
|
|
||||||
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
|
for (int index = 0; index < EQ::textures::materialCount; ++index) {
|
||||||
eq->CS_Colors[char_index].Slot[index].Color = emu_cse->Equip[index].Color;
|
eq->CS_Colors[char_index].Slot[index].Color = emu_cse->Equip[index].Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
eq->BeardColor[char_index] = emu_cse->BeardColor;
|
eq->BeardColor[char_index] = emu_cse->BeardColor;
|
||||||
eq->HairStyle[char_index] = emu_cse->HairStyle;
|
eq->HairStyle[char_index] = emu_cse->HairStyle;
|
||||||
|
|
||||||
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
|
for (int index = 0; index < EQ::textures::materialCount; ++index) {
|
||||||
eq->Equip[char_index].Slot[index].Material = emu_cse->Equip[index].Material;
|
eq->Equip[char_index].Slot[index].Material = emu_cse->Equip[index].Material;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1386,14 +1386,14 @@ namespace Titanium
|
|||||||
for (; char_index < 10; ++char_index) {
|
for (; char_index < 10; ++char_index) {
|
||||||
eq->Race[char_index] = 0;
|
eq->Race[char_index] = 0;
|
||||||
|
|
||||||
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
|
for (int index = 0; index < EQ::textures::materialCount; ++index) {
|
||||||
eq->CS_Colors[char_index].Slot[index].Color = 0;
|
eq->CS_Colors[char_index].Slot[index].Color = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
eq->BeardColor[char_index] = 0;
|
eq->BeardColor[char_index] = 0;
|
||||||
eq->HairStyle[char_index] = 0;
|
eq->HairStyle[char_index] = 0;
|
||||||
|
|
||||||
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
|
for (int index = 0; index < EQ::textures::materialCount; ++index) {
|
||||||
eq->Equip[char_index].Slot[index].Material = 0;
|
eq->Equip[char_index].Slot[index].Material = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1717,7 +1717,7 @@ namespace Titanium
|
|||||||
eq->petOwnerId = emu->petOwnerId;
|
eq->petOwnerId = emu->petOwnerId;
|
||||||
eq->guildrank = emu->guildrank;
|
eq->guildrank = emu->guildrank;
|
||||||
// eq->unknown0194[3] = emu->unknown0194[3];
|
// eq->unknown0194[3] = emu->unknown0194[3];
|
||||||
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
|
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
|
||||||
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
|
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
|
||||||
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
|
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
|
||||||
}
|
}
|
||||||
@ -1830,7 +1830,7 @@ namespace Titanium
|
|||||||
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
|
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
|
||||||
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
|
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
|
||||||
|
|
||||||
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
|
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
|
||||||
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
|
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
@ -1993,12 +1993,12 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
|
|
||||||
// move ammo up to last element in server array
|
// move ammo up to last element in server array
|
||||||
strn0cpy(emu->itemnames[EQEmu::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQEmu::invslot::slotAmmo]));
|
strn0cpy(emu->itemnames[EQ::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQ::invslot::slotAmmo]));
|
||||||
emu->itemicons[EQEmu::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
|
emu->itemicons[EQ::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
|
||||||
|
|
||||||
// nullify power source element in server array
|
// nullify power source element in server array
|
||||||
strn0cpy(emu->itemnames[EQEmu::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQEmu::invslot::slotPowerSource]));
|
strn0cpy(emu->itemnames[EQ::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQ::invslot::slotPowerSource]));
|
||||||
emu->itemicons[EQEmu::invslot::slotPowerSource] = 0xFFFFFFFF;
|
emu->itemicons[EQ::invslot::slotPowerSource] = 0xFFFFFFFF;
|
||||||
|
|
||||||
strn0cpy(emu->text, eq->text, sizeof(emu->text));
|
strn0cpy(emu->text, eq->text, sizeof(emu->text));
|
||||||
|
|
||||||
@ -2053,7 +2053,7 @@ namespace Titanium
|
|||||||
|
|
||||||
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
|
||||||
IN(spell[i]);
|
IN(spell[i]);
|
||||||
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
|
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
|
|
||||||
IN(unknown);
|
IN(unknown);
|
||||||
@ -2273,9 +2273,9 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
|
|
||||||
// file scope helper methods
|
// file scope helper methods
|
||||||
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 char *protection = "\\\\\\\\\\";
|
const char *protection = "\\\\\\\\\\";
|
||||||
const EQEmu::ItemData *item = inst->GetUnscaledItem();
|
const EQ::ItemData *item = inst->GetUnscaledItem();
|
||||||
|
|
||||||
ob << StringFormat(
|
ob << StringFormat(
|
||||||
"%.*s%s",
|
"%.*s%s",
|
||||||
@ -2293,7 +2293,7 @@ namespace Titanium
|
|||||||
ob << '|' << itoa((!inst->GetMerchantSlot() ? inst->GetSerialNumber()
|
ob << '|' << itoa((!inst->GetMerchantSlot() ? inst->GetSerialNumber()
|
||||||
: inst->GetMerchantSlot())); // merchant serial number
|
: inst->GetMerchantSlot())); // merchant serial number
|
||||||
ob << '|' << itoa(inst->GetRecastTimestamp()); // recast timestamp
|
ob << '|' << itoa(inst->GetRecastTimestamp()); // recast timestamp
|
||||||
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQEmu::item::ItemTypePotion) ? 1 : 0)
|
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQ::item::ItemTypePotion) ? 1 : 0)
|
||||||
: inst->GetCharges()))); // charge count
|
: inst->GetCharges()))); // charge count
|
||||||
ob << '|' << itoa((inst->IsAttuned() ? 1 : 0)); // inst attuned
|
ob << '|' << itoa((inst->IsAttuned() ? 1 : 0)); // inst attuned
|
||||||
ob << '|' << itoa(0); // unknown
|
ob << '|' << itoa(0); // unknown
|
||||||
@ -2502,10 +2502,10 @@ namespace Titanium
|
|||||||
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
|
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
|
||||||
|
|
||||||
// Sub data
|
// Sub data
|
||||||
for (int index = EQEmu::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
|
for (int index = EQ::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
|
||||||
ob << '|';
|
ob << '|';
|
||||||
|
|
||||||
EQEmu::ItemInstance *sub = inst->GetItem(index);
|
EQ::ItemInstance *sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -2525,59 +2525,59 @@ namespace Titanium
|
|||||||
static inline int16 ServerToTitaniumSlot(uint32 server_slot) {
|
static inline int16 ServerToTitaniumSlot(uint32 server_slot) {
|
||||||
int16 titanium_slot = invslot::SLOT_INVALID;
|
int16 titanium_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_slot <= EQEmu::invslot::slotWaist) {
|
if (server_slot <= EQ::invslot::slotWaist) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot == EQEmu::invslot::slotAmmo) {
|
else if (server_slot == EQ::invslot::slotAmmo) {
|
||||||
titanium_slot = server_slot - 1;
|
titanium_slot = server_slot - 1;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::slotGeneral8 && server_slot >= EQEmu::invslot::slotGeneral1) {
|
else if (server_slot <= EQ::invslot::slotGeneral8 && server_slot >= EQ::invslot::slotGeneral1) {
|
||||||
titanium_slot = server_slot - 1;
|
titanium_slot = server_slot - 1;
|
||||||
}
|
}
|
||||||
else if (server_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
|
else if (server_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
|
||||||
server_slot >= EQEmu::invslot::slotCursor) {
|
server_slot >= EQ::invslot::slotCursor) {
|
||||||
titanium_slot = server_slot - 3;
|
titanium_slot = server_slot - 3;
|
||||||
}
|
}
|
||||||
else if (server_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
|
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
||||||
titanium_slot = server_slot - 4;
|
titanium_slot = server_slot - 4;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END &&
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
|
||||||
server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
titanium_slot = server_slot - 20;
|
titanium_slot = server_slot - 20;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END &&
|
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END &&
|
||||||
server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
|
server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invbag::BANK_BAGS_16_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END &&
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
|
||||||
server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2590,16 +2590,16 @@ namespace Titanium
|
|||||||
static inline int16 ServerToTitaniumCorpseSlot(uint32 server_corpse_slot) {
|
static inline int16 ServerToTitaniumCorpseSlot(uint32 server_corpse_slot) {
|
||||||
int16 titanium_slot = invslot::SLOT_INVALID;
|
int16 titanium_slot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
|
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
|
||||||
titanium_slot = server_corpse_slot - 1;
|
titanium_slot = server_corpse_slot - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_corpse_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
|
else if (server_corpse_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
|
||||||
server_corpse_slot >= EQEmu::invslot::slotCursor) {
|
server_corpse_slot >= EQ::invslot::slotCursor) {
|
||||||
titanium_slot = server_corpse_slot - 3;
|
titanium_slot = server_corpse_slot - 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_corpse_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
|
else if (server_corpse_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
||||||
titanium_slot = server_corpse_slot - 4;
|
titanium_slot = server_corpse_slot - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2613,7 +2613,7 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32 TitaniumToServerSlot(int16 titanium_slot) {
|
static inline uint32 TitaniumToServerSlot(int16 titanium_slot) {
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (titanium_slot <= invslot::slotWaist) {
|
if (titanium_slot <= invslot::slotWaist) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
@ -2675,7 +2675,7 @@ namespace Titanium
|
|||||||
|
|
||||||
static inline uint32 TitaniumToServerCorpseSlot(int16 titanium_corpse_slot)
|
static inline uint32 TitaniumToServerCorpseSlot(int16 titanium_corpse_slot)
|
||||||
{
|
{
|
||||||
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
|
uint32 server_slot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (titanium_corpse_slot <= invslot::slotGeneral8 && titanium_corpse_slot >= invslot::slotGeneral1) {
|
if (titanium_corpse_slot <= invslot::slotGeneral8 && titanium_corpse_slot >= invslot::slotGeneral1) {
|
||||||
server_slot = titanium_corpse_slot + 1;
|
server_slot = titanium_corpse_slot + 1;
|
||||||
@ -2696,7 +2696,7 @@ namespace Titanium
|
|||||||
|
|
||||||
static inline void ServerToTitaniumSayLink(std::string &titanium_saylink, const std::string &server_saylink)
|
static inline void ServerToTitaniumSayLink(std::string &titanium_saylink, const std::string &server_saylink)
|
||||||
{
|
{
|
||||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
|
||||||
titanium_saylink = server_saylink;
|
titanium_saylink = server_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2705,7 +2705,7 @@ namespace Titanium
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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) {
|
||||||
titanium_saylink.append(segments[segment_iter]);
|
titanium_saylink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -2736,7 +2736,7 @@ namespace Titanium
|
|||||||
|
|
||||||
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink)
|
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
|
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
|
||||||
server_saylink = titanium_saylink;
|
server_saylink = titanium_saylink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2772,85 +2772,85 @@ namespace Titanium
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot) {
|
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::PotionBelt;
|
return spells::CastingSlot::PotionBelt;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
|
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Ability:
|
case spells::CastingSlot::Ability:
|
||||||
return EQEmu::spells::CastingSlot::Ability;
|
return EQ::spells::CastingSlot::Ability;
|
||||||
// Tit uses 10 for item and discipline casting, but items have a valid location
|
// Tit uses 10 for item and discipline casting, but items have a valid location
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
if (item_location == INVALID_INDEX)
|
if (item_location == INVALID_INDEX)
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
else
|
else
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::PotionBelt:
|
case spells::CastingSlot::PotionBelt:
|
||||||
return EQEmu::spells::CastingSlot::PotionBelt;
|
return EQ::spells::CastingSlot::PotionBelt;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
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 ServerToTitaniumBuffSlot(int index)
|
static inline int ServerToTitaniumBuffSlot(int index)
|
||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -2859,11 +2859,11 @@ namespace Titanium
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace Titanium
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace Titanium
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = true;
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace Titanium
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -106,7 +106,7 @@ namespace Titanium
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -204,7 +204,7 @@ namespace Titanium
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -236,7 +236,7 @@ namespace Titanium
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -248,7 +248,7 @@ namespace Titanium
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
enum ItemPacketType : int {
|
||||||
ItemPacketMerchant = 100,
|
ItemPacketMerchant = 100,
|
||||||
@ -266,7 +266,7 @@ namespace Titanium
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 4; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 4; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -278,11 +278,11 @@ namespace Titanium
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::DoD; // Someone had this as PoR in another section...
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::DoD; // Someone had this as PoR in another section...
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitDoD;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitDoD;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskDoD;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskDoD;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
||||||
|
|
||||||
@ -291,21 +291,21 @@ namespace Titanium
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const bool CoinHasWeight = true;
|
const bool CoinHasWeight = true;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
|
const size_t LastUsableSkill = EQ::skills::SkillFrenzy;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -161,7 +161,7 @@ struct TintProfile {
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ struct TextureProfile
|
|||||||
Texture_Struct Primary;
|
Texture_Struct Primary;
|
||||||
Texture_Struct Secondary;
|
Texture_Struct Secondary;
|
||||||
};
|
};
|
||||||
Texture_Struct Slot[EQEmu::textures::materialCount];
|
Texture_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
TextureProfile();
|
TextureProfile();
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace UF
|
|||||||
static OpcodeManager *opcodes = nullptr;
|
static OpcodeManager *opcodes = nullptr;
|
||||||
static Strategy struct_strategy;
|
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
|
// server to client inventory location converters
|
||||||
static inline uint32 ServerToUFSlot(uint32 serverSlot);
|
static inline uint32 ServerToUFSlot(uint32 serverSlot);
|
||||||
@ -59,8 +59,8 @@ namespace UF
|
|||||||
// client to server say link converter
|
// client to server say link converter
|
||||||
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
|
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
|
||||||
|
|
||||||
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot);
|
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot);
|
||||||
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
|
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
|
||||||
|
|
||||||
static inline int ServerToUFBuffSlot(int index);
|
static inline int ServerToUFBuffSlot(int index);
|
||||||
static inline int UFToServerBuffSlot(int index);
|
static inline int UFToServerBuffSlot(int index);
|
||||||
@ -144,9 +144,9 @@ namespace UF
|
|||||||
return(r);
|
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"
|
#include "ss_define.h"
|
||||||
@ -501,24 +501,24 @@ namespace UF
|
|||||||
//store away the emu struct
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
uchar* __emu_buffer = in->pBuffer;
|
||||||
|
|
||||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
|
||||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
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",
|
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;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
|
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
|
||||||
|
|
||||||
EQEmu::OutBuffer ob;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)&item_count, sizeof(uint32));
|
ob.write((const char*)&item_count, sizeof(uint32));
|
||||||
|
|
||||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
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)
|
if (ob.tellp() == last_pos)
|
||||||
LogNetcode("UF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
|
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
|
//store away the emu struct
|
||||||
uchar* __emu_buffer = in->pBuffer;
|
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;
|
EQ::OutBuffer ob;
|
||||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
EQ::OutBuffer::pos_type last_pos = ob.tellp();
|
||||||
|
|
||||||
ob.write((const char*)__emu_buffer, 4);
|
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) {
|
if (ob.tellp() == last_pos) {
|
||||||
LogNetcode("UF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
LogNetcode("UF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
@ -1693,7 +1693,7 @@ namespace UF
|
|||||||
OUT(hairstyle);
|
OUT(hairstyle);
|
||||||
OUT(beard);
|
OUT(beard);
|
||||||
// OUT(unknown00178[10]);
|
// 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].Material = emu->item_material.Slot[r].Material;
|
||||||
eq->equipment.Slot[r].Unknown1 = 0;
|
eq->equipment.Slot[r].Unknown1 = 0;
|
||||||
eq->equipment.Slot[r].EliteMaterial = 0;
|
eq->equipment.Slot[r].EliteMaterial = 0;
|
||||||
@ -1725,7 +1725,7 @@ namespace UF
|
|||||||
OUT(face);
|
OUT(face);
|
||||||
// OUT(unknown02264[47]);
|
// 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++) {
|
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
|
||||||
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
@ -1734,14 +1734,14 @@ namespace UF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
|
||||||
eq->spell_book[r] = emu->spell_book[r];
|
eq->spell_book[r] = emu->spell_book[r];
|
||||||
else
|
else
|
||||||
eq->spell_book[r] = 0xFFFFFFFFU;
|
eq->spell_book[r] = 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
// invalidate the rest of the spellbook slots
|
// 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]);
|
// OUT(unknown4184[128]);
|
||||||
@ -1797,7 +1797,7 @@ namespace UF
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indices converge
|
// 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);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++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].ID);
|
||||||
@ -1806,7 +1806,7 @@ namespace UF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indices diverge, with a client bias
|
// 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';
|
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
|
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].ID = 0;
|
||||||
@ -1818,13 +1818,13 @@ namespace UF
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indices converge
|
// 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].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indices diverge, with a client bias
|
// 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].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -2196,7 +2196,7 @@ namespace UF
|
|||||||
eq_cse->HairColor = emu_cse->HairColor;
|
eq_cse->HairColor = emu_cse->HairColor;
|
||||||
eq_cse->Face = emu_cse->Face;
|
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].Material = emu_cse->Equip[equip_index].Material;
|
||||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
|
||||||
@ -2755,7 +2755,7 @@ namespace UF
|
|||||||
float SpawnSize = emu->size;
|
float SpawnSize = emu->size;
|
||||||
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
|
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)
|
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))
|
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);
|
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;
|
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) {
|
if (emu->equipment.Slot[k].Material > 99999) {
|
||||||
Equipment[k].Material = 63;
|
Equipment[k].Material = 63;
|
||||||
} else {
|
} else {
|
||||||
@ -3000,7 +3000,7 @@ namespace UF
|
|||||||
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
|
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))
|
if (strlen(emu->title))
|
||||||
{
|
{
|
||||||
@ -3498,7 +3498,7 @@ namespace UF
|
|||||||
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
|
||||||
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, 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)
|
if (eq->spell[i] == 0)
|
||||||
emu->spell[i] = 0xFFFFFFFF;
|
emu->spell[i] = 0xFFFFFFFF;
|
||||||
else
|
else
|
||||||
@ -3737,9 +3737,9 @@ namespace UF
|
|||||||
return NextItemInstSerialNumber;
|
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;
|
UF::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -3783,7 +3783,7 @@ namespace UF
|
|||||||
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
||||||
uint16 ornaIcon = 0;
|
uint16 ornaIcon = 0;
|
||||||
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
|
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;
|
ornaIcon = aug_weap->Icon;
|
||||||
|
|
||||||
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
||||||
@ -3966,6 +3966,12 @@ namespace UF
|
|||||||
itbs.no_transfer = item->NoTransfer;
|
itbs.no_transfer = item->NoTransfer;
|
||||||
itbs.expendablearrow = item->ExpendableArrow;
|
itbs.expendablearrow = item->ExpendableArrow;
|
||||||
|
|
||||||
|
// Done to hack older clients to label expendable fishing poles as such
|
||||||
|
// July 28th, 2018 patch
|
||||||
|
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
|
||||||
|
itbs.expendablearrow = 1;
|
||||||
|
}
|
||||||
|
|
||||||
ob.write((const char*)&itbs, sizeof(UF::structs::ItemTertiaryBodyStruct));
|
ob.write((const char*)&itbs, sizeof(UF::structs::ItemTertiaryBodyStruct));
|
||||||
|
|
||||||
// Effect Structures Broken down to allow variable length strings for effect names
|
// Effect Structures Broken down to allow variable length strings for effect names
|
||||||
@ -4110,30 +4116,30 @@ namespace UF
|
|||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct));
|
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;
|
uint32 subitem_count = 0;
|
||||||
|
|
||||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||||
|
|
||||||
// moved outside of loop since it is not modified within that scope
|
// 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)
|
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
|
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
|
||||||
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
|
SubSlotNumber = EQ::invbag::SLOT_INVALID;
|
||||||
else if (slot_id_in == EQEmu::invslot::slotCursor)
|
else if (slot_id_in == EQ::invslot::slotCursor)
|
||||||
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
|
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
|
||||||
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
|
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
|
||||||
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
|
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
|
||||||
else
|
else
|
||||||
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
|
||||||
|
|
||||||
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
|
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
|
||||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
|
||||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
EQ::ItemInstance* sub = inst->GetItem(index);
|
||||||
if (!sub)
|
if (!sub)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -4152,59 +4158,59 @@ namespace UF
|
|||||||
{
|
{
|
||||||
uint32 UFSlot = invslot::SLOT_INVALID;
|
uint32 UFSlot = invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
|
if (serverSlot <= EQ::invslot::slotGeneral8) {
|
||||||
UFSlot = serverSlot;
|
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;
|
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;
|
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;
|
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;
|
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;
|
UFSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
|
||||||
UFSlot = serverSlot;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
UFSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4217,11 +4223,11 @@ namespace UF
|
|||||||
{
|
{
|
||||||
uint32 UFSlot = invslot::SLOT_INVALID;
|
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;
|
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;
|
UFSlot = serverCorpseSlot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4232,7 +4238,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline uint32 UFToServerSlot(uint32 ufSlot)
|
static inline uint32 UFToServerSlot(uint32 ufSlot)
|
||||||
{
|
{
|
||||||
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
|
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
|
||||||
|
|
||||||
if (ufSlot <= invslot::slotGeneral8) {
|
if (ufSlot <= invslot::slotGeneral8) {
|
||||||
ServerSlot = ufSlot;
|
ServerSlot = ufSlot;
|
||||||
@ -4297,7 +4303,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot)
|
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) {
|
if (ufCorpseSlot <= invslot::slotGeneral8 && ufCorpseSlot >= invslot::slotGeneral1) {
|
||||||
ServerSlot = ufCorpseSlot;
|
ServerSlot = ufCorpseSlot;
|
||||||
@ -4314,7 +4320,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
|
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;
|
ufSayLink = serverSayLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4323,7 +4329,7 @@ namespace UF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
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]);
|
ufSayLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
@ -4354,7 +4360,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
|
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;
|
serverSayLink = ufSayLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4388,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) {
|
switch (slot) {
|
||||||
case EQEmu::spells::CastingSlot::Gem1:
|
case EQ::spells::CastingSlot::Gem1:
|
||||||
return spells::CastingSlot::Gem1;
|
return spells::CastingSlot::Gem1;
|
||||||
case EQEmu::spells::CastingSlot::Gem2:
|
case EQ::spells::CastingSlot::Gem2:
|
||||||
return spells::CastingSlot::Gem2;
|
return spells::CastingSlot::Gem2;
|
||||||
case EQEmu::spells::CastingSlot::Gem3:
|
case EQ::spells::CastingSlot::Gem3:
|
||||||
return spells::CastingSlot::Gem3;
|
return spells::CastingSlot::Gem3;
|
||||||
case EQEmu::spells::CastingSlot::Gem4:
|
case EQ::spells::CastingSlot::Gem4:
|
||||||
return spells::CastingSlot::Gem4;
|
return spells::CastingSlot::Gem4;
|
||||||
case EQEmu::spells::CastingSlot::Gem5:
|
case EQ::spells::CastingSlot::Gem5:
|
||||||
return spells::CastingSlot::Gem5;
|
return spells::CastingSlot::Gem5;
|
||||||
case EQEmu::spells::CastingSlot::Gem6:
|
case EQ::spells::CastingSlot::Gem6:
|
||||||
return spells::CastingSlot::Gem6;
|
return spells::CastingSlot::Gem6;
|
||||||
case EQEmu::spells::CastingSlot::Gem7:
|
case EQ::spells::CastingSlot::Gem7:
|
||||||
return spells::CastingSlot::Gem7;
|
return spells::CastingSlot::Gem7;
|
||||||
case EQEmu::spells::CastingSlot::Gem8:
|
case EQ::spells::CastingSlot::Gem8:
|
||||||
return spells::CastingSlot::Gem8;
|
return spells::CastingSlot::Gem8;
|
||||||
case EQEmu::spells::CastingSlot::Gem9:
|
case EQ::spells::CastingSlot::Gem9:
|
||||||
return spells::CastingSlot::Gem9;
|
return spells::CastingSlot::Gem9;
|
||||||
case EQEmu::spells::CastingSlot::Gem10:
|
case EQ::spells::CastingSlot::Gem10:
|
||||||
return spells::CastingSlot::Gem10;
|
return spells::CastingSlot::Gem10;
|
||||||
case EQEmu::spells::CastingSlot::Gem11:
|
case EQ::spells::CastingSlot::Gem11:
|
||||||
return spells::CastingSlot::Gem11;
|
return spells::CastingSlot::Gem11;
|
||||||
case EQEmu::spells::CastingSlot::Gem12:
|
case EQ::spells::CastingSlot::Gem12:
|
||||||
return spells::CastingSlot::Gem12;
|
return spells::CastingSlot::Gem12;
|
||||||
case EQEmu::spells::CastingSlot::Item:
|
case EQ::spells::CastingSlot::Item:
|
||||||
case EQEmu::spells::CastingSlot::PotionBelt:
|
case EQ::spells::CastingSlot::PotionBelt:
|
||||||
return spells::CastingSlot::Item;
|
return spells::CastingSlot::Item;
|
||||||
case EQEmu::spells::CastingSlot::Discipline:
|
case EQ::spells::CastingSlot::Discipline:
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
case EQEmu::spells::CastingSlot::AltAbility:
|
case EQ::spells::CastingSlot::AltAbility:
|
||||||
return spells::CastingSlot::AltAbility;
|
return spells::CastingSlot::AltAbility;
|
||||||
default: // we shouldn't have any issues with other slots ... just return something
|
default: // we shouldn't have any issues with other slots ... just return something
|
||||||
return spells::CastingSlot::Discipline;
|
return spells::CastingSlot::Discipline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
|
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
|
||||||
{
|
{
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case spells::CastingSlot::Gem1:
|
case spells::CastingSlot::Gem1:
|
||||||
return EQEmu::spells::CastingSlot::Gem1;
|
return EQ::spells::CastingSlot::Gem1;
|
||||||
case spells::CastingSlot::Gem2:
|
case spells::CastingSlot::Gem2:
|
||||||
return EQEmu::spells::CastingSlot::Gem2;
|
return EQ::spells::CastingSlot::Gem2;
|
||||||
case spells::CastingSlot::Gem3:
|
case spells::CastingSlot::Gem3:
|
||||||
return EQEmu::spells::CastingSlot::Gem3;
|
return EQ::spells::CastingSlot::Gem3;
|
||||||
case spells::CastingSlot::Gem4:
|
case spells::CastingSlot::Gem4:
|
||||||
return EQEmu::spells::CastingSlot::Gem4;
|
return EQ::spells::CastingSlot::Gem4;
|
||||||
case spells::CastingSlot::Gem5:
|
case spells::CastingSlot::Gem5:
|
||||||
return EQEmu::spells::CastingSlot::Gem5;
|
return EQ::spells::CastingSlot::Gem5;
|
||||||
case spells::CastingSlot::Gem6:
|
case spells::CastingSlot::Gem6:
|
||||||
return EQEmu::spells::CastingSlot::Gem6;
|
return EQ::spells::CastingSlot::Gem6;
|
||||||
case spells::CastingSlot::Gem7:
|
case spells::CastingSlot::Gem7:
|
||||||
return EQEmu::spells::CastingSlot::Gem7;
|
return EQ::spells::CastingSlot::Gem7;
|
||||||
case spells::CastingSlot::Gem8:
|
case spells::CastingSlot::Gem8:
|
||||||
return EQEmu::spells::CastingSlot::Gem8;
|
return EQ::spells::CastingSlot::Gem8;
|
||||||
case spells::CastingSlot::Gem9:
|
case spells::CastingSlot::Gem9:
|
||||||
return EQEmu::spells::CastingSlot::Gem9;
|
return EQ::spells::CastingSlot::Gem9;
|
||||||
case spells::CastingSlot::Gem10:
|
case spells::CastingSlot::Gem10:
|
||||||
return EQEmu::spells::CastingSlot::Gem10;
|
return EQ::spells::CastingSlot::Gem10;
|
||||||
case spells::CastingSlot::Gem11:
|
case spells::CastingSlot::Gem11:
|
||||||
return EQEmu::spells::CastingSlot::Gem11;
|
return EQ::spells::CastingSlot::Gem11;
|
||||||
case spells::CastingSlot::Gem12:
|
case spells::CastingSlot::Gem12:
|
||||||
return EQEmu::spells::CastingSlot::Gem12;
|
return EQ::spells::CastingSlot::Gem12;
|
||||||
case spells::CastingSlot::Discipline:
|
case spells::CastingSlot::Discipline:
|
||||||
return EQEmu::spells::CastingSlot::Discipline;
|
return EQ::spells::CastingSlot::Discipline;
|
||||||
case spells::CastingSlot::Item:
|
case spells::CastingSlot::Item:
|
||||||
return EQEmu::spells::CastingSlot::Item;
|
return EQ::spells::CastingSlot::Item;
|
||||||
case spells::CastingSlot::AltAbility:
|
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
|
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)
|
static inline int ServerToUFBuffSlot(int index)
|
||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
|
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
|
||||||
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
spells::LONG_BUFFS + spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= EQEmu::spells::LONG_BUFFS)
|
if (index >= EQ::spells::LONG_BUFFS)
|
||||||
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
|
||||||
// we're a normal buff
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
@ -4482,11 +4488,11 @@ namespace UF
|
|||||||
{
|
{
|
||||||
// we're a disc
|
// we're a disc
|
||||||
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
|
||||||
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
|
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
|
||||||
EQEmu::spells::SHORT_BUFFS;
|
EQ::spells::SHORT_BUFFS;
|
||||||
// we're a song
|
// we're a song
|
||||||
if (index >= spells::LONG_BUFFS)
|
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
|
// we're a normal buff
|
||||||
return index; // as long as we guard against bad slots server side, we should be fine
|
return index; // as long as we guard against bad slots server side, we should be fine
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace UF
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
virtual std::string Describe() const;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
|
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
//magic macro to declare our opcode processors
|
||||||
#include "ss_declare.h"
|
#include "ss_declare.h"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace UF
|
|||||||
const int16 INULL = 0;
|
const int16 INULL = 0;
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = true;
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace UF
|
|||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventoryTypes : int16 {
|
enum InventoryTypes : int16 {
|
||||||
@ -106,7 +106,7 @@ namespace UF
|
|||||||
} /*invtype*/
|
} /*invtype*/
|
||||||
|
|
||||||
namespace invslot {
|
namespace invslot {
|
||||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
namespace enum_ {
|
namespace enum_ {
|
||||||
enum InventorySlots : int16 {
|
enum InventorySlots : int16 {
|
||||||
@ -205,7 +205,7 @@ namespace UF
|
|||||||
} /*invslot*/
|
} /*invslot*/
|
||||||
|
|
||||||
namespace invbag {
|
namespace invbag {
|
||||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
const int16 SLOT_INVALID = IINVALID;
|
||||||
const int16 SLOT_BEGIN = INULL;
|
const int16 SLOT_BEGIN = INULL;
|
||||||
@ -237,7 +237,7 @@ namespace UF
|
|||||||
} /*invbag*/
|
} /*invbag*/
|
||||||
|
|
||||||
namespace invaug {
|
namespace invaug {
|
||||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
const int16 SOCKET_INVALID = IINVALID;
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
const int16 SOCKET_BEGIN = INULL;
|
||||||
@ -249,7 +249,7 @@ namespace UF
|
|||||||
} /*invaug*/
|
} /*invaug*/
|
||||||
|
|
||||||
namespace item {
|
namespace item {
|
||||||
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
enum ItemPacketType : int {
|
||||||
ItemPacketMerchant = 100,
|
ItemPacketMerchant = 100,
|
||||||
@ -268,7 +268,7 @@ namespace UF
|
|||||||
} /*item*/
|
} /*item*/
|
||||||
|
|
||||||
namespace profile {
|
namespace profile {
|
||||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||||
@ -280,11 +280,11 @@ namespace UF
|
|||||||
} /*profile*/
|
} /*profile*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::UF;
|
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::UF;
|
||||||
const uint32 EXPANSION_BIT = EQEmu::expansions::bitUF;
|
const uint32 EXPANSION_BIT = EQ::expansions::bitUF;
|
||||||
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskUF;
|
const uint32 EXPANSIONS_MASK = EQ::expansions::maskUF;
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||||
|
|
||||||
@ -293,21 +293,21 @@ namespace UF
|
|||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const bool CoinHasWeight = false;
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
namespace skills {
|
namespace skills {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
|
||||||
|
|
||||||
} /*skills*/
|
} /*skills*/
|
||||||
|
|
||||||
namespace spells {
|
namespace spells {
|
||||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
|
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
enum class CastingSlot : uint32 {
|
||||||
Gem1 = 0,
|
Gem1 = 0,
|
||||||
|
|||||||
@ -149,7 +149,7 @@ struct TintProfile
|
|||||||
Tint_Struct Primary;
|
Tint_Struct Primary;
|
||||||
Tint_Struct Secondary;
|
Tint_Struct Secondary;
|
||||||
};
|
};
|
||||||
Tint_Struct Slot[EQEmu::textures::materialCount];
|
Tint_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ struct TextureProfile
|
|||||||
Texture_Struct Primary;
|
Texture_Struct Primary;
|
||||||
Texture_Struct Secondary;
|
Texture_Struct Secondary;
|
||||||
};
|
};
|
||||||
Texture_Struct Slot[EQEmu::textures::materialCount];
|
Texture_Struct Slot[EQ::textures::materialCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
TextureProfile();
|
TextureProfile();
|
||||||
@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
|
|||||||
/*0000*/ uint8 Beard; //
|
/*0000*/ uint8 Beard; //
|
||||||
/*0001*/ uint8 HairColor; //
|
/*0001*/ uint8 HairColor; //
|
||||||
/*0000*/ uint8 Face; //
|
/*0000*/ uint8 Face; //
|
||||||
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
|
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
|
||||||
/*0000*/ uint32 PrimaryIDFile; //
|
/*0000*/ uint32 PrimaryIDFile; //
|
||||||
/*0000*/ uint32 SecondaryIDFile; //
|
/*0000*/ uint32 SecondaryIDFile; //
|
||||||
/*0000*/ uint8 Unknown15; // 0xff
|
/*0000*/ uint8 Unknown15; // 0xff
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
static std::list<std::string> profanity_list;
|
static std::list<std::string> profanity_list;
|
||||||
static bool update_originator_flag = false;
|
static bool update_originator_flag = false;
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::LoadProfanityList(DBcore *db) {
|
bool EQ::ProfanityManager::LoadProfanityList(DBcore *db) {
|
||||||
if (update_originator_flag == true) {
|
if (update_originator_flag == true) {
|
||||||
update_originator_flag = false;
|
update_originator_flag = false;
|
||||||
return true;
|
return true;
|
||||||
@ -40,7 +40,7 @@ bool EQEmu::ProfanityManager::LoadProfanityList(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::UpdateProfanityList(DBcore *db) {
|
bool EQ::ProfanityManager::UpdateProfanityList(DBcore *db) {
|
||||||
if (!load_database_entries(db))
|
if (!load_database_entries(db))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ bool EQEmu::ProfanityManager::UpdateProfanityList(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::DeleteProfanityList(DBcore *db) {
|
bool EQ::ProfanityManager::DeleteProfanityList(DBcore *db) {
|
||||||
if (!clear_database_entries(db))
|
if (!clear_database_entries(db))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ bool EQEmu::ProfanityManager::DeleteProfanityList(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
|
bool EQ::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
|
||||||
if (!db || !profanity)
|
if (!db || !profanity)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ bool EQEmu::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
|
bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
|
||||||
if (!db || !profanity)
|
if (!db || !profanity)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ bool EQEmu::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ProfanityManager::RedactMessage(char *message) {
|
void EQ::ProfanityManager::RedactMessage(char *message) {
|
||||||
if (!message)
|
if (!message)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ void EQEmu::ProfanityManager::RedactMessage(char *message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::ProfanityManager::RedactMessage(std::string &message) {
|
void EQ::ProfanityManager::RedactMessage(std::string &message) {
|
||||||
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -169,14 +169,14 @@ void EQEmu::ProfanityManager::RedactMessage(std::string &message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::ContainsCensoredLanguage(const char *message) {
|
bool EQ::ProfanityManager::ContainsCensoredLanguage(const char *message) {
|
||||||
if (!message)
|
if (!message)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ContainsCensoredLanguage(std::string(message));
|
return ContainsCensoredLanguage(std::string(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
|
bool EQ::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
|
||||||
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -192,15 +192,15 @@ bool EQEmu::ProfanityManager::ContainsCensoredLanguage(const std::string &messag
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::list<std::string> &EQEmu::ProfanityManager::GetProfanityList() {
|
const std::list<std::string> &EQ::ProfanityManager::GetProfanityList() {
|
||||||
return profanity_list;
|
return profanity_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::IsCensorshipActive() {
|
bool EQ::ProfanityManager::IsCensorshipActive() {
|
||||||
return (profanity_list.size() != 0);
|
return (profanity_list.size() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::load_database_entries(DBcore *db) {
|
bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
|
||||||
if (!db)
|
if (!db)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ bool EQEmu::ProfanityManager::load_database_entries(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::clear_database_entries(DBcore *db) {
|
bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
|
||||||
if (!db)
|
if (!db)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ bool EQEmu::ProfanityManager::clear_database_entries(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::ProfanityManager::check_for_existing_entry(const char *profanity) {
|
bool EQ::ProfanityManager::check_for_existing_entry(const char *profanity) {
|
||||||
if (!profanity)
|
if (!profanity)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
class DBcore;
|
class DBcore;
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
class ProfanityManager {
|
class ProfanityManager {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
* Eventually this should be derived from an abstract base class
|
* Eventually this should be derived from an abstract base class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace EQEmu {
|
namespace EQ {
|
||||||
class Random {
|
class Random {
|
||||||
public:
|
public:
|
||||||
// AKA old MakeRandomInt
|
// AKA old MakeRandomInt
|
||||||
@ -80,7 +80,7 @@ namespace EQEmu {
|
|||||||
{
|
{
|
||||||
static_assert(std::is_same<std::random_access_iterator_tag,
|
static_assert(std::is_same<std::random_access_iterator_tag,
|
||||||
typename std::iterator_traits<RandomAccessIterator>::iterator_category>::value,
|
typename std::iterator_traits<RandomAccessIterator>::iterator_category>::value,
|
||||||
"EQEmu::Random::Shuffle requires random access iterators");
|
"EQ::Random::Shuffle requires random access iterators");
|
||||||
std::shuffle(first, last, m_gen);
|
std::shuffle(first, last, m_gen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,10 +26,10 @@
|
|||||||
#include "../zone/zonedb.h"
|
#include "../zone/zonedb.h"
|
||||||
|
|
||||||
|
|
||||||
bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct &say_link_body_struct, const std::string &say_link_body)
|
bool EQ::saylink::DegenerateLinkBody(SayLinkBody_Struct &say_link_body_struct, const std::string &say_link_body)
|
||||||
{
|
{
|
||||||
memset(&say_link_body_struct, 0, sizeof(say_link_body_struct));
|
memset(&say_link_body_struct, 0, sizeof(say_link_body_struct));
|
||||||
if (say_link_body.length() != EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
if (say_link_body.length() != EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct &say_link_body_struct
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::saylink::GenerateLinkBody(std::string &say_link_body, const SayLinkBody_Struct &say_link_body_struct)
|
bool EQ::saylink::GenerateLinkBody(std::string &say_link_body, const SayLinkBody_Struct &say_link_body_struct)
|
||||||
{
|
{
|
||||||
say_link_body = StringFormat(
|
say_link_body = StringFormat(
|
||||||
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
|
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
|
||||||
@ -69,19 +69,19 @@ bool EQEmu::saylink::GenerateLinkBody(std::string &say_link_body, const SayLinkB
|
|||||||
(0xFFFFFFFF & say_link_body_struct.hash)
|
(0xFFFFFFFF & say_link_body_struct.hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (say_link_body.length() != EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
if (say_link_body.length() != EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::SayLinkEngine::SayLinkEngine()
|
EQ::SayLinkEngine::SayLinkEngine()
|
||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &EQEmu::SayLinkEngine::GenerateLink()
|
const std::string &EQ::SayLinkEngine::GenerateLink()
|
||||||
{
|
{
|
||||||
m_Link.clear();
|
m_Link.clear();
|
||||||
m_LinkBody.clear();
|
m_LinkBody.clear();
|
||||||
@ -90,25 +90,25 @@ const std::string &EQEmu::SayLinkEngine::GenerateLink()
|
|||||||
generate_body();
|
generate_body();
|
||||||
generate_text();
|
generate_text();
|
||||||
|
|
||||||
if ((m_LinkBody.length() == EQEmu::constants::SAY_LINK_BODY_SIZE) && (m_LinkText.length() > 0)) {
|
if ((m_LinkBody.length() == EQ::constants::SAY_LINK_BODY_SIZE) && (m_LinkText.length() > 0)) {
|
||||||
m_Link.push_back(0x12);
|
m_Link.push_back(0x12);
|
||||||
m_Link.append(m_LinkBody);
|
m_Link.append(m_LinkBody);
|
||||||
m_Link.append(m_LinkText);
|
m_Link.append(m_LinkText);
|
||||||
m_Link.push_back(0x12);
|
m_Link.push_back(0x12);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_Link.length() == 0) || (m_Link.length() > (EQEmu::constants::SAY_LINK_MAXIMUM_SIZE))) {
|
if ((m_Link.length() == 0) || (m_Link.length() > (EQ::constants::SAY_LINK_MAXIMUM_SIZE))) {
|
||||||
m_Error = true;
|
m_Error = true;
|
||||||
m_Link = "<LINKER ERROR>";
|
m_Link = "<LINKER ERROR>";
|
||||||
LogError("SayLinkEngine::GenerateLink() failed to generate a useable say link");
|
LogError("SayLinkEngine::GenerateLink() failed to generate a useable say link");
|
||||||
LogError(">> LinkType: {}, Lengths: {link: {}({}), body: {}({}), text: {}({})}",
|
LogError(">> LinkType: {}, Lengths: {link: {}({}), body: {}({}), text: {}({})}",
|
||||||
m_LinkType,
|
m_LinkType,
|
||||||
m_Link.length(),
|
m_Link.length(),
|
||||||
EQEmu::constants::SAY_LINK_MAXIMUM_SIZE,
|
EQ::constants::SAY_LINK_MAXIMUM_SIZE,
|
||||||
m_LinkBody.length(),
|
m_LinkBody.length(),
|
||||||
EQEmu::constants::SAY_LINK_BODY_SIZE,
|
EQ::constants::SAY_LINK_BODY_SIZE,
|
||||||
m_LinkText.length(),
|
m_LinkText.length(),
|
||||||
EQEmu::constants::SAY_LINK_TEXT_SIZE
|
EQ::constants::SAY_LINK_TEXT_SIZE
|
||||||
);
|
);
|
||||||
LogError(">> LinkBody: {}", m_LinkBody.c_str());
|
LogError(">> LinkBody: {}", m_LinkBody.c_str());
|
||||||
LogError(">> LinkText: {}", m_LinkText.c_str());
|
LogError(">> LinkText: {}", m_LinkText.c_str());
|
||||||
@ -117,7 +117,7 @@ const std::string &EQEmu::SayLinkEngine::GenerateLink()
|
|||||||
return m_Link;
|
return m_Link;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::SayLinkEngine::Reset()
|
void EQ::SayLinkEngine::Reset()
|
||||||
{
|
{
|
||||||
m_LinkType = saylink::SayLinkBlank;
|
m_LinkType = saylink::SayLinkBlank;
|
||||||
m_ItemData = nullptr;
|
m_ItemData = nullptr;
|
||||||
@ -134,7 +134,7 @@ void EQEmu::SayLinkEngine::Reset()
|
|||||||
m_Error = false;
|
m_Error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::SayLinkEngine::generate_body()
|
void EQ::SayLinkEngine::generate_body()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Current server mask: EQClientRoF2
|
Current server mask: EQClientRoF2
|
||||||
@ -147,7 +147,7 @@ void EQEmu::SayLinkEngine::generate_body()
|
|||||||
|
|
||||||
memset(&m_LinkBodyStruct, 0, sizeof(SayLinkBody_Struct));
|
memset(&m_LinkBodyStruct, 0, sizeof(SayLinkBody_Struct));
|
||||||
|
|
||||||
const EQEmu::ItemData *item_data = nullptr;
|
const EQ::ItemData *item_data = nullptr;
|
||||||
|
|
||||||
switch (m_LinkType) {
|
switch (m_LinkType) {
|
||||||
case saylink::SayLinkBlank:
|
case saylink::SayLinkBlank:
|
||||||
@ -257,14 +257,14 @@ void EQEmu::SayLinkEngine::generate_body()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEmu::SayLinkEngine::generate_text()
|
void EQ::SayLinkEngine::generate_text()
|
||||||
{
|
{
|
||||||
if (m_LinkProxyStruct.text != nullptr) {
|
if (m_LinkProxyStruct.text != nullptr) {
|
||||||
m_LinkText = m_LinkProxyStruct.text;
|
m_LinkText = m_LinkProxyStruct.text;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::ItemData *item_data = nullptr;
|
const EQ::ItemData *item_data = nullptr;
|
||||||
|
|
||||||
switch (m_LinkType) {
|
switch (m_LinkType) {
|
||||||
case saylink::SayLinkBlank:
|
case saylink::SayLinkBlank:
|
||||||
@ -291,7 +291,7 @@ void EQEmu::SayLinkEngine::generate_text()
|
|||||||
m_LinkText = "null";
|
m_LinkText = "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string EQEmu::SayLinkEngine::GenerateQuestSaylink(std::string saylink_text, bool silent, std::string link_name)
|
std::string EQ::SayLinkEngine::GenerateQuestSaylink(std::string saylink_text, bool silent, std::string link_name)
|
||||||
{
|
{
|
||||||
uint32 saylink_id = 0;
|
uint32 saylink_id = 0;
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ std::string EQEmu::SayLinkEngine::GenerateQuestSaylink(std::string saylink_text,
|
|||||||
/**
|
/**
|
||||||
* Generate the actual link
|
* Generate the actual link
|
||||||
*/
|
*/
|
||||||
EQEmu::SayLinkEngine linker;
|
EQ::SayLinkEngine linker;
|
||||||
linker.SetProxyItemID(SAYLINK_ITEM_ID);
|
linker.SetProxyItemID(SAYLINK_ITEM_ID);
|
||||||
if (silent) {
|
if (silent) {
|
||||||
linker.SetProxyAugment2ID(saylink_id);
|
linker.SetProxyAugment2ID(saylink_id);
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
struct ServerLootItem_Struct;
|
struct ServerLootItem_Struct;
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
struct ItemData;
|
struct ItemData;
|
||||||
class ItemInstance;
|
class ItemInstance;
|
||||||
@ -72,7 +72,7 @@ namespace EQEmu
|
|||||||
SayLinkEngine();
|
SayLinkEngine();
|
||||||
|
|
||||||
void SetLinkType(saylink::SayLinkType link_type) { m_LinkType = link_type; }
|
void SetLinkType(saylink::SayLinkType link_type) { m_LinkType = link_type; }
|
||||||
void SetItemData(const EQEmu::ItemData* item_data) { m_ItemData = item_data; }
|
void SetItemData(const EQ::ItemData* item_data) { m_ItemData = item_data; }
|
||||||
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
|
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
|
||||||
void SetItemInst(const ItemInstance* item_inst) { m_ItemInst = item_inst; }
|
void SetItemInst(const ItemInstance* item_inst) { m_ItemInst = item_inst; }
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,14 @@
|
|||||||
#define ServerOP_UCSServerStatusReply 0x4014
|
#define ServerOP_UCSServerStatusReply 0x4014
|
||||||
#define ServerOP_HotReloadQuests 0x4015
|
#define ServerOP_HotReloadQuests 0x4015
|
||||||
#define ServerOP_CZSignalGroup 0x4016
|
#define ServerOP_CZSignalGroup 0x4016
|
||||||
|
#define ServerOP_CZSignalRaid 0x4017
|
||||||
|
#define ServerOP_CZSignalGuild 0x4018
|
||||||
|
#define ServerOP_CZMessageGroup 0x4019
|
||||||
|
#define ServerOP_CZMessageRaid 0x4020
|
||||||
#define ServerOP_CZMessageGuild 0x4021
|
#define ServerOP_CZMessageGuild 0x4021
|
||||||
|
#define ServerOP_CZSetEntityVariableByGroupID 0x4022
|
||||||
|
#define ServerOP_CZSetEntityVariableByRaidID 0x4023
|
||||||
|
#define ServerOP_CZSetEntityVariableByGuildID 0x4024
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QueryServer
|
* QueryServer
|
||||||
@ -1174,6 +1181,16 @@ struct CZGroupSignal_Struct {
|
|||||||
uint32 data;
|
uint32 data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CZRaidSignal_Struct {
|
||||||
|
int raid_id;
|
||||||
|
uint32 data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CZGuildSignal_Struct {
|
||||||
|
int guild_id;
|
||||||
|
uint32 data;
|
||||||
|
};
|
||||||
|
|
||||||
struct CZNPCSignal_Struct {
|
struct CZNPCSignal_Struct {
|
||||||
uint32 npctype_id;
|
uint32 npctype_id;
|
||||||
uint32 data;
|
uint32 data;
|
||||||
@ -1341,6 +1358,18 @@ struct CZMessagePlayer_Struct {
|
|||||||
char Message[512];
|
char Message[512];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CZMessageGroup_Struct {
|
||||||
|
uint32 Type;
|
||||||
|
int GroupID;
|
||||||
|
char Message[512];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CZMessageRaid_Struct {
|
||||||
|
uint32 Type;
|
||||||
|
int RaidID;
|
||||||
|
char Message[512];
|
||||||
|
};
|
||||||
|
|
||||||
struct CZMessageGuild_Struct {
|
struct CZMessageGuild_Struct {
|
||||||
uint32 Type;
|
uint32 Type;
|
||||||
int GuildID;
|
int GuildID;
|
||||||
@ -1368,6 +1397,24 @@ struct CZSetEntVarByClientName_Struct {
|
|||||||
char m_var[256];
|
char m_var[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CZSetEntVarByGroupID_Struct {
|
||||||
|
int group_id;
|
||||||
|
char id[256];
|
||||||
|
char m_var[256];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CZSetEntVarByRaidID_Struct {
|
||||||
|
int raid_id;
|
||||||
|
char id[256];
|
||||||
|
char m_var[256];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CZSetEntVarByGuildID_Struct {
|
||||||
|
int guild_id;
|
||||||
|
char id[256];
|
||||||
|
char m_var[256];
|
||||||
|
};
|
||||||
|
|
||||||
struct ReloadWorld_Struct {
|
struct ReloadWorld_Struct {
|
||||||
uint32 Option;
|
uint32 Option;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -164,14 +164,14 @@ std::string SharedDatabase::GetMailKey(int CharID, bool key_only)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end)
|
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQ::ItemInstance*>::const_iterator &start, std::list<EQ::ItemInstance*>::const_iterator &end)
|
||||||
{
|
{
|
||||||
// Delete cursor items
|
// Delete cursor items
|
||||||
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i "
|
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i "
|
||||||
"AND ((slotid >= 8000 AND slotid <= 8999) "
|
"AND ((slotid >= 8000 AND slotid <= 8999) "
|
||||||
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
|
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
|
||||||
char_id, EQEmu::invslot::slotCursor,
|
char_id, EQ::invslot::slotCursor,
|
||||||
EQEmu::invbag::CURSOR_BAG_BEGIN, EQEmu::invbag::CURSOR_BAG_END);
|
EQ::invbag::CURSOR_BAG_BEGIN, EQ::invbag::CURSOR_BAG_END);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
|
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
|
||||||
@ -181,8 +181,8 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
|
|||||||
int i = 8000;
|
int i = 8000;
|
||||||
for(auto it = start; it != end; ++it, i++) {
|
for(auto it = start; it != end; ++it, i++) {
|
||||||
if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high
|
if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high
|
||||||
EQEmu::ItemInstance *inst = *it;
|
EQ::ItemInstance *inst = *it;
|
||||||
int16 use_slot = (i == 8000) ? EQEmu::invslot::slotCursor : i;
|
int16 use_slot = (i == 8000) ? EQ::invslot::slotCursor : i;
|
||||||
if (!SaveInventory(char_id, inst, use_slot)) {
|
if (!SaveInventory(char_id, inst, use_slot)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const EQEmu::ItemInstance* inst)
|
bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const EQ::ItemInstance* inst)
|
||||||
{
|
{
|
||||||
// Delete cursor items
|
// Delete cursor items
|
||||||
std::string query = StringFormat("SELECT itemid, charges FROM sharedbank "
|
std::string query = StringFormat("SELECT itemid, charges FROM sharedbank "
|
||||||
@ -224,15 +224,15 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const EQE
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
bool SharedDatabase::SaveInventory(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id) {
|
||||||
|
|
||||||
//never save tribute slots:
|
//never save tribute slots:
|
||||||
if (slot_id >= EQEmu::invslot::TRIBUTE_BEGIN && slot_id <= EQEmu::invslot::TRIBUTE_END)
|
if (slot_id >= EQ::invslot::TRIBUTE_BEGIN && slot_id <= EQ::invslot::TRIBUTE_END)
|
||||||
return true;
|
return true;
|
||||||
if (slot_id >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN && slot_id <= EQEmu::invslot::GUILD_TRIBUTE_END)
|
if (slot_id >= EQ::invslot::GUILD_TRIBUTE_BEGIN && slot_id <= EQ::invslot::GUILD_TRIBUTE_END)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (slot_id >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
if (slot_id >= EQ::invslot::SHARED_BANK_BEGIN && slot_id <= EQ::invbag::SHARED_BANK_BAGS_END) {
|
||||||
// Shared bank inventory
|
// Shared bank inventory
|
||||||
if (!inst) {
|
if (!inst) {
|
||||||
return DeleteSharedBankSlot(char_id, slot_id);
|
return DeleteSharedBankSlot(char_id, slot_id);
|
||||||
@ -240,7 +240,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
|
|||||||
else {
|
else {
|
||||||
// Needed to clear out bag slots that 'REPLACE' in UpdateSharedBankSlot does not overwrite..otherwise, duplication occurs
|
// Needed to clear out bag slots that 'REPLACE' in UpdateSharedBankSlot does not overwrite..otherwise, duplication occurs
|
||||||
// (This requires that parent then child items be sent..which should be how they are currently passed)
|
// (This requires that parent then child items be sent..which should be how they are currently passed)
|
||||||
if (EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
if (EQ::InventoryProfile::SupportsContainers(slot_id))
|
||||||
DeleteSharedBankSlot(char_id, slot_id);
|
DeleteSharedBankSlot(char_id, slot_id);
|
||||||
return UpdateSharedBankSlot(char_id, inst, slot_id);
|
return UpdateSharedBankSlot(char_id, inst, slot_id);
|
||||||
}
|
}
|
||||||
@ -251,18 +251,18 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
|
|||||||
|
|
||||||
// Needed to clear out bag slots that 'REPLACE' in UpdateInventorySlot does not overwrite..otherwise, duplication occurs
|
// Needed to clear out bag slots that 'REPLACE' in UpdateInventorySlot does not overwrite..otherwise, duplication occurs
|
||||||
// (This requires that parent then child items be sent..which should be how they are currently passed)
|
// (This requires that parent then child items be sent..which should be how they are currently passed)
|
||||||
if (EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
if (EQ::InventoryProfile::SupportsContainers(slot_id))
|
||||||
DeleteInventorySlot(char_id, slot_id);
|
DeleteInventorySlot(char_id, slot_id);
|
||||||
return UpdateInventorySlot(char_id, inst, slot_id);
|
return UpdateInventorySlot(char_id, inst, slot_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id) {
|
||||||
// need to check 'inst' argument for valid pointer
|
// need to check 'inst' argument for valid pointer
|
||||||
|
|
||||||
uint32 augslot[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
uint32 augslot[EQ::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||||
if (inst->IsClassCommon()) {
|
if (inst->IsClassCommon()) {
|
||||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||||
EQEmu::ItemInstance *auginst = inst->GetItem(i);
|
EQ::ItemInstance *auginst = inst->GetItem(i);
|
||||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,12 +288,12 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
|
|||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
// Save bag contents, if slot supports bag contents
|
// Save bag contents, if slot supports bag contents
|
||||||
if (inst->IsClassBag() && EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
if (inst->IsClassBag() && EQ::InventoryProfile::SupportsContainers(slot_id))
|
||||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||||
// messages through attrition (and the modded code in SaveInventory)
|
// messages through attrition (and the modded code in SaveInventory)
|
||||||
for (uint8 idx = EQEmu::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQEmu::invbag::SLOT_END; idx++) {
|
for (uint8 idx = EQ::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQ::invbag::SLOT_END; idx++) {
|
||||||
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
|
const EQ::ItemInstance* baginst = inst->GetItem(idx);
|
||||||
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
|
SaveInventory(char_id, baginst, EQ::InventoryProfile::CalcSlotId(slot_id, idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
@ -303,13 +303,13 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id) {
|
||||||
// need to check 'inst' argument for valid pointer
|
// need to check 'inst' argument for valid pointer
|
||||||
|
|
||||||
uint32 augslot[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
uint32 augslot[EQ::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||||
if (inst->IsClassCommon()) {
|
if (inst->IsClassCommon()) {
|
||||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||||
EQEmu::ItemInstance *auginst = inst->GetItem(i);
|
EQ::ItemInstance *auginst = inst->GetItem(i);
|
||||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,12 +334,12 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInsta
|
|||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
// Save bag contents, if slot supports bag contents
|
// Save bag contents, if slot supports bag contents
|
||||||
if (inst->IsClassBag() && EQEmu::InventoryProfile::SupportsContainers(slot_id)) {
|
if (inst->IsClassBag() && EQ::InventoryProfile::SupportsContainers(slot_id)) {
|
||||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||||
// messages through attrition (and the modded code in SaveInventory)
|
// messages through attrition (and the modded code in SaveInventory)
|
||||||
for (uint8 idx = EQEmu::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQEmu::invbag::SLOT_END; idx++) {
|
for (uint8 idx = EQ::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQ::invbag::SLOT_END; idx++) {
|
||||||
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
|
const EQ::ItemInstance* baginst = inst->GetItem(idx);
|
||||||
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
|
SaveInventory(char_id, baginst, EQ::InventoryProfile::CalcSlotId(slot_id, idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,10 +360,10 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete bag slots, if need be
|
// Delete bag slots, if need be
|
||||||
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
if (!EQ::InventoryProfile::SupportsContainers(slot_id))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::invbag::SLOT_BEGIN);
|
int16 base_slot_id = EQ::InventoryProfile::CalcSlotId(slot_id, EQ::invbag::SLOT_BEGIN);
|
||||||
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
|
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
|
||||||
char_id, base_slot_id, (base_slot_id+10));
|
char_id, base_slot_id, (base_slot_id+10));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
@ -386,10 +386,10 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete bag slots, if need be
|
// Delete bag slots, if need be
|
||||||
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
if (!EQ::InventoryProfile::SupportsContainers(slot_id))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::invbag::SLOT_BEGIN);
|
int16 base_slot_id = EQ::InventoryProfile::CalcSlotId(slot_id, EQ::invbag::SLOT_BEGIN);
|
||||||
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
|
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
|
||||||
"AND slotid >= %i AND slotid < %i",
|
"AND slotid >= %i AND slotid < %i",
|
||||||
account_id, base_slot_id, (base_slot_id+10));
|
account_id, base_slot_id, (base_slot_id+10));
|
||||||
@ -429,9 +429,9 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
|
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQ::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
|
||||||
|
|
||||||
const EQEmu::ItemData* myitem;
|
const EQ::ItemData* myitem;
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items "
|
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items "
|
||||||
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
|
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
|
||||||
@ -452,7 +452,7 @@ bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::Inventory
|
|||||||
if(!myitem)
|
if(!myitem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
EQEmu::ItemInstance* myinst = CreateBaseItem(myitem, charges);
|
EQ::ItemInstance* myinst = CreateBaseItem(myitem, charges);
|
||||||
|
|
||||||
if(slot < 0)
|
if(slot < 0)
|
||||||
slot = inv->FindFreeSlot(0, 0);
|
slot = inv->FindFreeSlot(0, 0);
|
||||||
@ -466,7 +466,7 @@ bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::Inventory
|
|||||||
|
|
||||||
|
|
||||||
// Retrieve shared bank inventory based on either account or character
|
// Retrieve shared bank inventory based on either account or character
|
||||||
bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool is_charid)
|
bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is_charid)
|
||||||
{
|
{
|
||||||
std::string query;
|
std::string query;
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
|||||||
uint32 item_id = (uint32)atoi(row[1]);
|
uint32 item_id = (uint32)atoi(row[1]);
|
||||||
int8 charges = (int8)atoi(row[2]);
|
int8 charges = (int8)atoi(row[2]);
|
||||||
|
|
||||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||||
aug[0] = (uint32)atoi(row[3]);
|
aug[0] = (uint32)atoi(row[3]);
|
||||||
aug[1] = (uint32)atoi(row[4]);
|
aug[1] = (uint32)atoi(row[4]);
|
||||||
aug[2] = (uint32)atoi(row[5]);
|
aug[2] = (uint32)atoi(row[5]);
|
||||||
@ -501,7 +501,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
|||||||
aug[4] = (uint32)atoi(row[7]);
|
aug[4] = (uint32)atoi(row[7]);
|
||||||
aug[5] = (uint32)atoi(row[8]);
|
aug[5] = (uint32)atoi(row[8]);
|
||||||
|
|
||||||
const EQEmu::ItemData *item = GetItem(item_id);
|
const EQ::ItemData *item = GetItem(item_id);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
LogError("Warning: [{}] [{}] has an invalid item_id [{}] in inventory slot [{}]",
|
LogError("Warning: [{}] [{}] has an invalid item_id [{}] in inventory slot [{}]",
|
||||||
@ -511,9 +511,9 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
|||||||
|
|
||||||
int16 put_slot_id = INVALID_INDEX;
|
int16 put_slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
EQEmu::ItemInstance *inst = CreateBaseItem(item, charges);
|
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||||
if (inst && item->IsClassCommon()) {
|
if (inst && item->IsClassCommon()) {
|
||||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||||
if (aug[i])
|
if (aug[i])
|
||||||
inst->PutAugment(this, i, aug[i]);
|
inst->PutAugment(this, i, aug[i]);
|
||||||
}
|
}
|
||||||
@ -563,7 +563,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Overloaded: Retrieve character inventory based on character id (zone entry)
|
// Overloaded: Retrieve character inventory based on character id (zone entry)
|
||||||
bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||||
{
|
{
|
||||||
if (!char_id || !inv)
|
if (!char_id || !inv)
|
||||||
return false;
|
return false;
|
||||||
@ -591,28 +591,28 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
int16 slot_id = atoi(row[0]);
|
int16 slot_id = atoi(row[0]);
|
||||||
|
|
||||||
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) { // Titanium thru UF check
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) { // Titanium thru UF check
|
||||||
if ((((uint64)1 << slot_id) & pmask) == 0) {
|
if ((((uint64)1 << slot_id) & pmask) == 0) {
|
||||||
cv_conflict = true;
|
cv_conflict = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invbag::GENERAL_BAGS_END && slot_id >= EQEmu::invbag::GENERAL_BAGS_BEGIN) { // Titanium thru UF check
|
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) { // Titanium thru UF check
|
||||||
auto parent_slot = EQEmu::invslot::GENERAL_BEGIN + ((slot_id - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
auto parent_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if ((((uint64)1 << parent_slot) & pmask) == 0) {
|
if ((((uint64)1 << parent_slot) & pmask) == 0) {
|
||||||
cv_conflict = true;
|
cv_conflict = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) { // Titanium check
|
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) { // Titanium check
|
||||||
if ((slot_id - EQEmu::invslot::BANK_BEGIN) >= bank_size) {
|
if ((slot_id - EQ::invslot::BANK_BEGIN) >= bank_size) {
|
||||||
cv_conflict = true;
|
cv_conflict = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (slot_id <= EQEmu::invbag::BANK_BAGS_END && slot_id >= EQEmu::invbag::BANK_BAGS_BEGIN) { // Titanium check
|
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) { // Titanium check
|
||||||
auto parent_index = ((slot_id - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
|
auto parent_index = ((slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
|
||||||
if (parent_index < EQEmu::invslot::SLOT_BEGIN || parent_index >= bank_size) {
|
if (parent_index < EQ::invslot::SLOT_BEGIN || parent_index >= bank_size) {
|
||||||
cv_conflict = true;
|
cv_conflict = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -622,7 +622,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
uint16 charges = atoi(row[2]);
|
uint16 charges = atoi(row[2]);
|
||||||
uint32 color = atoul(row[3]);
|
uint32 color = atoul(row[3]);
|
||||||
|
|
||||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||||
|
|
||||||
aug[0] = (uint32)atoul(row[4]);
|
aug[0] = (uint32)atoul(row[4]);
|
||||||
aug[1] = (uint32)atoul(row[5]);
|
aug[1] = (uint32)atoul(row[5]);
|
||||||
@ -637,7 +637,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
uint32 ornament_idfile = (uint32)atoul(row[13]);
|
uint32 ornament_idfile = (uint32)atoul(row[13]);
|
||||||
uint32 ornament_hero_model = (uint32)atoul(row[14]);
|
uint32 ornament_hero_model = (uint32)atoul(row[14]);
|
||||||
|
|
||||||
const EQEmu::ItemData *item = GetItem(item_id);
|
const EQ::ItemData *item = GetItem(item_id);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
LogError("Warning: charid [{}] has an invalid item_id [{}] in inventory slot [{}]", char_id, item_id,
|
LogError("Warning: charid [{}] has an invalid item_id [{}] in inventory slot [{}]", char_id, item_id,
|
||||||
@ -647,7 +647,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
|
|
||||||
int16 put_slot_id = INVALID_INDEX;
|
int16 put_slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
EQEmu::ItemInstance *inst = CreateBaseItem(item, charges);
|
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr)
|
if (inst == nullptr)
|
||||||
continue;
|
continue;
|
||||||
@ -682,7 +682,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
inst->SetOrnamentationIDFile(ornament_idfile);
|
inst->SetOrnamentationIDFile(ornament_idfile);
|
||||||
inst->SetOrnamentHeroModel(item->HerosForgeModel);
|
inst->SetOrnamentHeroModel(item->HerosForgeModel);
|
||||||
|
|
||||||
if (instnodrop || (inst->GetItem()->Attuneable && slot_id >= EQEmu::invslot::EQUIPMENT_BEGIN && slot_id <= EQEmu::invslot::EQUIPMENT_END))
|
if (instnodrop || (inst->GetItem()->Attuneable && slot_id >= EQ::invslot::EQUIPMENT_BEGIN && slot_id <= EQ::invslot::EQUIPMENT_END))
|
||||||
inst->SetAttuned(true);
|
inst->SetAttuned(true);
|
||||||
|
|
||||||
if (color > 0)
|
if (color > 0)
|
||||||
@ -703,7 +703,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item->IsClassCommon()) {
|
if (item->IsClassCommon()) {
|
||||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||||
if (aug[i])
|
if (aug[i])
|
||||||
inst->PutAugment(this, i, aug[i]);
|
inst->PutAugment(this, i, aug[i]);
|
||||||
}
|
}
|
||||||
@ -735,7 +735,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
LogError("ClientVersion/Expansion conflict during inventory load at zone entry for [{}] (charid: [{}], inver: [{}], gmi: [{}])",
|
LogError("ClientVersion/Expansion conflict during inventory load at zone entry for [{}] (charid: [{}], inver: [{}], gmi: [{}])",
|
||||||
char_name,
|
char_name,
|
||||||
char_id,
|
char_id,
|
||||||
EQEmu::versions::MobVersionName(inv->InventoryVersion()),
|
EQ::versions::MobVersionName(inv->InventoryVersion()),
|
||||||
(inv->GMInventory() ? "true" : "false")
|
(inv->GMInventory() ? "true" : "false")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -745,7 +745,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Overloaded: Retrieve character inventory based on account_id and character name (char select)
|
// Overloaded: Retrieve character inventory based on account_id and character name (char select)
|
||||||
bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::InventoryProfile *inv) // deprecated
|
bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryProfile *inv) // deprecated
|
||||||
{
|
{
|
||||||
// Retrieve character inventory
|
// Retrieve character inventory
|
||||||
std::string query =
|
std::string query =
|
||||||
@ -769,7 +769,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
|||||||
int8 charges = atoi(row[2]);
|
int8 charges = atoi(row[2]);
|
||||||
uint32 color = atoul(row[3]);
|
uint32 color = atoul(row[3]);
|
||||||
|
|
||||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||||
aug[0] = (uint32)atoi(row[4]);
|
aug[0] = (uint32)atoi(row[4]);
|
||||||
aug[1] = (uint32)atoi(row[5]);
|
aug[1] = (uint32)atoi(row[5]);
|
||||||
aug[2] = (uint32)atoi(row[6]);
|
aug[2] = (uint32)atoi(row[6]);
|
||||||
@ -782,12 +782,12 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
|||||||
uint32 ornament_idfile = (uint32)atoul(row[13]);
|
uint32 ornament_idfile = (uint32)atoul(row[13]);
|
||||||
uint32 ornament_hero_model = (uint32)atoul(row[14]);
|
uint32 ornament_hero_model = (uint32)atoul(row[14]);
|
||||||
|
|
||||||
const EQEmu::ItemData *item = GetItem(item_id);
|
const EQ::ItemData *item = GetItem(item_id);
|
||||||
int16 put_slot_id = INVALID_INDEX;
|
int16 put_slot_id = INVALID_INDEX;
|
||||||
if (!item)
|
if (!item)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
EQEmu::ItemInstance *inst = CreateBaseItem(item, charges);
|
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr)
|
if (inst == nullptr)
|
||||||
continue;
|
continue;
|
||||||
@ -830,7 +830,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
|||||||
inst->SetCharges(charges);
|
inst->SetCharges(charges);
|
||||||
|
|
||||||
if (item->IsClassCommon()) {
|
if (item->IsClassCommon()) {
|
||||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||||
if (aug[i])
|
if (aug[i])
|
||||||
inst->PutAugment(this, i, aug[i]);
|
inst->PutAugment(this, i, aug[i]);
|
||||||
}
|
}
|
||||||
@ -914,11 +914,11 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("items");
|
EQ::IPCMutex mutex("items");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
|
||||||
items_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
items_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
|
||||||
items_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<EQEmu::ItemData>>(new EQEmu::FixedMemoryHashSet<EQEmu::ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
|
items_hash = std::unique_ptr<EQ::FixedMemoryHashSet<EQ::ItemData>>(new EQ::FixedMemoryHashSet<EQ::ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
LogError("Error Loading Items: {}", ex.what());
|
LogError("Error Loading Items: {}", ex.what());
|
||||||
@ -930,7 +930,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
|||||||
|
|
||||||
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id)
|
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id)
|
||||||
{
|
{
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(reinterpret_cast<uint8 *>(data), size, items, max_item_id);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(reinterpret_cast<uint8 *>(data), size, items, max_item_id);
|
||||||
|
|
||||||
std::string ndbuffer;
|
std::string ndbuffer;
|
||||||
bool disableNoRent = false;
|
bool disableNoRent = false;
|
||||||
@ -958,7 +958,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
|
|
||||||
const std::string query = "SELECT source,"
|
const std::string query = "SELECT source,"
|
||||||
#define F(x) "`"#x"`,"
|
#define F(x) "`"#x"`,"
|
||||||
@ -971,7 +971,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
memset(&item, 0, sizeof(EQEmu::ItemData));
|
memset(&item, 0, sizeof(EQ::ItemData));
|
||||||
|
|
||||||
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
|
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
|
||||||
strcpy(item.Name, row[ItemField::name]);
|
strcpy(item.Name, row[ItemField::name]);
|
||||||
@ -1189,7 +1189,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::ItemData *SharedDatabase::GetItem(uint32 id)
|
const EQ::ItemData *SharedDatabase::GetItem(uint32 id)
|
||||||
{
|
{
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -1206,7 +1206,7 @@ const EQEmu::ItemData *SharedDatabase::GetItem(uint32 id)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmu::ItemData* SharedDatabase::IterateItems(uint32* id) {
|
const EQ::ItemData* SharedDatabase::IterateItems(uint32* id) {
|
||||||
if(!items_hash || !id) {
|
if(!items_hash || !id) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1284,7 +1284,7 @@ const NPCFactionList* SharedDatabase::GetNPCFactionEntry(uint32 id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_count, uint32 max_lists) {
|
void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_count, uint32 max_lists) {
|
||||||
EQEmu::FixedMemoryHashSet<NPCFactionList> hash(reinterpret_cast<uint8*>(data), size, list_count, max_lists);
|
EQ::FixedMemoryHashSet<NPCFactionList> hash(reinterpret_cast<uint8*>(data), size, list_count, max_lists);
|
||||||
NPCFactionList faction;
|
NPCFactionList faction;
|
||||||
|
|
||||||
const std::string query = "SELECT npc_faction.id, npc_faction.primaryfaction, npc_faction.ignore_primary_assist, "
|
const std::string query = "SELECT npc_faction.id, npc_faction.primaryfaction, npc_faction.ignore_primary_assist, "
|
||||||
@ -1338,11 +1338,11 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("faction");
|
EQ::IPCMutex mutex("faction");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
|
||||||
faction_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
faction_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
|
||||||
faction_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<NPCFactionList>>(new EQEmu::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), faction_mmf->Size()));
|
faction_hash = std::unique_ptr<EQ::FixedMemoryHashSet<NPCFactionList>>(new EQ::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), faction_mmf->Size()));
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
LogError("Error Loading npc factions: {}", ex.what());
|
LogError("Error Loading npc factions: {}", ex.what());
|
||||||
@ -1352,18 +1352,18 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create appropriate EQEmu::ItemInstance class
|
// Create appropriate EQ::ItemInstance class
|
||||||
EQEmu::ItemInstance* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
|
EQ::ItemInstance* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
|
||||||
{
|
{
|
||||||
const EQEmu::ItemData* item = nullptr;
|
const EQ::ItemData* item = nullptr;
|
||||||
EQEmu::ItemInstance* inst = nullptr;
|
EQ::ItemInstance* inst = nullptr;
|
||||||
|
|
||||||
item = GetItem(item_id);
|
item = GetItem(item_id);
|
||||||
if (item) {
|
if (item) {
|
||||||
inst = CreateBaseItem(item, charges);
|
inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
LogError("Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||||
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1381,15 +1381,15 @@ EQEmu::ItemInstance* SharedDatabase::CreateItem(uint32 item_id, int16 charges, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create appropriate EQEmu::ItemInstance class
|
// Create appropriate EQ::ItemInstance class
|
||||||
EQEmu::ItemInstance* SharedDatabase::CreateItem(const EQEmu::ItemData* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
|
EQ::ItemInstance* SharedDatabase::CreateItem(const EQ::ItemData* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
|
||||||
{
|
{
|
||||||
EQEmu::ItemInstance* inst = nullptr;
|
EQ::ItemInstance* inst = nullptr;
|
||||||
if (item) {
|
if (item) {
|
||||||
inst = CreateBaseItem(item, charges);
|
inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
LogError("Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||||
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1406,8 +1406,8 @@ EQEmu::ItemInstance* SharedDatabase::CreateItem(const EQEmu::ItemData* item, int
|
|||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::ItemInstance* SharedDatabase::CreateBaseItem(const EQEmu::ItemData* item, int16 charges) {
|
EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, int16 charges) {
|
||||||
EQEmu::ItemInstance* inst = nullptr;
|
EQ::ItemInstance* inst = nullptr;
|
||||||
if (item) {
|
if (item) {
|
||||||
// if maxcharges is -1 that means it is an unlimited use item.
|
// if maxcharges is -1 that means it is an unlimited use item.
|
||||||
// set it to 1 charge so that it is usable on creation
|
// set it to 1 charge so that it is usable on creation
|
||||||
@ -1417,10 +1417,10 @@ EQEmu::ItemInstance* SharedDatabase::CreateBaseItem(const EQEmu::ItemData* item,
|
|||||||
if(charges <= 0 && item->Stackable)
|
if(charges <= 0 && item->Stackable)
|
||||||
charges = 1;
|
charges = 1;
|
||||||
|
|
||||||
inst = new EQEmu::ItemInstance(item, charges);
|
inst = new EQ::ItemInstance(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
LogError("Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateBaseItem()");
|
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateBaseItem()");
|
||||||
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
LogError("Item Data = ID: {}, Name: {}, Charges: {}", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1533,16 +1533,16 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
|||||||
skill_caps_mmf.reset(nullptr);
|
skill_caps_mmf.reset(nullptr);
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("skill_caps");
|
EQ::IPCMutex mutex("skill_caps");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
|
||||||
skill_caps_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
skill_caps_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
LogError("Error loading skill caps: {}", ex.what());
|
LogError("Error loading skill caps: {}", ex.what());
|
||||||
@ -1554,7 +1554,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
|||||||
|
|
||||||
void SharedDatabase::LoadSkillCaps(void *data) {
|
void SharedDatabase::LoadSkillCaps(void *data) {
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint16 *skill_caps_table = reinterpret_cast<uint16*>(data);
|
uint16 *skill_caps_table = reinterpret_cast<uint16*>(data);
|
||||||
|
|
||||||
@ -1579,7 +1579,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
|
uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQ::skills::SkillType Skill, uint8 Level) {
|
||||||
if(!skill_caps_mmf) {
|
if(!skill_caps_mmf) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1593,7 +1593,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1608,7 +1608,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill,
|
|||||||
return skill_caps_table[index];
|
return skill_caps_table[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
|
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQ::skills::SkillType Skill, uint8 Level) {
|
||||||
if(!skill_caps_mmf) {
|
if(!skill_caps_mmf) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1622,7 +1622,7 @@ uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1695,11 +1695,11 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("spells");
|
EQ::IPCMutex mutex("spells");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
|
||||||
spells_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
spells_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
|
||||||
*records = *reinterpret_cast<uint32*>(spells_mmf->Get());
|
*records = *reinterpret_cast<uint32*>(spells_mmf->Get());
|
||||||
*sp = reinterpret_cast<const SPDat_Spell_Struct*>((char*)spells_mmf->Get() + 4);
|
*sp = reinterpret_cast<const SPDat_Spell_Struct*>((char*)spells_mmf->Get() + 4);
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
@ -1793,10 +1793,10 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
|||||||
|
|
||||||
int tmp_skill = atoi(row[100]);;
|
int tmp_skill = atoi(row[100]);;
|
||||||
|
|
||||||
if (tmp_skill < 0 || tmp_skill > EQEmu::skills::HIGHEST_SKILL)
|
if (tmp_skill < 0 || tmp_skill > EQ::skills::HIGHEST_SKILL)
|
||||||
sp[tempid].skill = EQEmu::skills::SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
|
sp[tempid].skill = EQ::skills::SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
|
||||||
else
|
else
|
||||||
sp[tempid].skill = (EQEmu::skills::SkillType) tmp_skill;
|
sp[tempid].skill = (EQ::skills::SkillType) tmp_skill;
|
||||||
|
|
||||||
sp[tempid].zonetype=atoi(row[101]);
|
sp[tempid].zonetype=atoi(row[101]);
|
||||||
sp[tempid].EnvironmentType=atoi(row[102]);
|
sp[tempid].EnvironmentType=atoi(row[102]);
|
||||||
@ -1902,11 +1902,11 @@ bool SharedDatabase::LoadBaseData(const std::string &prefix) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("base_data");
|
EQ::IPCMutex mutex("base_data");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
|
||||||
base_data_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
base_data_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
LogError("Error Loading Base Data: {}", ex.what());
|
LogError("Error Loading Base Data: {}", ex.what());
|
||||||
@ -2035,7 +2035,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
||||||
EQEmu::FixedMemoryVariableHashSet<LootTable_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
EQ::FixedMemoryVariableHashSet<LootTable_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
||||||
|
|
||||||
uint8 loot_table[sizeof(LootTable_Struct) + (sizeof(LootTableEntries_Struct) * 128)];
|
uint8 loot_table[sizeof(LootTable_Struct) + (sizeof(LootTableEntries_Struct) * 128)];
|
||||||
LootTable_Struct *lt = reinterpret_cast<LootTable_Struct*>(loot_table);
|
LootTable_Struct *lt = reinterpret_cast<LootTable_Struct*>(loot_table);
|
||||||
@ -2089,7 +2089,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
|||||||
|
|
||||||
void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||||
|
|
||||||
EQEmu::FixedMemoryVariableHashSet<LootDrop_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
EQ::FixedMemoryVariableHashSet<LootDrop_Struct> hash(reinterpret_cast<uint8*>(data), size);
|
||||||
uint8 loot_drop[sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * 1260)];
|
uint8 loot_drop[sizeof(LootDrop_Struct) + (sizeof(LootDropEntries_Struct) * 1260)];
|
||||||
LootDrop_Struct *ld = reinterpret_cast<LootDrop_Struct*>(loot_drop);
|
LootDrop_Struct *ld = reinterpret_cast<LootDrop_Struct*>(loot_drop);
|
||||||
|
|
||||||
@ -2142,16 +2142,16 @@ bool SharedDatabase::LoadLoot(const std::string &prefix) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
EQEmu::IPCMutex mutex("loot");
|
EQ::IPCMutex mutex("loot");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
|
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
|
||||||
loot_table_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name_lt));
|
loot_table_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name_lt));
|
||||||
loot_table_hash = std::unique_ptr<EQEmu::FixedMemoryVariableHashSet<LootTable_Struct>>(new EQEmu::FixedMemoryVariableHashSet<LootTable_Struct>(
|
loot_table_hash = std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootTable_Struct>>(new EQ::FixedMemoryVariableHashSet<LootTable_Struct>(
|
||||||
reinterpret_cast<uint8*>(loot_table_mmf->Get()),
|
reinterpret_cast<uint8*>(loot_table_mmf->Get()),
|
||||||
loot_table_mmf->Size()));
|
loot_table_mmf->Size()));
|
||||||
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");
|
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");
|
||||||
loot_drop_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name_ld));
|
loot_drop_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name_ld));
|
||||||
loot_drop_hash = std::unique_ptr<EQEmu::FixedMemoryVariableHashSet<LootDrop_Struct>>(new EQEmu::FixedMemoryVariableHashSet<LootDrop_Struct>(
|
loot_drop_hash = std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootDrop_Struct>>(new EQ::FixedMemoryVariableHashSet<LootDrop_Struct>(
|
||||||
reinterpret_cast<uint8*>(loot_drop_mmf->Get()),
|
reinterpret_cast<uint8*>(loot_drop_mmf->Get()),
|
||||||
loot_drop_mmf->Size()));
|
loot_drop_mmf->Size()));
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
|
|||||||
@ -41,7 +41,7 @@ struct NPCFactionList;
|
|||||||
struct LootTable_Struct;
|
struct LootTable_Struct;
|
||||||
struct LootDrop_Struct;
|
struct LootDrop_Struct;
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
struct ItemData;
|
struct ItemData;
|
||||||
class ItemInstance;
|
class ItemInstance;
|
||||||
@ -80,22 +80,22 @@ class SharedDatabase : public Database
|
|||||||
/*
|
/*
|
||||||
Character InventoryProfile
|
Character InventoryProfile
|
||||||
*/
|
*/
|
||||||
bool SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end);
|
bool SaveCursor(uint32 char_id, std::list<EQ::ItemInstance*>::const_iterator &start, std::list<EQ::ItemInstance*>::const_iterator &end);
|
||||||
bool SaveInventory(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
|
bool SaveInventory(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id);
|
||||||
bool DeleteSharedBankSlot(uint32 char_id, int16 slot_id);
|
bool DeleteSharedBankSlot(uint32 char_id, int16 slot_id);
|
||||||
bool DeleteInventorySlot(uint32 char_id, int16 slot_id);
|
bool DeleteInventorySlot(uint32 char_id, int16 slot_id);
|
||||||
bool UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
|
bool UpdateInventorySlot(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id);
|
||||||
bool UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id);
|
bool UpdateSharedBankSlot(uint32 char_id, const EQ::ItemInstance* inst, int16 slot_id);
|
||||||
bool VerifyInventory(uint32 account_id, int16 slot_id, const EQEmu::ItemInstance* inst);
|
bool VerifyInventory(uint32 account_id, int16 slot_id, const EQ::ItemInstance* inst);
|
||||||
bool GetSharedBank(uint32 id, EQEmu::InventoryProfile* inv, bool is_charid);
|
bool GetSharedBank(uint32 id, EQ::InventoryProfile* inv, bool is_charid);
|
||||||
int32 GetSharedPlatinum(uint32 account_id);
|
int32 GetSharedPlatinum(uint32 account_id);
|
||||||
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
|
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
|
||||||
bool GetInventory(uint32 char_id, EQEmu::InventoryProfile* inv);
|
bool GetInventory(uint32 char_id, EQ::InventoryProfile* inv);
|
||||||
bool GetInventory(uint32 account_id, char* name, EQEmu::InventoryProfile* inv); // deprecated
|
bool GetInventory(uint32 account_id, char* name, EQ::InventoryProfile* inv); // deprecated
|
||||||
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
|
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
|
||||||
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
|
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
|
||||||
void ClearOldRecastTimestamps(uint32 char_id);
|
void ClearOldRecastTimestamps(uint32 char_id);
|
||||||
bool SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
|
bool SetStartingItems(PlayerProfile_Struct* pp, EQ::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin);
|
||||||
|
|
||||||
|
|
||||||
std::string GetBook(const char *txtfile, int16 *language);
|
std::string GetBook(const char *txtfile, int16 *language);
|
||||||
@ -103,9 +103,9 @@ class SharedDatabase : public Database
|
|||||||
/*
|
/*
|
||||||
Item Methods
|
Item Methods
|
||||||
*/
|
*/
|
||||||
EQEmu::ItemInstance* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
|
EQ::ItemInstance* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
|
||||||
EQEmu::ItemInstance* CreateItem(const EQEmu::ItemData* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
|
EQ::ItemInstance* CreateItem(const EQ::ItemData* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
|
||||||
EQEmu::ItemInstance* CreateBaseItem(const EQEmu::ItemData* item, int16 charges = 0);
|
EQ::ItemInstance* CreateBaseItem(const EQ::ItemData* item, int16 charges = 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Shared Memory crap
|
Shared Memory crap
|
||||||
@ -115,8 +115,8 @@ class SharedDatabase : public Database
|
|||||||
void GetItemsCount(int32 &item_count, uint32 &max_id);
|
void GetItemsCount(int32 &item_count, uint32 &max_id);
|
||||||
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
|
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
|
||||||
bool LoadItems(const std::string &prefix);
|
bool LoadItems(const std::string &prefix);
|
||||||
const EQEmu::ItemData* IterateItems(uint32* id);
|
const EQ::ItemData* IterateItems(uint32* id);
|
||||||
const EQEmu::ItemData* GetItem(uint32 id);
|
const EQ::ItemData* GetItem(uint32 id);
|
||||||
const EvolveInfo* GetEvolveInfo(uint32 loregroup);
|
const EvolveInfo* GetEvolveInfo(uint32 loregroup);
|
||||||
|
|
||||||
//faction lists
|
//faction lists
|
||||||
@ -136,8 +136,8 @@ class SharedDatabase : public Database
|
|||||||
|
|
||||||
void LoadSkillCaps(void *data);
|
void LoadSkillCaps(void *data);
|
||||||
bool LoadSkillCaps(const std::string &prefix);
|
bool LoadSkillCaps(const std::string &prefix);
|
||||||
uint16 GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
|
uint16 GetSkillCap(uint8 Class_, EQ::skills::SkillType Skill, uint8 Level);
|
||||||
uint8 GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
|
uint8 GetTrainLevel(uint8 Class_, EQ::skills::SkillType Skill, uint8 Level);
|
||||||
|
|
||||||
int GetMaxSpellID();
|
int GetMaxSpellID();
|
||||||
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
|
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
|
||||||
@ -151,17 +151,17 @@ class SharedDatabase : public Database
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> skill_caps_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> skill_caps_mmf;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> items_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> items_mmf;
|
||||||
std::unique_ptr<EQEmu::FixedMemoryHashSet<EQEmu::ItemData>> items_hash;
|
std::unique_ptr<EQ::FixedMemoryHashSet<EQ::ItemData>> items_hash;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> faction_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> faction_mmf;
|
||||||
std::unique_ptr<EQEmu::FixedMemoryHashSet<NPCFactionList>> faction_hash;
|
std::unique_ptr<EQ::FixedMemoryHashSet<NPCFactionList>> faction_hash;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> loot_table_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> loot_table_mmf;
|
||||||
std::unique_ptr<EQEmu::FixedMemoryVariableHashSet<LootTable_Struct>> loot_table_hash;
|
std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootTable_Struct>> loot_table_hash;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> loot_drop_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> loot_drop_mmf;
|
||||||
std::unique_ptr<EQEmu::FixedMemoryVariableHashSet<LootDrop_Struct>> loot_drop_hash;
|
std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootDrop_Struct>> loot_drop_hash;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> base_data_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> base_data_mmf;
|
||||||
std::unique_ptr<EQEmu::MemoryMappedFile> spells_mmf;
|
std::unique_ptr<EQ::MemoryMappedFile> spells_mmf;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*SHAREDDB_H_*/
|
#endif /*SHAREDDB_H_*/
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
bool EQEmu::skills::IsTradeskill(SkillType skill)
|
bool EQ::skills::IsTradeskill(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillFishing:
|
case SkillFishing:
|
||||||
@ -43,7 +43,7 @@ bool EQEmu::skills::IsTradeskill(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::skills::IsSpecializedSkill(SkillType skill)
|
bool EQ::skills::IsSpecializedSkill(SkillType skill)
|
||||||
{
|
{
|
||||||
// this could be a simple if, but if this is more portable if any IDs change (probably won't)
|
// this could be a simple if, but if this is more portable if any IDs change (probably won't)
|
||||||
// or any other specialized are added (also unlikely)
|
// or any other specialized are added (also unlikely)
|
||||||
@ -59,7 +59,7 @@ bool EQEmu::skills::IsSpecializedSkill(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float EQEmu::skills::GetSkillMeleePushForce(SkillType skill)
|
float EQ::skills::GetSkillMeleePushForce(SkillType skill)
|
||||||
{
|
{
|
||||||
// This is the force/magnitude of the push from an attack of this skill type
|
// This is the force/magnitude of the push from an attack of this skill type
|
||||||
// You can find these numbers in the clients skill struct
|
// You can find these numbers in the clients skill struct
|
||||||
@ -96,7 +96,7 @@ float EQEmu::skills::GetSkillMeleePushForce(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::skills::IsBardInstrumentSkill(SkillType skill)
|
bool EQ::skills::IsBardInstrumentSkill(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillBrassInstruments:
|
case SkillBrassInstruments:
|
||||||
@ -110,7 +110,7 @@ bool EQEmu::skills::IsBardInstrumentSkill(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::skills::IsCastingSkill(SkillType skill)
|
bool EQ::skills::IsCastingSkill(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillAbjuration:
|
case SkillAbjuration:
|
||||||
@ -124,7 +124,7 @@ bool EQEmu::skills::IsCastingSkill(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 EQEmu::skills::GetBaseDamage(SkillType skill)
|
int32 EQ::skills::GetBaseDamage(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillBash:
|
case SkillBash:
|
||||||
@ -148,7 +148,7 @@ int32 EQEmu::skills::GetBaseDamage(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::skills::IsMeleeDmg(SkillType skill)
|
bool EQ::skills::IsMeleeDmg(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case Skill1HBlunt:
|
case Skill1HBlunt:
|
||||||
@ -175,7 +175,7 @@ bool EQEmu::skills::IsMeleeDmg(SkillType skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<EQEmu::skills::SkillType, std::string>& EQEmu::skills::GetSkillTypeMap()
|
const std::map<EQ::skills::SkillType, std::string>& EQ::skills::GetSkillTypeMap()
|
||||||
{
|
{
|
||||||
/* VS2013 code
|
/* VS2013 code
|
||||||
static const std::map<SkillUseTypes, std::string> skill_use_types_map = {
|
static const std::map<SkillUseTypes, std::string> skill_use_types_map = {
|
||||||
@ -355,12 +355,12 @@ const std::map<EQEmu::skills::SkillType, std::string>& EQEmu::skills::GetSkillTy
|
|||||||
return skill_type_map;
|
return skill_type_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::SkillProfile::SkillProfile()
|
EQ::SkillProfile::SkillProfile()
|
||||||
{
|
{
|
||||||
memset(&Skill, 0, (sizeof(uint32) * PACKET_SKILL_ARRAY_SIZE));
|
memset(&Skill, 0, (sizeof(uint32) * PACKET_SKILL_ARRAY_SIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 EQEmu::SkillProfile::GetSkill(int skill_id)
|
uint32 EQ::SkillProfile::GetSkill(int skill_id)
|
||||||
{
|
{
|
||||||
if (skill_id < 0 || skill_id >= PACKET_SKILL_ARRAY_SIZE)
|
if (skill_id < 0 || skill_id >= PACKET_SKILL_ARRAY_SIZE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace skills {
|
namespace skills {
|
||||||
enum SkillType : int {
|
enum SkillType : int {
|
||||||
@ -287,7 +287,7 @@ namespace EQEmu
|
|||||||
|
|
||||||
uint32* GetSkills() { return reinterpret_cast<uint32*>(&Skill); }
|
uint32* GetSkills() { return reinterpret_cast<uint32*>(&Skill); }
|
||||||
|
|
||||||
skills::SkillType GetLastUseableSkill() { return EQEmu::skills::Skill2HPiercing; }
|
skills::SkillType GetLastUseableSkill() { return EQ::skills::Skill2HPiercing; }
|
||||||
|
|
||||||
size_t GetSkillsArraySize() { return PACKET_SKILL_ARRAY_SIZE; }
|
size_t GetSkillsArraySize() { return PACKET_SKILL_ARRAY_SIZE; }
|
||||||
uint32 GetSkill(int skill_id);
|
uint32 GetSkill(int skill_id);
|
||||||
|
|||||||
@ -748,7 +748,7 @@ struct SPDat_Spell_Struct
|
|||||||
/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects -- SPELLAFFECT1 ... SPELLAFFECT12
|
/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects -- SPELLAFFECT1 ... SPELLAFFECT12
|
||||||
/* 098 */ SpellTargetType targettype; // Spell's Target -- TYPENUMBER
|
/* 098 */ SpellTargetType targettype; // Spell's Target -- TYPENUMBER
|
||||||
/* 099 */ int basediff; // base difficulty fizzle adjustment -- BASEDIFFICULTY
|
/* 099 */ int basediff; // base difficulty fizzle adjustment -- BASEDIFFICULTY
|
||||||
/* 100 */ EQEmu::skills::SkillType skill; // -- CASTINGSKILL
|
/* 100 */ EQ::skills::SkillType skill; // -- CASTINGSKILL
|
||||||
/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any -- ZONETYPE
|
/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any -- ZONETYPE
|
||||||
/* 102 */ int8 EnvironmentType; // -- ENVIRONMENTTYPE
|
/* 102 */ int8 EnvironmentType; // -- ENVIRONMENTTYPE
|
||||||
/* 103 */ int8 TimeOfDay; // -- TIMEOFDAY
|
/* 103 */ int8 TimeOfDay; // -- TIMEOFDAY
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public:
|
|||||||
void Decode(EQApplicationPacket *p) const;
|
void Decode(EQApplicationPacket *p) const;
|
||||||
|
|
||||||
virtual std::string Describe() const = 0;
|
virtual std::string Describe() const = 0;
|
||||||
virtual const EQEmu::versions::ClientVersion ClientVersion() const = 0;
|
virtual const EQ::versions::ClientVersion ClientVersion() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//some common coders:
|
//some common coders:
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQ
|
||||||
{
|
{
|
||||||
namespace textures {
|
namespace textures {
|
||||||
enum : int8 { textureInvalid = -1, textureBegin };
|
enum : int8 { textureInvalid = -1, textureBegin };
|
||||||
|
|||||||
@ -195,7 +195,7 @@ public:
|
|||||||
void CreateEQEmuAccount(const std::string &in_account_name, const std::string &in_account_password, unsigned int loginserver_account_id);
|
void CreateEQEmuAccount(const std::string &in_account_name, const std::string &in_account_password, unsigned int loginserver_account_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EQEmu::Random random;
|
EQ::Random random;
|
||||||
std::shared_ptr<EQStreamInterface> connection;
|
std::shared_ptr<EQStreamInterface> connection;
|
||||||
LSClientVersion version;
|
LSClientVersion version;
|
||||||
LSClientStatus status;
|
LSClientStatus status;
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
#include "../common/eqemu_exception.h"
|
#include "../common/eqemu_exception.h"
|
||||||
|
|
||||||
void LoadBaseData(SharedDatabase *database, const std::string &prefix) {
|
void LoadBaseData(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("base_data");
|
EQ::IPCMutex mutex("base_data");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
int records = (database->GetMaxBaseDataLevel() + 1);
|
int records = (database->GetMaxBaseDataLevel() + 1);
|
||||||
if(records == 0) {
|
if(records == 0) {
|
||||||
@ -35,7 +35,7 @@ void LoadBaseData(SharedDatabase *database, const std::string &prefix) {
|
|||||||
|
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
|
||||||
EQEmu::MemoryMappedFile mmf(file_name, size);
|
EQ::MemoryMappedFile mmf(file_name, size);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
|
|
||||||
void *ptr = mmf.Get();
|
void *ptr = mmf.Get();
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include "../common/item_data.h"
|
#include "../common/item_data.h"
|
||||||
|
|
||||||
void LoadItems(SharedDatabase *database, const std::string &prefix) {
|
void LoadItems(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("items");
|
EQ::IPCMutex mutex("items");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
int32 items = -1;
|
int32 items = -1;
|
||||||
@ -35,11 +35,11 @@ void LoadItems(SharedDatabase *database, const std::string &prefix) {
|
|||||||
EQ_EXCEPT("Shared Memory", "Unable to get any items from the database.");
|
EQ_EXCEPT("Shared Memory", "Unable to get any items from the database.");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<EQEmu::ItemData>::estimated_size(items, max_item));
|
uint32 size = static_cast<uint32>(EQ::FixedMemoryHashSet<EQ::ItemData>::estimated_size(items, max_item));
|
||||||
|
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
|
||||||
EQEmu::MemoryMappedFile mmf(file_name, size);
|
EQ::MemoryMappedFile mmf(file_name, size);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
|
|
||||||
void *ptr = mmf.Get();
|
void *ptr = mmf.Get();
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#include "../common/loottable.h"
|
#include "../common/loottable.h"
|
||||||
|
|
||||||
void LoadLoot(SharedDatabase *database, const std::string &prefix) {
|
void LoadLoot(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("loot");
|
EQ::IPCMutex mutex("loot");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
uint32 loot_table_count, loot_table_max, loot_table_entries_count;
|
uint32 loot_table_count, loot_table_max, loot_table_entries_count;
|
||||||
@ -48,15 +48,15 @@ void LoadLoot(SharedDatabase *database, const std::string &prefix) {
|
|||||||
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
|
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
|
||||||
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");
|
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");
|
||||||
|
|
||||||
EQEmu::MemoryMappedFile mmf_loot_table(file_name_lt, loot_table_size);
|
EQ::MemoryMappedFile mmf_loot_table(file_name_lt, loot_table_size);
|
||||||
EQEmu::MemoryMappedFile mmf_loot_drop(file_name_ld, loot_drop_size);
|
EQ::MemoryMappedFile mmf_loot_drop(file_name_ld, loot_drop_size);
|
||||||
mmf_loot_table.ZeroFile();
|
mmf_loot_table.ZeroFile();
|
||||||
mmf_loot_drop.ZeroFile();
|
mmf_loot_drop.ZeroFile();
|
||||||
|
|
||||||
EQEmu::FixedMemoryVariableHashSet<LootTable_Struct> loot_table_hash(reinterpret_cast<byte*>(mmf_loot_table.Get()),
|
EQ::FixedMemoryVariableHashSet<LootTable_Struct> loot_table_hash(reinterpret_cast<byte*>(mmf_loot_table.Get()),
|
||||||
loot_table_size, loot_table_max);
|
loot_table_size, loot_table_max);
|
||||||
|
|
||||||
EQEmu::FixedMemoryVariableHashSet<LootDrop_Struct> loot_drop_hash(reinterpret_cast<byte*>(mmf_loot_drop.Get()),
|
EQ::FixedMemoryVariableHashSet<LootDrop_Struct> loot_drop_hash(reinterpret_cast<byte*>(mmf_loot_drop.Get()),
|
||||||
loot_drop_size, loot_drop_max);
|
loot_drop_size, loot_drop_max);
|
||||||
|
|
||||||
database->LoadLootTables(mmf_loot_table.Get(), loot_table_max);
|
database->LoadLootTables(mmf_loot_table.Get(), loot_table_max);
|
||||||
|
|||||||
@ -25,18 +25,18 @@
|
|||||||
#include "../common/faction.h"
|
#include "../common/faction.h"
|
||||||
|
|
||||||
void LoadFactions(SharedDatabase *database, const std::string &prefix) {
|
void LoadFactions(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("faction");
|
EQ::IPCMutex mutex("faction");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
uint32 lists = 0;
|
uint32 lists = 0;
|
||||||
uint32 max_list = 0;
|
uint32 max_list = 0;
|
||||||
database->GetFactionListInfo(lists, max_list);
|
database->GetFactionListInfo(lists, max_list);
|
||||||
|
|
||||||
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<NPCFactionList>::estimated_size(lists, max_list));
|
uint32 size = static_cast<uint32>(EQ::FixedMemoryHashSet<NPCFactionList>::estimated_size(lists, max_list));
|
||||||
|
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
|
||||||
EQEmu::MemoryMappedFile mmf(file_name, size);
|
EQ::MemoryMappedFile mmf(file_name, size);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
|
|
||||||
void *ptr = mmf.Get();
|
void *ptr = mmf.Get();
|
||||||
|
|||||||
@ -26,17 +26,17 @@
|
|||||||
#include "../common/features.h"
|
#include "../common/features.h"
|
||||||
|
|
||||||
void LoadSkillCaps(SharedDatabase *database, const std::string &prefix) {
|
void LoadSkillCaps(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("skill_caps");
|
EQ::IPCMutex mutex("skill_caps");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
uint32 skill_count = EQ::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
||||||
|
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
|
||||||
EQEmu::MemoryMappedFile mmf(file_name, size);
|
EQ::MemoryMappedFile mmf(file_name, size);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
|
|
||||||
void *ptr = mmf.Get();
|
void *ptr = mmf.Get();
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include "../common/spdat.h"
|
#include "../common/spdat.h"
|
||||||
|
|
||||||
void LoadSpells(SharedDatabase *database, const std::string &prefix) {
|
void LoadSpells(SharedDatabase *database, const std::string &prefix) {
|
||||||
EQEmu::IPCMutex mutex("spells");
|
EQ::IPCMutex mutex("spells");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
int records = database->GetMaxSpellID() + 1;
|
int records = database->GetMaxSpellID() + 1;
|
||||||
if(records == 0) {
|
if(records == 0) {
|
||||||
@ -36,7 +36,7 @@ void LoadSpells(SharedDatabase *database, const std::string &prefix) {
|
|||||||
|
|
||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
|
std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
|
||||||
EQEmu::MemoryMappedFile mmf(file_name, size);
|
EQ::MemoryMappedFile mmf(file_name, size);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
|
|
||||||
void *ptr = mmf.Get();
|
void *ptr = mmf.Get();
|
||||||
|
|||||||
@ -40,13 +40,13 @@ public:
|
|||||||
float value_f = 500.0f;
|
float value_f = 500.0f;
|
||||||
int value_i = 500;
|
int value_i = 500;
|
||||||
|
|
||||||
float vf1 = EQEmu::Clamp(value_f, 0.0f, 1000.0f);
|
float vf1 = EQ::Clamp(value_f, 0.0f, 1000.0f);
|
||||||
float vf2 = EQEmu::Clamp(value_f, 0.0f, 250.0f);
|
float vf2 = EQ::Clamp(value_f, 0.0f, 250.0f);
|
||||||
float vf3 = EQEmu::Clamp(value_f, 750.0f, 1000.0f);
|
float vf3 = EQ::Clamp(value_f, 750.0f, 1000.0f);
|
||||||
|
|
||||||
int vi1 = EQEmu::Clamp(value_i, 0, 1000);
|
int vi1 = EQ::Clamp(value_i, 0, 1000);
|
||||||
int vi2 = EQEmu::Clamp(value_i, 0, 250);
|
int vi2 = EQ::Clamp(value_i, 0, 250);
|
||||||
int vi3 = EQEmu::Clamp(value_i, 750, 1000);
|
int vi3 = EQ::Clamp(value_i, 750, 1000);
|
||||||
|
|
||||||
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
||||||
TEST_ASSERT_EQUALS(vf2, 250.0f);
|
TEST_ASSERT_EQUALS(vf2, 250.0f);
|
||||||
@ -61,11 +61,11 @@ public:
|
|||||||
float value_f = 500.0f;
|
float value_f = 500.0f;
|
||||||
int value_i = 500;
|
int value_i = 500;
|
||||||
|
|
||||||
float vf1 = EQEmu::ClampUpper(value_f, 1000.0f);
|
float vf1 = EQ::ClampUpper(value_f, 1000.0f);
|
||||||
float vf2 = EQEmu::ClampUpper(value_f, 250.0f);
|
float vf2 = EQ::ClampUpper(value_f, 250.0f);
|
||||||
|
|
||||||
int vi1 = EQEmu::ClampUpper(value_i, 1000);
|
int vi1 = EQ::ClampUpper(value_i, 1000);
|
||||||
int vi2 = EQEmu::ClampUpper(value_i, 250);
|
int vi2 = EQ::ClampUpper(value_i, 250);
|
||||||
|
|
||||||
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
||||||
TEST_ASSERT_EQUALS(vf2, 250.0f);
|
TEST_ASSERT_EQUALS(vf2, 250.0f);
|
||||||
@ -78,11 +78,11 @@ public:
|
|||||||
float value_f = 500.0f;
|
float value_f = 500.0f;
|
||||||
int value_i = 500;
|
int value_i = 500;
|
||||||
|
|
||||||
float vf1 = EQEmu::ClampLower(value_f, 0.0f);
|
float vf1 = EQ::ClampLower(value_f, 0.0f);
|
||||||
float vf2 = EQEmu::ClampLower(value_f, 750.0f);
|
float vf2 = EQ::ClampLower(value_f, 750.0f);
|
||||||
|
|
||||||
int vi1 = EQEmu::ClampLower(value_i, 0);
|
int vi1 = EQ::ClampLower(value_i, 0);
|
||||||
int vi2 = EQEmu::ClampLower(value_i, 750);
|
int vi2 = EQ::ClampLower(value_i, 750);
|
||||||
|
|
||||||
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
TEST_ASSERT_EQUALS(vf1, 500.0f);
|
||||||
TEST_ASSERT_EQUALS(vf2, 750.0f);
|
TEST_ASSERT_EQUALS(vf2, 750.0f);
|
||||||
@ -95,13 +95,13 @@ public:
|
|||||||
float value_f = 500.0f;
|
float value_f = 500.0f;
|
||||||
int value_i = 500;
|
int value_i = 500;
|
||||||
|
|
||||||
TEST_ASSERT(EQEmu::ValueWithin(value_f, 0.0f, 1000.0f));
|
TEST_ASSERT(EQ::ValueWithin(value_f, 0.0f, 1000.0f));
|
||||||
TEST_ASSERT(!EQEmu::ValueWithin(value_f, 0.0f, 400.0f));
|
TEST_ASSERT(!EQ::ValueWithin(value_f, 0.0f, 400.0f));
|
||||||
TEST_ASSERT(!EQEmu::ValueWithin(value_f, 600.0f, 900.0f));
|
TEST_ASSERT(!EQ::ValueWithin(value_f, 600.0f, 900.0f));
|
||||||
|
|
||||||
TEST_ASSERT(EQEmu::ValueWithin(value_i, 0, 1000));
|
TEST_ASSERT(EQ::ValueWithin(value_i, 0, 1000));
|
||||||
TEST_ASSERT(!EQEmu::ValueWithin(value_i, 0, 400));
|
TEST_ASSERT(!EQ::ValueWithin(value_i, 0, 400));
|
||||||
TEST_ASSERT(!EQEmu::ValueWithin(value_i, 600, 900));
|
TEST_ASSERT(!EQ::ValueWithin(value_i, 600, 900));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class FixedMemoryHashTest : public Test::Suite {
|
|||||||
typedef void(FixedMemoryHashTest::*TestFunction)(void);
|
typedef void(FixedMemoryHashTest::*TestFunction)(void);
|
||||||
public:
|
public:
|
||||||
FixedMemoryHashTest() {
|
FixedMemoryHashTest() {
|
||||||
size_ = EQEmu::FixedMemoryHashSet<EQEmu::ItemData>::estimated_size(72000, 190000);
|
size_ = EQ::FixedMemoryHashSet<EQ::ItemData>::estimated_size(72000, 190000);
|
||||||
data_ = new uint8[size_];
|
data_ = new uint8[size_];
|
||||||
memset(data_, 0, size_);
|
memset(data_, 0, size_);
|
||||||
TEST_ADD(FixedMemoryHashTest::InitTest);
|
TEST_ADD(FixedMemoryHashTest::InitTest);
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void InitTest() {
|
void InitTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_, 72000, 190000);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_, 72000, 190000);
|
||||||
TEST_ASSERT(!hash.exists(1001));
|
TEST_ASSERT(!hash.exists(1001));
|
||||||
TEST_ASSERT(hash.size() == 0);
|
TEST_ASSERT(hash.size() == 0);
|
||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
@ -57,7 +57,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoadTest() {
|
void LoadTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(!hash.exists(1001));
|
TEST_ASSERT(!hash.exists(1001));
|
||||||
TEST_ASSERT(hash.size() == 0);
|
TEST_ASSERT(hash.size() == 0);
|
||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
@ -65,8 +65,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsertTest() {
|
void InsertTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
strcpy(item.Name, "Iron Sword");
|
strcpy(item.Name, "Iron Sword");
|
||||||
item.ID = 1001;
|
item.ID = 1001;
|
||||||
@ -79,20 +79,20 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveTest() {
|
void RetrieveTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(1001));
|
TEST_ASSERT(hash.exists(1001));
|
||||||
TEST_ASSERT(hash.size() == 1);
|
TEST_ASSERT(hash.size() == 1);
|
||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
TEST_ASSERT(!hash.empty());
|
TEST_ASSERT(!hash.empty());
|
||||||
|
|
||||||
EQEmu::ItemData item = hash[1001];
|
EQ::ItemData item = hash[1001];
|
||||||
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
||||||
TEST_ASSERT(item.ID == 1001);
|
TEST_ASSERT(item.ID == 1001);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverwriteTest() {
|
void OverwriteTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
strcpy(item.Name, "Steel Sword");
|
strcpy(item.Name, "Steel Sword");
|
||||||
item.ID = 1001;
|
item.ID = 1001;
|
||||||
@ -105,20 +105,20 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OverwriteRetrieveTest() {
|
void OverwriteRetrieveTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(1001));
|
TEST_ASSERT(hash.exists(1001));
|
||||||
TEST_ASSERT(hash.size() == 1);
|
TEST_ASSERT(hash.size() == 1);
|
||||||
TEST_ASSERT((hash.max_size() == 72000));
|
TEST_ASSERT((hash.max_size() == 72000));
|
||||||
TEST_ASSERT(!hash.empty());
|
TEST_ASSERT(!hash.empty());
|
||||||
|
|
||||||
EQEmu::ItemData item = hash[1001];
|
EQ::ItemData item = hash[1001];
|
||||||
TEST_ASSERT(strcmp(item.Name, "Steel Sword") == 0);
|
TEST_ASSERT(strcmp(item.Name, "Steel Sword") == 0);
|
||||||
TEST_ASSERT(item.ID == 1001);
|
TEST_ASSERT(item.ID == 1001);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertAgainTest() {
|
void InsertAgainTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
strcpy(item.Name, "Iron Sword");
|
strcpy(item.Name, "Iron Sword");
|
||||||
item.ID = 1000;
|
item.ID = 1000;
|
||||||
@ -132,14 +132,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveAgainTest() {
|
void RetrieveAgainTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(1000));
|
TEST_ASSERT(hash.exists(1000));
|
||||||
TEST_ASSERT(hash.exists(1001));
|
TEST_ASSERT(hash.exists(1001));
|
||||||
TEST_ASSERT(hash.size() == 2);
|
TEST_ASSERT(hash.size() == 2);
|
||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
TEST_ASSERT(!hash.empty());
|
TEST_ASSERT(!hash.empty());
|
||||||
|
|
||||||
EQEmu::ItemData item = hash[1000];
|
EQ::ItemData item = hash[1000];
|
||||||
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
||||||
TEST_ASSERT(item.ID == 1000);
|
TEST_ASSERT(item.ID == 1000);
|
||||||
|
|
||||||
@ -149,8 +149,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsertBeginTest() {
|
void InsertBeginTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
strcpy(item.Name, "Bronze Sword");
|
strcpy(item.Name, "Bronze Sword");
|
||||||
item.ID = 0;
|
item.ID = 0;
|
||||||
@ -165,7 +165,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveBeginTest() {
|
void RetrieveBeginTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(1000));
|
TEST_ASSERT(hash.exists(1000));
|
||||||
TEST_ASSERT(hash.exists(1001));
|
TEST_ASSERT(hash.exists(1001));
|
||||||
TEST_ASSERT(hash.exists(0));
|
TEST_ASSERT(hash.exists(0));
|
||||||
@ -173,7 +173,7 @@ public:
|
|||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
TEST_ASSERT(!hash.empty());
|
TEST_ASSERT(!hash.empty());
|
||||||
|
|
||||||
EQEmu::ItemData item = hash[1000];
|
EQ::ItemData item = hash[1000];
|
||||||
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
||||||
TEST_ASSERT(item.ID == 1000);
|
TEST_ASSERT(item.ID == 1000);
|
||||||
|
|
||||||
@ -187,8 +187,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsertEndTest() {
|
void InsertEndTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
EQEmu::ItemData item;
|
EQ::ItemData item;
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
strcpy(item.Name, "Jade Sword");
|
strcpy(item.Name, "Jade Sword");
|
||||||
item.ID = 190000;
|
item.ID = 190000;
|
||||||
@ -204,7 +204,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveEndTest() {
|
void RetrieveEndTest() {
|
||||||
EQEmu::FixedMemoryHashSet<EQEmu::ItemData> hash(data_, size_);
|
EQ::FixedMemoryHashSet<EQ::ItemData> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(1000));
|
TEST_ASSERT(hash.exists(1000));
|
||||||
TEST_ASSERT(hash.exists(1001));
|
TEST_ASSERT(hash.exists(1001));
|
||||||
TEST_ASSERT(hash.exists(0));
|
TEST_ASSERT(hash.exists(0));
|
||||||
@ -213,7 +213,7 @@ public:
|
|||||||
TEST_ASSERT(hash.max_size() == 72000);
|
TEST_ASSERT(hash.max_size() == 72000);
|
||||||
TEST_ASSERT(!hash.empty());
|
TEST_ASSERT(!hash.empty());
|
||||||
|
|
||||||
EQEmu::ItemData item = hash[1000];
|
EQ::ItemData item = hash[1000];
|
||||||
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
|
||||||
TEST_ASSERT(item.ID == 1000);
|
TEST_ASSERT(item.ID == 1000);
|
||||||
|
|
||||||
|
|||||||
@ -48,19 +48,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void InitTest() {
|
void InitTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_, 501);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_, 501);
|
||||||
TEST_ASSERT(!hash.exists(0));
|
TEST_ASSERT(!hash.exists(0));
|
||||||
TEST_ASSERT(!hash.exists(501));
|
TEST_ASSERT(!hash.exists(501));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadTest() {
|
void LoadTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
TEST_ASSERT(!hash.exists(0));
|
TEST_ASSERT(!hash.exists(0));
|
||||||
TEST_ASSERT(!hash.exists(501));
|
TEST_ASSERT(!hash.exists(501));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertTest() {
|
void InsertTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
test_struct test;
|
test_struct test;
|
||||||
memset(&test, 0, sizeof(test));
|
memset(&test, 0, sizeof(test));
|
||||||
strcpy(test.name, "Bill D.");
|
strcpy(test.name, "Bill D.");
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveTest() {
|
void RetrieveTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(0));
|
TEST_ASSERT(hash.exists(0));
|
||||||
TEST_ASSERT(!hash.exists(501));
|
TEST_ASSERT(!hash.exists(501));
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsertAgainTest() {
|
void InsertAgainTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
test_struct test;
|
test_struct test;
|
||||||
memset(&test, 0, sizeof(test));
|
memset(&test, 0, sizeof(test));
|
||||||
strcpy(test.name, "Jimmy P.");
|
strcpy(test.name, "Jimmy P.");
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveAgainTest() {
|
void RetrieveAgainTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(0));
|
TEST_ASSERT(hash.exists(0));
|
||||||
TEST_ASSERT(hash.exists(501));
|
TEST_ASSERT(hash.exists(501));
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsertAgainFailTest() {
|
void InsertAgainFailTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
test_struct test;
|
test_struct test;
|
||||||
memset(&test, 0, sizeof(test));
|
memset(&test, 0, sizeof(test));
|
||||||
strcpy(test.name, "Tommy M.");
|
strcpy(test.name, "Tommy M.");
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RetrieveAgainFailTest() {
|
void RetrieveAgainFailTest() {
|
||||||
EQEmu::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
EQ::FixedMemoryVariableHashSet<test_struct> hash(data_, size_);
|
||||||
TEST_ASSERT(hash.exists(0));
|
TEST_ASSERT(hash.exists(0));
|
||||||
TEST_ASSERT(hash.exists(501));
|
TEST_ASSERT(hash.exists(501));
|
||||||
TEST_ASSERT(!hash.exists(500));
|
TEST_ASSERT(!hash.exists(500));
|
||||||
|
|||||||
@ -40,24 +40,24 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void LockMutexTest() {
|
void LockMutexTest() {
|
||||||
EQEmu::IPCMutex mutex("TestMutex1");
|
EQ::IPCMutex mutex("TestMutex1");
|
||||||
TEST_ASSERT(mutex.Lock());
|
TEST_ASSERT(mutex.Lock());
|
||||||
TEST_ASSERT(mutex.Unlock());
|
TEST_ASSERT(mutex.Unlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnlockMutexTest() {
|
void UnlockMutexTest() {
|
||||||
EQEmu::IPCMutex mutex("TestMutex2");
|
EQ::IPCMutex mutex("TestMutex2");
|
||||||
TEST_ASSERT(!mutex.Unlock());
|
TEST_ASSERT(!mutex.Unlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoubleLockMutexTest() {
|
void DoubleLockMutexTest() {
|
||||||
EQEmu::IPCMutex mutex("TestMutex3");
|
EQ::IPCMutex mutex("TestMutex3");
|
||||||
TEST_ASSERT(mutex.Lock());
|
TEST_ASSERT(mutex.Lock());
|
||||||
TEST_ASSERT(!mutex.Lock());
|
TEST_ASSERT(!mutex.Lock());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoubleUnlockMutexTest() {
|
void DoubleUnlockMutexTest() {
|
||||||
EQEmu::IPCMutex mutex("TestMutex4");
|
EQ::IPCMutex mutex("TestMutex4");
|
||||||
TEST_ASSERT(mutex.Lock());
|
TEST_ASSERT(mutex.Lock());
|
||||||
TEST_ASSERT(mutex.Unlock());
|
TEST_ASSERT(mutex.Unlock());
|
||||||
TEST_ASSERT(!mutex.Unlock());
|
TEST_ASSERT(!mutex.Unlock());
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadAndZeroMMF() {
|
void LoadAndZeroMMF() {
|
||||||
EQEmu::MemoryMappedFile mmf("testfile.txt", 512);
|
EQ::MemoryMappedFile mmf("testfile.txt", 512);
|
||||||
mmf.ZeroFile();
|
mmf.ZeroFile();
|
||||||
TEST_ASSERT(mmf.Size() == 512);
|
TEST_ASSERT(mmf.Size() == 512);
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoadExistingMMF() {
|
void LoadExistingMMF() {
|
||||||
EQEmu::MemoryMappedFile mmf("testfile.txt");
|
EQ::MemoryMappedFile mmf("testfile.txt");
|
||||||
TEST_ASSERT(mmf.Size() == 512);
|
TEST_ASSERT(mmf.Size() == 512);
|
||||||
|
|
||||||
unsigned char *data = reinterpret_cast<unsigned char*>(mmf.Get());
|
unsigned char *data = reinterpret_cast<unsigned char*>(mmf.Get());
|
||||||
|
|||||||
@ -35,13 +35,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void IsTradeskill() {
|
void IsTradeskill() {
|
||||||
TEST_ASSERT(EQEmu::skills::IsTradeskill(EQEmu::skills::SkillPottery));
|
TEST_ASSERT(EQ::skills::IsTradeskill(EQ::skills::SkillPottery));
|
||||||
TEST_ASSERT(!EQEmu::skills::IsTradeskill(EQEmu::skills::SkillParry));
|
TEST_ASSERT(!EQ::skills::IsTradeskill(EQ::skills::SkillParry));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IsSpecializedSkill() {
|
void IsSpecializedSkill() {
|
||||||
TEST_ASSERT(EQEmu::skills::IsSpecializedSkill(EQEmu::skills::SkillSpecializeConjuration));
|
TEST_ASSERT(EQ::skills::IsSpecializedSkill(EQ::skills::SkillSpecializeConjuration));
|
||||||
TEST_ASSERT(!EQEmu::skills::IsSpecializedSkill(EQEmu::skills::SkillConjuration))
|
TEST_ASSERT(!EQ::skills::IsSpecializedSkill(EQ::skills::SkillConjuration))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -393,7 +393,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
|
|||||||
|
|
||||||
if(!Sender) return;
|
if(!Sender) return;
|
||||||
|
|
||||||
std::string cv_messages[EQEmu::versions::ClientVersionCount];
|
std::string cv_messages[EQ::versions::ClientVersionCount];
|
||||||
|
|
||||||
ChatMessagesSent++;
|
ChatMessagesSent++;
|
||||||
|
|
||||||
@ -412,18 +412,18 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
|
|||||||
|
|
||||||
if (cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())].length() == 0) {
|
if (cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())].length() == 0) {
|
||||||
switch (ChannelClient->GetClientVersion()) {
|
switch (ChannelClient->GetClientVersion()) {
|
||||||
case EQEmu::versions::ClientVersion::Titanium:
|
case EQ::versions::ClientVersion::Titanium:
|
||||||
ServerToClient45SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
ServerToClient45SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::SoF:
|
case EQ::versions::ClientVersion::SoF:
|
||||||
case EQEmu::versions::ClientVersion::SoD:
|
case EQ::versions::ClientVersion::SoD:
|
||||||
case EQEmu::versions::ClientVersion::UF:
|
case EQ::versions::ClientVersion::UF:
|
||||||
ServerToClient50SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
ServerToClient50SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::RoF:
|
case EQ::versions::ClientVersion::RoF:
|
||||||
ServerToClient55SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
ServerToClient55SayLink(cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())], Message);
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::RoF2:
|
case EQ::versions::ClientVersion::RoF2:
|
||||||
default:
|
default:
|
||||||
cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())] = Message;
|
cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())] = Message;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -523,7 +523,7 @@ Client::Client(std::shared_ptr<EQStreamInterface> eqs) {
|
|||||||
GlobalChatLimiterTimer = new Timer(RuleI(Chat, IntervalDurationMS));
|
GlobalChatLimiterTimer = new Timer(RuleI(Chat, IntervalDurationMS));
|
||||||
|
|
||||||
TypeOfConnection = ConnectionTypeUnknown;
|
TypeOfConnection = ConnectionTypeUnknown;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::Unknown;
|
ClientVersion_ = EQ::versions::ClientVersion::Unknown;
|
||||||
|
|
||||||
UnderfootOrLater = false;
|
UnderfootOrLater = false;
|
||||||
}
|
}
|
||||||
@ -2163,54 +2163,54 @@ void Client::SetConnectionType(char c) {
|
|||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case EQEmu::versions::ucsTitaniumChat:
|
case EQ::versions::ucsTitaniumChat:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeChat;
|
TypeOfConnection = ConnectionTypeChat;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::Titanium;
|
ClientVersion_ = EQ::versions::ClientVersion::Titanium;
|
||||||
LogInfo("Connection type is Chat (Titanium)");
|
LogInfo("Connection type is Chat (Titanium)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsTitaniumMail:
|
case EQ::versions::ucsTitaniumMail:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeMail;
|
TypeOfConnection = ConnectionTypeMail;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::Titanium;
|
ClientVersion_ = EQ::versions::ClientVersion::Titanium;
|
||||||
LogInfo("Connection type is Mail (Titanium)");
|
LogInfo("Connection type is Mail (Titanium)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsSoFCombined:
|
case EQ::versions::ucsSoFCombined:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::SoF;
|
ClientVersion_ = EQ::versions::ClientVersion::SoF;
|
||||||
LogInfo("Connection type is Combined (SoF)");
|
LogInfo("Connection type is Combined (SoF)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsSoDCombined:
|
case EQ::versions::ucsSoDCombined:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::SoD;
|
ClientVersion_ = EQ::versions::ClientVersion::SoD;
|
||||||
LogInfo("Connection type is Combined (SoD)");
|
LogInfo("Connection type is Combined (SoD)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsUFCombined:
|
case EQ::versions::ucsUFCombined:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::UF;
|
ClientVersion_ = EQ::versions::ClientVersion::UF;
|
||||||
UnderfootOrLater = true;
|
UnderfootOrLater = true;
|
||||||
LogInfo("Connection type is Combined (Underfoot)");
|
LogInfo("Connection type is Combined (Underfoot)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsRoFCombined:
|
case EQ::versions::ucsRoFCombined:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::RoF;
|
ClientVersion_ = EQ::versions::ClientVersion::RoF;
|
||||||
UnderfootOrLater = true;
|
UnderfootOrLater = true;
|
||||||
LogInfo("Connection type is Combined (RoF)");
|
LogInfo("Connection type is Combined (RoF)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EQEmu::versions::ucsRoF2Combined:
|
case EQ::versions::ucsRoF2Combined:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::RoF2;
|
ClientVersion_ = EQ::versions::ClientVersion::RoF2;
|
||||||
UnderfootOrLater = true;
|
UnderfootOrLater = true;
|
||||||
LogInfo("Connection type is Combined (RoF2)");
|
LogInfo("Connection type is Combined (RoF2)");
|
||||||
break;
|
break;
|
||||||
@ -2218,7 +2218,7 @@ void Client::SetConnectionType(char c) {
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeUnknown;
|
TypeOfConnection = ConnectionTypeUnknown;
|
||||||
ClientVersion_ = EQEmu::versions::ClientVersion::Unknown;
|
ClientVersion_ = EQ::versions::ClientVersion::Unknown;
|
||||||
LogInfo("Connection type is unknown");
|
LogInfo("Connection type is unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,7 +142,7 @@ public:
|
|||||||
|
|
||||||
void SetConnectionType(char c);
|
void SetConnectionType(char c);
|
||||||
ConnectionType GetConnectionType() { return TypeOfConnection; }
|
ConnectionType GetConnectionType() { return TypeOfConnection; }
|
||||||
EQEmu::versions::ClientVersion GetClientVersion() { return ClientVersion_; }
|
EQ::versions::ClientVersion GetClientVersion() { return ClientVersion_; }
|
||||||
|
|
||||||
inline bool IsMailConnection() { return (TypeOfConnection == ConnectionTypeMail) || (TypeOfConnection == ConnectionTypeCombined); }
|
inline bool IsMailConnection() { return (TypeOfConnection == ConnectionTypeMail) || (TypeOfConnection == ConnectionTypeCombined); }
|
||||||
void SendNotification(int MailBoxNumber, std::string From, std::string Subject, int MessageID);
|
void SendNotification(int MailBoxNumber, std::string From, std::string Subject, int MessageID);
|
||||||
@ -173,7 +173,7 @@ private:
|
|||||||
bool ForceDisconnect;
|
bool ForceDisconnect;
|
||||||
|
|
||||||
ConnectionType TypeOfConnection;
|
ConnectionType TypeOfConnection;
|
||||||
EQEmu::versions::ClientVersion ClientVersion_;
|
EQ::versions::ClientVersion ClientVersion_;
|
||||||
bool UnderfootOrLater;
|
bool UnderfootOrLater;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmu::InitializeDynamicLookups();
|
EQ::InitializeDynamicLookups();
|
||||||
LogInfo("Initialized dynamic dictionary entries");
|
LogInfo("Initialized dynamic dictionary entries");
|
||||||
|
|
||||||
database.ExpireMail();
|
database.ExpireMail();
|
||||||
|
|||||||
@ -101,18 +101,18 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
|||||||
{
|
{
|
||||||
std::string new_message;
|
std::string new_message;
|
||||||
switch (c->GetClientVersion()) {
|
switch (c->GetClientVersion()) {
|
||||||
case EQEmu::versions::ClientVersion::Titanium:
|
case EQ::versions::ClientVersion::Titanium:
|
||||||
Client45ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
Client45ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::SoF:
|
case EQ::versions::ClientVersion::SoF:
|
||||||
case EQEmu::versions::ClientVersion::SoD:
|
case EQ::versions::ClientVersion::SoD:
|
||||||
case EQEmu::versions::ClientVersion::UF:
|
case EQ::versions::ClientVersion::UF:
|
||||||
Client50ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
Client50ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::RoF:
|
case EQ::versions::ClientVersion::RoF:
|
||||||
Client55ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
Client55ToServerSayLink(new_message, Message.substr(1, std::string::npos));
|
||||||
break;
|
break;
|
||||||
case EQEmu::versions::ClientVersion::RoF2:
|
case EQ::versions::ClientVersion::RoF2:
|
||||||
default:
|
default:
|
||||||
new_message = Message.substr(1, std::string::npos);
|
new_message = Message.substr(1, std::string::npos);
|
||||||
break;
|
break;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user