18#ifndef __WORLDSOCKET_H__
19#define __WORLDSOCKET_H__
30#include <boost/asio/ip/tcp.hpp>
62 class AuthContinuedSession;
63 class ConnectToFailed;
91 static uint8 const AuthCheckSeed[16];
92 static uint8 const SessionKeySeed[16];
93 static uint8 const ContinuedSessionSeed[16];
94 static uint8 const EncryptionKeySeed[16];
105 void Start()
override;
112 void SendAuthResponseError(
uint32 code);
119 bool ReadHeaderHandler();
128 ReadDataHandlerResult ReadDataHandler();
131 void InitializeHandler(boost::system::error_code
const& error, std::size_t transferedBytes);
135 void LogOpcodeText(
OpcodeClient opcode, std::unique_lock<std::mutex>
const& guard)
const;
137 void SendPacketAndLogOpcode(
WorldPacket const& packet);
141 void HandleSendAuthSession();
142 void HandleAuthSession(std::shared_ptr<WorldPackets::Auth::AuthSession> authSession);
143 void HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth::AuthSession> authSession,
PreparedQueryResult result);
144 void HandleAuthContinuedSession(std::shared_ptr<WorldPackets::Auth::AuthContinuedSession> authSession);
145 void HandleAuthContinuedSessionCallback(std::shared_ptr<WorldPackets::Auth::AuthContinuedSession> authSession,
PreparedQueryResult result);
149 void HandleEnterEncryptedModeAck();
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
std::shared_ptr< PreparedResultSet > PreparedQueryResult
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
std::conditional_t< IntrusiveLink !=nullptr, Trinity::Impl::MPSCQueueIntrusive< T, IntrusiveLink >, Trinity::Impl::MPSCQueueNonIntrusive< T > > MPSCQueue
struct z_stream_s z_stream
bool NeedsEncryption() const
EncryptablePacket(WorldPacket const &packet, bool encrypt)
std::atomic< EncryptablePacket * > SocketQueueLink
virtual void ReadHandler()=0
Player session in the World.
MessageBuffer _headerBuffer
ConnectionType GetConnectionType() const
static std::string const ClientConnectionInitialize
MessageBuffer _packetBuffer
QueryCallbackProcessor _queryProcessor
WorldPacketCrypt _authCrypt
WorldSocket & operator=(WorldSocket const &right)=delete
std::size_t _sendBufferSize
WorldSession * _worldSession
z_stream * _compressionStream
void SetSendBufferSize(std::size_t sendBufferSize)
MPSCQueue< EncryptablePacket, &EncryptablePacket::SocketQueueLink > _bufferQueue
static std::string const ServerConnectionInitialize
WorldSocket(WorldSocket const &right)=delete
std::array< uint8, 16 > _encryptKey
std::array< uint8, 16 > _serverChallenge
std::mutex _worldSessionLock
Socket< WorldSocket > BaseSocket
static uint32 const MinSizeForCompression
void Error(char const *file, int line, char const *function, char const *message)