mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Updated query opcodes
This commit is contained in:
6
sql/updates/world/2016_xx_xx_xx_world_legion_01.sql
Normal file
6
sql/updates/world/2016_xx_xx_xx_world_legion_01.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE `page_text`
|
||||
ADD `PlayerConditionID` int(11) NOT NULL DEFAULT '0' AFTER `NextPageID`,
|
||||
ADD `Flags` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `PlayerConditionID`;
|
||||
|
||||
UPDATE `gameobject_template` SET `Data8`=`Data8`^1 WHERE `type`=0;
|
||||
UPDATE `gameobject_template` SET `flags`=`flags`|0x00100000 WHERE `type`=15;
|
||||
@@ -1031,6 +1031,9 @@ bool GameObject::IsNeverVisible() const
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_SPELL_FOCUS && GetGOInfo()->spellFocus.serverOnly == 1)
|
||||
return true;
|
||||
|
||||
if (!GetUInt32Value(GAMEOBJECT_DISPLAYID))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1117,10 +1117,10 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
|
||||
Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport*>(this); else return NULL; }
|
||||
Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return NULL; }
|
||||
|
||||
float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); }
|
||||
float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); }
|
||||
float GetStationaryZ() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); }
|
||||
float GetStationaryO() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); }
|
||||
float GetStationaryX() const override { return m_stationaryPosition.GetPositionX(); }
|
||||
float GetStationaryY() const override { return m_stationaryPosition.GetPositionY(); }
|
||||
float GetStationaryZ() const override { return m_stationaryPosition.GetPositionZ(); }
|
||||
float GetStationaryO() const override { return m_stationaryPosition.GetOrientation(); }
|
||||
void RelocateStationaryPosition(float x, float y, float z, float o) { m_stationaryPosition.Relocate(x, y, z, o); }
|
||||
|
||||
float GetInteractionDistance() const;
|
||||
|
||||
@@ -299,6 +299,7 @@ Creature* Transport::CreateNPCPassenger(ObjectGuid::LowType guid, CreatureData c
|
||||
creature->SetTransport(this);
|
||||
creature->m_movementInfo.transport.guid = GetGUID();
|
||||
creature->m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
creature->m_movementInfo.transport.seat = -1;
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
creature->Relocate(x, y, z, o);
|
||||
creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
|
||||
@@ -355,6 +356,7 @@ GameObject* Transport::CreateGOPassenger(ObjectGuid::LowType guid, GameObjectDat
|
||||
go->SetTransport(this);
|
||||
go->m_movementInfo.transport.guid = GetGUID();
|
||||
go->m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
go->m_movementInfo.transport.seat = -1;
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
go->Relocate(x, y, z, o);
|
||||
go->RelocateStationaryPosition(x, y, z, o);
|
||||
|
||||
@@ -5125,8 +5125,8 @@ void ObjectMgr::LoadPageTexts()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Text, NextPageID FROM page_text");
|
||||
// 0 1 2 3 4
|
||||
QueryResult result = WorldDatabase.Query("SELECT ID, Text, NextPageID, PlayerConditionID, Flags FROM page_text");
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 page texts. DB table `page_text` is empty!");
|
||||
@@ -5143,22 +5143,18 @@ void ObjectMgr::LoadPageTexts()
|
||||
PageText& pageText = _pageTextStore[id];
|
||||
pageText.Text = fields[1].GetString();
|
||||
pageText.NextPageID = fields[2].GetUInt32();
|
||||
pageText.PlayerConditionID = fields[3].GetInt32();
|
||||
pageText.Flags = fields[4].GetUInt8();
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
for (PageTextContainer::const_iterator itr = _pageTextStore.begin(); itr != _pageTextStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.NextPageID)
|
||||
{
|
||||
PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPageID);
|
||||
if (itr2 == _pageTextStore.end())
|
||||
if (_pageTextStore.find(itr->second.NextPageID) == _pageTextStore.end())
|
||||
TC_LOG_ERROR("sql.sql", "Page text (ID: %u) has non-existing `NextPageID` (%u)", itr->first, itr->second.NextPageID);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ struct PageText
|
||||
{
|
||||
std::string Text;
|
||||
uint32 NextPageID;
|
||||
int32 PlayerConditionID;
|
||||
uint8 Flags;
|
||||
};
|
||||
|
||||
/// Key for storing temp summon data in TempSummonDataContainer
|
||||
|
||||
@@ -58,7 +58,6 @@ void WorldSession::SendQueryTimeResponse()
|
||||
{
|
||||
WorldPackets::Query::QueryTimeResponse queryTimeResponse;
|
||||
queryTimeResponse.CurrentTime = time(nullptr);
|
||||
queryTimeResponse.TimeOutRequest = sWorld->GetNextDailyQuestsResetTime() - queryTimeResponse.CurrentTime;
|
||||
SendPacket(queryTimeResponse.Write());
|
||||
}
|
||||
|
||||
@@ -129,7 +128,6 @@ void WorldSession::HandleCreatureQuery(WorldPackets::Query::QueryCreature& packe
|
||||
void WorldSession::HandleGameObjectQueryOpcode(WorldPackets::Query::QueryGameObject& packet)
|
||||
{
|
||||
WorldPackets::Query::QueryGameObjectResponse response;
|
||||
|
||||
response.GameObjectID = packet.GameObjectID;
|
||||
|
||||
if (GameObjectTemplate const* gameObjectInfo = sObjectMgr->GetGameObjectTemplate(packet.GameObjectID))
|
||||
@@ -157,19 +155,20 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPackets::Query::QueryGameObj
|
||||
stats.Size = gameObjectInfo->size;
|
||||
|
||||
if (GameObjectQuestItemList const* items = sObjectMgr->GetGameObjectQuestItemList(packet.GameObjectID))
|
||||
for (uint32 item : *items)
|
||||
for (int32 item : *items)
|
||||
stats.QuestItems.push_back(item);
|
||||
|
||||
for (uint32 i = 0; i < MAX_GAMEOBJECT_DATA; i++)
|
||||
stats.Data[i] = gameObjectInfo->raw.data[i];
|
||||
memcpy(stats.Data, gameObjectInfo->raw.data, MAX_GAMEOBJECT_DATA * sizeof(int32));
|
||||
stats.Expansion = gameObjectInfo->unkInt32;
|
||||
}
|
||||
|
||||
SendPacket(response.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLocationFromClient& /*packet*/)
|
||||
void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLocationFromClient& queryCorpseLocation)
|
||||
{
|
||||
if (!_player->HasCorpse())
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(queryCorpseLocation.Player);
|
||||
if (!player || !player->HasCorpse() || !_player->IsInSameRaidWith(player))
|
||||
{
|
||||
WorldPackets::Query::CorpseLocation packet;
|
||||
packet.Valid = false; // corpse not found
|
||||
@@ -177,7 +176,7 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc
|
||||
return;
|
||||
}
|
||||
|
||||
WorldLocation corpseLocation = _player->GetCorpseLocation();
|
||||
WorldLocation corpseLocation = player->GetCorpseLocation();
|
||||
uint32 corpseMapID = corpseLocation.GetMapId();
|
||||
uint32 mapID = corpseLocation.GetMapId();
|
||||
float x = corpseLocation.GetPositionX();
|
||||
@@ -185,7 +184,7 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc
|
||||
float z = corpseLocation.GetPositionZ();
|
||||
|
||||
// if corpse at different map
|
||||
if (mapID != _player->GetMapId())
|
||||
if (mapID != player->GetMapId())
|
||||
{
|
||||
// search entrance map for proper show entrance
|
||||
if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapID))
|
||||
@@ -198,7 +197,7 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc
|
||||
mapID = corpseMapEntry->CorpseMapID;
|
||||
x = corpseMapEntry->CorpsePos.X;
|
||||
y = corpseMapEntry->CorpsePos.Y;
|
||||
z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT);
|
||||
z = entranceMap->GetHeight(player->GetPhaseMask(), x, y, MAX_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,6 +205,7 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc
|
||||
|
||||
WorldPackets::Query::CorpseLocation packet;
|
||||
packet.Valid = true;
|
||||
packet.Player = queryCorpseLocation.Player;
|
||||
packet.MapID = corpseMapID;
|
||||
packet.ActualMapID = mapID;
|
||||
packet.Position = G3D::Vector3(x, y, z);
|
||||
@@ -244,55 +244,49 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPackets::Query::QueryNPCText& p
|
||||
/// Only _static_ data is sent in this packet !!!
|
||||
void WorldSession::HandleQueryPageText(WorldPackets::Query::QueryPageText& packet)
|
||||
{
|
||||
uint32 pageID = packet.PageTextID;
|
||||
WorldPackets::Query::QueryPageTextResponse response;
|
||||
response.PageTextID = packet.PageTextID;
|
||||
|
||||
uint32 pageID = packet.PageTextID;
|
||||
while (pageID)
|
||||
{
|
||||
PageText const* pageText = sObjectMgr->GetPageText(pageID);
|
||||
|
||||
WorldPackets::Query::QueryPageTextResponse response;
|
||||
response.PageTextID = pageID;
|
||||
|
||||
if (!pageText)
|
||||
{
|
||||
response.Allow = false;
|
||||
pageID = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Allow = true;
|
||||
response.Info.ID = pageID;
|
||||
response.Info.NextPageID = pageText->NextPageID;
|
||||
response.Info.Text = pageText->Text;
|
||||
break;
|
||||
|
||||
LocaleConstant localeConstant = GetSessionDbLocaleIndex();
|
||||
if (localeConstant >= LOCALE_enUS)
|
||||
if (PageTextLocale const* pageTextLocale = sObjectMgr->GetPageTextLocale(pageID))
|
||||
ObjectMgr::GetLocaleString(pageTextLocale->Text, localeConstant, response.Info.Text);
|
||||
WorldPackets::Query::QueryPageTextResponse::PageTextInfo page;
|
||||
page.ID = pageID;
|
||||
page.NextPageID = pageText->NextPageID;
|
||||
page.Text = pageText->Text;
|
||||
page.PlayerConditionID = pageText->PlayerConditionID;
|
||||
page.Flags = pageText->Flags;
|
||||
|
||||
pageID = pageText->NextPageID;
|
||||
}
|
||||
LocaleConstant locale = GetSessionDbLocaleIndex();
|
||||
if (locale >= LOCALE_enUS)
|
||||
if (PageTextLocale const* pageTextLocale = sObjectMgr->GetPageTextLocale(pageID))
|
||||
ObjectMgr::GetLocaleString(pageTextLocale->Text, locale, page.Text);
|
||||
|
||||
SendPacket(response.Write());
|
||||
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUERY_PAGE_TEXT_RESPONSE");
|
||||
response.Pages.push_back(page);
|
||||
pageID = pageText->NextPageID;
|
||||
}
|
||||
|
||||
response.Allow = !response.Pages.empty();
|
||||
|
||||
SendPacket(response.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleQueryCorpseTransport(WorldPackets::Query::QueryCorpseTransport& queryCorpseTransport)
|
||||
{
|
||||
Corpse* corpse = _player->GetCorpse();
|
||||
|
||||
WorldPackets::Query::CorpseTransportQuery response;
|
||||
if (!corpse || corpse->GetTransGUID().IsEmpty() || corpse->GetTransGUID() != queryCorpseTransport.Transport)
|
||||
response.Player = queryCorpseTransport.Player;
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(queryCorpseTransport.Player))
|
||||
{
|
||||
response.Position = G3D::Vector3(0.0f, 0.0f, 0.0f);
|
||||
response.Facing = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Position = G3D::Vector3(corpse->GetTransOffsetX(), corpse->GetTransOffsetY(), corpse->GetTransOffsetZ());
|
||||
response.Facing = corpse->GetTransOffsetO();
|
||||
Corpse* corpse = player->GetCorpse();
|
||||
if (_player->IsInSameRaidWith(player) && corpse && !corpse->GetTransGUID().IsEmpty() && corpse->GetTransGUID() == queryCorpseTransport.Transport)
|
||||
{
|
||||
response.Position = G3D::Vector3(corpse->GetTransOffsetX(), corpse->GetTransOffsetY(), corpse->GetTransOffsetZ());
|
||||
response.Facing = corpse->GetTransOffsetO();
|
||||
}
|
||||
}
|
||||
|
||||
SendPacket(response.Write());
|
||||
|
||||
@@ -2310,15 +2310,18 @@ enum GameobjectTypes : uint8 // (6.0.3.19103)
|
||||
|
||||
enum GameObjectFlags
|
||||
{
|
||||
GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated
|
||||
GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
|
||||
GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact)
|
||||
GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car)
|
||||
GO_FLAG_NOT_SELECTABLE = 0x00000010, // not selectable even in GM mode
|
||||
GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state
|
||||
GO_FLAG_TRIGGERED = 0x00000040, // typically, summoned objects. Triggered by spell or other events
|
||||
GO_FLAG_DAMAGED = 0x00000200,
|
||||
GO_FLAG_DESTROYED = 0x00000400
|
||||
GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated
|
||||
GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
|
||||
GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact - requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside)
|
||||
GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car)
|
||||
GO_FLAG_NOT_SELECTABLE = 0x00000010, // not selectable even in GM mode
|
||||
GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state
|
||||
GO_FLAG_AI_OBSTACLE = 0x00000040,
|
||||
GO_FLAG_FREEZE_ANIMATION = 0x00000080,
|
||||
GO_FLAG_DAMAGED = 0x00000200,
|
||||
GO_FLAG_DESTROYED = 0x00000400,
|
||||
GO_FLAG_INTERACT_DISTANCE_USES_TEMPLATE_MODEL = 0x00080000, // client checks interaction distance from model sent in SMSG_QUERY_GAMEOBJECT_RESPONSE instead of GAMEOBJECT_DISPLAYID
|
||||
GO_FLAG_MAP_OBJECT = 0x00100000 // pre-7.0 model loading used to be controlled by file extension (wmo vs m2)
|
||||
};
|
||||
|
||||
enum GameObjectDynamicLowFlags
|
||||
|
||||
@@ -511,7 +511,7 @@ WorldPacket const* WorldPackets::Movement::MoveTeleport::Write()
|
||||
_worldPacket << uint32(SequenceIndex);
|
||||
_worldPacket << Pos.PositionXYZStream();
|
||||
_worldPacket << float(Facing);
|
||||
_worldPacket << uint8(0); //! New in 7.x (gets written into movement queue node)
|
||||
_worldPacket << uint8(PreloadWorld);
|
||||
|
||||
_worldPacket.WriteBit(Vehicle.is_initialized());
|
||||
_worldPacket.WriteBit(TransportGUID.is_initialized());
|
||||
|
||||
@@ -255,6 +255,7 @@ namespace WorldPackets
|
||||
ObjectGuid MoverGUID;
|
||||
Optional<ObjectGuid> TransportGUID;
|
||||
float Facing = 0.0f;
|
||||
uint8 PreloadWorld = 0;
|
||||
};
|
||||
|
||||
struct MovementForce
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "QueryPackets.h"
|
||||
#include "BattlenetAccountMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PacketUtilities.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
@@ -58,24 +59,23 @@ WorldPacket const* WorldPackets::Query::QueryCreatureResponse::Write()
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
_worldPacket << Stats.Flags[i];
|
||||
|
||||
_worldPacket << Stats.CreatureType;
|
||||
_worldPacket << Stats.CreatureFamily;
|
||||
_worldPacket << Stats.Classification;
|
||||
_worldPacket << int32(Stats.CreatureType);
|
||||
_worldPacket << int32(Stats.CreatureFamily);
|
||||
_worldPacket << int32(Stats.Classification);
|
||||
|
||||
for (uint32 i = 0; i < MAX_KILL_CREDIT; ++i)
|
||||
_worldPacket << Stats.ProxyCreatureID[i];
|
||||
_worldPacket << int32(Stats.ProxyCreatureID[i]);
|
||||
|
||||
for (uint32 i = 0; i < MAX_CREATURE_MODELS; ++i)
|
||||
_worldPacket << Stats.CreatureDisplayID[i];
|
||||
|
||||
_worldPacket << Stats.HpMulti;
|
||||
_worldPacket << Stats.EnergyMulti;
|
||||
|
||||
_worldPacket << int32(Stats.QuestItems.size());
|
||||
_worldPacket << Stats.CreatureMovementInfoID;
|
||||
_worldPacket << Stats.RequiredExpansion;
|
||||
_worldPacket << int32(Stats.CreatureDisplayID[i]);
|
||||
|
||||
_worldPacket << float(Stats.HpMulti);
|
||||
_worldPacket << float(Stats.EnergyMulti);
|
||||
_worldPacket << uint32(Stats.QuestItems.size());
|
||||
_worldPacket << int32(Stats.CreatureMovementInfoID);
|
||||
_worldPacket << int32(Stats.RequiredExpansion);
|
||||
_worldPacket << int32(0); // FlagQuest
|
||||
_worldPacket << int32(0);
|
||||
|
||||
if (!Stats.Title.empty())
|
||||
_worldPacket << Stats.Title;
|
||||
@@ -196,6 +196,21 @@ void WorldPackets::Query::QueryPageText::Read()
|
||||
_worldPacket >> ItemGUID;
|
||||
}
|
||||
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Query::QueryPageTextResponse::PageTextInfo const& page)
|
||||
{
|
||||
data << uint32(page.ID);
|
||||
data << uint32(page.NextPageID);
|
||||
data << int32(page.PlayerConditionID);
|
||||
data << uint8(page.Flags);
|
||||
data.WriteBits(page.Text.length(), 12);
|
||||
data.FlushBits();
|
||||
|
||||
data.WriteString(page.Text);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Query::QueryPageTextResponse::Write()
|
||||
{
|
||||
_worldPacket << PageTextID;
|
||||
@@ -205,12 +220,9 @@ WorldPacket const* WorldPackets::Query::QueryPageTextResponse::Write()
|
||||
|
||||
if (Allow)
|
||||
{
|
||||
_worldPacket << Info.ID;
|
||||
_worldPacket << Info.NextPageID;
|
||||
_worldPacket.WriteBits(Info.Text.length(), 12);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
_worldPacket.WriteString(Info.Text);
|
||||
_worldPacket << uint32(Pages.size());
|
||||
for (PageTextInfo const& pageText : Pages)
|
||||
_worldPacket << pageText;
|
||||
}
|
||||
|
||||
return &_worldPacket;
|
||||
@@ -293,43 +305,47 @@ WorldPacket const* WorldPackets::Query::QueryGameObjectResponse::Write()
|
||||
_worldPacket.WriteBit(Allow);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
ByteBuffer statsData;
|
||||
if (Allow)
|
||||
{
|
||||
uint32 dataSize = Stats.GetDataSize();
|
||||
statsData << int32(Stats.Type);
|
||||
statsData << int32(Stats.DisplayID);
|
||||
for (int8 i = 0; i < 4; ++i)
|
||||
statsData << Stats.Name[i];
|
||||
|
||||
_worldPacket << uint32(dataSize);
|
||||
if (dataSize)
|
||||
{
|
||||
_worldPacket << Stats.Type;
|
||||
_worldPacket << Stats.DisplayID;
|
||||
for (int8 i = 0; i < 4; i++)
|
||||
_worldPacket << Stats.Name[i];
|
||||
statsData << Stats.IconName;
|
||||
statsData << Stats.CastBarCaption;
|
||||
statsData << Stats.UnkString;
|
||||
|
||||
_worldPacket << Stats.IconName;
|
||||
_worldPacket << Stats.CastBarCaption;
|
||||
_worldPacket << Stats.UnkString;
|
||||
for (uint32 i = 0; i < MAX_GAMEOBJECT_DATA; ++i)
|
||||
statsData << int32(Stats.Data[i]);
|
||||
|
||||
for (uint32 i = 0; i < MAX_GAMEOBJECT_DATA; i++)
|
||||
_worldPacket << Stats.Data[i];
|
||||
statsData << float(Stats.Size);
|
||||
statsData << uint8(Stats.QuestItems.size());
|
||||
for (int32 questItem : Stats.QuestItems)
|
||||
statsData << int32(questItem);
|
||||
|
||||
_worldPacket << Stats.Size;
|
||||
|
||||
_worldPacket << uint8(Stats.QuestItems.size());
|
||||
for (int32 questItem : Stats.QuestItems)
|
||||
_worldPacket << questItem;
|
||||
|
||||
_worldPacket << Stats.Expansion;
|
||||
}
|
||||
statsData << int32(Stats.Expansion);
|
||||
}
|
||||
|
||||
_worldPacket << uint32(statsData.size());
|
||||
if (!statsData.empty())
|
||||
_worldPacket.append(statsData);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Query::QueryCorpseLocationFromClient::Read()
|
||||
{
|
||||
_worldPacket >> Player;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Query::CorpseLocation::Write()
|
||||
{
|
||||
_worldPacket.WriteBit(Valid);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
_worldPacket << Player;
|
||||
_worldPacket << ActualMapID;
|
||||
_worldPacket << Position.x;
|
||||
_worldPacket << Position.y;
|
||||
@@ -342,14 +358,14 @@ WorldPacket const* WorldPackets::Query::CorpseLocation::Write()
|
||||
|
||||
void WorldPackets::Query::QueryCorpseTransport::Read()
|
||||
{
|
||||
_worldPacket >> Player;
|
||||
_worldPacket >> Transport;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Query::CorpseTransportQuery::Write()
|
||||
{
|
||||
_worldPacket << Position.x;
|
||||
_worldPacket << Position.y;
|
||||
_worldPacket << Position.z;
|
||||
_worldPacket << Player;
|
||||
_worldPacket << Position;
|
||||
_worldPacket << Facing;
|
||||
|
||||
return &_worldPacket;
|
||||
@@ -357,8 +373,7 @@ WorldPacket const* WorldPackets::Query::CorpseTransportQuery::Write()
|
||||
|
||||
WorldPacket const* WorldPackets::Query::QueryTimeResponse::Write()
|
||||
{
|
||||
_worldPacket << uint32(CurrentTime);
|
||||
_worldPacket << int32(TimeOutRequest);
|
||||
_worldPacket << int32(CurrentTime);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
@@ -483,8 +498,8 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Query::ItemTextCache cons
|
||||
WorldPacket const* WorldPackets::Query::QueryItemTextResponse::Write()
|
||||
{
|
||||
_worldPacket.WriteBit(Valid);
|
||||
_worldPacket << Id;
|
||||
_worldPacket << Item;
|
||||
_worldPacket << Id;
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -140,12 +140,14 @@ namespace WorldPackets
|
||||
{
|
||||
uint32 ID = 0;
|
||||
uint32 NextPageID = 0;
|
||||
int32 PlayerConditionID = 0;
|
||||
uint8 Flags = 0;
|
||||
std::string Text;
|
||||
};
|
||||
|
||||
bool Allow = false;
|
||||
PageTextInfo Info;
|
||||
uint32 PageTextID = 0;
|
||||
bool Allow = false;
|
||||
std::vector<PageTextInfo> Pages;
|
||||
};
|
||||
|
||||
class QueryNPCText final : public ClientPacket
|
||||
@@ -236,12 +238,6 @@ namespace WorldPackets
|
||||
float Size = 0.0f;
|
||||
std::vector<int32> QuestItems;
|
||||
uint32 Expansion = 0;
|
||||
|
||||
size_t GetDataSize() const
|
||||
{
|
||||
// [1..3] always empty '\0' '\0' '\0' '\0' QuestItems counter
|
||||
return sizeof(Type) + sizeof(DisplayID) + (Name->size() + (4 * 1)) + (IconName.size() + 1) + (CastBarCaption.size() + 1) + (UnkString.size() + 1) + sizeof(Data) + sizeof(Size) + sizeof(uint8) + (QuestItems.size() * sizeof(int32)) + sizeof(Expansion);
|
||||
}
|
||||
};
|
||||
|
||||
class QueryGameObjectResponse final : public ServerPacket
|
||||
@@ -261,7 +257,9 @@ namespace WorldPackets
|
||||
public:
|
||||
QueryCorpseLocationFromClient(WorldPacket&& packet) : ClientPacket(CMSG_QUERY_CORPSE_LOCATION_FROM_CLIENT, std::move(packet)) { }
|
||||
|
||||
void Read() override { }
|
||||
void Read() override;
|
||||
|
||||
ObjectGuid Player;
|
||||
};
|
||||
|
||||
class CorpseLocation final : public ServerPacket
|
||||
@@ -271,6 +269,7 @@ namespace WorldPackets
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid Player;
|
||||
ObjectGuid Transport;
|
||||
G3D::Vector3 Position;
|
||||
int32 ActualMapID = 0;
|
||||
@@ -285,6 +284,7 @@ namespace WorldPackets
|
||||
|
||||
void Read() override;
|
||||
|
||||
ObjectGuid Player;
|
||||
ObjectGuid Transport;
|
||||
};
|
||||
|
||||
@@ -295,6 +295,7 @@ namespace WorldPackets
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid Player;
|
||||
G3D::Vector3 Position;
|
||||
float Facing = 0.0f;
|
||||
};
|
||||
@@ -315,7 +316,6 @@ namespace WorldPackets
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
time_t CurrentTime = time_t(0);
|
||||
int32 TimeOutRequest = 0;
|
||||
};
|
||||
|
||||
class QuestPOIQuery final : public ClientPacket
|
||||
|
||||
@@ -579,8 +579,8 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_HANDLER(CMSG_PUSH_QUEST_TO_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::PushQuestToParty, &WorldSession::HandlePushQuestToParty);
|
||||
DEFINE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Battleground::PVPLogDataRequest, &WorldSession::HandlePVPLogDataOpcode);
|
||||
DEFINE_HANDLER(CMSG_QUERY_BATTLE_PET_NAME, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
DEFINE_HANDLER(CMSG_QUERY_CORPSE_LOCATION_FROM_CLIENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Query::QueryCorpseLocationFromClient, &WorldSession::HandleQueryCorpseLocation);
|
||||
DEFINE_HANDLER(CMSG_QUERY_CORPSE_TRANSPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Query::QueryCorpseTransport, &WorldSession::HandleQueryCorpseTransport);
|
||||
DEFINE_HANDLER(CMSG_QUERY_CORPSE_LOCATION_FROM_CLIENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Query::QueryCorpseLocationFromClient, &WorldSession::HandleQueryCorpseLocation);
|
||||
DEFINE_HANDLER(CMSG_QUERY_CORPSE_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Query::QueryCorpseTransport, &WorldSession::HandleQueryCorpseTransport);
|
||||
DEFINE_HANDLER(CMSG_QUERY_COUNTDOWN_TIMER, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
DEFINE_HANDLER(CMSG_QUERY_CREATURE, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Query::QueryCreature, &WorldSession::HandleCreatureQuery);
|
||||
DEFINE_HANDLER(CMSG_QUERY_GAME_OBJECT, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Query::QueryGameObject, &WorldSession::HandleGameObjectQueryOpcode);
|
||||
@@ -1007,9 +1007,9 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CONTROL_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_LOCATION, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_LOCATION, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_TRANSPORT_QUERY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_TRANSPORT_QUERY, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CREATE_CHAR, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CREATE_SHIPMENT_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
@@ -1474,19 +1474,19 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_SEASON, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_BATTLE_PET_NAME_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_CREATURE_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_GAME_OBJECT_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_CREATURE_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_GAME_OBJECT_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_GARRISON_CREATURE_NAME_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_GUILD_INFO_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_ITEM_TEXT_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_ITEM_TEXT_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_NPC_TEXT_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PAGE_TEXT_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PAGE_TEXT_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PETITION_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PET_NAME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_PLAYER_NAME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_QUEST_INFO_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_QUEST_REWARD_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_COMPLETION_NPC_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
|
||||
Reference in New Issue
Block a user