Core/PacketIO: updated SMSG_FEATURE_SYSTEM_STATUS (#24403)

* Core/Packets: updated SMSG_FEATURE_SYSTEM_STATUS

(cherry picked from commit 231207970b)

# Conflicts:
#	src/server/game/Battlegrounds/ArenaTeam.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/GroupHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Server/Packets/SpellPackets.cpp
#	src/server/game/Server/Packets/SpellPackets.h
#	src/server/game/Server/Packets/SystemPackets.cpp
#	src/server/game/Server/Packets/SystemPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/Protocol/Opcodes.h
#	src/server/game/Server/WorldSession.h

* Define complaint status values and replace magic numbers

* Add missing header

Co-authored-by: joschiwald <joschiwald.trinity@gmail.com>
This commit is contained in:
ForesterDev
2020-04-11 21:49:36 +04:00
committed by GitHub
parent 3e54e798e6
commit bfd73e7f47
6 changed files with 88 additions and 5 deletions

View File

@@ -48,6 +48,7 @@
#include "ScriptMgr.h"
#include "ServerMotd.h"
#include "SocialMgr.h"
#include "SystemPackets.h"
#include "QueryHolder.h"
#include "World.h"
@@ -747,10 +748,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
LoadAccountData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA), PER_CHARACTER_CACHE_MASK);
SendAccountDataTimes(PER_CHARACTER_CACHE_MASK);
WorldPacket data(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
data << uint8(2); // unknown value
data << uint8(0); // enable(1)/disable(0) voice chat interface in client
SendPacket(&data);
SendFeatureSystemStatus();
// Send MOTD
{
@@ -786,7 +784,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
}
}
data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4);
WorldPacket data(SMSG_LEARNED_DANCE_MOVES, 4+4);
data << uint32(0);
data << uint32(0);
SendPacket(&data);
@@ -1004,6 +1002,14 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
delete holder;
}
void WorldSession::SendFeatureSystemStatus()
{
WorldPackets::System::FeatureSystemStatus features;
features.ComplaintStatus = COMPLAINT_ENABLED_WITH_AUTO_IGNORE;
features.VoiceEnabled = false;
SendPacket(features.Write());
}
void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_SET_FACTION_ATWAR");

View File

@@ -28,6 +28,7 @@
#include "QueryPackets.h"
#include "QuestPackets.h"
#include "SpellPackets.h"
#include "SystemPackets.h"
#include "TotemPackets.h"
#include "WorldStatePackets.h"

View File

@@ -0,0 +1,26 @@
/*
* 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 "SystemPackets.h"
WorldPacket const* WorldPackets::System::FeatureSystemStatus::Write()
{
_worldPacket << uint8(ComplaintStatus);
_worldPacket << uint8(VoiceEnabled);
return &_worldPacket;
}

View File

@@ -0,0 +1,41 @@
/*
* 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 SystemPackets_h__
#define SystemPackets_h__
#include "Packet.h"
#include "SharedDefines.h"
namespace WorldPackets
{
namespace System
{
class FeatureSystemStatus final : public ServerPacket
{
public:
FeatureSystemStatus() : ServerPacket(SMSG_FEATURE_SYSTEM_STATUS, 2) { }
WorldPacket const* Write() override;
uint8 ComplaintStatus = COMPLAINT_ENABLED_WITH_AUTO_IGNORE;
bool VoiceEnabled = false;
};
}
}
#endif // SystemPackets_h__

View File

@@ -438,6 +438,8 @@ class TC_GAME_API WorldSession
/// Handle the authentication waiting queue (to be completed)
void SendAuthWaitQue(uint32 position);
void SendFeatureSystemStatus();
void SendNameQueryOpcode(ObjectGuid guid);
void SendTrainerList(Creature* npc);

View File

@@ -3457,6 +3457,13 @@ enum ResponseCodes
CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 103
};
enum ComplaintStatus : uint8
{
COMPLAINT_DISABLED = 0,
COMPLAINT_ENABLED_WITHOUT_AUTO_IGNORE = 1,
COMPLAINT_ENABLED_WITH_AUTO_IGNORE = 2
};
/// Ban function modes
enum BanMode
{