mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 21:41:29 +00:00
Reworked EQEmuDictionary to use class LookupEntry
This commit is contained in:
parent
79549ba330
commit
9ec299247c
@ -1,5 +1,8 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 06/06/2016 ==
|
||||||
|
Uleat: Reworked EQEmuDictionary to use class LookupEntry
|
||||||
|
|
||||||
== 06/01/2016 ==
|
== 06/01/2016 ==
|
||||||
Uleat: Implemented EQEmu::TintProfile
|
Uleat: Implemented EQEmu::TintProfile
|
||||||
Uleat: Implemented EQEmu::TextureProfile
|
Uleat: Implemented EQEmu::TextureProfile
|
||||||
|
|||||||
@ -36,6 +36,15 @@ namespace EntityLimits
|
|||||||
|
|
||||||
} /*NPC*/
|
} /*NPC*/
|
||||||
|
|
||||||
|
namespace NPCMerchant {
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
|
||||||
|
const size_t InvTypeTradeSize = 4;
|
||||||
|
|
||||||
|
} /*NPCMerchant*/
|
||||||
|
|
||||||
namespace Merc {
|
namespace Merc {
|
||||||
enum : int { Invalid = -1, Null, Safety };
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
|||||||
@ -212,6 +212,8 @@ const char* EQEmu::versions::InventoryVersionName(InventoryVersion inventory_ver
|
|||||||
return "RoF2";
|
return "RoF2";
|
||||||
case InventoryVersion::NPC:
|
case InventoryVersion::NPC:
|
||||||
return "NPC";
|
return "NPC";
|
||||||
|
case InventoryVersion::NPCMerchant:
|
||||||
|
return "NPC Merchant";
|
||||||
case InventoryVersion::Merc:
|
case InventoryVersion::Merc:
|
||||||
return "Merc";
|
return "Merc";
|
||||||
case InventoryVersion::Bot:
|
case InventoryVersion::Bot:
|
||||||
|
|||||||
@ -84,6 +84,7 @@ namespace EQEmu
|
|||||||
RoF,
|
RoF,
|
||||||
RoF2,
|
RoF2,
|
||||||
NPC,
|
NPC,
|
||||||
|
NPCMerchant,
|
||||||
Merc,
|
Merc,
|
||||||
Bot,
|
Bot,
|
||||||
ClientPet,
|
ClientPet,
|
||||||
|
|||||||
1155
common/eq_limits.cpp
1155
common/eq_limits.cpp
File diff suppressed because it is too large
Load Diff
@ -20,6 +20,7 @@
|
|||||||
#ifndef COMMON_EQ_LIMITS_H
|
#ifndef COMMON_EQ_LIMITS_H
|
||||||
#define COMMON_EQ_LIMITS_H
|
#define COMMON_EQ_LIMITS_H
|
||||||
|
|
||||||
|
#include "emu_legacy.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "eq_constants.h"
|
#include "eq_constants.h"
|
||||||
#include "emu_versions.h"
|
#include "emu_versions.h"
|
||||||
@ -34,28 +35,41 @@
|
|||||||
namespace EQEmu
|
namespace EQEmu
|
||||||
{
|
{
|
||||||
namespace constants {
|
namespace constants {
|
||||||
extern size_t GetCharacterCreationLimit(versions::ClientVersion client_version);
|
class LookupEntry {
|
||||||
|
public:
|
||||||
|
size_t CharacterCreationLimit;
|
||||||
|
};
|
||||||
|
|
||||||
|
const LookupEntry* Lookup(versions::ClientVersion client_version);
|
||||||
|
|
||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
namespace inventory {
|
namespace inventory {
|
||||||
extern size_t GetInventoryTypeSize(versions::InventoryVersion inventory_version, int inv_type);
|
class LookupEntry {
|
||||||
extern uint64 GetPossessionsBitmask(versions::InventoryVersion inventory_version);
|
public:
|
||||||
|
size_t InventoryTypeSize[legacy::TypeCount];
|
||||||
|
|
||||||
extern bool GetAllowEmptyBagInBag(versions::InventoryVersion inventory_version);
|
uint64 PossessionsBitmask;
|
||||||
extern bool GetAllowClickCastFromBag(versions::InventoryVersion inventory_version);
|
size_t ItemBagSize;
|
||||||
|
size_t ItemAugSize;
|
||||||
|
|
||||||
extern bool GetConcatenateInvTypeLimbo(versions::InventoryVersion inventory_version);
|
bool AllowEmptyBagInBag;
|
||||||
|
bool AllowClickCastFromBag;
|
||||||
|
bool ConcatenateInvTypeLimbo;
|
||||||
|
bool AllowOverLevelEquipment;
|
||||||
|
};
|
||||||
|
|
||||||
extern bool GetAllowOverLevelEquipment(versions::InventoryVersion inventory_version);
|
const LookupEntry* Lookup(versions::InventoryVersion inventory_version);
|
||||||
|
|
||||||
extern size_t GetItemAugSize(versions::InventoryVersion inventory_version);
|
|
||||||
extern size_t GetItemBagSize(versions::InventoryVersion inventory_version);
|
|
||||||
|
|
||||||
} /*inventory*/
|
} /*inventory*/
|
||||||
|
|
||||||
namespace behavior {
|
namespace behavior {
|
||||||
extern bool GetCoinHasWeight(versions::InventoryVersion inventory_version);
|
class LookupEntry {
|
||||||
|
public:
|
||||||
|
bool CoinHasWeight;
|
||||||
|
};
|
||||||
|
|
||||||
|
const LookupEntry* Lookup(versions::InventoryVersion inventory_version);
|
||||||
|
|
||||||
} /*behavior*/
|
} /*behavior*/
|
||||||
|
|
||||||
|
|||||||
@ -929,7 +929,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id)
|
|||||||
}
|
}
|
||||||
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)
|
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)
|
||||||
{
|
{
|
||||||
if (EQEmu::inventory::GetAllowClickCastFromBag(m_inventory_version))
|
if (EQEmu::inventory::Lookup(m_inventory_version)->AllowClickCastFromBag)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -211,7 +211,7 @@ void Client::SendMaxCharCreate() {
|
|||||||
auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct));
|
auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct));
|
||||||
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
|
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
mc->max_chars = EQEmu::constants::GetCharacterCreationLimit(m_ClientVersion);
|
mc->max_chars = EQEmu::constants::Lookup(m_ClientVersion)->CharacterCreationLimit;
|
||||||
if (mc->max_chars > EQEmu::constants::CharacterCreationMax)
|
if (mc->max_chars > EQEmu::constants::CharacterCreationMax)
|
||||||
mc->max_chars = EQEmu::constants::CharacterCreationMax;
|
mc->max_chars = EQEmu::constants::CharacterCreationMax;
|
||||||
|
|
||||||
@ -746,7 +746,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
// This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above)
|
// This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above)
|
||||||
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
|
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
|
||||||
if (!pZoning) {
|
if (!pZoning) {
|
||||||
size_t character_limit = EQEmu::constants::GetCharacterCreationLimit(eqs->ClientVersion());
|
size_t character_limit = EQEmu::constants::Lookup(eqs->ClientVersion())->CharacterCreationLimit;
|
||||||
if (character_limit > EQEmu::constants::CharacterCreationMax) { character_limit = EQEmu::constants::CharacterCreationMax; }
|
if (character_limit > EQEmu::constants::CharacterCreationMax) { character_limit = EQEmu::constants::CharacterCreationMax; }
|
||||||
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
|
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
|
|||||||
{
|
{
|
||||||
/* Set Character Creation Limit */
|
/* Set Character Creation Limit */
|
||||||
EQEmu::versions::ClientVersion client_version = EQEmu::versions::ConvertClientVersionBitToClientVersion(clientVersionBit);
|
EQEmu::versions::ClientVersion client_version = EQEmu::versions::ConvertClientVersionBitToClientVersion(clientVersionBit);
|
||||||
size_t character_limit = EQEmu::constants::GetCharacterCreationLimit(client_version);
|
size_t character_limit = EQEmu::constants::Lookup(client_version)->CharacterCreationLimit;
|
||||||
|
|
||||||
// Validate against absolute server max
|
// Validate against absolute server max
|
||||||
if (character_limit > EQEmu::constants::CharacterCreationMax)
|
if (character_limit > EQEmu::constants::CharacterCreationMax)
|
||||||
|
|||||||
@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight()
|
|||||||
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
|
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
|
||||||
*/
|
*/
|
||||||
// SoD+ client has no weight for coin
|
// SoD+ client has no weight for coin
|
||||||
if (EQEmu::behavior::GetCoinHasWeight(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))) {
|
if (EQEmu::behavior::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))->CoinHasWeight) {
|
||||||
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
||||||
}
|
}
|
||||||
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
||||||
|
|||||||
@ -992,7 +992,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
|||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
|
|
||||||
int corpselootlimit = EQEmu::inventory::GetInventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
|
||||||
|
|
||||||
for(; cur != end; ++cur) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item_data = *cur;
|
ServerLootItem_Struct* item_data = *cur;
|
||||||
@ -1286,7 +1286,7 @@ void Corpse::QueryLoot(Client* to) {
|
|||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
|
|
||||||
int corpselootlimit = EQEmu::inventory::GetInventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
|
||||||
|
|
||||||
for(; cur != end; ++cur) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* sitem = *cur;
|
ServerLootItem_Struct* sitem = *cur;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user