mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Reworked ClientVersion into EQEmu::versions; Added EQEmu::versions::InventoryVersion
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
@@ -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);
|
||||
|
||||
+34
-85
@@ -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))];
|
||||
}
|
||||
|
||||
+12
-28
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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_*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 */
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user