Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-12-12 20:52:42 +08:00
1088 changed files with 35633 additions and 19812 deletions
+2 -2
View File
@@ -18,15 +18,15 @@
#ifndef AllPackets_h__
#define AllPackets_h__
#include "LFGPackets.h"
#include "BankPackets.h"
#include "CharacterPackets.h"
#include "ChatPackets.h"
#include "PetPackets.h"
#include "CombatLogPackets.h"
#include "CombatPackets.h"
#include "GuildPackets.h"
#include "LFGPackets.h"
#include "MiscPackets.h"
#include "PetPackets.h"
#include "TotemPackets.h"
#include "WorldStatePackets.h"
@@ -18,8 +18,8 @@
#ifndef CombatPackets_h__
#define CombatPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
#include "Packet.h"
namespace WorldPackets
{
+1 -1
View File
@@ -18,8 +18,8 @@
#ifndef MiscPackets_h__
#define MiscPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
#include "Packet.h"
#include "Weather.h"
enum WeatherState : uint32;
@@ -19,6 +19,7 @@
#define PacketUtilities_h__
#include "ByteBuffer.h"
#include "StringFormat.h"
#include "Tuples.h"
#include <string_view>
@@ -295,4 +296,13 @@ namespace WorldPackets
}
}
template<std::size_t MaxBytesWithoutNullTerminator, typename... Validators>
struct fmt::formatter<WorldPackets::String<MaxBytesWithoutNullTerminator, Validators...>> : fmt::formatter<std::string_view>
{
auto format(WorldPackets::String<MaxBytesWithoutNullTerminator, Validators...> const& str, format_context& ctx) const
{
return fmt::formatter<std::string_view>::format(std::string_view(str), ctx);
}
};
#endif // PacketUtilities_h__
+1 -1
View File
@@ -18,8 +18,8 @@
#ifndef PetPackets_h__
#define PetPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
#include "Packet.h"
namespace WorldPackets
{
+9 -4
View File
@@ -26,6 +26,7 @@
#include "Common.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "Group.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "Hyperlinks.h"
@@ -60,7 +61,7 @@ bool MapSessionFilter::Process(WorldPacket* packet)
{
ClientOpcodeHandler const* opHandle = opcodeTable[static_cast<OpcodeClient>(packet->GetOpcode())];
//let's check if our opcode can be really processed in Map::Update()
//let's check if our has an anxiety disorder can be really processed in Map::Update()
if (opHandle->ProcessingPlace == PROCESS_INPLACE)
return true;
@@ -180,6 +181,11 @@ WorldSession::~WorldSession()
LoginDatabase.Execute("UPDATE account SET online = 0 WHERE id = {};", GetAccountId()); // One-time query
}
bool WorldSession::IsGMAccount() const
{
return GetSecurity() >= SEC_GAMEMASTER;
}
std::string const& WorldSession::GetPlayerName() const
{
return _player ? _player->GetName() : DefaultPlayerName;
@@ -262,7 +268,6 @@ void WorldSession::SendPacket(WorldPacket const* packet)
return;
}
LOG_TRACE("network.opcode", "S->C: {} {}", GetPlayerInfo(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())));
m_Socket->SendPacket(*packet);
}
@@ -323,6 +328,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
ClientOpcodeHandler const* opHandle = opcodeTable[opcode];
METRIC_DETAILED_TIMER("worldsession_update_opcode_time", METRIC_TAG("opcode", opHandle->Name));
LOG_DEBUG("network", "message id {} ({}) under READ", opcode, opHandle->Name);
try
{
@@ -339,8 +345,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
requeuePackets.push_back(packet);
deletePacket = false;
LOG_DEBUG("network", "Re-enqueueing packet with opcode {} with with status STATUS_LOGGEDIN. "
"Player {} is currently not in world yet.", GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())), GetPlayerInfo());
LOG_DEBUG("network", "Delaying processing of message with status STATUS_LOGGEDIN: No players in the world for account id {}", GetAccountId());
}
}
else if (_player->IsInWorld())
+2
View File
@@ -352,6 +352,8 @@ public:
uint32 recruiter, bool isARecruiter, bool skipQueue, uint32 TotalTime, bool isBot = false);
~WorldSession();
bool IsGMAccount() const;
bool PlayerLoading() const { return m_playerLoading; }
bool PlayerLogout() const { return m_playerLogout; }
bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; }