Reworked ClientVersion into EQEmu::versions; Added EQEmu::versions::InventoryVersion

This commit is contained in:
Uleat 2016-04-22 03:49:17 -04:00
parent 6bc60391fb
commit b3475d7b50
66 changed files with 732 additions and 561 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 04/22/2016 ==
Uleat: Reworked ClientVersion into namespace EQEmu; Added InventoryVersion
== 04/19/2016 ==
Uleat: Changed the recent EQEmu rework to eliminate the nested class design (possible cause of VS2015 update crashes - unverified)
Uleat: Some more inv2 convergence work

View File

@ -3,6 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(common_sources
base_packet.cpp
classes.cpp
client_version.cpp
condition.cpp
crash.cpp
crc16.cpp
@ -33,6 +34,7 @@ SET(common_sources
faction.cpp
guild_base.cpp
guilds.cpp
inventory_version.cpp
ipc_mutex.cpp
item.cpp
light_source.cpp
@ -101,6 +103,7 @@ SET(common_headers
base_data.h
bodytypes.h
classes.h
client_version.h
condition.h
crash.h
crc16.h
@ -142,6 +145,7 @@ SET(common_headers
global_define.h
guild_base.h
guilds.h
inventory_version.h
ipc_mutex.h
item.h
item_fieldlist.h

128
common/client_version.cpp Normal file
View File

@ -0,0 +1,128 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "client_version.h"
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return false;
return true;
}
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return ClientVersion::Unknown;
return client_version;
}
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
return "Unknown Version";
case ClientVersion::Client62:
return "Client 6.2";
case ClientVersion::Titanium:
return "Titanium";
case ClientVersion::SoF:
return "SoF";
case ClientVersion::SoD:
return "SoD";
case ClientVersion::UF:
return "UF";
case ClientVersion::RoF:
return "RoF";
case ClientVersion::RoF2:
return "RoF2";
default:
return "Invalid Version";
};
}
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
return bit_Unknown;
case ClientVersion::Titanium:
return bit_Titanium;
case ClientVersion::SoF:
return bit_SoF;
case ClientVersion::SoD:
return bit_SoD;
case ClientVersion::UF:
return bit_UF;
case ClientVersion::RoF:
return bit_RoF;
case ClientVersion::RoF2:
return bit_RoF2;
default:
return bit_Unknown;
}
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
{
switch (client_version_bit) {
case (uint32)static_cast<unsigned int>(ClientVersion::Unknown) :
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Client62) - 1)) :
return ClientVersion::Unknown;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
return ClientVersion::Titanium;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoF) - 1)) :
return ClientVersion::SoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoD) - 1)) :
return ClientVersion::SoD;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::UF) - 1)) :
return ClientVersion::UF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF) - 1)) :
return ClientVersion::RoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
return ClientVersion::RoF2;
default:
return ClientVersion::Unknown;
}
}
uint32 EQEmu::versions::ConvertClientVersionToExpansion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
case ClientVersion::Titanium:
return 0x000007FFU;
case ClientVersion::SoF:
return 0x00007FFFU;
case ClientVersion::SoD:
return 0x0000FFFFU;
case ClientVersion::UF:
return 0x0001FFFFU;
case ClientVersion::RoF:
case ClientVersion::RoF2:
return 0x000FFFFFU;
default:
return 0;
}
}

74
common/client_version.h Normal file
View File

@ -0,0 +1,74 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_CLIENT_VERSION_H
#define COMMON_CLIENT_VERSION_H
#include "types.h"
namespace EQEmu
{
namespace versions {
enum class ClientVersion {
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2 // Build: 'May 10 2013 23:30:08'
};
enum ClientVersionBit : uint32 {
bit_Unknown = 0,
bit_Client62 = 0x00000001, // unsupported (placeholder for scripts)
bit_Titanium = 0x00000002,
bit_SoF = 0x00000004,
bit_SoD = 0x00000008,
bit_UF = 0x00000010,
bit_RoF = 0x00000020,
bit_RoF2 = 0x00000040,
bit_TitaniumAndEarlier = 0x00000003,
bit_SoFAndEarlier = 0x00000007,
bit_SoDAndEarlier = 0x0000000F,
bit_UFAndEarlier = 0x0000001F,
bit_RoFAndEarlier = 0x0000003F,
bit_SoFAndLater = 0xFFFFFFFC,
bit_SoDAndLater = 0xFFFFFFF8,
bit_UFAndLater = 0xFFFFFFF0,
bit_RoFAndLater = 0xFFFFFFE0,
bit_RoF2AndLater = 0xFFFFFFC0,
bit_AllClients = 0xFFFFFFFF
};
static const ClientVersion LastClientVersion = ClientVersion::RoF2;
static const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
extern bool IsValidClientVersion(ClientVersion client_version);
extern ClientVersion ValidateClientVersion(ClientVersion client_version);
extern const char* ClientVersionName(ClientVersion client_version);
extern uint32 ConvertClientVersionToClientVersionBit(ClientVersion client_version);
extern ClientVersion ConvertClientVersionBitToClientVersion(uint32 client_version_bit);
extern uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
}
}
#endif /* COMMON_CLIENT_VERSION_H */

View File

@ -1,182 +0,0 @@
/*
EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CLIENTVERSIONS_H
#define CLIENTVERSIONS_H
#include "types.h"
static const uint32 BIT_Client62 = 0x00000001; // 1 (unsupported - placeholder for scripts)
static const uint32 BIT_Titanium = 0x00000002; // 2
static const uint32 BIT_SoF = 0x00000004; // 4
static const uint32 BIT_SoD = 0x00000008; // 8
static const uint32 BIT_UF = 0x00000010; // 16
static const uint32 BIT_RoF = 0x00000020; // 32
static const uint32 BIT_RoF2 = 0x00000040; // 64
static const uint32 BIT_TitaniumAndEarlier = 0x00000003; // 3
static const uint32 BIT_SoFAndEarlier = 0x00000007; // 7
static const uint32 BIT_SoDAndEarlier = 0x0000000F; // 15
static const uint32 BIT_UFAndEarlier = 0x0000001F; // 31
static const uint32 BIT_RoFAndEarlier = 0x0000003F; // 63
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC; // 4294967292
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8; // 4294967288
static const uint32 BIT_UFAndLater = 0xFFFFFFF0; // 4294967280
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0; // 4294967264
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0; // 4294967232
static const uint32 BIT_AllClients = 0xFFFFFFFF;
enum class ClientVersion
{
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2, // Build: 'May 10 2013 23:30:08'
MobNPC,
MobMerc,
MobBot,
MobPet,
};
#define CLIENT_VERSION_COUNT 12
#define LAST_PC_CLIENT ClientVersion::RoF2
#define LAST_NPC_CLIENT ClientVersion::MobPet
static const char* ClientVersionName(ClientVersion version)
{
switch (version)
{
case ClientVersion::Unknown:
return "Unknown";
case ClientVersion::Client62:
return "Client62";
case ClientVersion::Titanium:
return "Titanium";
case ClientVersion::SoF:
return "SoF";
case ClientVersion::SoD:
return "SoD";
case ClientVersion::UF:
return "UF";
case ClientVersion::RoF:
return "RoF";
case ClientVersion::RoF2:
return "RoF2";
case ClientVersion::MobNPC:
return "MobNPC";
case ClientVersion::MobMerc:
return "MobMerc";
case ClientVersion::MobBot:
return "MobBot";
case ClientVersion::MobPet:
return "MobPet";
default:
return "<ERROR> Invalid ClientVersion";
};
}
static uint32 ClientBitFromVersion(ClientVersion clientVersion)
{
switch (clientVersion)
{
case ClientVersion::Unknown:
case ClientVersion::Client62:
return 0;
case ClientVersion::Titanium:
case ClientVersion::SoF:
case ClientVersion::SoD:
case ClientVersion::UF:
case ClientVersion::RoF:
case ClientVersion::RoF2:
case ClientVersion::MobNPC:
case ClientVersion::MobMerc:
case ClientVersion::MobBot:
case ClientVersion::MobPet:
return ((uint32)1 << (static_cast<unsigned int>(clientVersion) - 1));
default:
return 0;
}
}
static ClientVersion ClientVersionFromBit(uint32 clientVersionBit)
{
switch (clientVersionBit)
{
case (uint32)static_cast<unsigned int>(ClientVersion::Unknown):
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Client62) - 1)):
return ClientVersion::Unknown;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)):
return ClientVersion::Titanium;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoF) - 1)):
return ClientVersion::SoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoD) - 1)):
return ClientVersion::SoD;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::UF) - 1)):
return ClientVersion::UF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF) - 1)):
return ClientVersion::RoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)):
return ClientVersion::RoF2;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::MobNPC) - 1)):
return ClientVersion::MobNPC;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::MobMerc) - 1)):
return ClientVersion::MobMerc;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::MobBot) - 1)):
return ClientVersion::MobBot;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::MobPet) - 1)):
return ClientVersion::MobPet;
default:
return ClientVersion::Unknown;
}
}
static uint32 ExpansionFromClientVersion(ClientVersion clientVersion)
{
switch(clientVersion)
{
case ClientVersion::Unknown:
case ClientVersion::Client62:
case ClientVersion::Titanium:
return 0x000007FFU;
case ClientVersion::SoF:
return 0x00007FFFU;
case ClientVersion::SoD:
return 0x0000FFFFU;
case ClientVersion::UF:
return 0x0001FFFFU;
case ClientVersion::RoF:
case ClientVersion::RoF2:
return 0x000FFFFFU;
default:
return 0;
}
}
#endif /* CLIENTVERSIONS_H */

View File

@ -26,6 +26,7 @@
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
#include "emu_legacy.h"
#include "inventory_version.h"
#include "light_source.h"
#include "deity.h"
#include "say_link.h"
@ -44,9 +45,8 @@ namespace EQEmu
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
namespace constants {
// database
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT;
static const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
static const size_t CharacterCreationLimit = RoF2::consts::CHARACTER_CREATION_LIMIT;
// inventory
extern uint16 InventoryTypeSize(int16 type_index);

View File

@ -20,61 +20,10 @@
#include "emu_constants.h"
// client validation
bool EQEmu::limits::IsValidPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return true;
return false;
}
ClientVersion EQEmu::limits::ValidatePCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// npc validation
bool EQEmu::limits::IsValidNPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return true;
return false;
}
ClientVersion EQEmu::limits::ValidateNPCClientVersion(ClientVersion clientVersion)
{
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// mob validation
bool EQEmu::limits::IsValidMobClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return true;
return false;
}
ClientVersion EQEmu::limits::ValidateMobClientVersion(ClientVersion clientVersion)
{
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// database
size_t EQEmu::limits::CharacterCreationLimit(ClientVersion clientVersion)
size_t EQEmu::limits::CharacterCreationLimit(versions::ClientVersion client_version)
{
static const size_t local[CLIENT_VERSION_COUNT] = {
static const size_t local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*Client62*/ NOT_USED,
/*Titanium*/ Titanium::consts::CHARACTER_CREATION_LIMIT,
@ -90,11 +39,11 @@ size_t EQEmu::limits::CharacterCreationLimit(ClientVersion clientVersion)
/*MobPet*/ NOT_USED
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return local[static_cast<size_t>(versions::ValidateClientVersion(client_version))];
}
// inventory
uint16 EQEmu::limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion)
uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type)
{
// 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
@ -107,7 +56,7 @@ uint16 EQEmu::limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
//
// 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] = {
static const uint16 local[TypeCount][versions::InventoryVersionCount] = {
// 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
@ -488,20 +437,20 @@ uint16 EQEmu::limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersi
}
};
if ((uint16)indexMap < TypeCount)
return local[indexMap][static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
if ((uint16)inv_type < TypeCount)
return local[inv_type][static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
return NOT_USED;
}
uint64 EQEmu::limits::PossessionsBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::PossessionsBitmask(versions::InventoryVersion inventory_version)
{
// 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[CLIENT_VERSION_COUNT] = {
static const uint64 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000027FDFFFFF,
/*Titanium*/ 0x000000027FDFFFFF,
@ -518,12 +467,12 @@ uint64 EQEmu::limits::PossessionsBitmask(ClientVersion clientVersion)
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint64 EQEmu::limits::EquipmentBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::EquipmentBitmask(versions::InventoryVersion inventory_version)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
static const uint64 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x00000000005FFFFF,
/*Titanium*/ 0x00000000005FFFFF,
@ -540,12 +489,12 @@ uint64 EQEmu::limits::EquipmentBitmask(ClientVersion clientVersion)
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint64 EQEmu::limits::GeneralBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::GeneralBitmask(versions::InventoryVersion inventory_version)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
static const uint64 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000007F800000,
/*Titanium*/ 0x000000007F800000,
@ -562,12 +511,12 @@ uint64 EQEmu::limits::GeneralBitmask(ClientVersion clientVersion)
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint64 EQEmu::limits::CursorBitmask(ClientVersion clientVersion)
uint64 EQEmu::limits::CursorBitmask(versions::InventoryVersion inventory_version)
{
static const uint64 local[CLIENT_VERSION_COUNT] = {
static const uint64 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x0000000200000000,
/*Titanium*/ 0x0000000200000000,
@ -584,12 +533,12 @@ uint64 EQEmu::limits::CursorBitmask(ClientVersion clientVersion)
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
bool EQEmu::limits::AllowEmptyBagInBag(versions::InventoryVersion inventory_version)
{
static const bool local[CLIENT_VERSION_COUNT] = {
static const bool local[versions::InventoryVersionCount] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG,
@ -606,12 +555,12 @@ bool EQEmu::limits::AllowsEmptyBagInBag(ClientVersion clientVersion)
};
return false; // not implemented
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::limits::AllowsClickCastFromBag(ClientVersion clientVersion)
bool EQEmu::limits::AllowClickCastFromBag(versions::InventoryVersion inventory_version)
{
static const bool local[CLIENT_VERSION_COUNT] = {
static const bool local[versions::InventoryVersionCount] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG,
@ -627,13 +576,13 @@ bool EQEmu::limits::AllowsClickCastFromBag(ClientVersion clientVersion)
/*Pet*/ false
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
// items
uint16 EQEmu::limits::ItemCommonSize(ClientVersion clientVersion)
uint16 EQEmu::limits::ItemCommonSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[CLIENT_VERSION_COUNT] = {
static const uint16 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ constants::ITEM_COMMON_SIZE,
/*Titanium*/ constants::ITEM_COMMON_SIZE,
@ -649,12 +598,12 @@ uint16 EQEmu::limits::ItemCommonSize(ClientVersion clientVersion)
/*Pet*/ constants::ITEM_COMMON_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint16 EQEmu::limits::ItemContainerSize(ClientVersion clientVersion)
uint16 EQEmu::limits::ItemContainerSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[CLIENT_VERSION_COUNT] = {
static const uint16 local[versions::InventoryVersionCount] = {
/*Unknown*/ NOT_USED,
/*62*/ constants::ITEM_CONTAINER_SIZE,
/*Titanium*/ constants::ITEM_CONTAINER_SIZE,
@ -670,12 +619,12 @@ uint16 EQEmu::limits::ItemContainerSize(ClientVersion clientVersion)
/*Pet*/ constants::ITEM_CONTAINER_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::limits::CoinHasWeight(ClientVersion clientVersion)
bool EQEmu::limits::CoinHasWeight(versions::InventoryVersion inventory_version)
{
static const bool local[CLIENT_VERSION_COUNT] = {
static const bool local[versions::InventoryVersionCount] = {
/*Unknown*/ true,
/*62*/ true,
/*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT,
@ -691,5 +640,5 @@ bool EQEmu::limits::CoinHasWeight(ClientVersion clientVersion)
/*Pet*/ true
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}

View File

@ -22,7 +22,7 @@
#include "types.h"
#include "eq_constants.h"
#include "clientversions.h"
#include "inventory_version.h" // inv2 watch
#include "../common/patches/titanium_constants.h"
#include "../common/patches/sof_constants.h"
#include "../common/patches/sod_constants.h"
@ -39,42 +39,26 @@
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...)
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)
extern bool IsValidPCClientVersion(ClientVersion clientVersion);
extern ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
// basically..any non-client classes - do not invoke when setting a valid client
extern bool IsValidNPCClientVersion(ClientVersion clientVersion);
extern ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
// these are 'universal' - do not invoke when setting a valid client
extern bool IsValidMobClientVersion(ClientVersion clientVersion);
extern ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
// database
extern size_t CharacterCreationLimit(ClientVersion clientVersion);
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
// inventory
extern uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
extern uint64 PossessionsBitmask(ClientVersion clientVersion);
extern uint64 EquipmentBitmask(ClientVersion clientVersion);
extern uint64 GeneralBitmask(ClientVersion clientVersion);
extern uint64 CursorBitmask(ClientVersion clientVersion);
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
extern uint64 EquipmentBitmask(versions::InventoryVersion inventory_version);
extern uint64 GeneralBitmask(versions::InventoryVersion inventory_version);
extern uint64 CursorBitmask(versions::InventoryVersion inventory_version);
extern bool AllowsEmptyBagInBag(ClientVersion clientVersion);
extern bool AllowsClickCastFromBag(ClientVersion clientVersion);
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
// items
extern uint16 ItemCommonSize(ClientVersion clientVersion);
extern uint16 ItemContainerSize(ClientVersion clientVersion);
extern uint16 ItemCommonSize(versions::InventoryVersion inventory_version);
extern uint16 ItemContainerSize(versions::InventoryVersion inventory_version);
// player profile
extern bool CoinHasWeight(ClientVersion clientVersion);
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
}
}

View File

@ -4,7 +4,7 @@
//this is the only part of an EQStream that is seen by the application.
#include <string>
#include "clientversions.h"
#include "client_version.h" // inv2 watch
typedef enum {
ESTABLISHED,
@ -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 ClientVersion GetClientVersion() const { return ClientVersion::Unknown; }
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
};
#endif /*EQSTREAMINTF_H_*/

View File

@ -21,9 +21,9 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const ClientVersion EQStreamProxy::GetClientVersion() const
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->GetClientVersion();
return m_structs->ClientVersion();
}
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {

View File

@ -28,7 +28,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const uint32 GetBytesSent() const;
virtual const uint32 GetBytesRecieved() const;

View File

@ -0,0 +1,147 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "inventory_version.h"
bool EQEmu::versions::IsValidInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastInventoryVersion)
return false;
return true;
}
bool EQEmu::versions::IsValidPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastPCInventoryVersion)
return false;
return true;
}
bool EQEmu::versions::IsValidNonPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= LastPCInventoryVersion || inventory_version > LastNonPCInventoryVersion)
return false;
return true;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidateInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidatePCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastPCInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidateNonPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= LastPCInventoryVersion || inventory_version > LastNonPCInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
const char* EQEmu::versions::InventoryVersionName(InventoryVersion inventory_version)
{
switch (inventory_version) {
case InventoryVersion::Unknown:
return "Unknown Version";
case InventoryVersion::Client62:
return "Client 6.2";
case InventoryVersion::Titanium:
return "Titanium";
case InventoryVersion::SoF:
return "SoF";
case InventoryVersion::SoD:
return "SoD";
case InventoryVersion::UF:
return "UF";
case InventoryVersion::RoF:
return "RoF";
case InventoryVersion::RoF2:
return "RoF2";
case InventoryVersion::NPC:
return "NPC";
case InventoryVersion::Merc:
return "Merc";
case InventoryVersion::Bot:
return "Bot";
case InventoryVersion::Pet:
return "Pet";
default:
return "Invalid Version";
};
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version)
{
switch (inventory_version) {
case InventoryVersion::Unknown:
case InventoryVersion::Client62:
return ClientVersion::Unknown;
case InventoryVersion::Titanium:
return ClientVersion::Titanium;
case InventoryVersion::SoF:
return ClientVersion::SoF;
case InventoryVersion::SoD:
return ClientVersion::SoD;
case InventoryVersion::UF:
return ClientVersion::UF;
case InventoryVersion::RoF:
return ClientVersion::RoF;
case InventoryVersion::RoF2:
return ClientVersion::RoF2;
default:
return ClientVersion::Unknown;
}
}
EQEmu::versions::InventoryVersion EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
return InventoryVersion::Unknown;
case ClientVersion::Titanium:
return InventoryVersion::Titanium;
case ClientVersion::SoF:
return InventoryVersion::SoF;
case ClientVersion::SoD:
return InventoryVersion::SoD;
case ClientVersion::UF:
return InventoryVersion::UF;
case ClientVersion::RoF:
return InventoryVersion::RoF;
case ClientVersion::RoF2:
return InventoryVersion::RoF2;
default:
return InventoryVersion::Unknown;
}
}

View File

@ -0,0 +1,62 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_INVENTORY_VERSION_H
#define COMMON_INVENTORY_VERSION_H
#include "types.h"
#include "client_version.h"
namespace EQEmu
{
namespace versions {
enum class InventoryVersion {
Unknown = 0,
Client62,
Titanium,
SoF,
SoD,
UF,
RoF,
RoF2,
NPC,
Merc,
Bot,
Pet
};
static const InventoryVersion LastInventoryVersion = InventoryVersion::Pet;
static const InventoryVersion LastPCInventoryVersion = InventoryVersion::RoF2;
static const InventoryVersion LastNonPCInventoryVersion = InventoryVersion::Pet;
static const size_t InventoryVersionCount = (static_cast<size_t>(LastInventoryVersion) + 1);
extern bool IsValidInventoryVersion(InventoryVersion inventory_version);
extern bool IsValidPCInventoryVersion(InventoryVersion inventory_version);
extern bool IsValidNonPCInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidateInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidatePCInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidateNonPCInventoryVersion(InventoryVersion inventory_version);
extern const char* InventoryVersionName(InventoryVersion inventory_version);
extern ClientVersion ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version);
extern InventoryVersion ConvertClientVersionToInventoryVersion(ClientVersion client_version);
}
}
#endif /* COMMON_INVENTORY_VERSION_H */

View File

@ -927,7 +927,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id)
}
else if (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END)
{
if (EQEmu::limits::AllowsClickCastFromBag(m_version))
if (EQEmu::limits::AllowClickCastFromBag(m_inventory_version))
return true;
}

View File

@ -114,22 +114,23 @@ public:
///////////////////////////////
// Public Methods
///////////////////////////////
Inventory() { m_version = ClientVersion::Unknown; m_versionset = false; }
Inventory() { m_inventory_version = EQEmu::versions::InventoryVersion::Unknown; m_inventory_version_set = false; }
~Inventory();
// Inventory v2 creep
bool SetInventoryVersion(ClientVersion version) {
if (!m_versionset) {
m_version = version;
return (m_versionset = true);
// inv2 creep
bool SetInventoryVersion(EQEmu::versions::InventoryVersion inventory_version) {
if (!m_inventory_version_set) {
m_inventory_version = EQEmu::versions::ValidateInventoryVersion(inventory_version);
return (m_inventory_version_set = true);
}
else {
return false;
}
}
bool SetInventoryVersion(EQEmu::versions::ClientVersion client_version) { return SetInventoryVersion(EQEmu::versions::ConvertClientVersionToInventoryVersion(client_version)); }
ClientVersion GetInventoryVersion() { return m_version; }
EQEmu::versions::InventoryVersion InventoryVersion() { return m_inventory_version; }
static void CleanDirty();
static void MarkDirty(ItemInst *inst);
@ -252,8 +253,8 @@ protected:
private:
// Active inventory version
ClientVersion m_version;
bool m_versionset;
EQEmu::versions::InventoryVersion m_inventory_version;
bool m_inventory_version_set;
};
class SharedDatabase;

View File

@ -117,9 +117,9 @@ namespace RoF
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::RoF;
return EQEmu::versions::ClientVersion::RoF;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace RoF {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -117,9 +117,9 @@ namespace RoF2
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::RoF2;
return EQEmu::versions::ClientVersion::RoF2;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace RoF2 {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -113,9 +113,9 @@ namespace SoD
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::SoD;
return EQEmu::versions::ClientVersion::SoD;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace SoD {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -113,9 +113,9 @@ namespace SoF
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::SoF;
return EQEmu::versions::ClientVersion::SoF;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace SoF {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -111,9 +111,9 @@ namespace Titanium
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::Titanium;
return EQEmu::versions::ClientVersion::Titanium;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace Titanium {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -113,9 +113,9 @@ namespace UF
return(r);
}
const ClientVersion Strategy::GetClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return ClientVersion::UF;
return EQEmu::versions::ClientVersion::UF;
}
#include "ss_define.h"

View File

@ -23,7 +23,7 @@ namespace UF {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"

View File

@ -4,7 +4,7 @@
class EQApplicationPacket;
class EQStream;
#include "emu_opcodes.h"
#include "clientversions.h"
#include "client_version.h" // inv2 watch
#include <string>
#include <memory>
@ -25,7 +25,7 @@ public:
void Decode(EQApplicationPacket *p) const;
virtual std::string Describe() const = 0;
virtual const ClientVersion GetClientVersion() const = 0;
virtual const EQEmu::versions::ClientVersion ClientVersion() const = 0;
protected:
//some common coders:

View File

@ -32,7 +32,7 @@
#include "../common/skills.h"
#include "../common/extprofile.h"
#include "../common/string_util.h"
#include "../common/clientversions.h"
#include "../common/client_version.h" // inv2 watch
#include "../common/random.h"
#include "../common/shareddb.h"
@ -106,8 +106,8 @@ Client::Client(EQStreamInterface* ieqs)
pwaitingforbootup = 0;
StartInTutorial = false;
m_ClientVersion = eqs->GetClientVersion();
m_ClientVersionBit = ClientBitFromVersion(m_ClientVersion);
m_ClientVersion = eqs->ClientVersion();
m_ClientVersionBit = EQEmu::versions::ConvertClientVersionToClientVersionBit(m_ClientVersion);
numclients++;
}
@ -171,7 +171,7 @@ void Client::SendExpansionInfo() {
auto outapp = new EQApplicationPacket(OP_ExpansionInfo, sizeof(ExpansionInfo_Struct));
ExpansionInfo_Struct *eis = (ExpansionInfo_Struct*)outapp->pBuffer;
if(RuleB(World, UseClientBasedExpansionSettings)) {
eis->Expansions = ExpansionFromClientVersion(eqs->GetClientVersion());
eis->Expansions = EQEmu::versions::ConvertClientVersionToExpansion(eqs->ClientVersion());
//eis->Expansions = ExpansionFromClientVersion(this->GetCLE.
} else {
eis->Expansions = (RuleI(World, ExpansionSettings));
@ -186,7 +186,7 @@ void Client::SendCharInfo() {
cle->SetOnline(CLE_Status_CharSelect);
}
if (m_ClientVersionBit & BIT_RoFAndLater) {
if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater) {
SendMaxCharCreate();
SendMembership();
SendMembershipSettings();
@ -212,8 +212,8 @@ void Client::SendMaxCharCreate() {
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
mc->max_chars = EQEmu::limits::CharacterCreationLimit(m_ClientVersion);
if (mc->max_chars > EQEmu::constants::CHARACTER_CREATION_LIMIT)
mc->max_chars = EQEmu::constants::CHARACTER_CREATION_LIMIT;
if (mc->max_chars > EQEmu::constants::CharacterCreationLimit)
mc->max_chars = EQEmu::constants::CharacterCreationLimit;
QueuePacket(outapp);
safe_delete(outapp);
@ -698,7 +698,7 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
}
else
{
if (m_ClientVersionBit & BIT_TitaniumAndEarlier)
if (m_ClientVersionBit & EQEmu::versions::bit_TitaniumAndEarlier)
StartInTutorial = true;
SendCharInfo();
}
@ -746,9 +746,9 @@ 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 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) {
size_t character_limit = EQEmu::limits::CharacterCreationLimit(eqs->GetClientVersion());
if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT) { character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT; }
if (eqs->GetClientVersion() == ClientVersion::Titanium) { character_limit = 8; }
size_t character_limit = EQEmu::limits::CharacterCreationLimit(eqs->ClientVersion());
if (character_limit > EQEmu::constants::CharacterCreationLimit) { character_limit = EQEmu::constants::CharacterCreationLimit; }
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
std::string tgh_query = StringFormat(
"SELECT "
@ -879,9 +879,9 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
char ConnectionType;
if (m_ClientVersionBit & BIT_UFAndLater)
if (m_ClientVersionBit & EQEmu::versions::bit_UFAndLater)
ConnectionType = 'U';
else if (m_ClientVersionBit & BIT_SoFAndLater)
else if (m_ClientVersionBit & EQEmu::versions::bit_SoFAndLater)
ConnectionType = 'S';
else
ConnectionType = 'C';
@ -905,7 +905,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
outapp2 = new EQApplicationPacket(OP_SetChatServer2);
if (m_ClientVersionBit & BIT_TitaniumAndEarlier)
if (m_ClientVersionBit & EQEmu::versions::bit_TitaniumAndEarlier)
ConnectionType = 'M';
sprintf(buffer,"%s,%i,%s.%s,%c%08X",
@ -939,7 +939,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) {
bool Client::HandleZoneChangePacket(const EQApplicationPacket *app) {
// HoT sends this to world while zoning and wants it echoed back.
if (m_ClientVersionBit & BIT_RoFAndLater)
if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater)
{
QueuePacket(app);
}
@ -1412,7 +1412,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
Log.Out(Logs::Detail, Logs::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
/* Validate the char creation struct */
if (m_ClientVersionBit & BIT_SoFAndLater) {
if (m_ClientVersionBit & EQEmu::versions::bit_SoFAndLater) {
if (!CheckCharCreateInfoSoF(cc)) {
Log.Out(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
return false;
@ -1483,7 +1483,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
pp.pvp = database.GetServerType() == 1 ? 1 : 0;
/* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */
if (m_ClientVersionBit & BIT_SoFAndLater) {
if (m_ClientVersionBit & EQEmu::versions::bit_SoFAndLater) {
Log.Out(Logs::Detail, Logs::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
if (RuleI(World, SoFStartZoneID) > 0) {
pp.zone_id = RuleI(World, SoFStartZoneID);
@ -1499,7 +1499,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
}
}
/* use normal starting zone logic to either get defaults, or if startzone was set, load that from the db table.*/
bool ValidStartZone = database.GetStartZone(&pp, cc, m_ClientVersionBit & BIT_TitaniumAndEarlier);
bool ValidStartZone = database.GetStartZone(&pp, cc, m_ClientVersionBit & EQEmu::versions::bit_TitaniumAndEarlier);
if (!ValidStartZone){
return false;
@ -1833,7 +1833,7 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
}
}
if (cle->GetClientVersion() < static_cast<uint8>(ClientVersion::RoF2) && pp->class_ == BERSERKER) {
if (cle->GetClientVersion() < static_cast<uint8>(EQEmu::versions::ClientVersion::RoF2) && pp->class_ == BERSERKER) {
pp->skills[Skill1HPiercing] = pp->skills[Skill2HPiercing];
pp->skills[Skill2HPiercing] = 0;
}

View File

@ -84,7 +84,7 @@ private:
uint32 pwaitingforbootup;
bool StartInTutorial;
ClientVersion m_ClientVersion;
EQEmu::versions::ClientVersion m_ClientVersion;
uint32 m_ClientVersionBit;
bool OPCharCreate(char *name, CharCreate_Struct *cc);

View File

@ -36,15 +36,15 @@ extern std::vector<RaceClassCombos> character_create_race_class_combos;
void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **outApp, uint32 clientVersionBit)
{
/* Set Character Creation Limit */
ClientVersion client_version = ClientVersionFromBit(clientVersionBit);
EQEmu::versions::ClientVersion client_version = EQEmu::versions::ConvertClientVersionBitToClientVersion(clientVersionBit);
size_t character_limit = EQEmu::limits::CharacterCreationLimit(client_version);
// Validate against absolute server max
if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT)
character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT;
if (character_limit > EQEmu::constants::CharacterCreationLimit)
character_limit = EQEmu::constants::CharacterCreationLimit;
// Force Titanium clients to use '8'
if (client_version == ClientVersion::Titanium)
if (client_version == EQEmu::versions::ClientVersion::Titanium)
character_limit = 8;
/* Get Character Info */

View File

@ -471,7 +471,7 @@ void Client::ResetAA() {
database.DeleteCharacterLeadershipAAs(CharacterID());
// undefined for these clients
if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
if (ClientVersionBit() & EQEmu::versions::bit_TitaniumAndEarlier)
Kick();
}
@ -1411,7 +1411,7 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
//the one titanium hack i will allow
//just to make sure we dont crash the client with newer aas
//we'll exclude any expendable ones
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_TitaniumAndEarlier) {
if(IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_TitaniumAndEarlier) {
if(ability->charges > 0) {
return false;
}

View File

@ -93,7 +93,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skillinuse = Skill1HPiercing;
else
skillinuse = Skill2HPiercing;
@ -1486,7 +1486,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
//this generates a lot of 'updates' to the client that the client does not need
BuffFadeNonPersistDeath();
if (RuleB(Character, UnmemSpellsOnDeath)) {
if((GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
if((ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && RuleB(Character, RespawnFromHover))
UnmemSpellAll(true);
else
UnmemSpellAll(false);
@ -1549,7 +1549,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
from these and overwrite what we set in pp anyway
*/
if(LeftCorpse && (GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
if(LeftCorpse && (ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && RuleB(Character, RespawnFromHover))
{
ClearDraggedCorpses();
RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000);
@ -3425,14 +3425,14 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
if (IsBuffSpell(spell_id)) { // hots
// message to caster
if (caster->IsClient() && caster == this) {
if (caster->CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name);
else
FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
YOU_HEALED, GetCleanName(), itoa(acthealed));
} else if (caster->IsClient() && caster != this) {
if (caster->CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed),
spells[spell_id].name);
@ -3442,7 +3442,7 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
}
// message to target
if (IsClient() && caster != this) {
if (CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime,
HOT_HEALED_OTHER, caster->GetCleanName(),
itoa(acthealed), spells[spell_id].name);

View File

@ -163,7 +163,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
}
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const ItemInst* inst = m_inv[SlotPowerSource];
if(inst)
@ -3293,7 +3293,7 @@ void Client::CalcItemScale() {
changed = true;
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(CalcItemScale(SlotPowerSource, SlotPowerSource))
changed = true;
@ -3387,7 +3387,7 @@ void Client::DoItemEnterZone() {
changed = true;
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(DoItemEnterZone(SlotPowerSource, SlotPowerSource))
changed = true;

View File

@ -1255,7 +1255,7 @@ int32 Bot::GenerateBaseHitPoints() {
uint32 lm = GetClassLevelFactor();
int32 Post255;
int32 NormalSTA = GetSTA();
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
float SoDPost255;
if(((NormalSTA - 255) / 2) > 0)
SoDPost255 = ((NormalSTA - 255) / 2);
@ -6127,7 +6127,7 @@ int32 Bot::GenerateBaseManaPoints() {
switch(GetCasterClass()) {
case 'I':
WisInt = INT;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if(WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if(WisInt > 201)
@ -6162,7 +6162,7 @@ int32 Bot::GenerateBaseManaPoints() {
break;
case 'W':
WisInt = WIS;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if(WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if(WisInt > 201)
@ -6346,7 +6346,7 @@ int32 Bot::GetMaxStat() {
int32 base = 0;
if (level < 61)
base = 255;
else if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoF)
else if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
base = (255 + 5 * (level - 60));
else if (level < 71)
base = (255 + 5 * (level - 60));
@ -6841,7 +6841,7 @@ int32 Bot::CalcBaseEndurance() {
int32 ConvertedStats = 0;
int32 sta_end = 0;
int Stats = 0;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int HeroicStats = 0;
Stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4);
HeroicStats = ((GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4);

View File

@ -4709,7 +4709,7 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep)
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(m_usage, "usage: %s [set | clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]);
c->Message(m_note, "Notes:");
if (c->GetClientVersion() >= ClientVersion::SoF) {
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
c->Message(m_message, "- Self-inspect and type your bot's inspect message");
c->Message(m_message, "- Close the self-inspect window to update the server");
c->Message(m_message, "- Type '%s set' to set the bot's inspect message", sep->arg[0]);

View File

@ -257,7 +257,7 @@ Client::Client(EQStreamInterface* ieqs)
GlobalChatLimiterTimer = new Timer(RuleI(Chat, IntervalDurationMS));
AttemptedMessages = 0;
TotalKarma = 0;
m_ClientVersion = ClientVersion::Unknown;
m_ClientVersion = EQEmu::versions::ClientVersion::Unknown;
m_ClientVersionBit = 0;
AggroCount = 0;
RestRegenHP = 0;
@ -1533,7 +1533,7 @@ void Client::UpdateWho(uint8 remove) {
else if (m_pp.anon >= 2)
scl->anon = 2;
scl->ClientVersion = static_cast<unsigned int>(GetClientVersion());
scl->ClientVersion = static_cast<unsigned int>(ClientVersion());
scl->tellsoff = tellsoff;
scl->guild_id = guild_id;
scl->LFG = LFG;
@ -1789,7 +1789,7 @@ void Client::SendManaUpdatePacket() {
if (!Connected() || IsCasting())
return;
if (GetClientVersion() >= ClientVersion::SoD) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) {
SendManaUpdate();
SendEnduranceUpdate();
}
@ -1824,7 +1824,7 @@ void Client::SendManaUpdatePacket() {
for(int i = 0; i < MAX_GROUP_MEMBERS; ++i)
if(g->members[i] && g->members[i]->IsClient() && (g->members[i] != this) && (g->members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD))
if (g->members[i] && g->members[i]->IsClient() && (g->members[i] != this) && (g->members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD))
{
g->members[i]->CastToClient()->QueuePacket(outapp);
g->members[i]->CastToClient()->QueuePacket(outapp2);
@ -2007,7 +2007,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
BookText_Struct *out = (BookText_Struct *) outapp->pBuffer;
out->window = book->window;
if(GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const ItemInst *inst = m_inv[book->invslot];
if(inst)
@ -2364,7 +2364,7 @@ bool Client::HasSkill(SkillUseTypes skill_id) const {
}
bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing)
skill_id = Skill2HPiercing;
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
@ -2372,7 +2372,7 @@ bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
}
uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
skillid = Skill2HPiercing;
return(database.GetSkillCap(class_, skillid, level));
@ -2380,7 +2380,7 @@ uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) cons
uint8 Client::SkillTrainLevel(SkillUseTypes skillid, uint16 class_)
{
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
skillid = Skill2HPiercing;
return(database.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
@ -2817,7 +2817,7 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){
Filter0(FilterMissedMe);
Filter1(FilterDamageShields);
if (GetClientVersionBit() & BIT_SoDAndLater) {
if (ClientVersionBit() & EQEmu::versions::bit_SoDAndLater) {
if (filter->filters[FilterDOT] == 0)
ClientFilters[FilterDOT] = FilterShow;
else if (filter->filters[FilterDOT] == 1)
@ -2838,7 +2838,7 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){
Filter1(FilterFocusEffects);
Filter1(FilterPetSpells);
if (GetClientVersionBit() & BIT_SoDAndLater) {
if (ClientVersionBit() & EQEmu::versions::bit_SoDAndLater) {
if (filter->filters[FilterHealOverTime] == 0)
ClientFilters[FilterHealOverTime] = FilterShow;
// This is called 'Show Mine Only' in the clients, but functions the same as show
@ -4123,7 +4123,7 @@ bool Client::GroupFollow(Client* inviter) {
group->UpdateGroupAAs();
//Invite the inviter into the group first.....dont ask
if (inviter->GetClientVersion() < ClientVersion::SoD)
if (inviter->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
GroupJoin_Struct* outgj = (GroupJoin_Struct*)outapp->pBuffer;
@ -4169,13 +4169,13 @@ bool Client::GroupFollow(Client* inviter) {
return false;
}
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
SendGroupJoinAcknowledge();
}
// Temporary hack for SoD, as things seem to work quite differently
if (inviter->IsClient() && inviter->GetClientVersion() >= ClientVersion::SoD)
if (inviter->IsClient() && inviter->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
database.RefreshGroupFromDB(inviter);
}
@ -4242,7 +4242,7 @@ uint16 Client::GetPrimarySkillValue()
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skill = Skill1HPiercing;
else
skill = Skill2HPiercing;
@ -4412,7 +4412,7 @@ void Client::IncrementAggroCount() {
if (AggroCount == 1)
SavedRaidRestTimer = rest_timer.GetRemainingTime();
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RestState, 1);
char *Buffer = (char *)outapp->pBuffer;
@ -4457,7 +4457,7 @@ void Client::DecrementAggroCount() {
rest_timer.Start(time_until_rest);
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RestState, 5);
char *Buffer = (char *)outapp->pBuffer;
@ -4978,12 +4978,12 @@ void Client::ShowSkillsWindow()
std::string WindowText;
std::map<SkillUseTypes, std::string> Skills = EQEmu::GetSkillUseTypesMap();
if (GetClientVersion() < ClientVersion::RoF2)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
Skills[Skill1HPiercing] = "Piercing";
// print out all available skills
for (auto skills_iter : Skills) {
if (skills_iter.first == Skill2HPiercing && GetClientVersion() < ClientVersion::RoF2)
if (skills_iter.first == Skill2HPiercing && ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
continue;
if (!GetSkill(skills_iter.first) && !MaxSkill(skills_iter.first))
continue;
@ -6115,7 +6115,7 @@ void Client::SendZonePoints()
while(iterator.MoreElements())
{
ZonePoint* data = iterator.GetData();
if(GetClientVersionBit() & data->client_version_mask)
if(ClientVersionBit() & data->client_version_mask)
{
count++;
}
@ -6132,7 +6132,7 @@ void Client::SendZonePoints()
while(iterator.MoreElements())
{
ZonePoint* data = iterator.GetData();
if(GetClientVersionBit() & data->client_version_mask)
if(ClientVersionBit() & data->client_version_mask)
{
zp->zpe[i].iterator = data->number;
zp->zpe[i].x = data->target_x;
@ -6852,7 +6852,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
if(use_window) {
if(final_stats.size() < 4096)
{
uint32 Buttons = (client->GetClientVersion() < ClientVersion::SoD) ? 0 : 1;
uint32 Buttons = (client->ClientVersion() < EQEmu::versions::ClientVersion::SoD) ? 0 : 1;
client->SendWindow(0, POPUPID_UPDATE_SHOWSTATSWINDOW, Buttons, "Cancel", "Update", 0, 1, this, "", "%s", final_stats.c_str());
goto Extra_Info;
}
@ -6888,7 +6888,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
}
void Client::SendAltCurrencies() {
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
uint32 count = zone->AlternateCurrencies.size();
if(count == 0) {
return;
@ -7439,7 +7439,7 @@ void Client::SendMercPersonalInfo()
if(mercData)
{
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (mercCount > 0)
{
@ -7550,7 +7550,7 @@ void Client::SendClearMercInfo()
void Client::DuplicateLoreMessage(uint32 ItemID)
{
if (!(m_ClientVersionBit & BIT_RoFAndLater))
if (!(m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater))
{
Message_StringID(0, PICK_LORE);
return;

View File

@ -33,7 +33,8 @@ struct Item_Struct;
#include "../common/ptimer.h"
#include "../common/emu_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "../common/eq_constants.h"
//#include "../common/eq_constants.h"
#include "../common/emu_constants.h" // inv2 watch
#include "../common/eq_stream_intf.h"
#include "../common/eq_packet.h"
#include "../common/linked_list.h"
@ -43,7 +44,7 @@ struct Item_Struct;
#include "../common/item.h"
#include "../common/guilds.h"
#include "../common/item_struct.h"
#include "../common/clientversions.h"
//#include "../common/clientversions.h"
#include "common.h"
#include "merc.h"
@ -976,9 +977,9 @@ public:
inline int ActiveTasksInSet(int TaskSet) { return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
inline int CompletedTasksInSet(int TaskSet) { return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
inline const ClientVersion GetClientVersion() const { return m_ClientVersion; }
inline const uint32 GetClientVersionBit() const { return m_ClientVersionBit; }
inline void SetClientVersion(ClientVersion in) { m_ClientVersion = in; }
inline const EQEmu::versions::ClientVersion ClientVersion() const { return m_ClientVersion; }
inline const uint32 ClientVersionBit() const { return m_ClientVersionBit; }
inline void SetClientVersion(EQEmu::versions::ClientVersion client_version) { m_ClientVersion = client_version; }
/** Adventure Stuff **/
void SendAdventureError(const char *error);
@ -1096,7 +1097,7 @@ public:
void HandleLFGuildResponse(ServerPacket *pack);
void SendLFGuildStatus();
void SendGuildLFGuildStatus();
inline bool XTargettingAvailable() const { return ((m_ClientVersionBit & BIT_UFAndLater) && RuleB(Character, EnableXTargetting)); }
inline bool XTargettingAvailable() const { return ((m_ClientVersionBit & EQEmu::versions::bit_UFAndLater) && RuleB(Character, EnableXTargetting)); }
inline uint8 GetMaxXTargets() const { return MaxXTargets; }
void SetMaxXTargets(uint8 NewMax);
bool IsXTarget(const Mob *m) const;
@ -1489,7 +1490,7 @@ private:
Timer *GlobalChatLimiterTimer; //60 seconds
uint32 AttemptedMessages;
ClientVersion m_ClientVersion;
EQEmu::versions::ClientVersion m_ClientVersion;
uint32 m_ClientVersionBit;
int XPRate;

View File

@ -42,7 +42,7 @@ int32 Client::GetMaxStat() const
if (level < 61) {
base = 255;
}
else if (GetClientVersion() >= ClientVersion::SoF) {
else if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
base = 255 + 5 * (level - 60);
}
else if (level < 71) {
@ -409,7 +409,7 @@ uint32 Mob::GetClassLevelFactor()
int32 Client::CalcBaseHP()
{
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int stats = GetSTA();
if (stats > 255) {
stats = (stats - 255) / 2;
@ -1162,7 +1162,7 @@ int32 Client::CalcBaseMana()
switch (GetCasterClass()) {
case 'I':
WisInt = GetINT();
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if (WisInt > 201) {
@ -1195,7 +1195,7 @@ int32 Client::CalcBaseMana()
break;
case 'W':
WisInt = GetWIS();
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if (WisInt > 201) {
@ -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.
*/
// SoD+ client has no weight for coin
if (EQEmu::limits::CoinHasWeight(GetClientVersion())) {
if (EQEmu::limits::CoinHasWeight(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))) {
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;
@ -2140,7 +2140,7 @@ void Client::CalcMaxEndurance()
int32 Client::CalcBaseEndurance()
{
int32 base_end = 0;
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
double heroic_stats = (GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4.0f;
double stats = (GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4.0f;
if (stats > 201.0f) {

View File

@ -510,7 +510,7 @@ void Client::CompleteConnect()
if (IsInAGuild()){
uint8 rank = GuildRank();
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
switch (rank) {
case 0: { rank = 5; break; } // GUILD_MEMBER 0
@ -831,7 +831,7 @@ void Client::CompleteConnect()
if (zone->GetZoneID() == RuleI(World, GuildBankZoneID) && GuildBanks)
GuildBanks->SendGuildBank(this);
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
entity_list.SendFindableNPCList(this);
if (IsInAGuild()) {
@ -846,7 +846,7 @@ void Client::CompleteConnect()
worldserver.SendPacket(pack);
delete pack;
if (IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) {
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater) {
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
}
@ -1044,7 +1044,7 @@ void Client::Handle_Connect_OP_ReqClientSpawn(const EQApplicationPacket *app)
outapp = new EQApplicationPacket(OP_SendExpZonein, 0);
FastQueuePacket(&outapp);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_ClientReady, 0);
FastQueuePacket(&outapp);
@ -1103,7 +1103,7 @@ void Client::Handle_Connect_OP_SendExpZonein(const EQApplicationPacket *app)
safe_delete(outapp);
// SoF+ Gets Zone-In packets after sending OP_WorldObjectsSent
if (GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
{
SendZoneInPackets();
}
@ -1199,8 +1199,8 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
conn_state = ReceivedZoneEntry;
SetClientVersion(Connection()->GetClientVersion());
m_ClientVersionBit = ClientBitFromVersion(Connection()->GetClientVersion());
SetClientVersion(Connection()->ClientVersion());
m_ClientVersionBit = EQEmu::versions::ConvertClientVersionToClientVersionBit(Connection()->ClientVersion());
bool siv = m_inv.SetInventoryVersion(m_ClientVersion);
Log.Out(Logs::General, Logs::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), ClientVersionName(m_ClientVersion), m_ClientVersion);
@ -1387,7 +1387,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
m_pp.guild_id = GuildID();
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
// FIXME: RoF guild rank
if (GetClientVersion() >= ClientVersion::RoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
switch (rank) {
case 0:
rank = 5;
@ -1441,7 +1441,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; }
if(RuleB(World, UseClientBasedExpansionSettings)) {
m_pp.expansions = ExpansionFromClientVersion(GetClientVersion());
m_pp.expansions = EQEmu::versions::ConvertClientVersionToExpansion(ClientVersion());
}
else {
m_pp.expansions = RuleI(World, ExpansionSettings);
@ -1696,13 +1696,13 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
/* Task Packets */
LoadClientTaskState();
if (GetClientVersion() >= ClientVersion::RoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
outapp = new EQApplicationPacket(OP_ReqNewZone, 0);
Handle_Connect_OP_ReqNewZone(outapp);
safe_delete(outapp);
}
if (m_ClientVersionBit & BIT_UFAndLater) {
if (m_ClientVersionBit & EQEmu::versions::bit_UFAndLater) {
outapp = new EQApplicationPacket(OP_XTargetResponse, 8);
outapp->WriteUInt32(GetMaxXTargets());
outapp->WriteUInt32(0);
@ -2926,7 +2926,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
AugmentItem_Struct* in_augment = (AugmentItem_Struct*)app->pBuffer;
bool deleteItems = false;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
ItemInst *itemOneToPush = nullptr, *itemTwoToPush = nullptr;
@ -4252,7 +4252,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app)
QueuePacket(&end_trade2);
// RoF sends a 0 sized packet for closing objects
if (GetTradeskillObject() && GetClientVersion() >= ClientVersion::RoF)
if (GetTradeskillObject() && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
GetTradeskillObject()->CastToObject()->Close();
return;
@ -5141,7 +5141,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
int16 AlcoholTolerance = GetSkill(SkillAlcoholTolerance);
int16 IntoxicationIncrease;
if (GetClientVersion() < ClientVersion::SoD)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoD)
IntoxicationIncrease = (200 - AlcoholTolerance) * 30 / 200 + 10;
else
IntoxicationIncrease = (270 - AlcoholTolerance) * 0.111111108 + 10;
@ -5453,7 +5453,7 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app)
Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer));
if (entity == 0) {
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
Corpse::SendEndLootErrorPacket(this);
else
Corpse::SendLootReqErrorPacket(this);
@ -7333,11 +7333,11 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
gc->guildeqid = GuildID();
// Convert Membership Level between RoF and previous clients.
if (client->GetClientVersion() < ClientVersion::RoF && GetClientVersion() >= ClientVersion::RoF)
if (client->ClientVersion() < EQEmu::versions::ClientVersion::RoF && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
gc->officer = 0;
}
if (client->GetClientVersion() >= ClientVersion::RoF && GetClientVersion() < ClientVersion::RoF)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF && ClientVersion() < EQEmu::versions::ClientVersion::RoF)
{
gc->officer = 8;
}
@ -7378,7 +7378,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
uint32 guildrank = gj->response;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (gj->response > 9)
{
@ -7413,11 +7413,11 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
{
Client* client = inviter->CastToClient();
// Convert Membership Level between RoF and previous clients.
if (client->GetClientVersion() < ClientVersion::RoF && GetClientVersion() >= ClientVersion::RoF)
if (client->ClientVersion() < EQEmu::versions::ClientVersion::RoF && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
guildrank = 0;
}
if (client->GetClientVersion() >= ClientVersion::RoF && GetClientVersion() < ClientVersion::RoF)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF && ClientVersion() < EQEmu::versions::ClientVersion::RoF)
{
guildrank = 8;
}
@ -7454,7 +7454,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
guildrank = gj->response;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (gj->response == 8)
{
@ -8060,7 +8060,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app)
Mob* tmp = entity_list.GetMob(ins->TargetID);
if (tmp != 0 && tmp->IsClient()) {
if (tmp->CastToClient()->GetClientVersion() < ClientVersion::SoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
if (tmp->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
// Inspecting an SoF or later client will make the server handle the request
else { ProcessInspectRequest(tmp->CastToClient(), this); }
}
@ -8563,7 +8563,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
}
else
{
if (GetClientVersion() >= ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
{
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol)
{
@ -9391,14 +9391,14 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
return;
}
mercTypeCount = tar->GetNumMercTypes(static_cast<unsigned int>(GetClientVersion()));
mercCount = tar->GetNumMercs(static_cast<unsigned int>(GetClientVersion()));
mercTypeCount = tar->GetNumMercTypes(static_cast<unsigned int>(ClientVersion()));
mercCount = tar->GetNumMercs(static_cast<unsigned int>(ClientVersion()));
if (mercCount > MAX_MERC)
return;
std::list<MercType> mercTypeList = tar->GetMercTypesList(static_cast<unsigned int>(GetClientVersion()));
std::list<MercData> mercDataList = tar->GetMercsList(static_cast<unsigned int>(GetClientVersion()));
std::list<MercType> mercTypeList = tar->GetMercTypesList(static_cast<unsigned int>(ClientVersion()));
std::list<MercData> mercDataList = tar->GetMercsList(static_cast<unsigned int>(ClientVersion()));
int i = 0;
int StanceCount = 0;
@ -11320,7 +11320,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app)
}
BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer;
ReadBook(book);
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
EQApplicationPacket EndOfBook(OP_FinishWindow, 0);
QueuePacket(&EndOfBook);
@ -12669,7 +12669,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
{
if (!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
{
if (GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
{
char *hack_str = nullptr;
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Invis: %i", sa->parameter);
@ -13519,7 +13519,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
this->Trader_StartTrader();
// This refreshes the Trader window to display the End Trader button
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Trader, sizeof(TraderStatus_Struct));
TraderStatus_Struct* tss = (TraderStatus_Struct*)outapp->pBuffer;

View File

@ -126,7 +126,7 @@ bool Client::Process() {
HandleRespawnFromHover(0);
}
if(IsTracking() && (GetClientVersion() >= ClientVersion::SoD) && TrackingTimer.Check())
if (IsTracking() && (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) && TrackingTimer.Check())
DoTracking();
// SendHPUpdate calls hpupdate_timer.Start so it can delay this timer, so lets not reset with the check
@ -800,7 +800,7 @@ void Client::BulkSendInventoryItems() {
}
// Power Source
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
const ItemInst* inst = m_inv[SlotPowerSource];
if(inst) {
std::string packet = inst->Serialize(SlotPowerSource);
@ -890,7 +890,7 @@ void Client::BulkSendInventoryItems()
void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
const Item_Struct* handyitem = nullptr;
uint32 numItemSlots = 80; //The max number of items passed in the transaction.
if (m_ClientVersionBit & BIT_RoFAndLater) { // RoF+ can send 200 items
if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater) { // RoF+ can send 200 items
numItemSlots = 200;
}
const Item_Struct *item;
@ -1554,7 +1554,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
}
}
if (GetClientVersion() < ClientVersion::RoF2 && GetClass() == BERSERKER) {
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && GetClass() == BERSERKER) {
gmtrain->skills[Skill1HPiercing] = gmtrain->skills[Skill2HPiercing];
gmtrain->skills[Skill2HPiercing] = 0;
}
@ -1734,7 +1734,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
}
}
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
// The following packet decreases the skill points left in the Training Window and
// produces the 'You have increased your skill / learned the basics of' message.
//
@ -2174,7 +2174,7 @@ void Client::ClearHover()
entity_list.QueueClients(this, outapp, false);
safe_delete(outapp);
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);

View File

@ -2562,7 +2562,7 @@ void command_peekinv(Client *c, const Seperator *sep)
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
}
if ((scopeWhere & peekWorn) && (targetClient->GetClientVersion() >= ClientVersion::SoF)) {
if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
inst_main = targetClient->GetInv().GetItem(SlotPowerSource);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);

View File

@ -313,7 +313,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
// cash
// Let's not move the cash when 'RespawnFromHover = true' && 'client->GetClientVersion() < EQClientSoF' since the client doesn't.
// (change to first client that supports 'death hover' mode, if not SoF.)
if (!RuleB(Character, RespawnFromHover) || client->GetClientVersion() < ClientVersion::SoF) {
if (!RuleB(Character, RespawnFromHover) || client->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
SetCash(pp->copper, pp->silver, pp->gold, pp->platinum);
pp->copper = 0;
pp->silver = 0;
@ -329,7 +329,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
std::list<uint32> removed_list;
for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) {
if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) {
if (i == SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(SlotPowerSource);
if (item != nullptr) {
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), TypeCorpse);
for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur;
@ -1060,7 +1060,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
// This is required for the 'Loot All' feature to work for SoD clients. I expect it is to tell the client that the
// server has now sent all the items on the corpse.
if(client->GetClientVersion() >= ClientVersion::SoD) { SendLootReqErrorPacket(client, 6); }
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { SendLootReqErrorPacket(client, 6); }
}
void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
@ -1294,7 +1294,7 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), TypeCorpse);
for(; cur != end; ++cur) {
ServerLootItem_Struct* sitem = *cur;

View File

@ -867,7 +867,7 @@ bool EntityList::MakeDoorSpawnPacket(EQApplicationPacket *app, Client *client)
if (door_list.empty())
return false;
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
int count = 0;
auto it = door_list.begin();
@ -1474,7 +1474,7 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
}
}
if (Send && (c->GetClientVersionBit() & ClientVersionBits))
if (Send && (c->ClientVersionBit() & ClientVersionBits))
c->QueuePacket(app, ackreq);
}
}
@ -4406,7 +4406,7 @@ void EntityList::UpdateFindableNPCState(NPC *n, bool Remove)
auto it = client_list.begin();
while (it != client_list.end()) {
Client *c = it->second;
if (c && (c->GetClientVersion() >= ClientVersion::SoD))
if (c && (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoD))
c->QueuePacket(outapp);
++it;

View File

@ -395,7 +395,7 @@ void Group::SendHPPacketsTo(Mob *member)
{
members[i]->CreateHPPacket(&hpapp);
member->CastToClient()->QueuePacket(&hpapp, false);
if(member->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (member->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@ -426,7 +426,7 @@ void Group::SendHPPacketsFrom(Mob *member)
if(members[i] && members[i] != member && members[i]->IsClient())
{
members[i]->CastToClient()->QueuePacket(&hp_app);
if(members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@ -566,7 +566,7 @@ bool Group::DelMemberOOZ(const char *Name) {
if(GroupCount() < 3)
{
UnDelegateMarkNPC(NPCMarkerName.c_str());
if(GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->GetClientVersion() < ClientVersion::SoD) {
if (GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD) {
UnDelegateMainAssist(MainAssistName.c_str());
}
ClearAllNPCMarks();
@ -724,7 +724,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender)
if(GroupCount() < 3)
{
UnDelegateMarkNPC(NPCMarkerName.c_str());
if(GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->GetClientVersion() < ClientVersion::SoD) {
if (GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD) {
UnDelegateMainAssist(MainAssistName.c_str());
}
ClearAllNPCMarks();
@ -1604,7 +1604,7 @@ void Group::NotifyMainTank(Client *c, uint8 toggle)
if(!MainTankName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
if(toggle)
c->Message(0, "%s is now Main Tank.", MainTankName.c_str());
@ -1644,7 +1644,7 @@ void Group::NotifyMainAssist(Client *c, uint8 toggle)
if(!MainAssistName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket *outapp = new EQApplicationPacket(OP_DelegateAbility, sizeof(DelegateAbility_Struct));
@ -1699,7 +1699,7 @@ void Group::NotifyPuller(Client *c, uint8 toggle)
if(!PullerName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
if(toggle)
c->Message(0, "%s is now Puller.", PullerName.c_str());
@ -2265,7 +2265,7 @@ void Group::ChangeLeader(Mob* newleader)
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (members[i] && members[i]->IsClient())
{
if(members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
members[i]->CastToClient()->SendGroupLeaderChangePacket(newleader->GetName());
members[i]->CastToClient()->QueuePacket(outapp);

View File

@ -63,7 +63,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
void Client::SendGuildURL()
{
if(GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
return;
if(IsInAGuild())
@ -84,7 +84,7 @@ void Client::SendGuildURL()
void Client::SendGuildChannel()
{
if(GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
return;
if(IsInAGuild())
@ -106,7 +106,7 @@ void Client::SendGuildChannel()
void Client::SendGuildRanks()
{
if(GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
return;
int permissions = 30 + 1; //Static number of permissions in all EQ clients as of May 2014
@ -149,7 +149,7 @@ void Client::SendGuildSpawnAppearance() {
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
SendAppearancePacket(AT_GuildID, GuildID());
if(GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
switch (rank) {
case 0: { rank = 5; break; } // GUILD_MEMBER 0
@ -249,7 +249,7 @@ void Client::RefreshGuildInfo()
if((guild_id != OldGuildID) && GuildBanks)
{
// Unsure about this for RoF+ ... But they don't have that action anymore so fuck it
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
ClearGuildBank();
if(guild_id != GUILD_NONE)

View File

@ -322,7 +322,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
else if(c != nullptr && s->guild_id != GUILD_NONE) {
//char is in zone, and has changed into a new guild, send MOTD.
c->SendGuildMOTD();
if(c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
c->SendGuildRanks();
}
@ -691,7 +691,7 @@ void GuildBankManager::SendGuildBank(Client *c)
auto &guild_bank = *Iterator;
// RoF+ uses a bulk list packet -- This is also how the Action 0 of older clients basically works
if (c->GetClientVersionBit() & BIT_RoFAndLater) {
if (c->ClientVersionBit() & EQEmu::versions::bit_RoFAndLater) {
auto outapp = new EQApplicationPacket(OP_GuildBankItemList, sizeof(GuildBankItemListEntry_Struct) * 240);
for (int i = 0; i < GUILD_BANK_DEPOSIT_AREA_SIZE; ++i) {
const Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);

View File

@ -56,7 +56,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
x++;
}
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
DeleteItemInInventory(SlotPowerSource, 0, true);
else
DeleteItemInInventory(SlotPowerSource, 0, false); // Prevents Titanium crash
@ -685,7 +685,7 @@ void Client::SendCursorBuffer()
// Temporary work-around for the RoF+ Client Buffer
// Instead of dealing with client moving items in cursor buffer,
// we can just send the next item in the cursor buffer to the cursor.
if (GetClientVersion() < ClientVersion::RoF) { return; }
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF) { return; }
if (GetInv().CursorEmpty()) { return; }
auto test_inst = GetInv().GetCursorItem();
@ -898,7 +898,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
// Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client
if (slot_id == SlotCursor && !cursor_empty) {
// RoF+ currently has a specialized cursor handler
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendItemPacket(slot_id, &inst, ItemPacketSummonItem);
}
else {
@ -991,7 +991,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::constants::GENERAL_BEGIN) {
// added power source check for SoF+ clients
if (this->GetClientVersion() >= ClientVersion::SoF)
if (this->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
i = SlotPowerSource;
else
break;
@ -1375,7 +1375,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (move_in->from_slot == move_in->to_slot) { // Item summon, no further processing needed
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
if (GetClientVersion() >= ClientVersion::RoF) { return true; } // Can't do RoF+
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { return true; } // Can't do RoF+
if (move_in->to_slot == SlotCursor) {
auto test_inst = m_inv.GetItem(SlotCursor);
@ -2358,7 +2358,7 @@ void Client::RemoveNoRent(bool client_update)
auto inst = m_inv[SlotPowerSource];
if (inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, SlotPowerSource);
DeleteItemInInventory(SlotPowerSource, 0, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
DeleteItemInInventory(SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
}
}
@ -2576,7 +2576,7 @@ void Client::MoveSlotNotAllowed(bool client_update)
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, SlotPowerSource, free_slot_id);
PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false);
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
database.SaveInventory(character_id, nullptr, SlotPowerSource);
safe_delete(inst);
}

View File

@ -854,12 +854,12 @@ void Lua_Client::SetAATitle(const char *title) {
int Lua_Client::GetClientVersion() {
Lua_Safe_Call_Int();
return static_cast<unsigned int>(self->GetClientVersion());
return static_cast<unsigned int>(self->ClientVersion());
}
uint32 Lua_Client::GetClientVersionBit() {
Lua_Safe_Call_Int();
return self->GetClientVersionBit();
return self->ClientVersionBit();
}
void Lua_Client::SetTitleSuffix(const char *text) {

View File

@ -1829,14 +1829,14 @@ luabind::scope lua_register_client_version() {
return luabind::class_<ClientVersions>("ClientVersion")
.enum_("constants")
[
luabind::value("Unknown", static_cast<int>(ClientVersion::Unknown)),
luabind::value("Titanium", static_cast<int>(ClientVersion::Titanium)),
luabind::value("SoF", static_cast<int>(ClientVersion::SoF)),
luabind::value("SoD", static_cast<int>(ClientVersion::SoD)),
luabind::value("Underfoot", static_cast<int>(ClientVersion::UF)), // deprecated
luabind::value("UF", static_cast<int>(ClientVersion::UF)),
luabind::value("RoF", static_cast<int>(ClientVersion::RoF)),
luabind::value("RoF2", static_cast<int>(ClientVersion::RoF2))
luabind::value("Unknown", static_cast<int>(EQEmu::versions::ClientVersion::Unknown)),
luabind::value("Titanium", static_cast<int>(EQEmu::versions::ClientVersion::Titanium)),
luabind::value("SoF", static_cast<int>(EQEmu::versions::ClientVersion::SoF)),
luabind::value("SoD", static_cast<int>(EQEmu::versions::ClientVersion::SoD)),
luabind::value("Underfoot", static_cast<int>(EQEmu::versions::ClientVersion::UF)), // deprecated
luabind::value("UF", static_cast<int>(EQEmu::versions::ClientVersion::UF)),
luabind::value("RoF", static_cast<int>(EQEmu::versions::ClientVersion::RoF)),
luabind::value("RoF2", static_cast<int>(EQEmu::versions::ClientVersion::RoF2))
];
}

View File

@ -50,7 +50,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
_baseFR = d->FR;
_basePR = d->PR;
_baseCorrup = d->Corrup;
_OwnerClientVersion = static_cast<unsigned int>(ClientVersion::Titanium);
_OwnerClientVersion = static_cast<unsigned int>(EQEmu::versions::ClientVersion::Titanium);
RestRegenHP = 0;
RestRegenMana = 0;
RestRegenEndurance = 0;
@ -1018,7 +1018,7 @@ int32 Merc::CalcBaseEndurance()
int32 sta_end = 0;
int Stats = 0;
if(GetClientVersion() >= static_cast<unsigned int>(ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetClientVersion() >= static_cast<unsigned int>(EQEmu::versions::ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int HeroicStats = 0;
Stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4);
@ -5127,109 +5127,109 @@ void Client::SendMercResponsePackets(uint32 ResponseType)
SendMercMerchantResponsePacket(6);
break;
case 7: //You must dismiss your suspended mercenary before purchasing a new one!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(7);
else
//You have the maximum number of mercenaries. You must dismiss one before purchasing a new one!
SendMercMerchantResponsePacket(6);
break;
case 8: //You can not purchase a mercenary because your group is full!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(8);
else
SendMercMerchantResponsePacket(7);
break;
case 9: //You can not purchase a mercenary because you are in combat!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//Mercenary failed to spawn!
SendMercMerchantResponsePacket(3);
else
SendMercMerchantResponsePacket(8);
break;
case 10: //You have recently dismissed a mercenary and must wait a few more seconds before you can purchase a new one!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//Mercenary failed to spawn!
SendMercMerchantResponsePacket(3);
else
SendMercMerchantResponsePacket(9);
break;
case 11: //An error occurred created your mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(9);
else
SendMercMerchantResponsePacket(10);
break;
case 12: //Upkeep Charge Message
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(10);
else
SendMercMerchantResponsePacket(11);
break;
case 13: // ???
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(11);
else
SendMercMerchantResponsePacket(12);
break;
case 14: //You ran out of funds to pay for your mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(12);
else
SendMercMerchantResponsePacket(13);
break;
case 15: // ???
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(13);
else
SendMercMerchantResponsePacket(14);
break;
case 16: //Your mercenary is about to be suspended due to insufficient funds!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(14);
else
SendMercMerchantResponsePacket(15);
break;
case 17: //There is no mercenary liaison nearby!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(15);
else
SendMercMerchantResponsePacket(16);
break;
case 18: //You are too far from the liaison!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(16);
else
SendMercMerchantResponsePacket(17);
break;
case 19: //You do not meet the requirements for that mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(18);
break;
case 20: //You are unable to interact with the liaison!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You are too far from the liaison!
SendMercMerchantResponsePacket(16);
else
SendMercMerchantResponsePacket(19);
break;
case 21: //You do not have a high enough membership level to purchase this mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(20);
break;
case 22: //Your purchase has failed because this mercenary requires a Gold membership!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(21);
break;
case 23: //Your purchase has failed because this mercenary requires at least a Silver membership!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
@ -5380,7 +5380,7 @@ bool Client::CheckCanSpawnMerc(uint32 template_id) {
}
// Check client version
if(static_cast<unsigned int>(GetClientVersion()) < mercTemplate->ClientVersion)
if(static_cast<unsigned int>(ClientVersion()) < mercTemplate->ClientVersion)
{
SendMercResponsePackets(3);
return false;
@ -6036,7 +6036,7 @@ void Client::SetMerc(Merc* newmerc) {
//Client* oldowner = entity_list.GetClientByID(newmerc->GetOwnerID());
newmerc->SetOwnerID(this->GetID());
newmerc->SetMercCharacterID(this->CharacterID());
newmerc->SetClientVersion((uint8)this->GetClientVersion());
newmerc->SetClientVersion((uint8)this->ClientVersion());
GetMercInfo().mercid = newmerc->GetMercID();
GetMercInfo().MercTemplateID = newmerc->GetMercTemplateID();
GetMercInfo().myTemplate = zone->GetMercTemplate(GetMercInfo().MercTemplateID);
@ -6060,7 +6060,7 @@ void Client::UpdateMercLevel() {
void Client::SendMercMerchantResponsePacket(int32 response_type) {
// This response packet brings up the Mercenary Manager window
if(GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;

View File

@ -1284,7 +1284,7 @@ void Mob::SendHPUpdate(bool skip_self)
CreateHPPacket(&hp_app);
// send to people who have us targeted
entity_list.QueueClientsByTarget(this, &hp_app, false, 0, false, true, BIT_AllClients);
entity_list.QueueClientsByTarget(this, &hp_app, false, 0, false, true, EQEmu::versions::bit_AllClients);
entity_list.QueueClientsByXTarget(this, &hp_app, false);
entity_list.QueueToGroupsForNPCHealthAA(this, &hp_app);
@ -5031,7 +5031,7 @@ uint16 Mob::GetSkillByItemType(int ItemType)
case ItemType2HBlunt:
return Skill2HBlunt;
case ItemType2HPiercing:
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
return Skill1HPiercing;
else
return Skill2HPiercing;

View File

@ -24,7 +24,7 @@
#include "../common/seperator.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/clientversions.h"
#include "../common/client_version.h" // inv2 watch
#include "../common/features.h"
#include "../common/item.h"
#include "../common/item_struct.h"

View File

@ -117,7 +117,7 @@ Object::Object(Client* client, const ItemInst* inst)
m_data.heading = client->GetHeading();
m_data.x = client->GetX();
m_data.y = client->GetY();
if (client->GetClientVersion() >= ClientVersion::RoF2)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF2)
{
// RoF2 places items at player's Z, which is 0.625 of their height.
m_data.z = client->GetZ() - (client->GetSize() * 0.625f);
@ -548,7 +548,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
else {
coa->open = 0x00;
if (sender->GetClientVersion() >= ClientVersion::RoF) {
if (sender->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
coa->drop_id = 0xFFFFFFFF;
sender->Message(0, "Someone else is using that. Try again later.");
}

View File

@ -3974,7 +3974,7 @@ XS(XS_Client_GetClientVersion)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = static_cast<unsigned int>(THIS->GetClientVersion());
RETVAL = static_cast<unsigned int>(THIS->ClientVersion());
XSprePUSH; PUSHu((UV)RETVAL);
}
XSRETURN(1);
@ -4000,7 +4000,7 @@ XS(XS_Client_GetClientVersionBit)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetClientVersionBit();
RETVAL = THIS->ClientVersionBit();
XSprePUSH; PUSHu((UV)RETVAL);
}
XSRETURN(1);

View File

@ -475,7 +475,7 @@ void Pet::SetTarget(Mob *mob)
return;
auto owner = GetOwner();
if (owner && owner->IsClient() && owner->CastToClient()->GetClientVersionBit() & BIT_UFAndLater) {
if (owner && owner->IsClient() && owner->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater) {
auto app = new EQApplicationPacket(OP_PetHoTT, sizeof(ClientTarget_Struct));
auto ct = (ClientTarget_Struct *)app->pBuffer;
ct->new_target = mob ? mob->GetID() : 0;

View File

@ -1529,7 +1529,7 @@ void Raid::SendHPPacketsTo(Client *c)
{
members[x].member->CreateHPPacket(&hpapp);
c->QueuePacket(&hpapp, false);
if(c->GetClientVersion() >= ClientVersion::SoD)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@ -1565,7 +1565,7 @@ void Raid::SendHPPacketsFrom(Mob *m)
if(!m->IsClient() || ((members[x].member != m->CastToClient()) && (members[x].GroupNumber == gid)))
{
members[x].member->QueuePacket(&hpapp, false);
if(members[x].member->GetClientVersion() >= ClientVersion::SoD)
if (members[x].member->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;

View File

@ -182,7 +182,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
pTimerType timer = pTimerCombatAbility;
// RoF2+ Tiger Claw is unlinked from other monk skills, if they ever do that for other classes there will need
// to be more checks here
if (GetClientVersion() >= ClientVersion::RoF2 && ca_atk->m_skill == SkillTigerClaw)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF2 && ca_atk->m_skill == SkillTigerClaw)
timer = pTimerCombatAbility2;
/* Check to see if actually have skill */

View File

@ -135,7 +135,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (spells[spell_id].EndurUpkeep > 0)
SetEndurUpkeep(true);
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
@ -818,7 +818,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{
CastToClient()->SetSenseExemption(true);
if(CastToClient()->GetClientVersionBit() & BIT_SoDAndLater)
if (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater)
{
bodyType bt = BT_Undead;
@ -1627,7 +1627,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif
// This is handled by the client prior to SoD.
//
if(IsClient() && (CastToClient()->GetClientVersionBit() & BIT_SoDAndLater))
if (IsClient() && (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater))
CastToClient()->LocateCorpse();
break;
@ -3374,7 +3374,7 @@ void Mob::BuffProcess()
Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining);
}
}
else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater))
else if (IsClient() && !(CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater))
{
buffs[buffs_i].UpdateClient = true;
}
@ -3386,7 +3386,7 @@ void Mob::BuffProcess()
{
CastToClient()->SendBuffDurationPacket(buffs[buffs_i]);
// Hack to get UF to play nicer, RoF seems fine without it
if (CastToClient()->GetClientVersion() == ClientVersion::UF && buffs[buffs_i].numhits > 0)
if (CastToClient()->ClientVersion() == EQEmu::versions::ClientVersion::UF && buffs[buffs_i].numhits > 0)
CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i);
buffs[buffs_i].UpdateClient = false;
}
@ -3649,7 +3649,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_LocateCorpse: {
// This is handled by the client prior to SoD.
if (IsClient() && (CastToClient()->GetClientVersionBit() & BIT_SoDAndLater))
if (IsClient() && (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater))
CastToClient()->LocateCorpse();
}
case SE_TotalHP: {
@ -4113,7 +4113,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
{
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater);
if(IsClient() && GetTarget() == this) {
CastToClient()->QueuePacket(outapp);
}
@ -4123,11 +4123,11 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater, true);
safe_delete(outapp);
}
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
@ -6574,7 +6574,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
if (spells[spell_id].resisttype == RESIST_FIRE) {
if (IsClient()){
if (CastToClient()->GetClientVersionBit() <= 4) //Titanium needs alternate graphic.
if (CastToClient()->ClientVersionBit() <= 4) //Titanium needs alternate graphic.
ProjectileAnimation(spell_target,(RuleI(Spells, FRProjectileItem_Titanium)), false, speed);
else
ProjectileAnimation(spell_target,(RuleI(Spells, FRProjectileItem_SOF)), false, speed);

View File

@ -259,7 +259,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
bitmask = bitmask << (CastToClient()->GetClass() - 1);
if( itm && itm->GetItem()->Classes != 65535 ) {
if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that requires equipping but shouldn't let them equip it
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!",
CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
@ -271,14 +271,14 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
return(false);
}
if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that they don't meet the race/class requirements to cast
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!",
CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class");
}
else {
if (CastToClient()->GetClientVersion() >= ClientVersion::RoF)
if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Line 181 in eqstr_us.txt was changed in RoF+
Message(15, "Your race, class, or deity cannot use this item.");
@ -292,7 +292,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
}
}
if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= SlotAmmo || item_slot == SlotPowerSource) ){
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are attempting to cast a must equip clicky without having it equipped
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it");
@ -3246,7 +3246,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
{
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater);
if(IsClient() && GetTarget() == this)
CastToClient()->QueuePacket(outapp);
@ -3256,7 +3256,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater, true);
safe_delete(outapp);
}
@ -5403,7 +5403,7 @@ void Client::SendBuffDurationPacket(Buffs_Struct &buff)
void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot)
{
// UF+ use this packet
if (GetClientVersion() < ClientVersion::UF)
if (ClientVersion() < EQEmu::versions::ClientVersion::UF)
return;
EQApplicationPacket *outapp;
outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct));
@ -5457,7 +5457,7 @@ void Mob::SendBuffsToClient(Client *c)
if(!c)
return;
if(c->GetClientVersionBit() & BIT_SoDAndLater)
if (c->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket();
c->FastQueuePacket(&outapp);

View File

@ -990,7 +990,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *TaskList) {
if (c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
SendTaskSelectorNew(c, mob, TaskCount, TaskList);
return;
@ -2485,7 +2485,7 @@ void TaskManager::SendTaskActivityShort(Client *c, int TaskID, int ActivityID, i
TaskActivityShort_Struct* tass;
if(c->GetClientVersionBit() & BIT_RoFAndLater)
if (c->ClientVersionBit() & EQEmu::versions::bit_RoFAndLater)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_TaskActivity, 25);
outapp->WriteUInt32(ClientTaskIndex);
@ -2521,7 +2521,7 @@ void TaskManager::SendTaskActivityShort(Client *c, int TaskID, int ActivityID, i
void TaskManager::SendTaskActivityLong(Client *c, int TaskID, int ActivityID, int ClientTaskIndex, bool Optional, bool TaskComplete) {
if (c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
SendTaskActivityNew(c, TaskID, ActivityID, ClientTaskIndex, Optional, TaskComplete);
return;

View File

@ -1098,7 +1098,7 @@ void Client::Trader_EndTrader() {
for(int i = 0; i < 80; i++) {
if(gis->Items[i] != 0) {
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = gis->Items[i];
@ -1351,7 +1351,7 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Cu
tdis->Unknown000 = 0;
tdis->TraderID = Customer->GetID();
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = itemid;
@ -1487,7 +1487,7 @@ void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCha
EQApplicationPacket* outapp = nullptr;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_TraderShop, sizeof(TraderBuy_Struct));
}
@ -1499,7 +1499,7 @@ void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCha
TraderBuy_Struct* outtbs = (TraderBuy_Struct*)outapp->pBuffer;
memcpy(outtbs, tbs, app->size);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Serial Number back to Item ID for RoF+
outtbs->ItemID = itemid;
@ -1567,7 +1567,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
const ItemInst* BuyItem = nullptr;
uint32 ItemID = 0;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Item ID to Serial Number for RoF+
ItemID = tbs->ItemID;
@ -1629,7 +1629,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
// This cannot overflow assuming MAX_TRANSACTION_VALUE, checked above, is the default of 2000000000
uint32 TotalCost = tbs->Price * outtbs->Quantity;
if(Trader->GetClientVersion() >= ClientVersion::RoF)
if (Trader->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ uses individual item price where older clients use total price
outtbs->Price = tbs->Price;
@ -1680,7 +1680,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
Trader->FindAndNukeTraderItem(tbs->ItemID, outtbs->Quantity, this, 0);
if (ItemID > 0 && Trader->GetClientVersion() >= ClientVersion::RoF)
if (ItemID > 0 && Trader->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Serial Number back to ItemID for RoF+
outtbs->ItemID = ItemID;
@ -1698,7 +1698,7 @@ void Client::SendBazaarWelcome()
auto row = results.begin();
EQApplicationPacket* outapp = nullptr;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_TraderShop, sizeof(BazaarWelcome_Struct));
}
@ -1716,7 +1716,7 @@ void Client::SendBazaarWelcome()
bws->Traders = atoi(row[0]);
bws->Items = atoi(row[1]);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
bws->Unknown012 = GetID();
}
@ -2091,7 +2091,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
for(int i = 0; i < 80; i++) {
if(gis->ItemID[i] == ItemID) {
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = gis->ItemID[i];
@ -2745,7 +2745,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity);
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity * Price);
if(GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); // Think this is the upper 32 bits of a 64 bit price
}
@ -2769,7 +2769,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity);
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity * Price);
if(Buyer->GetClientVersion() >= ClientVersion::SoD)
if (Buyer->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); // Think this is the upper 32 bits of a 64 bit price
}

View File

@ -864,7 +864,7 @@ void WorldServer::Process() {
database.SetGroupLeaderName(group->GetID(), Inviter->GetName());
group->UpdateGroupAAs();
if(Inviter->CastToClient()->GetClientVersion() < ClientVersion::SoD)
if (Inviter->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket* outapp=new EQApplicationPacket(OP_GroupUpdate,sizeof(GroupJoin_Struct));
GroupJoin_Struct* outgj=(GroupJoin_Struct*)outapp->pBuffer;

View File

@ -1566,7 +1566,7 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Clien
while(iterator.MoreElements())
{
ZonePoint* zp = iterator.GetData();
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
if(!(zp->client_version_mask & mask_test))
{
iterator.Advance();
@ -1620,7 +1620,7 @@ ZonePoint* Zone::GetClosestZonePointWithoutZone(float x, float y, float z, Clien
while(iterator.MoreElements())
{
ZonePoint* zp = iterator.GetData();
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
if(!(zp->client_version_mask & mask_test))
{

View File

@ -2823,7 +2823,7 @@ void ZoneDatabase::RefreshGroupFromDB(Client *client){
client->QueuePacket(outapp);
safe_delete(outapp);
if(client->GetClientVersion() >= ClientVersion::SoD) {
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) {
group->NotifyMainTank(client, 1);
group->NotifyPuller(client, 1);
}

View File

@ -562,7 +562,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
if (entity == 0)
{
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
Corpse::SendEndLootErrorPacket(this);
else
Corpse::SendLootReqErrorPacket(this);
@ -588,7 +588,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
// If we are SoF and later and are respawning from hover, we want the real zone ID, else zero to use the old hack.
//
if(zone->GetZoneID() == zoneID) {
if((GetClientVersionBit() & BIT_SoFAndLater) && (!RuleB(Character, RespawnFromHover) || !IsHoveringForRespawn()))
if ((ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && (!RuleB(Character, RespawnFromHover) || !IsHoveringForRespawn()))
gmg->bind_zone_id = 0;
else
gmg->bind_zone_id = zoneID;