Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: README.md src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Updates/UpdateData.h src/server/game/Server/WorldPacket.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSession.h src/server/game/Server/WorldSocket.cpp src/server/game/Server/WorldSocket.h src/server/shared/Packets/ByteBuffer.h
This commit is contained in:
commit
2cba07d6a1
32 files changed
+264
-138
No files matched your search
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "AuthSession.h"
|
||||
#include "Log.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "AuthCodes.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "SHA1.h"
|
||||
@@ -173,19 +172,16 @@ void AuthSession::ReadDataHandler(boost::system::error_code error, size_t transf
|
||||
CloseSocket();
|
||||
}
|
||||
|
||||
void AuthSession::AsyncWrite(ByteBuffer const& packet)
|
||||
void AuthSession::AsyncWrite(ByteBuffer& packet)
|
||||
{
|
||||
std::vector<uint8> data(packet.size());
|
||||
std::memcpy(data.data(), packet.contents(), packet.size());
|
||||
|
||||
std::lock_guard<std::mutex> guard(_writeLock);
|
||||
|
||||
bool needsWriteStart = _writeQueue.empty();
|
||||
|
||||
_writeQueue.push(std::move(data));
|
||||
_writeQueue.push(std::move(packet));
|
||||
|
||||
if (needsWriteStart)
|
||||
AsyncWrite(_writeQueue.front());
|
||||
Base::AsyncWrite(_writeQueue.front());
|
||||
}
|
||||
|
||||
bool AuthSession::HandleLogonChallenge()
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define __AUTHSESSION_H__
|
||||
|
||||
#include "Common.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Socket.h"
|
||||
#include "BigNumber.h"
|
||||
#include <memory>
|
||||
@@ -28,10 +29,10 @@
|
||||
using boost::asio::ip::tcp;
|
||||
|
||||
struct AuthHandler;
|
||||
class ByteBuffer;
|
||||
|
||||
class AuthSession : public Socket<AuthSession>
|
||||
class AuthSession : public Socket<AuthSession, ByteBuffer>
|
||||
{
|
||||
typedef Socket<AuthSession, ByteBuffer> Base;
|
||||
|
||||
public:
|
||||
static std::unordered_map<uint8, AuthHandler> InitHandlers();
|
||||
@@ -47,8 +48,8 @@ public:
|
||||
AsyncReadHeader();
|
||||
}
|
||||
|
||||
using Socket<AuthSession>::AsyncWrite;
|
||||
void AsyncWrite(ByteBuffer const& packet);
|
||||
using Base::AsyncWrite;
|
||||
void AsyncWrite(ByteBuffer& packet);
|
||||
|
||||
protected:
|
||||
void ReadHeaderHandler(boost::system::error_code error, size_t transferedBytes) override;
|
||||
|
||||
@@ -234,4 +234,15 @@ namespace Battlenet
|
||||
bool BitStream::Read<bool>(uint32 bitCount);
|
||||
}
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace asio
|
||||
{
|
||||
inline const_buffers_1 buffer(Battlenet::BitStream const& stream)
|
||||
{
|
||||
return buffer(stream.GetBuffer(), stream.GetSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __BATTLENETBITSTREAM_H__
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "BattlenetPackets.h"
|
||||
#include "BattlenetPacketCrypt.h"
|
||||
#include "Socket.h"
|
||||
#include "BigNumber.h"
|
||||
#include <memory>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
|
||||
Reference in new issue
Block a user