TrinityCore
|
#include <WorldSocket.h>
Public Member Functions | |
WorldSocket (boost::asio::ip::tcp::socket &&socket) | |
~WorldSocket () | |
WorldSocket (WorldSocket const &right)=delete | |
WorldSocket & | operator= (WorldSocket const &right)=delete |
void | Start () override |
bool | Update () override |
void | SendPacket (WorldPacket const &packet) |
ConnectionType | GetConnectionType () const |
void | SendAuthResponseError (uint32 code) |
void | SetWorldSession (WorldSession *session) |
void | SetSendBufferSize (std::size_t sendBufferSize) |
Public Member Functions inherited from Socket< WorldSocket > | |
Socket (boost::asio::ip::tcp::socket &&socket, Args &&... args) | |
Socket (Socket const &other)=delete | |
Socket (Socket &&other)=delete | |
Socket & | operator= (Socket const &other)=delete |
Socket & | operator= (Socket &&other)=delete |
virtual | ~Socket () |
virtual void | Start ()=0 |
virtual bool | Update () |
boost::asio::ip::address | GetRemoteIpAddress () const |
uint16 | GetRemotePort () const |
void | AsyncRead () |
void | AsyncReadWithCallback (void(T::*callback)(boost::system::error_code const &, std::size_t)) |
void | QueuePacket (MessageBuffer &&buffer) |
bool | IsOpen () const |
void | CloseSocket () |
void | DelayedCloseSocket () |
Marks the socket for closing after write buffer becomes empty. More... | |
MessageBuffer & | GetReadBuffer () |
Protected Types | |
enum class | ReadDataHandlerResult { Ok = 0 , Error = 1 , WaitingForQuery = 2 } |
Protected Member Functions | |
void | OnClose () override |
void | ReadHandler () override |
bool | ReadHeaderHandler () |
ReadDataHandlerResult | ReadDataHandler () |
Protected Member Functions inherited from Socket< WorldSocket > | |
virtual void | OnClose () |
virtual void | ReadHandler ()=0 |
bool | AsyncProcessQueue () |
void | SetNoDelay (bool enable) |
boost::asio::ip::tcp::socket & | underlying_stream () |
Private Types | |
typedef Socket< WorldSocket > | BaseSocket |
Private Attributes | |
ConnectionType | _type |
uint64 | _key |
std::array< uint8, 16 > | _serverChallenge |
WorldPacketCrypt | _authCrypt |
SessionKey | _sessionKey |
std::array< uint8, 16 > | _encryptKey |
TimePoint | _LastPingTime |
uint32 | _OverSpeedPings |
std::mutex | _worldSessionLock |
WorldSession * | _worldSession |
bool | _authed |
bool | _canRequestHotfixes |
MessageBuffer | _headerBuffer |
MessageBuffer | _packetBuffer |
MPSCQueue< EncryptablePacket, &EncryptablePacket::SocketQueueLink > | _bufferQueue |
std::size_t | _sendBufferSize |
z_stream * | _compressionStream |
QueryCallbackProcessor | _queryProcessor |
std::string | _ipCountry |
Static Private Attributes | |
static std::string const | ServerConnectionInitialize |
static std::string const | ClientConnectionInitialize |
static uint32 const | MinSizeForCompression = 0x400 |
static uint8 const | AuthCheckSeed [16] = { 0xC5, 0xC6, 0x98, 0x95, 0x76, 0x3F, 0x1D, 0xCD, 0xB6, 0xA1, 0x37, 0x28, 0xB3, 0x12, 0xFF, 0x8A } |
static uint8 const | SessionKeySeed [16] = { 0x58, 0xCB, 0xCF, 0x40, 0xFE, 0x2E, 0xCE, 0xA6, 0x5A, 0x90, 0xB8, 0x01, 0x68, 0x6C, 0x28, 0x0B } |
static uint8 const | ContinuedSessionSeed [16] = { 0x16, 0xAD, 0x0C, 0xD4, 0x46, 0xF9, 0x4F, 0xB2, 0xEF, 0x7D, 0xEA, 0x2A, 0x17, 0x66, 0x4D, 0x2F } |
static uint8 const | EncryptionKeySeed [16] = { 0xE9, 0x75, 0x3C, 0x50, 0x90, 0x93, 0x61, 0xDA, 0x3B, 0x07, 0xEE, 0xFA, 0xFF, 0x9D, 0x41, 0xB8 } |
Definition at line 85 of file WorldSocket.h.
|
private |
Definition at line 96 of file WorldSocket.h.
|
strongprotected |
Enumerator | |
---|---|
Ok | |
Error | |
WaitingForQuery |
Definition at line 121 of file WorldSocket.h.
WorldSocket::WorldSocket | ( | boost::asio::ip::tcp::socket && | socket | ) |
WorldSocket::~WorldSocket | ( | ) |
Definition at line 69 of file WorldSocket.cpp.
|
delete |
|
private |
|
private |
Definition at line 581 of file WorldSocket.cpp.
|
inline |
|
private |
Definition at line 900 of file WorldSocket.cpp.
|
private |
|
private |
Definition at line 671 of file WorldSocket.cpp.
|
private |
Negative mutetime indicates amount of seconds to be muted effective on next login - which is now.
Definition at line 684 of file WorldSocket.cpp.
|
private |
Definition at line 967 of file WorldSocket.cpp.
|
private |
Definition at line 1005 of file WorldSocket.cpp.
|
private |
Definition at line 1021 of file WorldSocket.cpp.
|
private |
Definition at line 241 of file WorldSocket.cpp.
|
private |
Definition at line 123 of file WorldSocket.cpp.
|
private |
|
private |
writes network.opcode log accessing WorldSession is not threadsafe, only do it when holding _worldSessionLock
Definition at line 507 of file WorldSocket.cpp.
|
overrideprotectedvirtual |
Reimplemented from Socket< WorldSocket >.
Definition at line 251 of file WorldSocket.cpp.
|
delete |
|
protected |
Definition at line 352 of file WorldSocket.cpp.
|
overrideprotectedvirtual |
Implements Socket< WorldSocket >.
Definition at line 259 of file WorldSocket.cpp.
|
protected |
Definition at line 327 of file WorldSocket.cpp.
void WorldSocket::SendAuthResponseError | ( | uint32 | code | ) |
Definition at line 1014 of file WorldSocket.cpp.
void WorldSocket::SendPacket | ( | WorldPacket const & | packet | ) |
Definition at line 526 of file WorldSocket.cpp.
|
private |
sends and logs network.opcode without accessing WorldSession
Definition at line 520 of file WorldSocket.cpp.
|
inline |
Definition at line 114 of file WorldSocket.h.
void WorldSocket::SetWorldSession | ( | WorldSession * | session | ) |
Definition at line 320 of file WorldSocket.cpp.
|
overridevirtual |
Implements Socket< WorldSocket >.
Definition at line 78 of file WorldSocket.cpp.
|
overridevirtual |
Reimplemented from Socket< WorldSocket >.
Definition at line 201 of file WorldSocket.cpp.
|
private |
Definition at line 537 of file WorldSocket.cpp.
|
private |
Definition at line 155 of file WorldSocket.h.
|
private |
Definition at line 164 of file WorldSocket.h.
|
private |
Definition at line 169 of file WorldSocket.h.
|
private |
Definition at line 165 of file WorldSocket.h.
|
private |
Definition at line 172 of file WorldSocket.h.
|
private |
Definition at line 157 of file WorldSocket.h.
|
private |
Definition at line 167 of file WorldSocket.h.
|
private |
Definition at line 175 of file WorldSocket.h.
|
private |
Definition at line 152 of file WorldSocket.h.
|
private |
Definition at line 159 of file WorldSocket.h.
|
private |
Definition at line 160 of file WorldSocket.h.
|
private |
Definition at line 168 of file WorldSocket.h.
|
private |
Definition at line 174 of file WorldSocket.h.
|
private |
Definition at line 170 of file WorldSocket.h.
|
private |
Definition at line 154 of file WorldSocket.h.
|
private |
Definition at line 156 of file WorldSocket.h.
|
private |
Definition at line 151 of file WorldSocket.h.
|
private |
Definition at line 163 of file WorldSocket.h.
|
private |
Definition at line 162 of file WorldSocket.h.
|
staticprivate |
Definition at line 91 of file WorldSocket.h.
|
staticprivate |
Definition at line 88 of file WorldSocket.h.
|
staticprivate |
Definition at line 93 of file WorldSocket.h.
|
staticprivate |
Definition at line 94 of file WorldSocket.h.
|
staticprivate |
Definition at line 89 of file WorldSocket.h.
|
staticprivate |
Definition at line 87 of file WorldSocket.h.
|
staticprivate |
Definition at line 92 of file WorldSocket.h.