Core/Packets: update & enabled CMSG_SHOWING_CLOAK, CMSG_SHOWING_HELM (#24394)

(cherry picked from commit a47d57d1db)

Co-authored-by: DJScias <zumbak04@gmail.com>
This commit is contained in:
ForesterDev
2020-04-04 20:34:43 +04:00
committed by GitHub
parent a7636c39d6
commit 5d70f6ccd4
5 changed files with 96 additions and 10 deletions

View File

@@ -19,6 +19,7 @@
#include "ArenaTeamMgr.h"
#include "CalendarMgr.h"
#include "CharacterCache.h"
#include "CharacterPackets.h"
#include "Chat.h"
#include "DatabaseEnv.h"
#include "DBCStores.h"
@@ -1072,18 +1073,20 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket& recvData)
_player->GetReputationMgr().SetInactive(replistid, inactive != 0);
}
void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData)
void WorldSession::HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm& packet)
{
TC_LOG_DEBUG("network", "CMSG_SHOWING_HELM for %s", _player->GetName().c_str());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
if (packet.ShowHelm)
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
else
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
}
void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData)
void WorldSession::HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak& packet)
{
TC_LOG_DEBUG("network", "CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
if (packet.ShowCloak)
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
else
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
}
void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData)

View File

@@ -18,6 +18,7 @@
#ifndef AllPackets_h__
#define AllPackets_h__
#include "CharacterPackets.h"
#include "ChatPackets.h"
#include "CombatPackets.h"
#include "GuildPackets.h"

View File

@@ -0,0 +1,28 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CharacterPackets.h"
void WorldPackets::Character::ShowingCloak::Read()
{
_worldPacket >> ShowCloak;
}
void WorldPackets::Character::ShowingHelm::Read()
{
_worldPacket >> ShowHelm;
}

View File

@@ -0,0 +1,49 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CharacterPackets_h__
#define CharacterPackets_h__
#include "Packet.h"
namespace WorldPackets
{
namespace Character
{
class ShowingCloak final : public ClientPacket
{
public:
ShowingCloak(WorldPacket&& packet) : ClientPacket(CMSG_SHOWING_CLOAK, std::move(packet)) { }
void Read() override;
bool ShowCloak = false;
};
class ShowingHelm final : public ClientPacket
{
public:
ShowingHelm(WorldPacket&& packet) : ClientPacket(CMSG_SHOWING_HELM, std::move(packet)) { }
void Read() override;
bool ShowHelm = false;
};
}
}
#endif // CharacterPackets_h__

View File

@@ -78,6 +78,11 @@ class RBACData;
namespace WorldPackets
{
namespace Character
{
class ShowingCloak;
class ShowingHelm;
}
namespace Chat
{
class EmoteClient;
@@ -582,8 +587,8 @@ class TC_GAME_API WorldSession
void HandleMountSpecialAnimOpcode(WorldPacket& recvdata);
// character view
void HandleShowingHelmOpcode(WorldPacket& recvData);
void HandleShowingCloakOpcode(WorldPacket& recvData);
void HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm& packet);
void HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak& packet);
// repair
void HandleRepairItemOpcode(WorldPacket& recvPacket);