mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Client version is now returned by the stream proxy as a number.
This commit is contained in:
parent
d1afad47aa
commit
07979ce2de
@ -4,6 +4,7 @@
|
||||
//this is the only part of an EQStream that is seen by the application.
|
||||
|
||||
#include <string>
|
||||
#include "clientversions.h"
|
||||
|
||||
typedef enum {
|
||||
ESTABLISHED,
|
||||
@ -34,6 +35,7 @@ public:
|
||||
virtual const uint32 GetBytesRecieved() const { return 0; }
|
||||
virtual const uint32 GetBytesSentPerSecond() const { return 0; }
|
||||
virtual const uint32 GetBytesRecvPerSecond() const { return 0; }
|
||||
virtual const EQClientVersion ClientVersion() const { return EQClientUnknown; }
|
||||
};
|
||||
|
||||
#endif /*EQSTREAMINTF_H_*/
|
||||
|
||||
@ -22,6 +22,11 @@ std::string EQStreamProxy::Describe() const {
|
||||
return(m_structs->Describe());
|
||||
}
|
||||
|
||||
const EQClientVersion EQStreamProxy::ClientVersion() const
|
||||
{
|
||||
return m_structs->ClientVersion();
|
||||
}
|
||||
|
||||
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {
|
||||
if(p == NULL)
|
||||
return;
|
||||
|
||||
@ -27,6 +27,7 @@ public:
|
||||
virtual void RemoveData();
|
||||
virtual bool CheckState(EQStreamState state);
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
virtual const uint32 GetBytesSent() const;
|
||||
virtual const uint32 GetBytesRecieved() const;
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
class EQApplicationPacket;
|
||||
class EQStream;
|
||||
#include "emu_opcodes.h"
|
||||
#include "clientversions.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -23,6 +24,7 @@ public:
|
||||
void Decode(EQApplicationPacket *p) const;
|
||||
|
||||
virtual std::string Describe() const = 0;
|
||||
virtual const EQClientVersion ClientVersion() const = 0;
|
||||
|
||||
protected:
|
||||
//some common coders:
|
||||
|
||||
27
common/clientversions.h
Normal file
27
common/clientversions.h
Normal 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 */
|
||||
@ -18,19 +18,6 @@
|
||||
#ifndef 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"
|
||||
|
||||
/*
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include "../eq_packet_structs.h"
|
||||
#include "../MiscFunctions.h"
|
||||
#include "../Item.h"
|
||||
#include "../clientversions.h"
|
||||
#include "Client62_structs.h"
|
||||
|
||||
namespace Client62 {
|
||||
@ -93,6 +94,10 @@ std::string Strategy::Describe() const {
|
||||
return(r);
|
||||
}
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClient62;
|
||||
}
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ namespace Client62 {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -98,9 +98,12 @@ std::string Strategy::Describe() const {
|
||||
r += name;
|
||||
return(r);
|
||||
}
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClientRoF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
// Converts Titanium Slot IDs to RoF Slot IDs for use in Encodes
|
||||
|
||||
@ -23,6 +23,7 @@ namespace RoF {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -99,7 +99,10 @@ std::string Strategy::Describe() const {
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClientSoD;
|
||||
}
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ namespace SoD {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -99,7 +99,10 @@ std::string Strategy::Describe() const {
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClientSoF;
|
||||
}
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ namespace SoF {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -97,7 +97,10 @@ std::string Strategy::Describe() const {
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClientTitanium;
|
||||
}
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ namespace Titanium {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -100,7 +100,10 @@ std::string Strategy::Describe() const {
|
||||
return(r);
|
||||
}
|
||||
|
||||
|
||||
const EQClientVersion Strategy::ClientVersion() const
|
||||
{
|
||||
return EQClientUnderfoot;
|
||||
}
|
||||
|
||||
#include "SSDefine.h"
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ namespace Underfoot {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
|
||||
//magic macro to declare our opcode processors
|
||||
#include "SSDeclare.h"
|
||||
|
||||
@ -23,7 +23,7 @@ namespace TEMPLATE {
|
||||
protected:
|
||||
|
||||
virtual std::string Describe() const;
|
||||
|
||||
virtual const EQClientVersion ClientVersion() const;
|
||||
//magic macro to declare our opcodes
|
||||
#include "SSDeclare.h"
|
||||
#include "TEMPLATE_ops.h"
|
||||
|
||||
@ -58,6 +58,7 @@ using namespace std;
|
||||
#include "wguild_mgr.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "SoFCharCreateData.h"
|
||||
#include "../common/clientversions.h"
|
||||
|
||||
std::vector<RaceClassAllocation> character_create_allocations;
|
||||
std::vector<RaceClassCombos> character_create_race_class_combos;
|
||||
@ -93,32 +94,7 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
ClientVersionBit = 0;
|
||||
numclients++;
|
||||
|
||||
string StreamDescription = eqs->Describe();
|
||||
|
||||
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;
|
||||
}
|
||||
ClientVersionBit = 1 << (eqs->ClientVersion() - 1);
|
||||
}
|
||||
|
||||
Client::~Client() {
|
||||
|
||||
@ -47,6 +47,7 @@ class Client;
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "../common/item_struct.h"
|
||||
#include "../common/clientversions.h"
|
||||
#include "QGlobals.h"
|
||||
|
||||
#define CLIENT_TIMEOUT 90000
|
||||
@ -120,16 +121,6 @@ typedef enum {
|
||||
MQGhost
|
||||
} CheatTypes;
|
||||
|
||||
typedef enum {
|
||||
EQClientUnknown = 0,
|
||||
EQClient62,
|
||||
EQClientTitanium,
|
||||
EQClientSoF,
|
||||
EQClientSoD,
|
||||
EQClientUnderfoot,
|
||||
EQClientRoF
|
||||
} EQClientVersion;
|
||||
|
||||
enum {
|
||||
HideCorpseNone = 0,
|
||||
HideCorpseAll = 1,
|
||||
|
||||
@ -517,38 +517,10 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
|
||||
conn_state = ReceivedZoneEntry;
|
||||
|
||||
string StreamDescription = Connection()->Describe();
|
||||
|
||||
if(StreamDescription == "Patch Titanium")
|
||||
{
|
||||
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;
|
||||
}
|
||||
ClientVersion = Connection()->ClientVersion();
|
||||
ClientVersionBit = 1 << (ClientVersion - 1);
|
||||
|
||||
// Antighost code
|
||||
// tmp var is so the search doesnt find this object
|
||||
Client* client = entity_list.GetClientByName(cze->char_name);
|
||||
|
||||
@ -689,7 +689,7 @@ void Zone::LoadMercTemplates(){
|
||||
mysql_free_result(DatasetResult);
|
||||
}
|
||||
|
||||
safe_delete(Query);
|
||||
safe_delete_array(Query);
|
||||
Query = 0;
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
safe_delete(Query);
|
||||
safe_delete_array(Query);
|
||||
Query = 0;
|
||||
|
||||
if(!errorMessage.empty()) {
|
||||
@ -2648,4 +2648,4 @@ void Zone::ReloadWorld(uint32 Option){
|
||||
zone->Repop(0);
|
||||
parse->ReloadQuests();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user