mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
feat(Core/Packet): CMSG_SET_SHEATHED
This commit is contained in:
committed by
GitHub
parent
a775ddcb5b
commit
1f90a18a58
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "CreatureAI.h"
|
||||
#include "CombatPackets.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
@@ -70,18 +71,15 @@ void WorldSession::HandleAttackStopOpcode(WorldPacket& /*recvData*/)
|
||||
GetPlayer()->AttackStop();
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet)
|
||||
{
|
||||
uint32 sheathed;
|
||||
recvData >> sheathed;
|
||||
|
||||
if (sheathed >= MAX_SHEATH_STATE)
|
||||
if (packet.CurrentSheathState >= MAX_SHEATH_STATE)
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", sheathed);
|
||||
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", packet.CurrentSheathState);
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->SetSheath(SheathState(sheathed));
|
||||
_player->SetSheath(SheathState(packet.CurrentSheathState));
|
||||
}
|
||||
|
||||
void WorldSession::SendAttackStop(Unit const* enemy)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "ChatPackets.h"
|
||||
#include "PetPackets.h"
|
||||
#include "CombatLogPackets.h"
|
||||
#include "CombatPackets.h"
|
||||
#include "GuildPackets.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "TotemPackets.h"
|
||||
|
||||
23
src/server/game/Server/Packets/CombatPackets.cpp
Normal file
23
src/server/game/Server/Packets/CombatPackets.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore 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 Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 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 Affero 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 "CombatPackets.h"
|
||||
|
||||
void WorldPackets::Combat::SetSheathed::Read()
|
||||
{
|
||||
_worldPacket >> CurrentSheathState;
|
||||
}
|
||||
40
src/server/game/Server/Packets/CombatPackets.h
Normal file
40
src/server/game/Server/Packets/CombatPackets.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore 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 Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 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 Affero 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 CombatPackets_h__
|
||||
#define CombatPackets_h__
|
||||
|
||||
#include "Packet.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
namespace WorldPackets
|
||||
{
|
||||
namespace Combat
|
||||
{
|
||||
class SetSheathed final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
SetSheathed(WorldPacket&& packet) : ClientPacket(CMSG_SET_SHEATHED, std::move(packet)) { }
|
||||
|
||||
void Read() override;
|
||||
|
||||
uint32 CurrentSheathState = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CombatPackets_h__
|
||||
@@ -608,7 +608,7 @@ void OpcodeTable::Initialize()
|
||||
/*0x1DD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER);
|
||||
/*0x1DE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER);
|
||||
/*0x1DF*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER);
|
||||
/*0x1E0*/ DEFINE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode );
|
||||
/*0x1E0*/ DEFINE_HANDLER(CMSG_SET_SHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode );
|
||||
/*0x1E1*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER);
|
||||
/*0x1E2*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER);
|
||||
/*0x1E3*/ DEFINE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestPOIQuery );
|
||||
|
||||
@@ -507,7 +507,7 @@ enum Opcodes : uint16
|
||||
SMSG_PONG = 0x1DD,
|
||||
SMSG_CLEAR_COOLDOWN = 0x1DE,
|
||||
SMSG_GAMEOBJECT_PAGETEXT = 0x1DF,
|
||||
CMSG_SETSHEATHED = 0x1E0,
|
||||
CMSG_SET_SHEATHED = 0x1E0,
|
||||
SMSG_COOLDOWN_CHEAT = 0x1E1,
|
||||
SMSG_SPELL_DELAYED = 0x1E2,
|
||||
CMSG_QUEST_POI_QUERY = 0x1E3,
|
||||
|
||||
@@ -1363,7 +1363,7 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
|
||||
case CMSG_CORPSE_MAP_POSITION_QUERY: // 0 1
|
||||
case CMSG_MOVE_TIME_SKIPPED: // 0 1
|
||||
case MSG_QUERY_NEXT_MAIL_TIME: // 0 1
|
||||
case CMSG_SETSHEATHED: // 0 1
|
||||
case CMSG_SET_SHEATHED: // 0 1
|
||||
case MSG_RAID_TARGET_UPDATE: // 0 1
|
||||
case CMSG_PLAYER_LOGOUT: // 0 1
|
||||
case CMSG_LOGOUT_REQUEST: // 0 1
|
||||
|
||||
@@ -104,6 +104,11 @@ namespace WorldPackets
|
||||
class BuyBankSlot;
|
||||
}
|
||||
|
||||
namespace Combat
|
||||
{
|
||||
class SetSheathed;
|
||||
}
|
||||
|
||||
namespace Guild
|
||||
{
|
||||
class QueryGuildInfo;
|
||||
@@ -794,7 +799,7 @@ public: // opcodes handlers
|
||||
|
||||
void HandleAttackSwingOpcode(WorldPacket& recvPacket);
|
||||
void HandleAttackStopOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetSheathedOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet);
|
||||
|
||||
void HandleUseItemOpcode(WorldPacket& recvPacket);
|
||||
void HandleOpenItemOpcode(WorldPacket& recvPacket);
|
||||
|
||||
Reference in New Issue
Block a user