* Remove last occurrences of clientbuild and hardcoded build numbers
This commit is contained in:
parent
c024fac446
commit
3845d3b51c
@ -248,9 +248,9 @@ void RealmSession::_HandleRealmList(ByteBuffer& pkt)
|
||||
std::string realmAddr;
|
||||
|
||||
SRealmHeader rh;
|
||||
uint16 cb = GetInstance()->GetConf()->clientbuild;
|
||||
uint16 client = GetInstance()->GetConf()->client;
|
||||
pkt >> rh.cmd >> rh.size >> rh.unknown;
|
||||
if(cb<=6005)
|
||||
if(client==CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
uint8 count;
|
||||
pkt >> count;
|
||||
@ -272,7 +272,7 @@ void RealmSession::_HandleRealmList(ByteBuffer& pkt)
|
||||
// readout realms
|
||||
for(uint8 i=0;i<rh.count;i++)
|
||||
{
|
||||
if(cb<=6005)
|
||||
if(client==CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
uint32 icon;
|
||||
pkt >> icon;
|
||||
@ -539,9 +539,7 @@ void RealmSession::_HandleLogonChallenge(ByteBuffer& pkt)
|
||||
packet.append(M1hash.GetDigest(),M1hash.GetLength());
|
||||
packet.append(crc_hash,20);
|
||||
packet << (uint8)0; // number of keys = 0
|
||||
|
||||
if(GetInstance()->GetConf()->clientbuild > 5302)
|
||||
packet << (uint8)0; // 1.11.x compatibility (needs one more 0)
|
||||
packet << (uint8)0; // 1.11.x compatibility (needs one more 0)
|
||||
|
||||
GetInstance()->SetSessionKey(_key);
|
||||
memcpy(this->_m2,M2hash.GetDigest(),M2hash.GetLength()); // save M2 to an extern var to check it later
|
||||
@ -561,7 +559,7 @@ void RealmSession::_HandleLogonChallenge(ByteBuffer& pkt)
|
||||
void RealmSession::_HandleLogonProof(ByteBuffer& pkt)
|
||||
{
|
||||
PseuGUI *gui = GetInstance()->GetGUI();
|
||||
logdebug("RealmSocket: Got AUTH_LOGON_PROOF [%u of %u bytes]",pkt.size(),(GetInstance()->GetConf()->clientbuild>6005 ? sizeof(sAuthLogonProof_S) : sizeof(sAuthLogonProof_S_6005)));
|
||||
logdebug("RealmSocket: Got AUTH_LOGON_PROOF [%u of %u bytes]",pkt.size(),(GetInstance()->GetConf()->client>CLIENT_CLASSIC_WOW ? sizeof(sAuthLogonProof_S) : sizeof(sAuthLogonProof_S_6005)));
|
||||
if(pkt.size() < 2)
|
||||
{
|
||||
logerror("AUTH_LOGON_PROOF: Recieved incorrect/unknown packet. Hexdump:");
|
||||
@ -612,7 +610,7 @@ void RealmSession::_HandleLogonProof(ByteBuffer& pkt)
|
||||
|
||||
|
||||
sAuthLogonProof_S lp;
|
||||
if(GetInstance()->GetConf()->clientbuild<=6005)
|
||||
if(GetInstance()->GetConf()->client==CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
sAuthLogonProof_S_6005 lp6005;
|
||||
pkt.read((uint8*)&lp6005, sizeof(sAuthLogonProof_S_6005));
|
||||
|
||||
@ -81,7 +81,7 @@ void Channel::Join(std::string channel, std::string password)
|
||||
// Send join channel request
|
||||
WorldPacket worldPacket;
|
||||
worldPacket.SetOpcode(CMSG_JOIN_CHANNEL);
|
||||
if(_worldSession->GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(_worldSession->GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
worldPacket << (uint32)0; // new since 2.0.x, some channel ID? server answers us with that number later if channel joined
|
||||
worldPacket << (uint8)0; // unk
|
||||
|
||||
@ -17,7 +17,7 @@ void WorldSession::_HandleItemQuerySingleResponseOpcode(WorldPacket& recvPacket)
|
||||
proto->Id = ItemID;
|
||||
recvPacket >> proto->Class;
|
||||
recvPacket >> proto->SubClass;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> unk; // dont need that value?
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ void WorldSession::_HandleDestroyObjectOpcode(WorldPacket& recvPacket)
|
||||
uint8 dummy;
|
||||
|
||||
recvPacket >> guid;
|
||||
if(GetInstance()->GetConf()->clientbuild>6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> dummy;
|
||||
logdebug("Destroy Object "I64FMT,guid);
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#include "ZCompressor.h"
|
||||
#include "WorldSession.h"
|
||||
#include "UpdateData.h"
|
||||
#include "UpdateFields.h"
|
||||
#include "Object.h"
|
||||
#include "Unit.h"
|
||||
#include "Bag.h"
|
||||
@ -41,7 +40,7 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket)
|
||||
uint32 usize, ublocks, readblocks=0;
|
||||
uint64 uguid;
|
||||
recvPacket >> ublocks; // >> hasTransport;
|
||||
if(GetInstance()->GetConf()->clientbuild <= 6005)
|
||||
if(GetInstance()->GetConf()->client == CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> hasTransport;
|
||||
|
||||
logdev("UpdateObject: blocks = %u", ublocks);
|
||||
@ -245,7 +244,7 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
float speedWalk =0, speedRun =0, speedSwimBack =0, speedSwim =0, speedWalkBack =0, speedTurn =0, speedFly =0, speedFlyBack =0, speedPitchRate =0;
|
||||
uint32 unk32;
|
||||
|
||||
uint16 cb = GetInstance()->GetConf()->clientbuild;
|
||||
uint16 client = GetInstance()->GetConf()->client;
|
||||
|
||||
Object *obj = (Object*)objmgr.GetObj(uguid, true); // also depleted objects
|
||||
Unit *u = NULL;
|
||||
@ -261,7 +260,7 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
logerror("MovementUpdate for unknown object "I64FMT" typeid=%u",uguid,objtypeid);
|
||||
}
|
||||
|
||||
if(cb > 6005)
|
||||
if(client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> flags;
|
||||
else
|
||||
{
|
||||
@ -273,7 +272,7 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
if(flags & UPDATEFLAG_LIVING)
|
||||
{
|
||||
recvPacket >> mi.flags;
|
||||
if(cb > 6005)
|
||||
if(client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> mi.unkFlags;
|
||||
recvPacket>> mi.time;
|
||||
|
||||
@ -315,10 +314,10 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
}
|
||||
|
||||
recvPacket >> speedWalk >> speedRun >> speedSwimBack >> speedSwim >> speedWalkBack; // speedRun can also be mounted speed if player is mounted; WalkBack is called RunBack in Mangos
|
||||
if(cb > 6005)
|
||||
if(client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> speedFly >> speedFlyBack; // fly added in 2.0.x
|
||||
recvPacket >> speedTurn;
|
||||
if(cb > 6005)
|
||||
if(client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> speedPitchRate;
|
||||
logdev("MovementUpdate: Got speeds, walk=%f run=%f turn=%f", speedWalk, speedRun, speedTurn);
|
||||
if(u)
|
||||
@ -375,20 +374,20 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
}
|
||||
}
|
||||
|
||||
if(cb > 6005 && flags & UPDATEFLAG_LOWGUID)
|
||||
if(client > CLIENT_CLASSIC_WOW && flags & UPDATEFLAG_LOWGUID)
|
||||
{
|
||||
recvPacket >> unk32;
|
||||
logdev("MovementUpdate: UPDATEFLAG_LOWGUID is set, got %X", unk32);
|
||||
}
|
||||
|
||||
if(cb > 6005 && flags & UPDATEFLAG_HIGHGUID)
|
||||
if(client > CLIENT_CLASSIC_WOW && flags & UPDATEFLAG_HIGHGUID)
|
||||
{
|
||||
recvPacket >> unk32; // 2.0.6 - high guid was there, unk for 2.0.12
|
||||
// not sure if this is correct, MaNGOS sends 0 always.
|
||||
//obj->SetUInt32Value(OBJECT_FIELD_GUID+1,higuid); // note that this sets only the high part of the guid
|
||||
logdev("MovementUpdate: UPDATEFLAG_HIGHGUID is set, got %X", unk32);
|
||||
}
|
||||
if(cb <= 6005 && flags & UPDATEFLAG_ALL_6005)
|
||||
if(client == CLIENT_CLASSIC_WOW && flags & UPDATEFLAG_ALL_6005)
|
||||
{
|
||||
recvPacket >> unk32;
|
||||
// MaNGOS sends 1 always.
|
||||
@ -404,7 +403,7 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
|
||||
if(flags & UPDATEFLAG_TRANSPORT)
|
||||
{
|
||||
recvPacket >> unk32; // whats this used for?
|
||||
recvPacket >> unk32; // mangos says: ms time
|
||||
logdev("MovementUpdate: UPDATEFLAG_TRANSPORT is set, got %u", unk32);
|
||||
}
|
||||
|
||||
|
||||
@ -560,7 +560,7 @@ void WorldSession::_HandleAuthChallengeOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
//Read Packet
|
||||
uint32 sp, serverseed;
|
||||
if(GetInstance()->GetConf()->clientbuild>6005)//TODO: Check TBC
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)//TODO: Check TBC
|
||||
{
|
||||
recvPacket >> sp;
|
||||
}
|
||||
@ -585,7 +585,7 @@ void WorldSession::_HandleAuthChallengeOpcode(WorldPacket& recvPacket)
|
||||
|
||||
// Send Reply
|
||||
WorldPacket auth;
|
||||
if(GetInstance()->GetConf()->clientbuild<=6005)
|
||||
if(GetInstance()->GetConf()->client==CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
auth<<(uint32)(GetInstance()->GetConf()->clientbuild)<<unk<<acc<<clientseed_uint32;
|
||||
auth.append(digest.GetDigest(),20);
|
||||
@ -612,7 +612,7 @@ void WorldSession::_HandleAuthResponseOpcode(WorldPacket& recvPacket)
|
||||
uint8 BillingPlanFlags, expansion; uint32 BillingTimeRemaining, BillingTimeRested;
|
||||
recvPacket >> errcode;
|
||||
recvPacket >> BillingTimeRemaining >> BillingPlanFlags >> BillingTimeRested;
|
||||
if(GetInstance()->GetConf()->clientbuild >6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> expansion;
|
||||
// TODO: add data to generic_text.scp and use the strings here
|
||||
if(errcode == AUTH_OK)
|
||||
@ -670,7 +670,7 @@ void WorldSession::_HandleCharEnumOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> plr[i]._z;
|
||||
recvPacket >> plr[i]._guildId;
|
||||
recvPacket >> plr[i]._flags;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> dummy32; // at_login_customize
|
||||
}
|
||||
@ -681,7 +681,7 @@ void WorldSession::_HandleCharEnumOpcode(WorldPacket& recvPacket)
|
||||
for(unsigned int inv=0;inv<20;inv++)
|
||||
{
|
||||
recvPacket >> plr[i]._items[inv].displayId >> plr[i]._items[inv].inventorytype ;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> dummy32; // whatever
|
||||
}
|
||||
@ -886,7 +886,7 @@ void WorldSession::_HandleMessageChatOpcode(WorldPacket& recvPacket) //TODO: REW
|
||||
|
||||
if(lang == LANG_ADDON && GetInstance()->GetConf()->skipaddonchat)
|
||||
return;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> source_guid;
|
||||
recvPacket >> unk32;
|
||||
@ -1081,7 +1081,7 @@ void WorldSession::_HandleNameQueryResponseOpcode(WorldPacket& recvPacket)
|
||||
uint8 realm;
|
||||
std::string pname;
|
||||
uint32 prace, pgender, pclass;
|
||||
if(GetInstance()->GetConf()->clientbuild>6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
pguid = recvPacket.GetPackedGuid();
|
||||
else
|
||||
recvPacket >> pguid;
|
||||
@ -1138,7 +1138,7 @@ void WorldSession::_HandleMovementOpcode(WorldPacket& recvPacket)
|
||||
uint16 flags2;
|
||||
guid = recvPacket.GetPackedGuid();
|
||||
recvPacket >> flags;
|
||||
if(GetInstance()->GetConf()->clientbuild>6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> flags2;
|
||||
}
|
||||
@ -1429,7 +1429,7 @@ void WorldSession::_HandleInitialSpellsOpcode(WorldPacket& recvPacket)
|
||||
uint32 spellid;
|
||||
recvPacket >> unk >> count;
|
||||
logdebug("Got initial spells list, %u spells.",count);
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
for(uint16 i = 0; i < count; i++)
|
||||
{
|
||||
@ -1709,13 +1709,13 @@ void WorldSession::_HandleCreatureQueryResponseOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> s;
|
||||
recvPacket >> s;
|
||||
recvPacket >> ct->subname;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> ct->directions;
|
||||
recvPacket >> ct->flag1;
|
||||
recvPacket >> ct->type;
|
||||
recvPacket >> ct->family;
|
||||
recvPacket >> ct->rank;
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
for(uint32 i = 0; i < MAX_KILL_CREDIT; i++)
|
||||
recvPacket >> ct->killCredit[i];
|
||||
@ -1775,7 +1775,7 @@ void WorldSession::_HandleGameobjectQueryResponseOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> other_names; // name1
|
||||
recvPacket >> other_names; // name2
|
||||
recvPacket >> other_names; // name3 (all unused)
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> unks;
|
||||
recvPacket >> go->castBarCaption;
|
||||
@ -1783,7 +1783,7 @@ void WorldSession::_HandleGameobjectQueryResponseOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
for(uint32 i = 0; i < GAMEOBJECT_DATA_FIELDS; i++)
|
||||
recvPacket >> go->raw.data[i];
|
||||
if(GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
recvPacket >> go->size;
|
||||
for(uint32 i = 0; i < 4; i++)
|
||||
@ -1839,7 +1839,7 @@ void WorldSession::_HandleMonsterMoveOpcode(WorldPacket& recvPacket)
|
||||
uint8 unk, type;
|
||||
uint32 time, flags, movetime, waypoints;
|
||||
float x, y, z;
|
||||
if(GetInstance()->GetConf()->clientbuild>6005)
|
||||
if(GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
recvPacket >> unk;
|
||||
|
||||
recvPacket >> x >> y >> z >> time >> type;
|
||||
|
||||
@ -84,7 +84,7 @@ void WorldSocket::OnRead()
|
||||
break;
|
||||
}
|
||||
|
||||
if(GetSession()->GetInstance()->GetConf()->clientbuild > 6005)
|
||||
if(GetSession()->GetInstance()->GetConf()->client > CLIENT_CLASSIC_WOW)
|
||||
{
|
||||
// read first byte and check if size is 3 or 2 bytes
|
||||
uint8 firstSizeByte;
|
||||
@ -166,9 +166,9 @@ void WorldSocket::SendWorldPacket(WorldPacket &pkt)
|
||||
void WorldSocket::InitCrypt(BigNumber *k)
|
||||
{
|
||||
//As crypt
|
||||
switch(GetSession()->GetInstance()->GetConf()->clientbuild)
|
||||
switch(GetSession()->GetInstance()->GetConf()->client)
|
||||
{
|
||||
case 6005:
|
||||
case CLIENT_CLASSIC_WOW:
|
||||
{
|
||||
logdebug("Setting Crypt to Build 6005");
|
||||
pInit = &AuthCrypt::Init_6005;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user