Client version is now returned by the stream proxy as a number.

This commit is contained in:
Derision 2013-02-17 18:09:31 +00:00
parent d1afad47aa
commit 07979ce2de
23 changed files with 79 additions and 90 deletions

View File

@ -4,6 +4,7 @@
//this is the only part of an EQStream that is seen by the application. //this is the only part of an EQStream that is seen by the application.
#include <string> #include <string>
#include "clientversions.h"
typedef enum { typedef enum {
ESTABLISHED, ESTABLISHED,
@ -34,6 +35,7 @@ public:
virtual const uint32 GetBytesRecieved() const { return 0; } virtual const uint32 GetBytesRecieved() const { return 0; }
virtual const uint32 GetBytesSentPerSecond() const { return 0; } virtual const uint32 GetBytesSentPerSecond() const { return 0; }
virtual const uint32 GetBytesRecvPerSecond() const { return 0; } virtual const uint32 GetBytesRecvPerSecond() const { return 0; }
virtual const EQClientVersion ClientVersion() const { return EQClientUnknown; }
}; };
#endif /*EQSTREAMINTF_H_*/ #endif /*EQSTREAMINTF_H_*/

View File

@ -22,6 +22,11 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe()); return(m_structs->Describe());
} }
const EQClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->ClientVersion();
}
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) { void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {
if(p == NULL) if(p == NULL)
return; return;

View File

@ -27,6 +27,7 @@ public:
virtual void RemoveData(); virtual void RemoveData();
virtual bool CheckState(EQStreamState state); virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const; virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const uint32 GetBytesSent() const; virtual const uint32 GetBytesSent() const;
virtual const uint32 GetBytesRecieved() const; virtual const uint32 GetBytesRecieved() const;

View File

@ -4,6 +4,7 @@
class EQApplicationPacket; class EQApplicationPacket;
class EQStream; class EQStream;
#include "emu_opcodes.h" #include "emu_opcodes.h"
#include "clientversions.h"
#include <string> #include <string>
@ -23,6 +24,7 @@ public:
void Decode(EQApplicationPacket *p) const; void Decode(EQApplicationPacket *p) const;
virtual std::string Describe() const = 0; virtual std::string Describe() const = 0;
virtual const EQClientVersion ClientVersion() const = 0;
protected: protected:
//some common coders: //some common coders:

27
common/clientversions.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef CLIENTVERSIONS_H
#define CLIENTVERSIONS_H
static const uint32 BIT_Client62 = 1;
static const uint32 BIT_Titanium = 2;
static const uint32 BIT_SoF = 4;
static const uint32 BIT_SoD = 8;
static const uint32 BIT_Underfoot = 16;
static const uint32 BIT_RoF = 32;
static const uint32 BIT_TitaniumAndEarlier = 3;
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
typedef enum {
EQClientUnknown = 0,
EQClient62,
EQClientTitanium,
EQClientSoF,
EQClientSoD,
EQClientUnderfoot,
EQClientRoF
} EQClientVersion;
#endif /* CLIENTVERSIONS_H */

View File

@ -18,19 +18,6 @@
#ifndef EQ_CONSTANTS_H #ifndef EQ_CONSTANTS_H
#define EQ_CONSTANTS_H #define EQ_CONSTANTS_H
#define BIT_Client62 1
#define BIT_Titanium 2
#define BIT_SoF 4
#define BIT_SoD 8
#define BIT_Underfoot 16
#define BIT_RoF 32
#define BIT_TitaniumAndEarlier 3
#define BIT_SoFAndLater 0xFFFFFFFC
#define BIT_SoDAndLater 0xFFFFFFF8
#define BIT_UnderfootAndLater 0xFFFFFFF0
#define BIT_RoFAndLater 0xFFFFFFE0
#define BIT_AllClients 0xFFFFFFFF
#include "skills.h" #include "skills.h"
/* /*

View File

@ -9,6 +9,7 @@
#include "../eq_packet_structs.h" #include "../eq_packet_structs.h"
#include "../MiscFunctions.h" #include "../MiscFunctions.h"
#include "../Item.h" #include "../Item.h"
#include "../clientversions.h"
#include "Client62_structs.h" #include "Client62_structs.h"
namespace Client62 { namespace Client62 {
@ -93,6 +94,10 @@ std::string Strategy::Describe() const {
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClient62;
}
#include "SSDefine.h" #include "SSDefine.h"

View File

@ -24,6 +24,7 @@ namespace Client62 {
protected: protected:
virtual std::string Describe() const; virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors //magic macro to declare our opcode processors
#include "SSDeclare.h" #include "SSDeclare.h"

View File

@ -98,9 +98,12 @@ std::string Strategy::Describe() const {
r += name; r += name;
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientRoF;
}
#include "SSDefine.h" #include "SSDefine.h"
// Converts Titanium Slot IDs to RoF Slot IDs for use in Encodes // Converts Titanium Slot IDs to RoF Slot IDs for use in Encodes

View File

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

View File

@ -99,7 +99,10 @@ std::string Strategy::Describe() const {
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientSoD;
}
#include "SSDefine.h" #include "SSDefine.h"

View File

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

View File

@ -99,7 +99,10 @@ std::string Strategy::Describe() const {
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientSoF;
}
#include "SSDefine.h" #include "SSDefine.h"

View File

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

View File

@ -97,7 +97,10 @@ std::string Strategy::Describe() const {
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientTitanium;
}
#include "SSDefine.h" #include "SSDefine.h"

View File

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

View File

@ -100,7 +100,10 @@ std::string Strategy::Describe() const {
return(r); return(r);
} }
const EQClientVersion Strategy::ClientVersion() const
{
return EQClientUnderfoot;
}
#include "SSDefine.h" #include "SSDefine.h"

View File

@ -23,6 +23,7 @@ namespace Underfoot {
protected: protected:
virtual std::string Describe() const; virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcode processors //magic macro to declare our opcode processors
#include "SSDeclare.h" #include "SSDeclare.h"

View File

@ -23,7 +23,7 @@ namespace TEMPLATE {
protected: protected:
virtual std::string Describe() const; virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
//magic macro to declare our opcodes //magic macro to declare our opcodes
#include "SSDeclare.h" #include "SSDeclare.h"
#include "TEMPLATE_ops.h" #include "TEMPLATE_ops.h"

View File

@ -58,6 +58,7 @@ using namespace std;
#include "wguild_mgr.h" #include "wguild_mgr.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "SoFCharCreateData.h" #include "SoFCharCreateData.h"
#include "../common/clientversions.h"
std::vector<RaceClassAllocation> character_create_allocations; std::vector<RaceClassAllocation> character_create_allocations;
std::vector<RaceClassCombos> character_create_race_class_combos; std::vector<RaceClassCombos> character_create_race_class_combos;
@ -93,32 +94,7 @@ Client::Client(EQStreamInterface* ieqs)
ClientVersionBit = 0; ClientVersionBit = 0;
numclients++; numclients++;
string StreamDescription = eqs->Describe(); ClientVersionBit = 1 << (eqs->ClientVersion() - 1);
if(StreamDescription == "Patch Titanium")
{
ClientVersionBit = BIT_Titanium;
}
else if(StreamDescription == "Patch 6.2")
{
ClientVersionBit = BIT_Client62;
}
else if(StreamDescription == "Patch SoF")
{
ClientVersionBit = BIT_SoF;
}
else if(StreamDescription == "Patch SoD")
{
ClientVersionBit = BIT_SoD;
}
else if(StreamDescription == "Patch Underfoot")
{
ClientVersionBit = BIT_Underfoot;
}
else if(StreamDescription == "Patch RoF")
{
ClientVersionBit = BIT_RoF;
}
} }
Client::~Client() { Client::~Client() {

View File

@ -47,6 +47,7 @@ class Client;
#include <set> #include <set>
#include <string> #include <string>
#include "../common/item_struct.h" #include "../common/item_struct.h"
#include "../common/clientversions.h"
#include "QGlobals.h" #include "QGlobals.h"
#define CLIENT_TIMEOUT 90000 #define CLIENT_TIMEOUT 90000
@ -120,16 +121,6 @@ typedef enum {
MQGhost MQGhost
} CheatTypes; } CheatTypes;
typedef enum {
EQClientUnknown = 0,
EQClient62,
EQClientTitanium,
EQClientSoF,
EQClientSoD,
EQClientUnderfoot,
EQClientRoF
} EQClientVersion;
enum { enum {
HideCorpseNone = 0, HideCorpseNone = 0,
HideCorpseAll = 1, HideCorpseAll = 1,

View File

@ -517,38 +517,10 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
conn_state = ReceivedZoneEntry; conn_state = ReceivedZoneEntry;
string StreamDescription = Connection()->Describe();
if(StreamDescription == "Patch Titanium") ClientVersion = Connection()->ClientVersion();
{ ClientVersionBit = 1 << (ClientVersion - 1);
ClientVersion = EQClientTitanium;
ClientVersionBit = BIT_Titanium;
}
else if(StreamDescription == "Patch 6.2")
{
ClientVersion = EQClient62;
ClientVersionBit = BIT_Client62;
}
else if(StreamDescription == "Patch SoF")
{
ClientVersion = EQClientSoF;
ClientVersionBit = BIT_SoF;
}
else if(StreamDescription == "Patch SoD")
{
ClientVersion = EQClientSoD;
ClientVersionBit = BIT_SoD;
}
else if(StreamDescription == "Patch Underfoot")
{
ClientVersion = EQClientUnderfoot;
ClientVersionBit = BIT_Underfoot;
}
else if(StreamDescription == "Patch RoF")
{
ClientVersion = EQClientRoF;
ClientVersionBit = BIT_RoF;
}
// Antighost code // Antighost code
// tmp var is so the search doesnt find this object // tmp var is so the search doesnt find this object
Client* client = entity_list.GetClientByName(cze->char_name); Client* client = entity_list.GetClientByName(cze->char_name);

View File

@ -689,7 +689,7 @@ void Zone::LoadMercTemplates(){
mysql_free_result(DatasetResult); mysql_free_result(DatasetResult);
} }
safe_delete(Query); safe_delete_array(Query);
Query = 0; Query = 0;
if(!errorMessage.empty()) { if(!errorMessage.empty()) {
@ -763,7 +763,7 @@ void Zone::LoadMercSpells(){
LogFile->write(EQEMuLog::Debug, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); LogFile->write(EQEMuLog::Debug, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size());
} }
safe_delete(Query); safe_delete_array(Query);
Query = 0; Query = 0;
if(!errorMessage.empty()) { if(!errorMessage.empty()) {
@ -2648,4 +2648,4 @@ void Zone::ReloadWorld(uint32 Option){
zone->Repop(0); zone->Repop(0);
parse->ReloadQuests(); parse->ReloadQuests();
} }
} }