Implemented 'enum class ClientVersion' -- added 'RoF2' to lua client version enumeration

This commit is contained in:
Uleat
2015-01-19 23:32:57 -05:00
parent 52eb287082
commit e70e443950
51 changed files with 311 additions and 520 deletions
+43 -44
View File
@@ -17,59 +17,58 @@ static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
typedef enum
enum class ClientVersion
{
EQClientUnknown = 0,
EQClient62, // Build: 'Aug 4 2005 15:40:59'
EQClientTitanium, // Build: 'Oct 31 2005 10:33:37'
EQClientSoF, // Build: 'Sep 7 2007 09:11:49'
EQClientSoD, // Build: 'Dec 19 2008 15:22:49'
EQClientUnderfoot, // Build: 'Jun 8 2010 16:44:32'
EQClientRoF, // Build: 'Dec 10 2012 17:35:44'
EQClientRoF2, // Build: 'May 10 2013 23:30:08'
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Tit, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
Und, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2, // Build: 'May 10 2013 23:30:08'
_EQClientCount, // place new clients before this point (preferably, in release/attribute order)
MobNPC,
MobMerc,
MobBot,
MobPet,
};
// Values below are not implemented, as yet...
#define CLIENT_VERSION_COUNT 12
#define LAST_PC_CLIENT ClientVersion::RoF2
#define LAST_NPC_CLIENT ClientVersion::MobPet
EmuNPC = _EQClientCount,
EmuMerc,
EmuBot,
EmuPet,
_EmuClientCount // array size for EQLimits
} EQClientVersion;
static const char* EQClientVersionName(EQClientVersion version)
static const char* ClientVersionName(ClientVersion version)
{
switch (version)
{
case EQClientUnknown:
return "EQClientUnknown";
case EQClient62:
return "EQClient62";
case EQClientTitanium:
return "EQClientTitanium";
case EQClientSoF:
return "EQClientSoF";
case EQClientSoD:
return "EQClientSoD";
case EQClientUnderfoot:
return "EQClientUnderfoot";
case EQClientRoF:
return "EQClientRoF";
case EQClientRoF2:
return "EQClientRoF2";
case EmuNPC:
return "EmuNPC";
case EmuMerc:
return "EmuMerc";
case EmuBot:
return "EmuBot";
case EmuPet:
return "EmuPet";
case ClientVersion::Unknown:
return "ClientVersion::Unknown";
case ClientVersion::Client62:
return "ClientVersion::Client62";
case ClientVersion::Tit:
return "ClientVersion::Tit";
case ClientVersion::SoF:
return "ClientVersion::SoF";
case ClientVersion::SoD:
return "ClientVersion::SoD";
case ClientVersion::Und:
return "ClientVersion::Und";
case ClientVersion::RoF:
return "ClientVersion::RoF";
case ClientVersion::RoF2:
return "ClientVersion::RoF2";
case ClientVersion::MobNPC:
return "ClientVersion::MobNPC";
case ClientVersion::MobMerc:
return "ClientVersion::MobMerc";
case ClientVersion::MobBot:
return "ClientVersion::MobBot";
case ClientVersion::MobPet:
return "ClientVersion::MobPet";
default:
return "ERROR: Invalid EQClientVersion";
return "<ERROR> Invalid ClientVersion";
};
}
+78 -288
View File
@@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// class EmuConstants
//
uint16 EmuConstants::InventoryMapSize(int16 map) {
switch (map) {
uint16 EmuConstants::InventoryMapSize(int16 indexMap) {
switch (indexMap) {
case MapPossessions:
return MAP_POSSESSIONS_SIZE;
case MapBank:
@@ -91,8 +91,8 @@ std::string EmuConstants::InventoryLocationName(Location_Struct location) {
}
*/
std::string EmuConstants::InventoryMapName(int16 map) {
switch (map) {
std::string EmuConstants::InventoryMapName(int16 indexMap) {
switch (indexMap) {
case INVALID_INDEX:
return "Invalid Map";
case MapPossessions:
@@ -150,8 +150,8 @@ std::string EmuConstants::InventoryMapName(int16 map) {
}
}
std::string EmuConstants::InventoryMainName(int16 main) {
switch (main) {
std::string EmuConstants::InventoryMainName(int16 indexMain) {
switch (indexMain) {
case INVALID_INDEX:
return "Invalid Main";
case MainCharm:
@@ -229,293 +229,83 @@ std::string EmuConstants::InventoryMainName(int16 main) {
}
}
std::string EmuConstants::InventorySubName(int16 sub) {
if (sub == INVALID_INDEX)
std::string EmuConstants::InventorySubName(int16 indexSub) {
if (indexSub == INVALID_INDEX)
return "Invalid Sub";
if ((uint16)sub >= ITEM_CONTAINER_SIZE)
if ((uint16)indexSub >= ITEM_CONTAINER_SIZE)
return "Unknown Sub";
std::string ret_str;
ret_str = StringFormat("Container %i", (sub + 1)); // zero-based index..but, count starts at one
ret_str = StringFormat("Container %i", (indexSub + 1)); // zero-based index..but, count starts at one
return ret_str;
}
std::string EmuConstants::InventoryAugName(int16 aug) {
if (aug == INVALID_INDEX)
std::string EmuConstants::InventoryAugName(int16 indexAug) {
if (indexAug == INVALID_INDEX)
return "Invalid Aug";
if ((uint16)aug >= ITEM_COMMON_SIZE)
if ((uint16)indexAug >= ITEM_COMMON_SIZE)
return "Unknown Aug";
std::string ret_str;
ret_str = StringFormat("Augment %i", (aug + 1)); // zero-based index..but, count starts at one
ret_str = StringFormat("Augment %i", (indexAug + 1)); // zero-based index..but, count starts at one
return ret_str;
}
// legacy-related functions
//
// these should work for the first-stage coversions..but, once the new system is up and going..conversions will be incompatible
// without limiting server functions and other aspects, such as augment control, bag size, etc. A complete remapping will be
// required when bag sizes over 10 and direct manipulation of augments are implemented, due to the massive increase in range usage.
//
// (current personal/cursor bag range {251..340}, or 90 slots ... conversion translated range would be {10000..12804}, or 2805 slots...
// these would have to be hard-coded into all perl code to allow access to full range of the new system - actual limits would be
// less, based on bag size..but, the range must be full and consistent to avoid translation issues -- similar changes to other ranges
// (240 versus 6120 slots for bank bags, for example...))
/*
int EmuConstants::ServerToPerlSlot(int server_slot) { // set r/s
switch (server_slot) {
case legacy::SLOT_CURSOR_END:
return legacy::SLOT_CURSOR_END;
case INVALID_INDEX:
return legacy::SLOT_INVALID;
case MainPowerSource:
return legacy::SLOT_POWER_SOURCE;
case MainAmmo:
return legacy::SLOT_AMMO;
case MainCursor:
return legacy::SLOT_CURSOR;
case legacy::SLOT_TRADESKILL:
return legacy::SLOT_TRADESKILL;
case legacy::SLOT_AUGMENT:
return legacy::SLOT_AUGMENT;
default:
int perl_slot = legacy::SLOT_INVALID;
// activate the internal checks as needed
if (server_slot >= EmuConstants::EQUIPMENT_BEGIN && server_slot <= MainWaist) {
perl_slot = server_slot;
}
else if (server_slot >= EmuConstants::GENERAL_BEGIN && server_slot <= EmuConstants::GENERAL_END) {
perl_slot = server_slot;// + legacy::SLOT_PERSONAL_BEGIN - EmuConstants::GENERAL_BEGIN;
//if (perl_slot < legacy::SLOT_PERSONAL_BEGIN || perl_slot > legacy::SLOT_PERSONAL_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::GENERAL_BAGS_BEGIN && server_slot <= EmuConstants::GENERAL_BAGS_END) {
perl_slot = server_slot;// + legacy::SLOT_PERSONAL_BAGS_BEGIN - EmuConstants::GENERAL_BAGS_BEGIN;
//if (perl_slot < legacy::SLOT_PERSONAL_BAGS_BEGIN || perl_slot > legacy::SLOT_PERSONAL_BAGS_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::CURSOR_BAG_BEGIN && server_slot <= EmuConstants::CURSOR_BAG_END) {
perl_slot = server_slot;// + legacy::SLOT_CURSOR_BAG_BEGIN - EmuConstants::CURSOR_BAG_BEGIN;
//if (perl_slot < legacy::SLOT_CURSOR_BAG_BEGIN || perl_slot > legacy::SLOT_CURSOR_BAG_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::TRIBUTE_BEGIN && server_slot <= EmuConstants::TRIBUTE_END) {
perl_slot = server_slot;// + legacy::SLOT_TRIBUTE_BEGIN - EmuConstants::TRADE_BEGIN;
//if (perl_slot < legacy::SLOT_TRIBUTE_BEGIN || perl_slot > legacy::SLOT_TRIBUTE_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::BANK_BEGIN && server_slot <= EmuConstants::BANK_END) {
perl_slot = server_slot;// + legacy::SLOT_BANK_BEGIN - EmuConstants::BANK_BEGIN;
//if (perl_slot < legacy::SLOT_BANK_BEGIN || perl_slot > legacy::SLOT_BANK_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::BANK_BAGS_BEGIN && server_slot <= EmuConstants::BANK_BAGS_END) {
perl_slot = server_slot;// + legacy::SLOT_BANK_BAGS_BEGIN - EmuConstants::BANK_BAGS_BEGIN;
//if (perl_slot < legacy::SLOT_BANK_BAGS_BEGIN || perl_slot > legacy::SLOT_BANK_BAGS_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::SHARED_BANK_BEGIN && server_slot <= EmuConstants::SHARED_BANK_END) {
perl_slot = server_slot;// + legacy::SLOT_SHARED_BANK_BEGIN - EmuConstants::SHARED_BANK_BEGIN;
//if (perl_slot < legacy::SLOT_SHARED_BANK_BEGIN || perl_slot > legacy::SLOT_SHARED_BANK_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && server_slot <= EmuConstants::SHARED_BANK_BAGS_END) {
perl_slot = server_slot;// + legacy::SLOT_SHARED_BANK_BAGS_BEGIN - EmuConstants::SHARED_BANK_BAGS_BEGIN;
//if (perl_slot < legacy::SLOT_SHARED_BANK_BAGS_BEGIN || perl_slot > legacy::SLOT_SHARED_BANK_BAGS_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::TRADE_BEGIN && server_slot <= EmuConstants::TRADE_END) {
perl_slot = server_slot;// + legacy::SLOT_TRADE_BEGIN - EmuConstants::TRADE_BEGIN;
//if (perl_slot < legacy::SLOT_TRADE_BEGIN || perl_slot > legacy::SLOT_TRADE_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::TRADE_BAGS_BEGIN && server_slot <= EmuConstants::TRADE_BAGS_END) {
perl_slot = server_slot;// + legacy::SLOT_TRADE_BAGS_BEGIN - EmuConstants::TRADE_BAGS_BEGIN;
//if (perl_slot < legacy::SLOT_TRADE_BAGS_BEGIN || perl_slot > legacy::SLOT_TRADE_BAGS_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= EmuConstants::WORLD_BEGIN && server_slot <= EmuConstants::WORLD_END) {
perl_slot = server_slot;// + legacy::SLOT_WORLD_BEGIN - EmuConstants::WORLD_BEGIN;
//if (perl_slot < legacy::SLOT_WORLD_BEGIN || perl_slot > legacy::SLOT_WORLD_END)
// perl_slot = legacy::SLOT_INVALID;
}
else if (server_slot >= 8000 && server_slot <= 8999) { // this range may be limited to 36 in the future (client size)
perl_slot = server_slot;
}
return perl_slot;
}
}
*/
/*
int EmuConstants::PerlToServerSlot(int perl_slot) { // set r/s
switch (perl_slot) {
case legacy::SLOT_CURSOR_END:
return legacy::SLOT_CURSOR_END;
case legacy::SLOT_INVALID:
return INVALID_INDEX;
case legacy::SLOT_POWER_SOURCE:
return MainPowerSource;
case legacy::SLOT_AMMO:
return MainAmmo;
case legacy::SLOT_CURSOR:
return MainCursor;
case legacy::SLOT_TRADESKILL:
return legacy::SLOT_TRADESKILL;
case legacy::SLOT_AUGMENT:
return legacy::SLOT_AUGMENT;
default:
int server_slot = INVALID_INDEX;
// activate the internal checks as needed
if (perl_slot >= legacy::SLOT_EQUIPMENT_BEGIN && perl_slot <= legacy::SLOT_WAIST) {
server_slot = perl_slot;
}
else if (perl_slot >= legacy::SLOT_PERSONAL_BEGIN && perl_slot <= legacy::SLOT_PERSONAL_END) {
server_slot = perl_slot;// + EmuConstants::GENERAL_BEGIN - legacy::SLOT_PERSONAL_BEGIN;
//if (server_slot < EmuConstants::GENERAL_BEGIN || server_slot > EmuConstants::GENERAL_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_PERSONAL_BAGS_BEGIN && perl_slot <= legacy::SLOT_PERSONAL_BAGS_END) {
server_slot = perl_slot;// + EmuConstants::GENERAL_BAGS_BEGIN - legacy::SLOT_PERSONAL_BAGS_BEGIN;
//if (server_slot < EmuConstants::GENERAL_BAGS_BEGIN || server_slot > EmuConstants::GENERAL_BAGS_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_CURSOR_BAG_BEGIN && perl_slot <= legacy::SLOT_CURSOR_BAG_END) {
server_slot = perl_slot;// + EmuConstants::CURSOR_BAG_BEGIN - legacy::SLOT_CURSOR_BAG_BEGIN;
//if (server_slot < EmuConstants::CURSOR_BAG_BEGIN || server_slot > EmuConstants::CURSOR_BAG_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_TRIBUTE_BEGIN && perl_slot <= legacy::SLOT_TRIBUTE_END) {
server_slot = perl_slot;// + EmuConstants::TRIBUTE_BEGIN - legacy::SLOT_TRIBUTE_BEGIN;
//if (server_slot < EmuConstants::TRIBUTE_BEGIN || server_slot > EmuConstants::TRIBUTE_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_BANK_BEGIN && perl_slot <= legacy::SLOT_BANK_END) {
server_slot = perl_slot;// + EmuConstants::BANK_BEGIN - legacy::SLOT_BANK_BEGIN;
//if (server_slot < EmuConstants::BANK_BEGIN || server_slot > EmuConstants::BANK_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_BANK_BAGS_BEGIN && perl_slot <= legacy::SLOT_BANK_BAGS_END) {
server_slot = perl_slot;// + EmuConstants::BANK_BAGS_BEGIN - legacy::SLOT_BANK_BAGS_BEGIN;
//if (server_slot < EmuConstants::BANK_BAGS_BEGIN || server_slot > EmuConstants::BANK_BAGS_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_SHARED_BANK_BEGIN && perl_slot <= legacy::SLOT_SHARED_BANK_END) {
server_slot = perl_slot;// + EmuConstants::SHARED_BANK_BEGIN - legacy::SLOT_SHARED_BANK_BEGIN;
//if (server_slot < EmuConstants::SHARED_BANK_BEGIN || server_slot > EmuConstants::SHARED_BANK_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_SHARED_BANK_BAGS_BEGIN && perl_slot <= legacy::SLOT_SHARED_BANK_BAGS_END) {
server_slot = perl_slot;// + EmuConstants::SHARED_BANK_BAGS_BEGIN - legacy::SLOT_SHARED_BANK_BAGS_END;
//if (server_slot < EmuConstants::SHARED_BANK_BAGS_BEGIN || server_slot > EmuConstants::SHARED_BANK_BAGS_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_TRADE_BEGIN && perl_slot <= legacy::SLOT_TRADE_END) {
server_slot = perl_slot;// + EmuConstants::TRADE_BEGIN - legacy::SLOT_TRADE_BEGIN;
//if (server_slot < EmuConstants::TRADE_BEGIN || server_slot > EmuConstants::TRADE_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_TRADE_BAGS_BEGIN && perl_slot <= legacy::SLOT_TRADE_BAGS_END) {
server_slot = perl_slot;// + EmuConstants::TRADE_BAGS_BEGIN - legacy::SLOT_TRADE_BAGS_BEGIN;
//if (server_slot < EmuConstants::TRADE_BAGS_BEGIN || server_slot > EmuConstants::TRADE_BAGS_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= legacy::SLOT_WORLD_BEGIN && perl_slot <= legacy::SLOT_WORLD_END) {
server_slot = perl_slot;// + EmuConstants::WORLD_BEGIN - legacy::SLOT_WORLD_BEGIN;
//if (server_slot < EmuConstants::WORLD_BEGIN || server_slot > EmuConstants::WORLD_END)
// server_slot = INVALID_INDEX;
}
else if (perl_slot >= 8000 && perl_slot <= 8999) { // this range may be limited to 36 in the future (client size)
server_slot = perl_slot;
}
return server_slot;
}
}
*/
//
// class EQLimits
//
// client validation
bool EQLimits::IsValidClientVersion(uint32 version) {
if (version < _EQClientCount)
bool EQLimits::IsValidPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return true;
return false;
}
uint32 EQLimits::ValidateClientVersion(uint32 version) {
if (version < _EQClientCount)
return version;
ClientVersion EQLimits::ValidatePCClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return clientVersion;
return EQClientUnknown;
}
EQClientVersion EQLimits::ValidateClientVersion(EQClientVersion version) {
if (version >= EQClientUnknown)
if (version < _EQClientCount)
return version;
return EQClientUnknown;
return ClientVersion::Unknown;
}
// npc validation
bool EQLimits::IsValidNPCVersion(uint32 version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return true;
return false;
}
uint32 EQLimits::ValidateNPCVersion(uint32 version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
EQClientVersion EQLimits::ValidateNPCVersion(EQClientVersion version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
// mob validation
bool EQLimits::IsValidMobVersion(uint32 version) {
if (version < _EmuClientCount)
bool EQLimits::IsValidNPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return true;
return false;
}
uint32 EQLimits::ValidateMobVersion(uint32 version) {
if (version < _EmuClientCount)
return version;
ClientVersion EQLimits::ValidateNPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return EQClientUnknown;
return ClientVersion::Unknown;
}
EQClientVersion EQLimits::ValidateMobVersion(EQClientVersion version) {
if (version >= EQClientUnknown)
if (version < _EmuClientCount)
return version;
// mob validation
bool EQLimits::IsValidMobClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return true;
return EQClientUnknown;
return false;
}
ClientVersion EQLimits::ValidateMobClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// inventory
uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
uint16 EQLimits::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
// ALL of these values need to be verified before pushing to live
@@ -527,7 +317,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
//
// when setting NPC-based values, try to adhere to an EmuConstants::<property> or NOT_USED value to avoid unnecessary issues
static const uint16 local[_MapCount][_EmuClientCount] = {
static const uint16 local[_MapCount][CLIENT_VERSION_COUNT] = {
// server and database are sync'd to current MapPossessions's client as set in 'using namespace RoF::slots;' and
// 'EmuConstants::MAP_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask()
// for partial range validation checks and 'EmuConstants::MAP_POSSESSIONS_SIZE' for full range iterations
@@ -908,19 +698,19 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
}
};
if ((uint16)map < _MapCount)
return local[map][ValidateMobVersion(version)];
if ((uint16)indexMap < _MapCount)
return local[indexMap][static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return NOT_USED;
}
uint64 EQLimits::PossessionsBitmask(uint32 version) {
uint64 EQLimits::PossessionsBitmask(ClientVersion clientVersion) {
// these are for the new inventory system (RoF)..not the current (Ti) one...
// 0x0000000000200000 is SlotPowerSource (SoF+)
// 0x0000000080000000 is SlotGeneral9 (RoF+)
// 0x0000000100000000 is SlotGeneral10 (RoF+)
static const uint64 local[_EmuClientCount] = {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000027FDFFFFF,
/*Titanium*/ 0x000000027FDFFFFF,
@@ -937,11 +727,11 @@ uint64 EQLimits::PossessionsBitmask(uint32 version) {
};
return NOT_USED;
//return local[ValidateMobVersion(version)];
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::EquipmentBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
uint64 EQLimits::EquipmentBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x00000000005FFFFF,
/*Titanium*/ 0x00000000005FFFFF,
@@ -958,11 +748,11 @@ uint64 EQLimits::EquipmentBitmask(uint32 version) {
};
return NOT_USED;
//return local[ValidateMobVersion(version)];
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::GeneralBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
uint64 EQLimits::GeneralBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000007F800000,
/*Titanium*/ 0x000000007F800000,
@@ -979,11 +769,11 @@ uint64 EQLimits::GeneralBitmask(uint32 version) {
};
return NOT_USED;
//return local[ValidateMobVersion(version)];
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::CursorBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
uint64 EQLimits::CursorBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x0000000200000000,
/*Titanium*/ 0x0000000200000000,
@@ -1000,11 +790,11 @@ uint64 EQLimits::CursorBitmask(uint32 version) {
};
return NOT_USED;
//return local[ValidateMobVersion(version)];
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::AllowsEmptyBagInBag(uint32 version) {
static const bool local[_EmuClientCount] = {
bool EQLimits::AllowsEmptyBagInBag(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG,
@@ -1021,11 +811,11 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) {
};
return false; // not implemented
//return local[ValidateMobVersion(version)];
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::AllowsClickCastFromBag(uint32 version) {
static const bool local[_EmuClientCount] = {
bool EQLimits::AllowsClickCastFromBag(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG,
@@ -1041,12 +831,12 @@ bool EQLimits::AllowsClickCastFromBag(uint32 version) {
/*Pet*/ false
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
// items
uint16 EQLimits::ItemCommonSize(uint32 version) {
static const uint16 local[_EmuClientCount] = {
uint16 EQLimits::ItemCommonSize(ClientVersion clientVersion) {
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::ITEM_COMMON_SIZE,
/*Titanium*/ EmuConstants::ITEM_COMMON_SIZE,
@@ -1062,11 +852,11 @@ uint16 EQLimits::ItemCommonSize(uint32 version) {
/*Pet*/ EmuConstants::ITEM_COMMON_SIZE
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint16 EQLimits::ItemContainerSize(uint32 version) {
static const uint16 local[_EmuClientCount] = {
uint16 EQLimits::ItemContainerSize(ClientVersion clientVersion) {
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Titanium*/ EmuConstants::ITEM_CONTAINER_SIZE,
@@ -1082,11 +872,11 @@ uint16 EQLimits::ItemContainerSize(uint32 version) {
/*Pet*/ EmuConstants::ITEM_CONTAINER_SIZE
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::CoinHasWeight(uint32 version) {
static const bool local[_EmuClientCount] = {
bool EQLimits::CoinHasWeight(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ true,
/*62*/ true,
/*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT,
@@ -1102,11 +892,11 @@ bool EQLimits::CoinHasWeight(uint32 version) {
/*Pet*/ true
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::BandoliersCount(uint32 version) {
static const uint32 local[_EmuClientCount] = {
uint32 EQLimits::BandoliersCount(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::BANDOLIERS_COUNT,
/*Titanium*/ EmuConstants::BANDOLIERS_COUNT,
@@ -1122,11 +912,11 @@ uint32 EQLimits::BandoliersCount(uint32 version) {
/*Pet*/ NOT_USED
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::BandolierSize(uint32 version) {
static const uint32 local[_EmuClientCount] = {
uint32 EQLimits::BandolierSize(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::BANDOLIER_SIZE,
/*Titanium*/ EmuConstants::BANDOLIER_SIZE,
@@ -1142,11 +932,11 @@ uint32 EQLimits::BandolierSize(uint32 version) {
/*Pet*/ NOT_USED
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::PotionBeltSize(uint32 version) {
static const uint32 local[_EmuClientCount] = {
uint32 EQLimits::PotionBeltSize(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::POTION_BELT_SIZE,
/*Titanium*/ EmuConstants::POTION_BELT_SIZE,
@@ -1162,5 +952,5 @@ uint32 EQLimits::PotionBeltSize(uint32 version) {
/*Pet*/ NOT_USED
};
return local[ValidateMobVersion(version)];
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
+26 -29
View File
@@ -46,15 +46,15 @@ class EmuConstants {
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
public:
// database
static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF; // adjust according to starting item placement and target client
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
// inventory
static uint16 InventoryMapSize(int16 map);
static uint16 InventoryMapSize(int16 indexMap);
//static std::string InventoryLocationName(Location_Struct location);
static std::string InventoryMapName(int16 map);
static std::string InventoryMainName(int16 main);
static std::string InventorySubName(int16 sub);
static std::string InventoryAugName(int16 aug);
static std::string InventoryMapName(int16 indexMap);
static std::string InventoryMainName(int16 indexMain);
static std::string InventorySubName(int16 indexSub);
static std::string InventoryAugName(int16 indexAug);
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 MAP_POSSESSIONS_SIZE = _MainCount;
@@ -163,44 +163,41 @@ class EQLimits {
public:
// 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 IsValidClientVersion(uint32 version);
static uint32 ValidateClientVersion(uint32 version);
static EQClientVersion ValidateClientVersion(EQClientVersion version);
static bool IsValidPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
// basically..any non-client classes - do not when setting a valid client
static bool IsValidNPCVersion(uint32 version);
static uint32 ValidateNPCVersion(uint32 version);
static EQClientVersion ValidateNPCVersion(EQClientVersion version);
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
// these are 'universal' - do not when setting a valid client
static bool IsValidMobVersion(uint32 version);
static uint32 ValidateMobVersion(uint32 version);
static EQClientVersion ValidateMobVersion(EQClientVersion version);
static bool IsValidMobClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
// inventory
static uint16 InventoryMapSize(int16 map, uint32 version);
static uint64 PossessionsBitmask(uint32 version);
static uint64 EquipmentBitmask(uint32 version);
static uint64 GeneralBitmask(uint32 version);
static uint64 CursorBitmask(uint32 version);
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);
static bool AllowsEmptyBagInBag(uint32 version);
static bool AllowsClickCastFromBag(uint32 version);
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
// items
static uint16 ItemCommonSize(uint32 version);
static uint16 ItemContainerSize(uint32 version);
static uint16 ItemCommonSize(ClientVersion clientVersion);
static uint16 ItemContainerSize(ClientVersion clientVersion);
// player profile
static bool CoinHasWeight(uint32 version);
static bool CoinHasWeight(ClientVersion clientVersion);
static uint32 BandoliersCount(uint32 version);
static uint32 BandolierSize(uint32 version);
static uint32 BandoliersCount(ClientVersion clientVersion);
static uint32 BandolierSize(ClientVersion clientVersion);
static uint32 PotionBeltSize(uint32 version);
static uint32 PotionBeltSize(ClientVersion clientVersion);
};
#endif /* EQ_LIMITS_H */
#endif /* EQ_DICTIONARY_H */
/*
Working Notes:
+1 -1
View File
@@ -35,7 +35,7 @@ public:
virtual const uint32 GetBytesRecieved() const { return 0; }
virtual const uint32 GetBytesSentPerSecond() const { return 0; }
virtual const uint32 GetBytesRecvPerSecond() const { return 0; }
virtual const EQClientVersion ClientVersion() const { return EQClientUnknown; }
virtual const ClientVersion GetClientVersion() const { return ClientVersion::Unknown; }
};
#endif /*EQSTREAMINTF_H_*/
+2 -2
View File
@@ -22,9 +22,9 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const EQClientVersion EQStreamProxy::ClientVersion() const
const ClientVersion EQStreamProxy::GetClientVersion() const
{
return m_structs->ClientVersion();
return m_structs->GetClientVersion();
}
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {
+1 -1
View File
@@ -27,7 +27,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
virtual const uint32 GetBytesSent() const;
virtual const uint32 GetBytesRecieved() const;
+4 -4
View File
@@ -117,11 +117,11 @@ public:
// Public Methods
///////////////////////////////
Inventory() { m_version = EQClientUnknown; m_versionset = false; }
Inventory() { m_version = ClientVersion::Unknown; m_versionset = false; }
~Inventory();
// Inventory v2 creep
bool SetInventoryVersion(EQClientVersion version) {
bool SetInventoryVersion(ClientVersion version) {
if (!m_versionset) {
m_version = version;
return (m_versionset = true);
@@ -131,7 +131,7 @@ public:
}
}
EQClientVersion GetInventoryVersion() { return m_version; }
ClientVersion GetInventoryVersion() { return m_version; }
static void CleanDirty();
static void MarkDirty(ItemInst *inst);
@@ -252,7 +252,7 @@ protected:
private:
// Active inventory version
EQClientVersion m_version;
ClientVersion m_version;
bool m_versionset;
};
+2 -2
View File
@@ -114,9 +114,9 @@ namespace RoF
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientRoF;
return ClientVersion::RoF;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace RoF {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+2 -2
View File
@@ -114,9 +114,9 @@ namespace RoF2
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientRoF2;
return ClientVersion::RoF2;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace RoF2 {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+2 -2
View File
@@ -112,9 +112,9 @@ namespace SoD
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientSoD;
return ClientVersion::SoD;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace SoD {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+2 -2
View File
@@ -112,9 +112,9 @@ namespace SoF
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientSoF;
return ClientVersion::SoF;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace SoF {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+2 -2
View File
@@ -110,9 +110,9 @@ namespace Titanium
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientTitanium;
return ClientVersion::Tit;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace Titanium {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+2 -2
View File
@@ -112,9 +112,9 @@ namespace Underfoot
return(r);
}
const EQClientVersion Strategy::ClientVersion() const
const ClientVersion Strategy::GetClientVersion() const
{
return EQClientUnderfoot;
return ClientVersion::Und;
}
#include "ss_define.h"
+1 -1
View File
@@ -23,7 +23,7 @@ namespace Underfoot {
protected:
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const ClientVersion GetClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+1 -1
View File
@@ -24,7 +24,7 @@ public:
void Decode(EQApplicationPacket *p) const;
virtual std::string Describe() const = 0;
virtual const EQClientVersion ClientVersion() const = 0;
virtual const ClientVersion GetClientVersion() const = 0;
protected:
//some common coders: