19 #ifndef __WORLDSOCKET_H__
20 #define __WORLDSOCKET_H__
31 #include <boost/asio/ip/tcp.hpp>
33 using boost::asio::ip::tcp;
43 class AuthContinuedSession;
44 class ConnectToFailed;
77 static uint8 const AuthCheckSeed[16];
78 static uint8 const SessionKeySeed[16];
79 static uint8 const ContinuedSessionSeed[16];
90 void Start()
override;
103 bool ReadHeaderHandler();
112 ReadDataHandlerResult ReadDataHandler();
115 void InitializeHandler(boost::system::error_code error, std::size_t transferedBytes);
119 void LogOpcodeText(
OpcodeClient opcode, std::unique_lock<std::mutex>
const& guard)
const;
121 void SendPacketAndLogOpcode(
WorldPacket const& packet);
125 void HandleSendAuthSession();
126 void HandleAuthSession(std::shared_ptr<WorldPackets::Auth::AuthSession> authSession);
127 void HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth::AuthSession> authSession,
PreparedQueryResult result);
128 void HandleAuthContinuedSession(std::shared_ptr<WorldPackets::Auth::AuthContinuedSession> authSession);
129 void HandleAuthContinuedSessionCallback(std::shared_ptr<WorldPackets::Auth::AuthContinuedSession> authSession,
PreparedQueryResult result);
Definition: BigNumber.h:28
std::chrono::steady_clock::time_point _LastPingTime
Definition: WorldSocket.h:144
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: WorldPacketCrypt.h:26
BigNumber _serverChallenge
Definition: WorldSocket.h:139
BigNumber _decryptSeed
Definition: WorldSocket.h:142
std::function< void(PreparedQueryResult &&)> _queryCallback
Definition: WorldSocket.h:158
virtual bool Update()
Definition: Socket.h:83
static std::string const ClientConnectionInitialize
Definition: WorldSocket.h:74
Definition: WorldSocket.cpp:44
WorldSession * _worldSession
Definition: WorldSocket.h:148
uint32 _OverSpeedPings
Definition: WorldSocket.h:145
Socket< WorldSocket > BaseSocket
Definition: WorldSocket.h:81
MessageBuffer _headerBuffer
Definition: WorldSocket.h:151
MessageBuffer _packetBuffer
Definition: WorldSocket.h:152
std::mutex _worldSessionLock
Definition: WorldSocket.h:147
Definition: AuthenticationPackets.h:203
Definition: WorldSocket.h:70
Vector2int16 & operator=(const Any &a)
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
static std::string const ServerConnectionInitialize
Definition: WorldSocket.h:73
Definition: inftrees.h:24
Definition: BattlegroundMgr.h:57
bool _authed
Definition: WorldSocket.h:149
std::future< PreparedQueryResult > PreparedQueryResultFuture
Definition: Callback.h:26
static uint32 const MinSizeForCompression
Definition: WorldSocket.h:75
WorldPacketCrypt _authCrypt
Definition: WorldSocket.h:140
ConnectionType GetConnectionType() const
Definition: WorldSocket.h:95
virtual void ReadHandler()=0
#define TC_GAME_API
Definition: Define.h:134
z_stream_s * _compressionStream
Definition: WorldSocket.h:155
uint8_t uint8
Definition: Define.h:152
std::string _ipCountry
Definition: WorldSocket.h:159
OpcodeClient
Definition: Opcodes.h:46
MPSCQueue< EncryptablePacket > _bufferQueue
Definition: WorldSocket.h:153
Player session in the World.
Definition: WorldSession.h:882
void Error(char const *file, int line, char const *function, char const *message)
Definition: Errors.cpp:77
PreparedQueryResultFuture _queryFuture
Definition: WorldSocket.h:157
virtual void OnClose()
Definition: Socket.h:162
Definition: WorldPacket.h:26
ConnectionType _type
Definition: WorldSocket.h:137
Definition: MessageBuffer.h:24
ConnectionType
Definition: Opcodes.h:29
BigNumber _encryptSeed
Definition: WorldSocket.h:141
static uint32 const ConnectionInitializeMagic
Definition: WorldSocket.h:72
ReadDataHandlerResult
Definition: WorldSocket.h:105