Switch to support client 3.0.8a (build 3506)

Merge commit 'origin/308'
This commit is contained in:
VladimirMangos 2009-01-30 00:27:55 +03:00
commit 0fd361a0a3
11 changed files with 120 additions and 63 deletions

2
NEWS
View file

@ -15,7 +15,7 @@ http://mangos.lighthouseapp.com/
Version 0.13 Version 0.13
* Under discussion. * Under discussion.
* Upgrade to client version 3.0.3 (build 9183). * Upgrade to client version 3.0.8 (build 9506).
Version 0.12 Version 0.12
* Migrate from SVN to GIT. * Migrate from SVN to GIT.

View file

@ -64,63 +64,84 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target)
if (Source->rpos() + 4 > Source->size()) if (Source->rpos() + 4 > Source->size())
return false; return false;
*Source >> TempValue; //get real size of the packed structure *Source >> TempValue; // get real size of the packed structure
// empty addon packet, nothing process, can't be received from real client // empty addon packet, nothing process, can't be received from real client
if(!TempValue) if(!TempValue)
return false; return false;
AddonRealSize = TempValue; //temp value because ZLIB only excepts uLongf AddonRealSize = TempValue; // temp value because ZLIB only excepts uLongf
CurrentPosition = Source->rpos(); //get the position of the pointer in the structure CurrentPosition = Source->rpos(); // get the position of the pointer in the structure
AddOnPacked.resize(AddonRealSize); //resize target for zlib action AddOnPacked.resize(AddonRealSize); // resize target for zlib action
if (!uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition)!= Z_OK) if (!uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition)!= Z_OK)
{ {
Target->Initialize(SMSG_ADDON_INFO); Target->Initialize(SMSG_ADDON_INFO);
while(AddOnPacked.rpos() < AddOnPacked.size()) uint32 addonsCount;
AddOnPacked >> addonsCount; // addons count?
for(uint32 i = 0; i < addonsCount; ++i)
{ {
std::string AddonNames; std::string addonName;
uint8 unk6; uint8 enabled;
uint32 crc, unk7; uint32 crc, unk2;
// check next addon data format correctness // check next addon data format correctness
if(AddOnPacked.rpos()+1+4+4+1 > AddOnPacked.size()) if(AddOnPacked.rpos()+1 > AddOnPacked.size())
return false; return false;
AddOnPacked >> AddonNames; AddOnPacked >> addonName;
// recheck next addon data format correctness // recheck next addon data format correctness
if(AddOnPacked.rpos()+4+4+1 > AddOnPacked.size()) if(AddOnPacked.rpos()+1+4+4 > AddOnPacked.size())
return false; return false;
AddOnPacked >> crc >> unk7 >> unk6; AddOnPacked >> enabled >> crc >> unk2;
//sLog.outDebug("ADDON: Name:%s CRC:%x Unknown1 :%x Unknown2 :%x", AddonNames.c_str(), crc, unk7, unk6); sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2);
*Target << (uint8)2; uint8 state = (enabled ? 2 : 1);
*Target << uint8(state);
uint8 unk1 = 1; uint8 unk1 = (enabled ? 1 : 0);
*Target << (uint8)unk1; *Target << uint8(unk1);
if (unk1) if (unk1)
{ {
uint8 unk2 = crc != 0x1c776d01LL; //If addon is Standard addon CRC uint8 unk2 = (crc != 0x4c1c776d); // If addon is Standard addon CRC
*Target << (uint8)unk2; *Target << uint8(unk2);
if (unk2) if (unk2)
Target->append(tdata, sizeof(tdata)); Target->append(tdata, sizeof(tdata));
*Target << (uint32)0; *Target << uint32(0);
} }
uint8 unk3 = 0; uint8 unk3 = (enabled ? 0 : 1);
*Target << (uint8)unk3; *Target << uint8(unk3);
if (unk3) if (unk3)
{ {
// String, 256 // String, 256 (null terminated?)
*Target << uint8(0);
} }
} }
uint32 unk4;
AddOnPacked >> unk4;
uint32 count = 0;
*Target << uint32(count);
/*for(uint32 i = 0; i < count; ++i)
{
uint32
string (16 bytes)
string (16 bytes)
uint32
}*/
if(AddOnPacked.rpos() != AddOnPacked.size())
sLog.outDebug("packet under read!");
} }
else else
{ {

View file

@ -304,8 +304,11 @@ void ArenaTeam::Roster(WorldSession *session)
{ {
Player *pl = NULL; Player *pl = NULL;
uint8 unk308 = 0;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100); WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // arena team id data << uint32(GetId()); // arena team id
data << uint8(unk308); // 308 unknown value but affect packet structure
data << uint32(GetMembersSize()); // members count data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type? data << uint32(GetType()); // arena team type?
@ -313,18 +316,24 @@ void ArenaTeam::Roster(WorldSession *session)
{ {
pl = objmgr.GetPlayer(itr->guid); pl = objmgr.GetPlayer(itr->guid);
data << uint64(itr->guid); // guid data << uint64(itr->guid); // guid
data << uint8((pl ? 1 : 0)); // online flag data << uint8((pl ? 1 : 0)); // online flag
data << itr->name; // member name data << itr->name; // member name
data << uint32((itr->guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member data << uint32((itr->guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
data << uint8((pl ? pl->getLevel() : 0)); // unknown, level? data << uint8((pl ? pl->getLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class data << uint8(itr->Class); // class
data << uint32(itr->games_week); // played this week data << uint32(itr->games_week); // played this week
data << uint32(itr->wins_week); // wins this week data << uint32(itr->wins_week); // wins this week
data << uint32(itr->games_season); // played this season data << uint32(itr->games_season); // played this season
data << uint32(itr->wins_season); // wins this season data << uint32(itr->wins_season); // wins this season
data << uint32(itr->personal_rating); // personal rating data << uint32(itr->personal_rating); // personal rating
if(unk308)
{
data << float(0.0); // 308 unk
data << float(0.0); // 308 unk
}
} }
session->SendPacket(&data); session->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
} }

View file

@ -24,8 +24,6 @@
#include "Opcodes.h" #include "Opcodes.h"
#include "InstanceSaveMgr.h" #include "InstanceSaveMgr.h"
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data) void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
{ {
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
@ -65,7 +63,9 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
data.put<uint32>(p_counter,counter); data.put<uint32>(p_counter,counter);
data << (uint32) 1135753200; //wtf?? (28.12.2005 12:00) data << (uint32) 1135753200; //wtf?? (28.12.2005 12:00)
sLog.outDebug("Sending calendar"); data << (uint32) 0; // unk counter 4
data << (uint32) 0; // unk counter 5
//sLog.outDebug("Sending calendar");
//data.hexlike(); //data.hexlike();
SendPacket(&data); SendPacket(&data);
} }

View file

@ -593,11 +593,18 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << uint32(pQuest->ReqCreatureOrGOId[iI]); data << uint32(pQuest->ReqCreatureOrGOId[iI]);
} }
data << uint32(pQuest->ReqCreatureOrGOCount[iI]); data << uint32(pQuest->ReqCreatureOrGOCount[iI]);
data << uint32(pQuest->ReqItemId[iI]);
data << uint32(pQuest->ReqItemCount[iI]);
data << uint32(0); // added in WotLK, dunno if offset if correct data << uint32(0); // added in WotLK, dunno if offset if correct
} }
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
{
data << uint32(pQuest->ReqItemId[iI]);
data << uint32(pQuest->ReqItemCount[iI]);
}
data << uint32(0); // TODO: 5 item objective
data << uint32(0);
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; iI++) for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; iI++)
data << ObjectiveText[iI]; data << ObjectiveText[iI];

View file

@ -1216,4 +1216,11 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4A5*/ { "SMSG_PET_GUIDS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4A5*/ { "SMSG_PET_GUIDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x4A6*/ { "SMSG_CLIENTCACHE_VERSION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
/*0x4A7*/ { "UMSG_UNKNOWN_1191", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4A8*/ { "UMSG_UNKNOWN_1192", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4A9*/ { "UMSG_UNKNOWN_1193", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4AA*/ { "UMSG_UNKNOWN_1194", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4AB*/ { "UMSG_UNKNOWN_1195", STATUS_NEVER, &WorldSession::Handle_NULL },
/*0x4AC*/ { "UMSG_UNKNOWN_1196", STATUS_NEVER, &WorldSession::Handle_NULL },
}; };

View file

@ -1224,7 +1224,14 @@ enum Opcodes
SMSG_SERVER_BUCK_DATA_START = 0x4A3, SMSG_SERVER_BUCK_DATA_START = 0x4A3,
CMSG_QUERY_VEHICLE_STATUS = 0x4A4, CMSG_QUERY_VEHICLE_STATUS = 0x4A4,
SMSG_PET_GUIDS = 0x4A5, SMSG_PET_GUIDS = 0x4A5,
NUM_MSG_TYPES = 0x4A6 SMSG_CLIENTCACHE_VERSION = 0x4A6,
UMSG_UNKNOWN_1191 = 0x4A7,
UMSG_UNKNOWN_1192 = 0x4A8,
UMSG_UNKNOWN_1193 = 0x4A9,
UMSG_UNKNOWN_1194 = 0x4AA,
UMSG_UNKNOWN_1195 = 0x4AB,
UMSG_UNKNOWN_1196 = 0x4AC,
NUM_MSG_TYPES = 0x4AD
}; };
/// Player state /// Player state

View file

@ -177,7 +177,7 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
if(!data->readPackGUID(m_unitTargetGUID)) if(!data->readPackGUID(m_unitTargetGUID))
return false; return false;
if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK )) if( m_targetMask & ( TARGET_FLAG_OBJECT ))
if(!data->readPackGUID(m_GOTargetGUID)) if(!data->readPackGUID(m_GOTargetGUID))
return false; return false;
@ -185,6 +185,10 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
if(!data->readPackGUID(m_itemTargetGUID)) if(!data->readPackGUID(m_itemTargetGUID))
return false; return false;
if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) )
if(!data->readPackGUID(m_CorpseTargetGUID))
return false;
if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION )
{ {
if(data->rpos()+4+4+4 > data->size()) if(data->rpos()+4+4+4 > data->size())
@ -197,7 +201,10 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
if( m_targetMask & TARGET_FLAG_DEST_LOCATION ) if( m_targetMask & TARGET_FLAG_DEST_LOCATION )
{ {
if(data->rpos()+4+4+4 > data->size()) if(data->rpos()+1+4+4+4 > data->size())
return false;
if(!data->readPackGUID(m_unitTargetGUID))
return false; return false;
*data >> m_destX >> m_destY >> m_destZ; *data >> m_destX >> m_destY >> m_destZ;
@ -213,10 +220,6 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
*data >> m_strTarget; *data >> m_strTarget;
} }
if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) )
if(!data->readPackGUID(m_CorpseTargetGUID))
return false;
// find real units/GOs // find real units/GOs
Update(caster); Update(caster);
return true; return true;
@ -226,7 +229,7 @@ void SpellCastTargets::write ( WorldPacket * data )
{ {
*data << uint32(m_targetMask); *data << uint32(m_targetMask);
if( m_targetMask & ( TARGET_FLAG_UNIT | TARGET_FLAG_PVP_CORPSE | TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK | TARGET_FLAG_CORPSE | TARGET_FLAG_UNK2 ) ) if( m_targetMask & ( TARGET_FLAG_UNIT | TARGET_FLAG_PVP_CORPSE | TARGET_FLAG_OBJECT | TARGET_FLAG_CORPSE | TARGET_FLAG_UNK2 ) )
{ {
if(m_targetMask & TARGET_FLAG_UNIT) if(m_targetMask & TARGET_FLAG_UNIT)
{ {
@ -235,7 +238,7 @@ void SpellCastTargets::write ( WorldPacket * data )
else else
*data << uint8(0); *data << uint8(0);
} }
else if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK ) ) else if( m_targetMask & TARGET_FLAG_OBJECT )
{ {
if(m_GOTarget) if(m_GOTarget)
data->append(m_GOTarget->GetPackGUID()); data->append(m_GOTarget->GetPackGUID());
@ -260,7 +263,14 @@ void SpellCastTargets::write ( WorldPacket * data )
*data << m_srcX << m_srcY << m_srcZ; *data << m_srcX << m_srcY << m_srcZ;
if( m_targetMask & TARGET_FLAG_DEST_LOCATION ) if( m_targetMask & TARGET_FLAG_DEST_LOCATION )
{
if(m_unitTarget)
data->append(m_unitTarget->GetPackGUID());
else
*data << uint8(0);
*data << m_destX << m_destY << m_destZ; *data << m_destX << m_destY << m_destZ;
}
if( m_targetMask & TARGET_FLAG_STRING ) if( m_targetMask & TARGET_FLAG_STRING )
*data << m_strTarget; *data << m_strTarget;

View file

@ -7566,6 +7566,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
// Taken/Done fixed damage bonus auras // Taken/Done fixed damage bonus auras
int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto)); int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto));
int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim); int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
// Pets just add their bonus damage to their spell damage // Pets just add their bonus damage to their spell damage
// note that their spell damage is just gain of their own auras // note that their spell damage is just gain of their own auras
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())

View file

@ -66,8 +66,8 @@ enum LoginResult
// we need to stick to 1 version or half of the stuff will work for someone // we need to stick to 1 version or half of the stuff will work for someone
// others will not and opposite // others will not and opposite
// will only support WoW, WoW:TBC and WoW:WotLK 3.0.3 client build 9183... // will only support WoW, WoW:TBC and WoW:WotLK 3.0.8 client build 9506...
#define EXPECTED_MANGOS_CLIENT_BUILD {9183, 0} #define EXPECTED_MANGOS_CLIENT_BUILD {9506, 0}
#endif #endif

View file

@ -498,20 +498,15 @@ void LoadDBCStores(const std::string& dataPath)
exit(1); exit(1);
} }
// check at up-to-date DBC files (54909 is last added spell in 3.0.1) // Check loaded DBC files proper version
// check at up-to-date DBC files (19162 is last added spell in abilities in 3.0.1) if( !sSpellStore.LookupEntry(54909) || // last added spell in 3.0.8a
// check at up-to-date DBC files (619 is last map added in 3.0.1) !sSpellStore.LookupEntry(49184) || // last added spell in 3.0.8a
// check at up-to-date DBC files (1361 is last gem property added in 3.0.1) sSpellStore.LookupEntry(49184)->RecoveryTime!=5000||// last changed spell in 3.0.8a
// check at up-to-date DBC files (2425 is last item extended cost added in 3.0.1) !sMapStore.LookupEntry(624) || // last map added in 3.0.8a
// check at up-to-date DBC files (76 is last char title added in 3.0.1) !sGemPropertiesStore.LookupEntry(1557) || // last gem property added in 3.0.8a
// check at up-to-date DBC files (2311 is last area added in 3.0.1) !sItemExtendedCostStore.LookupEntry(2589) || // last item extended cost added in 3.0.8a
if( !sSpellStore.LookupEntry(54909) || !sCharTitlesStore.LookupEntry(144) || // last char title added in 3.0.8a
!sSkillLineAbilityStore.LookupEntry(19162) || !sAreaStore.LookupEntry(2769) ) // last area (areaflag) added in 3.0.8a
!sMapStore.LookupEntry(619) ||
!sGemPropertiesStore.LookupEntry(1361) ||
!sItemExtendedCostStore.LookupEntry(2425) ||
!sCharTitlesStore.LookupEntry(76) ||
!sAreaStore.LookupEntry(2311) )
{ {
sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client.");
exit(1); exit(1);