Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work

This commit is contained in:
Uleat
2016-04-19 04:02:53 -04:00
parent 53c7abf16e
commit 8edb6e9595
65 changed files with 1196 additions and 1186 deletions
+6 -6
View File
@@ -708,7 +708,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
/* Insert starting inventory... */
std::string invquery;
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END;) {
for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::BANK_BAGS_END;) {
const ItemInst* newinv = inv->GetItem(i);
if (newinv) {
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
@@ -718,15 +718,15 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
}
if (i == SlotCursor) {
i = EQEmu::Constants::GENERAL_BAGS_BEGIN;
i = EQEmu::constants::GENERAL_BAGS_BEGIN;
continue;
}
else if (i == EQEmu::Constants::CURSOR_BAG_END) {
i = EQEmu::Constants::BANK_BEGIN;
else if (i == EQEmu::constants::CURSOR_BAG_END) {
i = EQEmu::constants::BANK_BEGIN;
continue;
}
else if (i == EQEmu::Constants::BANK_END) {
i = EQEmu::Constants::BANK_BAGS_BEGIN;
else if (i == EQEmu::constants::BANK_END) {
i = EQEmu::constants::BANK_BAGS_BEGIN;
continue;
}
i++;
+2 -2
View File
@@ -330,7 +330,7 @@ namespace Convert {
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE];
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE];
/*7264*/ Convert::Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1428,7 +1428,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Tribute Convert */
first_entry = 0; rquery = "";
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){
for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
+38 -38
View File
@@ -20,92 +20,92 @@
#include "deity.h"
EQEmu::Deity::TypeBits EQEmu::Deity::ConvertDeityToDeityBit(Types deity)
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityToDeityBit(DeityType deity)
{
switch (deity) {
case DeityBertoxxulous:
return BIT_DeityBertoxxulous;
return bit_DeityBertoxxulous;
case DeityBrellSirilis:
return BIT_DeityBrellSirilis;
return bit_DeityBrellSirilis;
case DeityCazicThule:
return BIT_DeityCazicThule;
return bit_DeityCazicThule;
case DeityErollisiMarr:
return BIT_DeityErollisiMarr;
return bit_DeityErollisiMarr;
case DeityBristlebane:
return BIT_DeityBristlebane;
return bit_DeityBristlebane;
case DeityInnoruuk:
return BIT_DeityInnoruuk;
return bit_DeityInnoruuk;
case DeityKarana:
return BIT_DeityKarana;
return bit_DeityKarana;
case DeityMithanielMarr:
return BIT_DeityMithanielMarr;
return bit_DeityMithanielMarr;
case DeityPrexus:
return BIT_DeityPrexus;
return bit_DeityPrexus;
case DeityQuellious:
return BIT_DeityQuellious;
return bit_DeityQuellious;
case DeityRallosZek:
return BIT_DeityRallosZek;
return bit_DeityRallosZek;
case DeityRodcetNife:
return BIT_DeityRodcetNife;
return bit_DeityRodcetNife;
case DeitySolusekRo:
return BIT_DeitySolusekRo;
return bit_DeitySolusekRo;
case DeityTheTribunal:
return BIT_DeityTheTribunal;
return bit_DeityTheTribunal;
case DeityTunare:
return BIT_DeityTunare;
return bit_DeityTunare;
case DeityVeeshan:
return BIT_DeityVeeshan;
return bit_DeityVeeshan;
case DeityAgnostic_LB:
case DeityAgnostic:
return BIT_DeityAgnostic;
return bit_DeityAgnostic;
default:
return BIT_DeityAll;
return bit_DeityAll;
};
}
EQEmu::Deity::Types EQEmu::Deity::ConvertDeityBitToDeity(TypeBits deity_bit)
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityBitToDeity(DeityTypeBit deity_bit)
{
switch (deity_bit) {
case BIT_DeityAgnostic:
case bit_DeityAgnostic:
return DeityAgnostic;
case BIT_DeityBertoxxulous:
case bit_DeityBertoxxulous:
return DeityBertoxxulous;
case BIT_DeityBrellSirilis:
case bit_DeityBrellSirilis:
return DeityBrellSirilis;
case BIT_DeityCazicThule:
case bit_DeityCazicThule:
return DeityCazicThule;
case BIT_DeityErollisiMarr:
case bit_DeityErollisiMarr:
return DeityErollisiMarr;
case BIT_DeityBristlebane:
case bit_DeityBristlebane:
return DeityBristlebane;
case BIT_DeityInnoruuk:
case bit_DeityInnoruuk:
return DeityInnoruuk;
case BIT_DeityKarana:
case bit_DeityKarana:
return DeityKarana;
case BIT_DeityMithanielMarr:
case bit_DeityMithanielMarr:
return DeityMithanielMarr;
case BIT_DeityPrexus:
case bit_DeityPrexus:
return DeityPrexus;
case BIT_DeityQuellious:
case bit_DeityQuellious:
return DeityQuellious;
case BIT_DeityRallosZek:
case bit_DeityRallosZek:
return DeityRallosZek;
case BIT_DeityRodcetNife:
case bit_DeityRodcetNife:
return DeityRodcetNife;
case BIT_DeitySolusekRo:
case bit_DeitySolusekRo:
return DeitySolusekRo;
case BIT_DeityTheTribunal:
case bit_DeityTheTribunal:
return DeityTheTribunal;
case BIT_DeityTunare:
case bit_DeityTunare:
return DeityTunare;
case BIT_DeityVeeshan:
case bit_DeityVeeshan:
return DeityVeeshan;
default:
return DeityUnknown;
};
}
const char* EQEmu::Deity::GetDeityName(Types deity)
const char* EQEmu::deity::GetDeityName(DeityType deity)
{
switch (deity) {
case DeityBertoxxulous:
+29 -30
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,17 +15,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEITY_H
#define DEITY_H
#ifndef COMMON_DEITY_H
#define COMMON_DEITY_H
#include "types.h"
namespace EQEmu
{
class Deity {
public:
enum Types {
namespace deity {
enum DeityType {
DeityUnknown = 0,
DeityAgnostic_LB = 140,
DeityBertoxxulous = 201,
@@ -47,31 +46,31 @@ namespace EQEmu
DeityAgnostic = 396
};
enum TypeBits : uint32 {
BIT_DeityAll = 0x00000000,
BIT_DeityAgnostic = 0x00000001,
BIT_DeityBertoxxulous = 0x00000002,
BIT_DeityBrellSirilis = 0x00000004,
BIT_DeityCazicThule = 0x00000008,
BIT_DeityErollisiMarr = 0x00000010,
BIT_DeityBristlebane = 0x00000020,
BIT_DeityInnoruuk = 0x00000040,
BIT_DeityKarana = 0x00000080,
BIT_DeityMithanielMarr = 0x00000100,
BIT_DeityPrexus = 0x00000200,
BIT_DeityQuellious = 0x00000400,
BIT_DeityRallosZek = 0x00000800,
BIT_DeityRodcetNife = 0x00001000,
BIT_DeitySolusekRo = 0x00002000,
BIT_DeityTheTribunal = 0x00004000,
BIT_DeityTunare = 0x00008000,
BIT_DeityVeeshan = 0x00010000
enum DeityTypeBit : uint32 {
bit_DeityAll = 0x00000000,
bit_DeityAgnostic = 0x00000001,
bit_DeityBertoxxulous = 0x00000002,
bit_DeityBrellSirilis = 0x00000004,
bit_DeityCazicThule = 0x00000008,
bit_DeityErollisiMarr = 0x00000010,
bit_DeityBristlebane = 0x00000020,
bit_DeityInnoruuk = 0x00000040,
bit_DeityKarana = 0x00000080,
bit_DeityMithanielMarr = 0x00000100,
bit_DeityPrexus = 0x00000200,
bit_DeityQuellious = 0x00000400,
bit_DeityRallosZek = 0x00000800,
bit_DeityRodcetNife = 0x00001000,
bit_DeitySolusekRo = 0x00002000,
bit_DeityTheTribunal = 0x00004000,
bit_DeityTunare = 0x00008000,
bit_DeityVeeshan = 0x00010000
};
static TypeBits ConvertDeityToDeityBit(Types deity);
static Types ConvertDeityBitToDeity(TypeBits deity_bit);
static const char* GetDeityName(Types deity);
};
DeityTypeBit ConvertDeityToDeityBit(DeityType deity);
DeityType ConvertDeityBitToDeity(DeityTypeBit deity_bit);
const char* GetDeityName(DeityType deity);
}
}
#endif /* DEITY_H */
#endif /* COMMON_DEITY_H */
+6 -6
View File
@@ -21,7 +21,7 @@
#include "string_util.h"
uint16 EQEmu::Constants::InventoryTypeSize(int16 type_index)
uint16 EQEmu::constants::InventoryTypeSize(int16 type_index)
{
switch (type_index) {
case TypePossessions:
@@ -80,7 +80,7 @@ uint16 EQEmu::Constants::InventoryTypeSize(int16 type_index)
}
/*
const char* EQEmu::Constants::InventoryLocationName(Location_Struct location)
const char* EQEmu::constants::InventoryLocationName(Location_Struct location)
{
// not ready for implementation...
std::string ret_str;
@@ -89,7 +89,7 @@ const char* EQEmu::Constants::InventoryLocationName(Location_Struct location)
}
*/
const char* EQEmu::Constants::InventoryTypeName(int16 type_index)
const char* EQEmu::constants::InventoryTypeName(int16 type_index)
{
switch (type_index) {
case INVALID_INDEX:
@@ -149,7 +149,7 @@ const char* EQEmu::Constants::InventoryTypeName(int16 type_index)
}
}
const char* EQEmu::Constants::InventorySlotName(int16 slot_index)
const char* EQEmu::constants::InventorySlotName(int16 slot_index)
{
switch (slot_index) {
case INVALID_INDEX:
@@ -229,7 +229,7 @@ const char* EQEmu::Constants::InventorySlotName(int16 slot_index)
}
}
const char* EQEmu::Constants::InventorySubName(int16 sub_index)
const char* EQEmu::constants::InventorySubName(int16 sub_index)
{
if (sub_index == INVALID_INDEX)
return "Invalid Sub";
@@ -243,7 +243,7 @@ const char* EQEmu::Constants::InventorySubName(int16 sub_index)
return ret_str.c_str();
}
const char* EQEmu::Constants::InventoryAugName(int16 aug_index)
const char* EQEmu::constants::InventoryAugName(int16 aug_index)
{
if (aug_index == INVALID_INDEX)
return "Invalid Aug";
+5 -6
View File
@@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EMU_CONSTANTS_H
#define EMU_CONSTANTS_H
#ifndef COMMON_EMU_CONSTANTS_H
#define COMMON_EMU_CONSTANTS_H
#include "eq_limits.h"
// (future use)
@@ -42,8 +42,7 @@
namespace EQEmu
{
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
class Constants {
public:
namespace constants {
// database
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
@@ -149,7 +148,7 @@ namespace EQEmu
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
};
}
}
#endif /* EMU_CONSTANTS_H */
#endif /* COMMON_EMU_CONSTANTS_H */
+7 -8
View File
@@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EMU_LEGACY_H
#define EMU_LEGACY_H
#ifndef COMMON_EMU_LEGACY_H
#define COMMON_EMU_LEGACY_H
#include "types.h"
@@ -26,9 +26,8 @@
namespace EQEmu
{
// this is for perl and other legacy systems
class Legacy {
public:
typedef enum {
namespace legacy {
enum InventorySlot : int16 {
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
@@ -102,8 +101,8 @@ namespace EQEmu
SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009
} InventorySlot;
};
};
}
}
#endif /* EMU_LEGACY_H */
#endif /* COMMON_EMU_LEGACY_H */
+2 -2
View File
@@ -931,8 +931,8 @@ enum PossessionsSlots : int16
// plus, since they're pre-op's, they don't affect the actual binary size
#define TYPE_BEGIN 0
#define SLOT_BEGIN 0
#define SUB_BEGIN 0
#define AUG_BEGIN 0
#define SUB_INDEX_BEGIN 0
#define AUG_INDEX_BEGIN 0
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
+132 -132
View File
@@ -21,7 +21,7 @@
// client validation
bool EQEmu::Limits::IsValidPCClientVersion(ClientVersion clientVersion)
bool EQEmu::limits::IsValidPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return true;
@@ -29,7 +29,7 @@ bool EQEmu::Limits::IsValidPCClientVersion(ClientVersion clientVersion)
return false;
}
ClientVersion EQEmu::Limits::ValidatePCClientVersion(ClientVersion clientVersion)
ClientVersion EQEmu::limits::ValidatePCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return clientVersion;
@@ -38,7 +38,7 @@ ClientVersion EQEmu::Limits::ValidatePCClientVersion(ClientVersion clientVersion
}
// npc validation
bool EQEmu::Limits::IsValidNPCClientVersion(ClientVersion clientVersion)
bool EQEmu::limits::IsValidNPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return true;
@@ -46,7 +46,7 @@ bool EQEmu::Limits::IsValidNPCClientVersion(ClientVersion clientVersion)
return false;
}
ClientVersion EQEmu::Limits::ValidateNPCClientVersion(ClientVersion clientVersion)
ClientVersion EQEmu::limits::ValidateNPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
@@ -55,7 +55,7 @@ ClientVersion EQEmu::Limits::ValidateNPCClientVersion(ClientVersion clientVersio
}
// mob validation
bool EQEmu::Limits::IsValidMobClientVersion(ClientVersion clientVersion)
bool EQEmu::limits::IsValidMobClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return true;
@@ -63,7 +63,7 @@ bool EQEmu::Limits::IsValidMobClientVersion(ClientVersion clientVersion)
return false;
}
ClientVersion EQEmu::Limits::ValidateMobClientVersion(ClientVersion clientVersion)
ClientVersion EQEmu::limits::ValidateMobClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
@@ -72,7 +72,7 @@ ClientVersion EQEmu::Limits::ValidateMobClientVersion(ClientVersion clientVersio
}
// database
size_t EQEmu::Limits::CharacterCreationLimit(ClientVersion clientVersion)
size_t EQEmu::limits::CharacterCreationLimit(ClientVersion clientVersion)
{
static const size_t local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
@@ -94,7 +94,7 @@ size_t EQEmu::Limits::CharacterCreationLimit(ClientVersion clientVersion)
}
// inventory
uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion)
uint16 EQEmu::limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion)
{
// not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...)
// a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified
@@ -105,36 +105,36 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
//
// TYPE_POSSESSIONS_SIZE does not reflect all actual <client>_constants size due to bitmask-use compatibility
//
// when setting NPC-based values, try to adhere to an Constants::<property> or NOT_USED value to avoid unnecessary issues
// when setting NPC-based values, try to adhere to an constants::<property> or NOT_USED value to avoid unnecessary issues
static const uint16 local[TypeCount][CLIENT_VERSION_COUNT] = {
// server and database are sync'd to current TypePossessions's client as set in 'using namespace RoF::slots;' and
// 'Constants::TYPE_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask()
// for partial range validation checks and 'Constants::TYPE_POSSESSIONS_SIZE' for full range iterations
// 'constants::TYPE_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask()
// for partial range validation checks and 'constants::TYPE_POSSESSIONS_SIZE' for full range iterations
{ // local[TypePossessions]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_POSSESSIONS_SIZE,
/*Titanium*/ Constants::TYPE_POSSESSIONS_SIZE,
/*SoF*/ Constants::TYPE_POSSESSIONS_SIZE,
/*SoD*/ Constants::TYPE_POSSESSIONS_SIZE,
/*Underfoot*/ Constants::TYPE_POSSESSIONS_SIZE,
/*RoF*/ Constants::TYPE_POSSESSIONS_SIZE,
/*RoF2*/ Constants::TYPE_POSSESSIONS_SIZE,
/*62*/ constants::TYPE_POSSESSIONS_SIZE,
/*Titanium*/ constants::TYPE_POSSESSIONS_SIZE,
/*SoF*/ constants::TYPE_POSSESSIONS_SIZE,
/*SoD*/ constants::TYPE_POSSESSIONS_SIZE,
/*Underfoot*/ constants::TYPE_POSSESSIONS_SIZE,
/*RoF*/ constants::TYPE_POSSESSIONS_SIZE,
/*RoF2*/ constants::TYPE_POSSESSIONS_SIZE,
/*NPC*/ Constants::TYPE_POSSESSIONS_SIZE,
/*Merc*/ Constants::TYPE_POSSESSIONS_SIZE,
/*Bot*/ Constants::TYPE_POSSESSIONS_SIZE,
/*Pet*/ Constants::TYPE_POSSESSIONS_SIZE
/*NPC*/ constants::TYPE_POSSESSIONS_SIZE,
/*Merc*/ constants::TYPE_POSSESSIONS_SIZE,
/*Bot*/ constants::TYPE_POSSESSIONS_SIZE,
/*Pet*/ constants::TYPE_POSSESSIONS_SIZE
},
{ // local[TypeBank]
/*Unknown*/ NOT_USED,
/*62*/ NOT_USED,
/*Titanium*/ Titanium::consts::TYPE_BANK_SIZE,
/*SoF*/ Constants::TYPE_BANK_SIZE,
/*SoD*/ Constants::TYPE_BANK_SIZE,
/*Underfoot*/ Constants::TYPE_BANK_SIZE,
/*RoF*/ Constants::TYPE_BANK_SIZE,
/*RoF2*/ Constants::TYPE_BANK_SIZE,
/*SoF*/ constants::TYPE_BANK_SIZE,
/*SoD*/ constants::TYPE_BANK_SIZE,
/*Underfoot*/ constants::TYPE_BANK_SIZE,
/*RoF*/ constants::TYPE_BANK_SIZE,
/*RoF2*/ constants::TYPE_BANK_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
@@ -143,13 +143,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
},
{ // local[TypeSharedBank]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_SHARED_BANK_SIZE,
/*Titanium*/ Constants::TYPE_SHARED_BANK_SIZE,
/*SoF*/ Constants::TYPE_SHARED_BANK_SIZE,
/*SoD*/ Constants::TYPE_SHARED_BANK_SIZE,
/*Underfoot*/ Constants::TYPE_SHARED_BANK_SIZE,
/*RoF*/ Constants::TYPE_SHARED_BANK_SIZE,
/*RoF2*/ Constants::TYPE_SHARED_BANK_SIZE,
/*62*/ constants::TYPE_SHARED_BANK_SIZE,
/*Titanium*/ constants::TYPE_SHARED_BANK_SIZE,
/*SoF*/ constants::TYPE_SHARED_BANK_SIZE,
/*SoD*/ constants::TYPE_SHARED_BANK_SIZE,
/*Underfoot*/ constants::TYPE_SHARED_BANK_SIZE,
/*RoF*/ constants::TYPE_SHARED_BANK_SIZE,
/*RoF2*/ constants::TYPE_SHARED_BANK_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
@@ -158,28 +158,28 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
},
{ // local[TypeTrade]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_TRADE_SIZE,
/*Titanium*/ Constants::TYPE_TRADE_SIZE,
/*SoF*/ Constants::TYPE_TRADE_SIZE,
/*SoD*/ Constants::TYPE_TRADE_SIZE,
/*Underfoot*/ Constants::TYPE_TRADE_SIZE,
/*RoF*/ Constants::TYPE_TRADE_SIZE,
/*RoF2*/ Constants::TYPE_TRADE_SIZE,
/*62*/ constants::TYPE_TRADE_SIZE,
/*Titanium*/ constants::TYPE_TRADE_SIZE,
/*SoF*/ constants::TYPE_TRADE_SIZE,
/*SoD*/ constants::TYPE_TRADE_SIZE,
/*Underfoot*/ constants::TYPE_TRADE_SIZE,
/*RoF*/ constants::TYPE_TRADE_SIZE,
/*RoF2*/ constants::TYPE_TRADE_SIZE,
/*NPC*/ 4,
/*Merc*/ 4,
/*Bot*/ Constants::TYPE_TRADE_SIZE, // client thinks this is another client
/*Bot*/ constants::TYPE_TRADE_SIZE, // client thinks this is another client
/*Pet*/ 4
},
{ // local[TypeWorld]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_WORLD_SIZE,
/*Titanium*/ Constants::TYPE_WORLD_SIZE,
/*SoF*/ Constants::TYPE_WORLD_SIZE,
/*SoD*/ Constants::TYPE_WORLD_SIZE,
/*Underfoot*/ Constants::TYPE_WORLD_SIZE,
/*RoF*/ Constants::TYPE_WORLD_SIZE,
/*RoF2*/ Constants::TYPE_WORLD_SIZE,
/*62*/ constants::TYPE_WORLD_SIZE,
/*Titanium*/ constants::TYPE_WORLD_SIZE,
/*SoF*/ constants::TYPE_WORLD_SIZE,
/*SoD*/ constants::TYPE_WORLD_SIZE,
/*Underfoot*/ constants::TYPE_WORLD_SIZE,
/*RoF*/ constants::TYPE_WORLD_SIZE,
/*RoF2*/ constants::TYPE_WORLD_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
@@ -188,13 +188,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
},
{ // local[TypeLimbo]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_LIMBO_SIZE,
/*Titanium*/ Constants::TYPE_LIMBO_SIZE,
/*SoF*/ Constants::TYPE_LIMBO_SIZE,
/*SoD*/ Constants::TYPE_LIMBO_SIZE,
/*Underfoot*/ Constants::TYPE_LIMBO_SIZE,
/*RoF*/ Constants::TYPE_LIMBO_SIZE,
/*RoF2*/ Constants::TYPE_LIMBO_SIZE,
/*62*/ constants::TYPE_LIMBO_SIZE,
/*Titanium*/ constants::TYPE_LIMBO_SIZE,
/*SoF*/ constants::TYPE_LIMBO_SIZE,
/*SoD*/ constants::TYPE_LIMBO_SIZE,
/*Underfoot*/ constants::TYPE_LIMBO_SIZE,
/*RoF*/ constants::TYPE_LIMBO_SIZE,
/*RoF2*/ constants::TYPE_LIMBO_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
@@ -203,13 +203,13 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
},
{ // local[TypeTribute]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_TRIBUTE_SIZE,
/*Titanium*/ Constants::TYPE_TRIBUTE_SIZE,
/*SoF*/ Constants::TYPE_TRIBUTE_SIZE,
/*SoD*/ Constants::TYPE_TRIBUTE_SIZE,
/*Underfoot*/ Constants::TYPE_TRIBUTE_SIZE,
/*RoF*/ Constants::TYPE_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_TRIBUTE_SIZE,
/*62*/ constants::TYPE_TRIBUTE_SIZE,
/*Titanium*/ constants::TYPE_TRIBUTE_SIZE,
/*SoF*/ constants::TYPE_TRIBUTE_SIZE,
/*SoD*/ constants::TYPE_TRIBUTE_SIZE,
/*Underfoot*/ constants::TYPE_TRIBUTE_SIZE,
/*RoF*/ constants::TYPE_TRIBUTE_SIZE,
/*RoF2*/ constants::TYPE_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -223,8 +223,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*RoF*/ constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ constants::TYPE_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -238,8 +238,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_GUILD_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_GUILD_TRIBUTE_SIZE,
/*RoF*/ constants::TYPE_GUILD_TRIBUTE_SIZE,
/*RoF2*/ constants::TYPE_GUILD_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -253,8 +253,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_MERCHANT_SIZE,
/*RoF2*/ Constants::TYPE_MERCHANT_SIZE,
/*RoF*/ constants::TYPE_MERCHANT_SIZE,
/*RoF2*/ constants::TYPE_MERCHANT_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -268,8 +268,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_DELETED_SIZE,
/*RoF2*/ Constants::TYPE_DELETED_SIZE,
/*RoF*/ constants::TYPE_DELETED_SIZE,
/*RoF2*/ constants::TYPE_DELETED_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -293,15 +293,15 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
},
{ // local[TypeBazaar]
/*Unknown*/ NOT_USED,
/*62*/ Constants::TYPE_BAZAAR_SIZE,
/*Titanium*/ Constants::TYPE_BAZAAR_SIZE,
/*SoF*/ Constants::TYPE_BAZAAR_SIZE,
/*SoD*/ Constants::TYPE_BAZAAR_SIZE,
/*Underfoot*/ Constants::TYPE_BAZAAR_SIZE,
/*RoF*/ Constants::TYPE_BAZAAR_SIZE,
/*RoF2*/ Constants::TYPE_BAZAAR_SIZE,
/*62*/ constants::TYPE_BAZAAR_SIZE,
/*Titanium*/ constants::TYPE_BAZAAR_SIZE,
/*SoF*/ constants::TYPE_BAZAAR_SIZE,
/*SoD*/ constants::TYPE_BAZAAR_SIZE,
/*Underfoot*/ constants::TYPE_BAZAAR_SIZE,
/*RoF*/ constants::TYPE_BAZAAR_SIZE,
/*RoF2*/ constants::TYPE_BAZAAR_SIZE,
/*NPC*/ 0, // this may need to be 'Constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc
/*NPC*/ 0, // this may need to be 'constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
@@ -328,8 +328,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_REAL_ESTATE_SIZE,
/*RoF2*/ Constants::TYPE_REAL_ESTATE_SIZE,
/*RoF*/ constants::TYPE_REAL_ESTATE_SIZE,
/*RoF2*/ constants::TYPE_REAL_ESTATE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -343,8 +343,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_PC_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_PC_SIZE,
/*RoF*/ constants::TYPE_VIEW_MOD_PC_SIZE,
/*RoF2*/ constants::TYPE_VIEW_MOD_PC_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -358,8 +358,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_BANK_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_BANK_SIZE,
/*RoF*/ constants::TYPE_VIEW_MOD_BANK_SIZE,
/*RoF2*/ constants::TYPE_VIEW_MOD_BANK_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -373,8 +373,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*RoF*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*RoF2*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -388,8 +388,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*RoF2*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*RoF*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*RoF2*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -403,8 +403,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_ALT_STORAGE_SIZE,
/*RoF2*/ Constants::TYPE_ALT_STORAGE_SIZE,
/*RoF*/ constants::TYPE_ALT_STORAGE_SIZE,
/*RoF2*/ constants::TYPE_ALT_STORAGE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -418,8 +418,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_ARCHIVED_SIZE,
/*RoF2*/ Constants::TYPE_ARCHIVED_SIZE,
/*RoF*/ constants::TYPE_ARCHIVED_SIZE,
/*RoF2*/ constants::TYPE_ARCHIVED_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -433,8 +433,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_MAIL_SIZE,
/*RoF2*/ Constants::TYPE_MAIL_SIZE,
/*RoF*/ constants::TYPE_MAIL_SIZE,
/*RoF2*/ constants::TYPE_MAIL_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -448,8 +448,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*RoF*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -463,8 +463,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ NOT_USED,
/*SoD*/ NOT_USED,
/*Underfoot*/ NOT_USED,
/*RoF*/ Constants::TYPE_KRONO_SIZE,
/*RoF2*/ Constants::TYPE_KRONO_SIZE,
/*RoF*/ constants::TYPE_KRONO_SIZE,
/*RoF2*/ constants::TYPE_KRONO_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -478,8 +478,8 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ Constants::TYPE_OTHER_SIZE,
/*RoF2*/ Constants::TYPE_OTHER_SIZE,
/*RoF*/ constants::TYPE_OTHER_SIZE,
/*RoF2*/ constants::TYPE_OTHER_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
@@ -494,7 +494,7 @@ uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
return NOT_USED;
}
uint64 EQEmu::Limits::PossessionsBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::PossessionsBitmask(ClientVersion clientVersion)
{
// these are for the new inventory system (RoF)..not the current (Ti) one...
// 0x0000000000200000 is SlotPowerSource (SoF+)
@@ -521,7 +521,7 @@ uint64 EQEmu::Limits::PossessionsBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQEmu::Limits::EquipmentBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::EquipmentBitmask(ClientVersion clientVersion)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
@@ -543,7 +543,7 @@ uint64 EQEmu::Limits::EquipmentBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQEmu::Limits::GeneralBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::GeneralBitmask(ClientVersion clientVersion)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
@@ -565,7 +565,7 @@ uint64 EQEmu::Limits::GeneralBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQEmu::Limits::CursorBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::CursorBitmask(ClientVersion clientVersion)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
@@ -587,7 +587,7 @@ uint64 EQEmu::Limits::CursorBitmask(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQEmu::Limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
bool EQEmu::limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
{
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
@@ -609,7 +609,7 @@ bool EQEmu::Limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQEmu::Limits::AllowsClickCastFromBag(ClientVersion clientVersion)
bool EQEmu::limits::AllowsClickCastFromBag(ClientVersion clientVersion)
{
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
@@ -631,49 +631,49 @@ bool EQEmu::Limits::AllowsClickCastFromBag(ClientVersion clientVersion)
}
// items
uint16 EQEmu::Limits::ItemCommonSize(ClientVersion clientVersion)
uint16 EQEmu::limits::ItemCommonSize(ClientVersion clientVersion)
{
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ Constants::ITEM_COMMON_SIZE,
/*Titanium*/ Constants::ITEM_COMMON_SIZE,
/*SoF*/ Constants::ITEM_COMMON_SIZE,
/*SoD*/ Constants::ITEM_COMMON_SIZE,
/*Underfoot*/ Constants::ITEM_COMMON_SIZE,
/*RoF*/ Constants::ITEM_COMMON_SIZE,
/*RoF2*/ Constants::ITEM_COMMON_SIZE,
/*62*/ constants::ITEM_COMMON_SIZE,
/*Titanium*/ constants::ITEM_COMMON_SIZE,
/*SoF*/ constants::ITEM_COMMON_SIZE,
/*SoD*/ constants::ITEM_COMMON_SIZE,
/*Underfoot*/ constants::ITEM_COMMON_SIZE,
/*RoF*/ constants::ITEM_COMMON_SIZE,
/*RoF2*/ constants::ITEM_COMMON_SIZE,
/*NPC*/ Constants::ITEM_COMMON_SIZE,
/*Merc*/ Constants::ITEM_COMMON_SIZE,
/*Bot*/ Constants::ITEM_COMMON_SIZE,
/*Pet*/ Constants::ITEM_COMMON_SIZE
/*NPC*/ constants::ITEM_COMMON_SIZE,
/*Merc*/ constants::ITEM_COMMON_SIZE,
/*Bot*/ constants::ITEM_COMMON_SIZE,
/*Pet*/ constants::ITEM_COMMON_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint16 EQEmu::Limits::ItemContainerSize(ClientVersion clientVersion)
uint16 EQEmu::limits::ItemContainerSize(ClientVersion clientVersion)
{
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ Constants::ITEM_CONTAINER_SIZE,
/*Titanium*/ Constants::ITEM_CONTAINER_SIZE,
/*SoF*/ Constants::ITEM_CONTAINER_SIZE,
/*SoD*/ Constants::ITEM_CONTAINER_SIZE,
/*Underfoot*/ Constants::ITEM_CONTAINER_SIZE,
/*RoF*/ Constants::ITEM_CONTAINER_SIZE,
/*RoF2*/ Constants::ITEM_CONTAINER_SIZE,
/*62*/ constants::ITEM_CONTAINER_SIZE,
/*Titanium*/ constants::ITEM_CONTAINER_SIZE,
/*SoF*/ constants::ITEM_CONTAINER_SIZE,
/*SoD*/ constants::ITEM_CONTAINER_SIZE,
/*Underfoot*/ constants::ITEM_CONTAINER_SIZE,
/*RoF*/ constants::ITEM_CONTAINER_SIZE,
/*RoF2*/ constants::ITEM_CONTAINER_SIZE,
/*NPC*/ Constants::ITEM_CONTAINER_SIZE,
/*Merc*/ Constants::ITEM_CONTAINER_SIZE,
/*Bot*/ Constants::ITEM_CONTAINER_SIZE,
/*Pet*/ Constants::ITEM_CONTAINER_SIZE
/*NPC*/ constants::ITEM_CONTAINER_SIZE,
/*Merc*/ constants::ITEM_CONTAINER_SIZE,
/*Bot*/ constants::ITEM_CONTAINER_SIZE,
/*Pet*/ constants::ITEM_CONTAINER_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQEmu::Limits::CoinHasWeight(ClientVersion clientVersion)
bool EQEmu::limits::CoinHasWeight(ClientVersion clientVersion)
{
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ true,
+22 -23
View File
@@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_LIMITS_H
#define EQ_LIMITS_H
#ifndef COMMON_EQ_LIMITS_H
#define COMMON_EQ_LIMITS_H
#include "types.h"
#include "eq_constants.h"
@@ -42,41 +42,40 @@ namespace EQEmu
// values should default to a non-beneficial value..unless value conflicts with intended operation
//
// EQEmu::Constants may be used as references..but, not every reference needs to be in EQEmu::Constants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
class Limits {
public:
namespace limits {
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
// use this inside of class Client (limits to actual clients)
static bool IsValidPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
bool IsValidPCClientVersion(ClientVersion clientVersion);
ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
// basically..any non-client classes - do not invoke when setting a valid client
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
bool IsValidNPCClientVersion(ClientVersion clientVersion);
ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
// these are 'universal' - do not invoke when setting a valid client
static bool IsValidMobClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
bool IsValidMobClientVersion(ClientVersion clientVersion);
ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
// database
static size_t CharacterCreationLimit(ClientVersion clientVersion);
size_t CharacterCreationLimit(ClientVersion clientVersion);
// inventory
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
static uint64 PossessionsBitmask(ClientVersion clientVersion);
static uint64 EquipmentBitmask(ClientVersion clientVersion);
static uint64 GeneralBitmask(ClientVersion clientVersion);
static uint64 CursorBitmask(ClientVersion clientVersion);
uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
uint64 PossessionsBitmask(ClientVersion clientVersion);
uint64 EquipmentBitmask(ClientVersion clientVersion);
uint64 GeneralBitmask(ClientVersion clientVersion);
uint64 CursorBitmask(ClientVersion clientVersion);
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
bool AllowsEmptyBagInBag(ClientVersion clientVersion);
bool AllowsClickCastFromBag(ClientVersion clientVersion);
// items
static uint16 ItemCommonSize(ClientVersion clientVersion);
static uint16 ItemContainerSize(ClientVersion clientVersion);
uint16 ItemCommonSize(ClientVersion clientVersion);
uint16 ItemContainerSize(ClientVersion clientVersion);
// player profile
static bool CoinHasWeight(ClientVersion clientVersion);
};
bool CoinHasWeight(ClientVersion clientVersion);
}
}
#endif /* EQ_LIMITS_H */
#endif /* COMMON_EQ_LIMITS_H */
+6 -6
View File
@@ -776,7 +776,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[EQEmu::Constants::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[EQEmu::constants::BANDOLIER_ITEM_COUNT];
};
//len = 72
@@ -790,7 +790,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[EQEmu::Constants::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[EQEmu::constants::POTION_BELT_ITEM_COUNT];
};
struct MovePotionToBelt_Struct
@@ -1092,7 +1092,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE];
/*7224*/ Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1119,7 +1119,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::Constants::BANDOLIERS_SIZE];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::constants::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -3472,8 +3472,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active
uint32 tributes[EQEmu::Constants::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::Constants::TRIBUTE_SIZE]; //all 00's
uint32 tributes[EQEmu::constants::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::constants::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id;
};
+161 -161
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -183,9 +183,9 @@ struct Item_Struct {
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::Constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint8 AugSlotType[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
+53 -48
View File
@@ -20,7 +20,12 @@
#include "light_source.h"
void EQEmu::LightSource::impl::Clear()
EQEmu::lightsource::LightSourceProfile::LightSourceProfile()
{
Clear();
}
void EQEmu::lightsource::LightSourceProfile::Clear()
{
Type.Innate = 0;
Type.Equipment = 0;
@@ -33,62 +38,62 @@ void EQEmu::LightSource::impl::Clear()
Level.Active = 0;
}
uint8 EQEmu::LightSource::TypeToLevel(uint8 light_type)
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
{
switch (light_type) {
case TypeGlobeOfStars:
return LevelBrilliant; // 10
case TypeFlamelessLantern:
case TypeGreaterLightstone:
return LevelLargeMagic; // 9
case TypeLargeLantern:
return LevelLargeLantern; // 8
case TypeSteinOfMoggok:
case TypeLightstone:
return LevelMagicLantern; // 7
case TypeSmallLantern:
return LevelSmallLantern; // 6
case TypeColdlight:
case TypeUnknown2:
return LevelBlueLight; // 5
case TypeFireBeetleEye:
case TypeUnknown1:
return LevelRedLight; // 4
case TypeTinyGlowingSkull:
case TypeLightGlobe:
return LevelSmallMagic; // 3
case TypeTorch:
return LevelTorch; // 2
case TypeCandle:
return LevelCandle; // 1
case LightTypeGlobeOfStars:
return LightLevelBrilliant; // 10
case LightTypeFlamelessLantern:
case LightTypeGreaterLightstone:
return LightLevelLargeMagic; // 9
case LightTypeLargeLantern:
return LightLevelLargeLantern; // 8
case LightTypeSteinOfMoggok:
case LightTypeLightstone:
return LightLevelMagicLantern; // 7
case LightTypeSmallLantern:
return LightLevelSmallLantern; // 6
case LightTypeColdlight:
case LightTypeUnknown2:
return LightLevelBlueLight; // 5
case LightTypeFireBeetleEye:
case LightTypeUnknown1:
return LightLevelRedLight; // 4
case LightTypeTinyGlowingSkull:
case LightTypeLightGlobe:
return LightLevelSmallMagic; // 3
case LightTypeTorch:
return LightLevelTorch; // 2
case LightTypeCandle:
return LightLevelCandle; // 1
default:
return LevelUnlit; // 0
return LightLevelUnlit; // 0
}
}
bool EQEmu::LightSource::IsLevelGreater(uint8 left_type, uint8 right_type)
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
{
static const uint8 light_levels[TypeCount] = {
LevelUnlit, /* TypeNone */
LevelCandle, /* TypeCandle */
LevelTorch, /* TypeTorch */
LevelSmallMagic, /* TypeTinyGlowingSkull */
LevelSmallLantern, /* TypeSmallLantern */
LevelMagicLantern, /* TypeSteinOfMoggok */
LevelLargeLantern, /* TypeLargeLantern */
LevelLargeMagic, /* TypeFlamelessLantern */
LevelBrilliant, /* TypeGlobeOfStars */
LevelSmallMagic, /* TypeLightGlobe */
LevelMagicLantern, /* TypeLightstone */
LevelLargeMagic, /* TypeGreaterLightstone */
LevelRedLight, /* TypeFireBeetleEye */
LevelBlueLight, /* TypeColdlight */
LevelRedLight, /* TypeUnknown1 */
LevelBlueLight /* TypeUnknown2 */
static const uint8 light_levels[LightTypeCount] = {
LightLevelUnlit, /* LightTypeNone */
LightLevelCandle, /* LightTypeCandle */
LightLevelTorch, /* LightTypeTorch */
LightLevelSmallMagic, /* LightTypeTinyGlowingSkull */
LightLevelSmallLantern, /* LightTypeSmallLantern */
LightLevelMagicLantern, /* LightTypeSteinOfMoggok */
LightLevelLargeLantern, /* LightTypeLargeLantern */
LightLevelLargeMagic, /* LightTypeFlamelessLantern */
LightLevelBrilliant, /* LightTypeGlobeOfStars */
LightLevelSmallMagic, /* LightTypeLightGlobe */
LightLevelMagicLantern, /* LightTypeLightstone */
LightLevelLargeMagic, /* LightTypeGreaterLightstone */
LightLevelRedLight, /* LightTypeFireBeetleEye */
LightLevelBlueLight, /* LightTypeColdlight */
LightLevelRedLight, /* LightTypeUnknown1 */
LightLevelBlueLight /* LightTypeUnknown2 */
};
if (left_type >= TypeCount) { left_type = TypeNone; }
if (right_type >= TypeCount) { right_type = TypeNone; }
if (left_type >= LightTypeCount) { left_type = LightTypeNone; }
if (right_type >= LightTypeCount) { right_type = LightTypeNone; }
return (light_levels[left_type] > light_levels[right_type]);
}
+39 -41
View File
@@ -17,52 +17,51 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef LIGHT_SOURCE_H
#define LIGHT_SOURCE_H
#ifndef COMMON_LIGHT_SOURCE_H
#define COMMON_LIGHT_SOURCE_H
#include "types.h"
namespace EQEmu
{
class LightSource {
public:
enum Types {
TypeNone = 0,
TypeCandle,
TypeTorch,
TypeTinyGlowingSkull,
TypeSmallLantern,
TypeSteinOfMoggok, // 5
TypeLargeLantern,
TypeFlamelessLantern,
TypeGlobeOfStars,
TypeLightGlobe,
TypeLightstone, // 10
TypeGreaterLightstone,
TypeFireBeetleEye,
TypeColdlight,
TypeUnknown1,
TypeUnknown2, // 15
TypeCount
namespace lightsource {
enum LightType {
LightTypeNone = 0,
LightTypeCandle,
LightTypeTorch,
LightTypeTinyGlowingSkull,
LightTypeSmallLantern,
LightTypeSteinOfMoggok, // 5
LightTypeLargeLantern,
LightTypeFlamelessLantern,
LightTypeGlobeOfStars,
LightTypeLightGlobe,
LightTypeLightstone, // 10
LightTypeGreaterLightstone,
LightTypeFireBeetleEye,
LightTypeColdlight,
LightTypeUnknown1,
LightTypeUnknown2, // 15
LightTypeCount
};
enum Levels {
LevelUnlit = 0,
LevelCandle,
LevelTorch,
LevelSmallMagic,
LevelRedLight,
LevelBlueLight, // 5
LevelSmallLantern,
LevelMagicLantern,
LevelLargeLantern,
LevelLargeMagic,
LevelBrilliant, // 10
LevelCount
enum LightLevel {
LightLevelUnlit = 0,
LightLevelCandle,
LightLevelTorch,
LightLevelSmallMagic,
LightLevelRedLight,
LightLevelBlueLight, // 5
LightLevelSmallLantern,
LightLevelMagicLantern,
LightLevelLargeLantern,
LightLevelLargeMagic,
LightLevelBrilliant, // 10
LightLevelCount
};
class impl {
struct LightSourceProfile {
/*
Current criteria (light types):
Equipment: { 0 .. 15 }
@@ -79,8 +78,7 @@ namespace EQEmu
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
-- The timer-based update cancels out the invalid light source
*/
public:
impl() { Clear(); }
LightSourceProfile();
void Clear();
@@ -101,9 +99,9 @@ namespace EQEmu
} Level;
};
static uint8 TypeToLevel(uint8 light_type);
static bool IsLevelGreater(uint8 left_type, uint8 right_type);
uint8 TypeToLevel(uint8 light_type);
bool IsLevelGreater(uint8 left_type, uint8 right_type);
};
}
#endif /* LIGHT_SOURCE_H */
#endif /* COMMON_LIGHT_SOURCE_H */
+71 -71
View File
@@ -2342,7 +2342,7 @@ namespace RoF
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(emu->bandoliers[r].Name);
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
@@ -2357,7 +2357,7 @@ namespace RoF
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
@@ -2369,7 +2369,7 @@ namespace RoF
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
// Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2381,7 +2381,7 @@ namespace RoF
}
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -2502,9 +2502,9 @@ namespace RoF
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE);
outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++)
for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++)
{
outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier);
@@ -2824,8 +2824,8 @@ namespace RoF
RoFSlot.Type = 8; // Observed
RoFSlot.Unknown02 = 0;
RoFSlot.Slot = 0xffff;
RoFSlot.Sub = 0xffff;
RoFSlot.Aug = 0xffff;
RoFSlot.SubIndex = 0xffff;
RoFSlot.AugIndex = 0xffff;
RoFSlot.Unknown01 = 0;
eq->unknown_slot = RoFSlot;
OUT(recipe_id);
@@ -4810,7 +4810,7 @@ namespace RoF
IN(item_id);
int r;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
IN(augments[r]);
}
// Max Augs is now 6, but no code to support that many yet
@@ -4866,7 +4866,7 @@ namespace RoF
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
emu->from_slot = RoFToServerSlot(eq->from_slot);
emu->to_slot = RoFToServerSlot(eq->to_slot);
IN(number_in_stack);
@@ -5101,7 +5101,7 @@ namespace RoF
int16 slot_id = RoFToServerSlot(eq->container_slot);
if (slot_id == 4000) {
slot_id = EQEmu::Legacy::SLOT_TRADESKILL; // 1000
slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
}
emu->container_slot = slot_id;
emu->guildtribute_slot = RoFToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
@@ -5218,8 +5218,8 @@ namespace RoF
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items?
hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff;
hdr.unknown013 = (merchant_slot == 0) ? slot_id.Aug : 0xffff;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubIndex : 0xffff;
hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugIndex : 0xffff;
hdr.price = inst->GetPrice();
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
//hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff;
@@ -5427,7 +5427,7 @@ namespace RoF
isbs.augdistiller = 65535;
isbs.augrestrict = item->AugRestrict;
for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
for (int x = AUG_INDEX_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
{
isbs.augslots[x].type = item->AugSlotType[x];
isbs.augslots[x].visible = item->AugSlotVisible[x];
@@ -5678,7 +5678,7 @@ namespace RoF
uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr;
@@ -5690,15 +5690,15 @@ namespace RoF
iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor?
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END)
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END)
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x);
else
SubSlotNumber = slot_id_in; // ???????
@@ -5713,7 +5713,7 @@ namespace RoF
ss.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
if (SubSerializations[x]) {
@@ -5739,8 +5739,8 @@ namespace RoF
RoFSlot.Type = INVALID_INDEX;
RoFSlot.Unknown02 = NOT_USED;
RoFSlot.Slot = INVALID_INDEX;
RoFSlot.Sub = INVALID_INDEX;
RoFSlot.Aug = INVALID_INDEX;
RoFSlot.SubIndex = INVALID_INDEX;
RoFSlot.AugIndex = INVALID_INDEX;
RoFSlot.Unknown01 = NOT_USED;
uint32 TempSlot = 0;
@@ -5764,51 +5764,51 @@ namespace RoF
RoFSlot.MainSlot = ServerSlot - 31;
}*/
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341)
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341)
RoFSlot.Type = inventory::TypePossessions;
TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30)
RoFSlot.Slot = inventory::SlotCursor;
}
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute
else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute
RoFSlot.Type = inventory::TypeTribute;
RoFSlot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN;
RoFSlot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN;
}
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) {
else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeBank;
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN;
TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN;
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
}
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeSharedBank;
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN;
TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN;
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
}
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) {
else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) {
RoFSlot.Type = inventory::TypeTrade;
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN;
TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN;
RoFSlot.Slot = TempSlot;
if (TempSlot > 30) {
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
/*
@@ -5825,13 +5825,13 @@ namespace RoF
*/
}
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) {
else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) {
RoFSlot.Type = inventory::TypeWorld;
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN;
TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN;
RoFSlot.Slot = TempSlot;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, RoFSlot.Unknown01);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
return RoFSlot;
}
@@ -5840,8 +5840,8 @@ namespace RoF
{
structs::TypelessInventorySlot_Struct RoFSlot;
RoFSlot.Slot = INVALID_INDEX;
RoFSlot.Sub = INVALID_INDEX;
RoFSlot.Aug = INVALID_INDEX;
RoFSlot.SubIndex = INVALID_INDEX;
RoFSlot.AugIndex = INVALID_INDEX;
RoFSlot.Unknown01 = NOT_USED;
uint32 TempSlot = 0;
@@ -5866,13 +5866,13 @@ namespace RoF
}*/
}
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) {
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) {
TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, RoFSlot.Unknown01);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
return RoFSlot;
}
@@ -5911,17 +5911,17 @@ namespace RoF
else // Worn Slots
TempSlot = rofSlot.Slot;
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot;
}
else if (rofSlot.Type == inventory::TypeBank) {
TempSlot = EQEmu::Constants::BANK_BEGIN;
TempSlot = EQEmu::constants::BANK_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
else
TempSlot += rofSlot.Slot;
@@ -5930,10 +5930,10 @@ namespace RoF
}
else if (rofSlot.Type == inventory::TypeSharedBank) {
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN;
TempSlot = EQEmu::constants::SHARED_BANK_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
else
TempSlot += rofSlot.Slot;
@@ -5942,12 +5942,12 @@ namespace RoF
}
else if (rofSlot.Type == inventory::TypeTrade) {
TempSlot = EQEmu::Constants::TRADE_BEGIN;
TempSlot = EQEmu::constants::TRADE_BEGIN;
if (rofSlot.Sub >= SUB_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
// OLD CODE:
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::Constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot;
else
TempSlot += rofSlot.Slot;
@@ -5956,9 +5956,9 @@ namespace RoF
}
else if (rofSlot.Type == inventory::TypeWorld) {
TempSlot = EQEmu::Constants::WORLD_BEGIN;
TempSlot = EQEmu::constants::WORLD_BEGIN;
if (rofSlot.Slot >= SUB_BEGIN)
if (rofSlot.Slot >= SUB_INDEX_BEGIN)
TempSlot += rofSlot.Slot;
ServerSlot = TempSlot;
@@ -5977,7 +5977,7 @@ namespace RoF
ServerSlot = INVALID_INDEX;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
return ServerSlot;
}
@@ -6006,13 +6006,13 @@ namespace RoF
else
TempSlot = rofSlot.Slot;
if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1;
ServerSlot = TempSlot;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
return ServerSlot;
}
@@ -6024,7 +6024,7 @@ namespace RoF
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rofTextLink = serverTextLink;
return;
}
@@ -6033,7 +6033,7 @@ namespace RoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
rofTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -6063,7 +6063,7 @@ namespace RoF
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = rofTextLink;
return;
}
+74 -74
View File
@@ -2421,7 +2421,7 @@ namespace RoF2
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(emu->bandoliers[r].Name);
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
@@ -2436,7 +2436,7 @@ namespace RoF2
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
@@ -2448,7 +2448,7 @@ namespace RoF2
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
// Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2460,7 +2460,7 @@ namespace RoF2
}
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -2577,9 +2577,9 @@ namespace RoF2
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE);
outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++)
for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++)
{
outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier);
@@ -2914,8 +2914,8 @@ namespace RoF2
RoF2Slot.Type = 8; // Observed
RoF2Slot.Unknown02 = 0;
RoF2Slot.Slot = 0xffff;
RoF2Slot.Sub = 0xffff;
RoF2Slot.Aug = 0xffff;
RoF2Slot.SubIndex = 0xffff;
RoF2Slot.AugIndex = 0xffff;
RoF2Slot.Unknown01 = 0;
eq->unknown_slot = RoF2Slot;
OUT(recipe_id);
@@ -5028,7 +5028,7 @@ namespace RoF2
IN(item_id);
int r;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
IN(augments[r]);
}
IN(link_hash);
@@ -5082,7 +5082,7 @@ namespace RoF2
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
emu->from_slot = RoF2ToServerSlot(eq->from_slot);
emu->to_slot = RoF2ToServerSlot(eq->to_slot);
IN(number_in_stack);
@@ -5372,7 +5372,7 @@ namespace RoF2
int16 slot_id = RoF2ToServerSlot(eq->container_slot);
if (slot_id == 4000) {
slot_id = EQEmu::Legacy::SLOT_TRADESKILL; // 1000
slot_id = EQEmu::legacy::SLOT_TRADESKILL; // 1000
}
emu->container_slot = slot_id;
emu->guildtribute_slot = RoF2ToServerSlot(eq->guildtribute_slot); // this should only return INVALID_INDEX until implemented
@@ -5489,8 +5489,8 @@ namespace RoF2
hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items?
hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff;
hdr.aug_slot = (merchant_slot == 0) ? slot_id.Aug : 0xffff;
hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubIndex : 0xffff;
hdr.aug_slot = (merchant_slot == 0) ? slot_id.AugIndex : 0xffff;
hdr.price = inst->GetPrice();
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
@@ -5697,7 +5697,7 @@ namespace RoF2
isbs.augrestrict2 = -1;
isbs.augrestrict = item->AugRestrict;
for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
for (int x = AUG_INDEX_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
{
isbs.augslots[x].type = item->AugSlotType[x];
isbs.augslots[x].visible = item->AugSlotVisible[x];
@@ -5961,7 +5961,7 @@ namespace RoF2
uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr;
@@ -5973,15 +5973,15 @@ namespace RoF2
iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor?
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END)
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END)
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x);
else
SubSlotNumber = slot_id_in; // ???????
@@ -5996,7 +5996,7 @@ namespace RoF2
ss.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
if (SubSerializations[x]) {
@@ -6022,8 +6022,8 @@ namespace RoF2
RoF2Slot.Type = INVALID_INDEX;
RoF2Slot.Unknown02 = NOT_USED;
RoF2Slot.Slot = INVALID_INDEX;
RoF2Slot.Sub = INVALID_INDEX;
RoF2Slot.Aug = INVALID_INDEX;
RoF2Slot.SubIndex = INVALID_INDEX;
RoF2Slot.AugIndex = INVALID_INDEX;
RoF2Slot.Unknown01 = NOT_USED;
uint32 TempSlot = 0;
@@ -6032,7 +6032,7 @@ namespace RoF2
if (PacketType == ItemPacketLoot)
{
RoF2Slot.Type = inventory::TypeCorpse;
RoF2Slot.Slot = serverSlot - EQEmu::Constants::CORPSE_BEGIN;
RoF2Slot.Slot = serverSlot - EQEmu::constants::CORPSE_BEGIN;
}
else
{
@@ -6055,51 +6055,51 @@ namespace RoF2
RoF2Slot.MainSlot = ServerSlot - 31;
}*/
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341)
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341)
RoF2Slot.Type = inventory::TypePossessions;
TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30)
RoF2Slot.Slot = inventory::SlotCursor;
}
else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute
else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute
RoF2Slot.Type = inventory::TypeTribute;
RoF2Slot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN;
RoF2Slot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN;
}
else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) {
else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeBank;
TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN;
TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN;
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
}
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeSharedBank;
TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN;
TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN;
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) { // (> 30)
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
}
else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) {
else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) {
RoF2Slot.Type = inventory::TypeTrade;
TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN;
TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN;
RoF2Slot.Slot = TempSlot;
if (TempSlot > 30) {
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
/*
@@ -6116,13 +6116,13 @@ namespace RoF2
*/
}
else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) {
else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) {
RoF2Slot.Type = inventory::TypeWorld;
TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN;
TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN;
RoF2Slot.Slot = TempSlot;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
return RoF2Slot;
}
@@ -6131,8 +6131,8 @@ namespace RoF2
{
structs::TypelessInventorySlot_Struct RoF2Slot;
RoF2Slot.Slot = INVALID_INDEX;
RoF2Slot.Sub = INVALID_INDEX;
RoF2Slot.Aug = INVALID_INDEX;
RoF2Slot.SubIndex = INVALID_INDEX;
RoF2Slot.AugIndex = INVALID_INDEX;
RoF2Slot.Unknown01 = NOT_USED;
uint32 TempSlot = 0;
@@ -6157,20 +6157,20 @@ namespace RoF2
}*/
}
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) {
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) {
TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE);
RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE);
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
return RoF2Slot;
}
static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot)
{
return (serverCorpseSlot - EQEmu::Constants::CORPSE_BEGIN + 1);
return (serverCorpseSlot - EQEmu::constants::CORPSE_BEGIN + 1);
}
static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType)
@@ -6202,17 +6202,17 @@ namespace RoF2
else // Worn Slots
TempSlot = rof2Slot.Slot;
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot;
}
else if (rof2Slot.Type == inventory::TypeBank) {
TempSlot = EQEmu::Constants::BANK_BEGIN;
TempSlot = EQEmu::constants::BANK_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
else
TempSlot += rof2Slot.Slot;
@@ -6221,10 +6221,10 @@ namespace RoF2
}
else if (rof2Slot.Type == inventory::TypeSharedBank) {
TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN;
TempSlot = EQEmu::constants::SHARED_BANK_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
else
TempSlot += rof2Slot.Slot;
@@ -6233,10 +6233,10 @@ namespace RoF2
}
else if (rof2Slot.Type == inventory::TypeTrade) {
TempSlot = EQEmu::Constants::TRADE_BEGIN;
TempSlot = EQEmu::constants::TRADE_BEGIN;
if (rof2Slot.Sub >= SUB_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
// OLD CODE:
//TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot;
@@ -6247,9 +6247,9 @@ namespace RoF2
}
else if (rof2Slot.Type == inventory::TypeWorld) {
TempSlot = EQEmu::Constants::WORLD_BEGIN;
TempSlot = EQEmu::constants::WORLD_BEGIN;
if (rof2Slot.Slot >= SUB_BEGIN)
if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
TempSlot += rof2Slot.Slot;
ServerSlot = TempSlot;
@@ -6269,10 +6269,10 @@ namespace RoF2
}
else if (rof2Slot.Type == inventory::TypeCorpse) {
ServerSlot = rof2Slot.Slot + EQEmu::Constants::CORPSE_BEGIN;
ServerSlot = rof2Slot.Slot + EQEmu::constants::CORPSE_BEGIN;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
return ServerSlot;
}
@@ -6301,25 +6301,25 @@ namespace RoF2
else
TempSlot = rof2Slot.Slot;
if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots
TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1;
ServerSlot = TempSlot;
}
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot);
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
return ServerSlot;
}
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot)
{
return (rof2CorpseSlot + EQEmu::Constants::CORPSE_BEGIN - 1);
return (rof2CorpseSlot + EQEmu::constants::CORPSE_BEGIN - 1);
}
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rof2TextLink = serverTextLink;
return;
}
@@ -6328,7 +6328,7 @@ namespace RoF2
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
rof2TextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -6351,7 +6351,7 @@ namespace RoF2
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
serverTextLink = rof2TextLink;
return;
}
+5 -5
View File
@@ -31,11 +31,11 @@ struct WorldObjectsSent_Struct {
// New for RoF2 - Size: 12
struct InventorySlot_Struct
{
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*002*/ int16 Unknown02;
/*004*/ int16 Slot;
/*006*/ int16 Sub;
/*008*/ int16 Aug; // Guessing - Seen 0xffff
/*006*/ int16 SubIndex;
/*008*/ int16 AugIndex; // Guessing - Seen 0xffff
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
/*012*/
};
@@ -45,8 +45,8 @@ struct InventorySlot_Struct
struct TypelessInventorySlot_Struct
{
/*000*/ int16 Slot;
/*002*/ int16 Sub;
/*004*/ int16 Aug;
/*002*/ int16 SubIndex;
/*004*/ int16 AugIndex;
/*006*/ int16 Unknown01;
/*008*/
};
+5 -5
View File
@@ -31,11 +31,11 @@ struct WorldObjectsSent_Struct {
// New for RoF - Size: 12
struct InventorySlot_Struct
{
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1
/*002*/ int16 Unknown02;
/*004*/ int16 Slot;
/*006*/ int16 Sub;
/*008*/ int16 Aug; // Guessing - Seen 0xffff
/*006*/ int16 SubIndex;
/*008*/ int16 AugIndex; // Guessing - Seen 0xffff
/*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID
/*012*/
};
@@ -45,8 +45,8 @@ struct InventorySlot_Struct
struct TypelessInventorySlot_Struct
{
/*000*/ int16 Slot;
/*002*/ int16 Sub;
/*004*/ int16 Aug;
/*002*/ int16 SubIndex;
/*004*/ int16 AugIndex;
/*006*/ int16 Unknown01;
/*008*/
};
+17 -17
View File
@@ -1614,7 +1614,7 @@ namespace SoD
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1623,7 +1623,7 @@ namespace SoD
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1635,13 +1635,13 @@ namespace SoD
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -3934,7 +3934,7 @@ namespace SoD
uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr;
@@ -3946,15 +3946,15 @@ namespace SoD
iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor?
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END)
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END)
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x);
else
SubSlotNumber = slot_id_in; // ???????
@@ -3995,11 +3995,11 @@ namespace SoD
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
SoDSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource)
SoDSlot = inventory::SlotPowerSource;
@@ -4041,7 +4041,7 @@ namespace SoD
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sodTextLink = serverTextLink;
return;
}
@@ -4050,7 +4050,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
sodTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4081,7 +4081,7 @@ namespace SoD
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sodTextLink;
return;
}
+17 -17
View File
@@ -1271,7 +1271,7 @@ namespace SoF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1280,7 +1280,7 @@ namespace SoF
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1292,13 +1292,13 @@ namespace SoF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -3256,7 +3256,7 @@ namespace SoF
uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr;
const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x);
@@ -3267,15 +3267,15 @@ namespace SoF
iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor?
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END)
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END)
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x);
else
SubSlotNumber = slot_id_in; // ???????
@@ -3314,11 +3314,11 @@ namespace SoF
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
SoFSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
SoFSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
SoFSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource)
SoFSlot = inventory::SlotPowerSource;
@@ -3362,7 +3362,7 @@ namespace SoF
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sofTextLink = serverTextLink;
return;
}
@@ -3371,7 +3371,7 @@ namespace SoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
sofTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -3402,7 +3402,7 @@ namespace SoF
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sofTextLink;
return;
}
+7 -7
View File
@@ -943,7 +943,7 @@ namespace Titanium
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -952,7 +952,7 @@ namespace Titanium
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -964,13 +964,13 @@ namespace Titanium
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2198,7 +2198,7 @@ namespace Titanium
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
titaniumTextLink = serverTextLink;
return;
}
@@ -2207,7 +2207,7 @@ namespace Titanium
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
titaniumTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -2238,7 +2238,7 @@ namespace Titanium
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
serverTextLink = titaniumTextLink;
return;
}
+17 -17
View File
@@ -1878,7 +1878,7 @@ namespace UF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::Constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1887,7 +1887,7 @@ namespace UF
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1899,13 +1899,13 @@ namespace UF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::Constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::Constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -4263,7 +4263,7 @@ namespace UF
uint32 SubLengths[10];
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) {
SubSerializations[x] = nullptr;
@@ -4275,15 +4275,15 @@ namespace UF
iqbs.subitem_count++;
if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor?
if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor?
//SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1);
SubSlotNumber = (((slot_id_in + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::Constants::BANK_BEGIN && slot_id_in <= EQEmu::Constants::BANK_END)
SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1);
else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END)
//SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::Constants::SHARED_BANK_END)
SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x);
else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END)
//SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1);
SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x);
SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x);
else
SubSlotNumber = slot_id_in; // ???????
@@ -4324,11 +4324,11 @@ namespace UF
if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END)
else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END)
UnderfootSlot = serverSlot + 11;
else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END)
UnderfootSlot = serverSlot + 1;
else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END)
else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END)
UnderfootSlot = serverSlot + 1;
else if (serverSlot == SlotPowerSource)
UnderfootSlot = inventory::SlotPowerSource;
@@ -4372,7 +4372,7 @@ namespace UF
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
ufTextLink = serverTextLink;
return;
}
@@ -4381,7 +4381,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
ufTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4412,7 +4412,7 @@ namespace UF
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
{
if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
serverTextLink = ufTextLink;
return;
}
+23 -18
View File
@@ -25,7 +25,12 @@
#include "../zone/zonedb.h"
std::string EQEmu::SayLink::impl::GenerateLink()
EQEmu::saylink::SayLinkEngine::SayLinkEngine()
{
Reset();
}
std::string EQEmu::saylink::SayLinkEngine::GenerateLink()
{
m_Link.clear();
m_LinkBody.clear();
@@ -34,7 +39,7 @@ std::string EQEmu::SayLink::impl::GenerateLink()
generate_body();
generate_text();
if ((m_LinkBody.length() == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
if ((m_LinkBody.length() == EQEmu::constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
m_Link.push_back(0x12);
m_Link.append(m_LinkBody);
m_Link.append(m_LinkText);
@@ -53,9 +58,9 @@ std::string EQEmu::SayLink::impl::GenerateLink()
return m_Link;
}
void EQEmu::SayLink::impl::Reset()
void EQEmu::saylink::SayLinkEngine::Reset()
{
m_LinkType = LinkBlank;
m_LinkType = SayLinkBlank;
m_ItemData = nullptr;
m_LootData = nullptr;
m_ItemInst = nullptr;
@@ -80,7 +85,7 @@ void EQEmu::SayLink::impl::Reset()
m_Error = false;
}
void EQEmu::SayLink::impl::generate_body()
void EQEmu::saylink::SayLinkEngine::generate_body()
{
/*
Current server mask: EQClientRoF2
@@ -96,16 +101,16 @@ void EQEmu::SayLink::impl::generate_body()
const Item_Struct* item_data = nullptr;
switch (m_LinkType) {
case LinkBlank:
case SayLinkBlank:
break;
case LinkItemData:
case SayLinkItemData:
if (m_ItemData == nullptr) { break; }
m_LinkBodyStruct.item_id = m_ItemData->ID;
m_LinkBodyStruct.evolve_group = m_ItemData->LoreGroup; // this probably won't work for all items
//m_LinkBodyStruct.evolve_level = m_ItemData->EvolvingLevel;
// TODO: add hash call
break;
case LinkLootItem:
case SayLinkLootItem:
if (m_LootData == nullptr) { break; }
item_data = database.GetItem(m_LootData->item_id);
if (item_data == nullptr) { break; }
@@ -120,7 +125,7 @@ void EQEmu::SayLink::impl::generate_body()
//m_LinkBodyStruct.evolve_level = item_data->EvolvingLevel;
// TODO: add hash call
break;
case LinkItemInst:
case SayLinkItemInst:
if (m_ItemInst == nullptr) { break; }
if (m_ItemInst->GetItem() == nullptr) { break; }
m_LinkBodyStruct.item_id = m_ItemInst->GetItem()->ID;
@@ -189,7 +194,7 @@ void EQEmu::SayLink::impl::generate_body()
);
}
void EQEmu::SayLink::impl::generate_text()
void EQEmu::saylink::SayLinkEngine::generate_text()
{
if (m_ProxyText != nullptr) {
m_LinkText = m_ProxyText;
@@ -199,19 +204,19 @@ void EQEmu::SayLink::impl::generate_text()
const Item_Struct* item_data = nullptr;
switch (m_LinkType) {
case LinkBlank:
case SayLinkBlank:
break;
case LinkItemData:
case SayLinkItemData:
if (m_ItemData == nullptr) { break; }
m_LinkText = m_ItemData->Name;
return;
case LinkLootItem:
case SayLinkLootItem:
if (m_LootData == nullptr) { break; }
item_data = database.GetItem(m_LootData->item_id);
if (item_data == nullptr) { break; }
m_LinkText = item_data->Name;
return;
case LinkItemInst:
case SayLinkItemInst:
if (m_ItemInst == nullptr) { break; }
if (m_ItemInst->GetItem() == nullptr) { break; }
m_LinkText = m_ItemInst->GetItem()->Name;
@@ -223,10 +228,10 @@ void EQEmu::SayLink::impl::generate_text()
m_LinkText = "null";
}
bool EQEmu::SayLink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body)
bool EQEmu::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));
if (say_link_body.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH)
if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH)
return false;
say_link_body_struct.unknown_1 = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16);
@@ -246,7 +251,7 @@ bool EQEmu::SayLink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct
return true;
}
bool EQEmu::SayLink::GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct)
bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct)
{
say_link_body = StringFormat(
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
@@ -265,7 +270,7 @@ bool EQEmu::SayLink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
(0xFFFFFFFF & say_link_body_struct.hash)
);
if (say_link_body.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH)
if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH)
return false;
return true;
+22 -20
View File
@@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SAY_LINK_H
#define SAY_LINK_H
#ifndef COMMON_SAY_LINK_H
#define COMMON_SAY_LINK_H
#include "types.h"
@@ -26,16 +26,13 @@
class ItemInst;
class Item_Struct;
class ServerLootItem_Struct;
struct Item_Struct;
struct ServerLootItem_Struct;
namespace EQEmu
{
class SayLink {
public:
enum Type { LinkBlank = 0, LinkItemData, LinkLootItem, LinkItemInst };
namespace saylink {
// Current server mask: EQClientRoF2
struct SayLinkBody_Struct {
uint8 unknown_1; /* %1X */
@@ -53,11 +50,18 @@ namespace EQEmu
int hash; /* %08X */
};
class impl {
class SayLinkEngine {
public:
impl() { Reset(); }
enum SayLinkType {
SayLinkBlank = 0,
SayLinkItemData,
SayLinkLootItem,
SayLinkItemInst
};
void SetLinkType(Type link_type) { m_LinkType = link_type; }
SayLinkEngine();
void SetLinkType(SayLinkType link_type) { m_LinkType = link_type; }
void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; }
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; }
@@ -83,9 +87,9 @@ namespace EQEmu
std::string GenerateLink();
bool LinkError() { return m_Error; }
std::string GetLink() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
std::string GetLinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
std::string GetLinkText() { return m_LinkText; } // contains string format: '<LinkText>'
std::string Link() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
std::string LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
std::string LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
void Reset();
@@ -120,11 +124,9 @@ namespace EQEmu
bool m_Error;
};
static bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body);
static bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
};
bool DegenerateLinkBody(SayLinkBody_Struct& say_Link_body_struct, const std::string& say_link_body);
bool GenerateLinkBody(std::string& say_link_body, const SayLinkBody_Struct& say_link_body_struct);
}
}
#endif /* SAY_LINK_H */
#endif /* COMMON_SAY_LINK_H */
+18 -18
View File
@@ -105,7 +105,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<ItemInst*>::const_iter
"AND ((slotid >= 8000 AND slotid <= 8999) "
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
char_id, SlotCursor,
EQEmu::Constants::CURSOR_BAG_BEGIN, EQEmu::Constants::CURSOR_BAG_END);
EQEmu::constants::CURSOR_BAG_BEGIN, EQEmu::constants::CURSOR_BAG_END);
auto results = QueryDatabase(query);
if (!results.Success()) {
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
@@ -161,10 +161,10 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite
bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) {
//never save tribute slots:
if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END)
if (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END)
return true;
if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
// Shared bank inventory
if (!inst) {
return DeleteSharedBankSlot(char_id, slot_id);
@@ -191,9 +191,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
}
@@ -223,7 +223,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(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)
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
}
@@ -238,9 +238,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
}
@@ -269,7 +269,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(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)
for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = inst->GetItem(idx);
SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx));
}
@@ -295,7 +295,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_BEGIN);
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
char_id, base_slot_id, (base_slot_id+10));
results = QueryDatabase(query);
@@ -321,7 +321,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
if (!Inventory::SupportsContainers(slot_id))
return true;
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_BEGIN);
int16 base_slot_id = Inventory::CalcSlotId(slot_id, SUB_INDEX_BEGIN);
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
"AND slotid >= %i AND slotid < %i",
account_id, base_slot_id, (base_slot_id+10));
@@ -427,7 +427,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
@@ -448,7 +448,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
ItemInst *inst = CreateBaseItem(item, charges);
if (inst && item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}
@@ -522,7 +522,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
uint16 charges = atoi(row[2]);
uint32 color = atoul(row[3]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoul(row[4]);
aug[1] = (uint32)atoul(row[5]);
@@ -584,7 +584,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
inst->SetOrnamentHeroModel(ornament_hero_model);
if (instnodrop ||
(((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) ||
(((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) ||
slot_id == SlotPowerSource) &&
inst->GetItem()->Attuneable))
inst->SetAttuned(true);
@@ -608,7 +608,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
}
if (item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}
@@ -665,7 +665,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
int8 charges = atoi(row[2]);
uint32 color = atoul(row[3]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[4]);
aug[1] = (uint32)atoi(row[5]);
aug[2] = (uint32)atoi(row[6]);
@@ -726,7 +726,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
inst->SetCharges(charges);
if (item->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
}