EvEmu
0.8.4
11 September 2021
|
Client session from server's side. More...
#include "EVESession.h"
Public Types | |
typedef TCPConnection::state_t | state_t |
Public Member Functions | |
EVEClientSession (EVETCPConnection **n) | |
virtual | ~EVEClientSession () |
Destroys contained connection. More... | |
state_t | GetState () const |
std::string | GetAddress () const |
void | Reset () |
Resets session. More... | |
void | QueuePacket (PyPacket *packet) |
Queues new packet, retaking ownership. More... | |
PyPacket * | PopPacket () |
Pops new packet from queue. More... | |
void | CloseClientConnection () |
Disconnects client from the server. More... | |
Protected Member Functions | |
virtual void | _GetVersion (VersionExchangeServer &version)=0 |
Obtains version. More... | |
virtual uint32 | _GetQueuePosition ()=0 |
virtual bool | _VerifyVersion (VersionExchangeClient &version)=0 |
Verifies version. More... | |
virtual bool | _VerifyVIPKey (const std::string &vipKey)=0 |
Verifies VIP key. More... | |
virtual bool | _VerifyCrypto (CryptoRequestPacket &cr)=0 |
Verifies crypto. More... | |
virtual bool | _VerifyLogin (CryptoChallengePacket &ccp)=0 |
Verifies login. More... | |
virtual bool | _VerifyFuncResult (CryptoHandshakeResult &result)=0 |
Verifies function result. More... | |
Protected Attributes | |
EVETCPConnection *const | mNet |
Private Member Functions | |
PyPacket * | _HandleVersion (PyRep *rep) |
PyPacket * | _HandleCommand (PyRep *rep) |
PyPacket * | _HandleCrypto (PyRep *rep) |
PyPacket * | _HandleAuthentication (PyRep *rep) |
PyPacket * | _HandleFuncResult (PyRep *rep) |
PyPacket * | _HandlePacket (PyRep *rep) |
Private Attributes | |
PyPacket *(EVEClientSession::* | mPacketHandler )(PyRep *rep) |
Client session from server's side.
Defines what server needs to do when dealing with client; takes care of initial authentication, before actual packets are sent.
Definition at line 49 of file EVESession.h.
Typedef for readability.
Definition at line 53 of file EVESession.h.
EVEClientSession::EVEClientSession | ( | EVETCPConnection ** | n | ) |
[in] | n | Connection of this session. |
Definition at line 38 of file EVESession.cpp.
|
virtual |
|
protectedpure virtual |
Implemented in Client.
Referenced by _HandleCommand().
|
protectedpure virtual |
Definition at line 158 of file EVESession.cpp.
References _HandleFuncResult(), _VerifyLogin(), GetAddress(), mPacketHandler, PopPacket(), and sLog.
Referenced by _HandleCrypto().
Definition at line 106 of file EVESession.cpp.
References _GetQueuePosition(), _HandleCrypto(), _log, _VerifyVIPKey(), PyRep::AsTuple(), PyRep::Dump(), GetAddress(), is_log_enabled, PyRep::IsTuple(), mNet, mPacketHandler, PopPacket(), EVETCPConnection::QueueRep(), Reset(), PyTuple::size(), and sLog.
Referenced by _HandleVersion().
Definition at line 147 of file EVESession.cpp.
References _HandleAuthentication(), _VerifyCrypto(), GetAddress(), mPacketHandler, PopPacket(), and sLog.
Referenced by _HandleCommand().
Definition at line 169 of file EVESession.cpp.
References _HandlePacket(), _VerifyFuncResult(), GetAddress(), mPacketHandler, PopPacket(), and sLog.
Referenced by _HandleAuthentication().
Definition at line 179 of file EVESession.cpp.
References PyPacket::Decode(), GetAddress(), PopPacket(), PySafeDecRef, SafeDelete(), and sLog.
Referenced by _HandleFuncResult().
Definition at line 94 of file EVESession.cpp.
References _HandleCommand(), _VerifyVersion(), GetAddress(), mPacketHandler, PopPacket(), and sLog.
Referenced by Reset().
|
protectedpure virtual |
Verifies crypto.
[in] | cr | Crypto sent by client. |
true | Verification succeeded; proceeds to next state. |
false | Verification failed; stays in current state. |
Implemented in Client.
Referenced by _HandleCrypto().
|
protectedpure virtual |
Verifies function result.
[in] | result | Function result sent by client. |
true | Verification succeeded; proceeds to next state. |
false | Verification failed; stays in current state. |
Implemented in Client.
Referenced by _HandleFuncResult().
|
protectedpure virtual |
Verifies login.
[in] | ccp | Login data sent by client. |
true | Verification succeeded; proceeds to next state. |
false | Verification failed; stays in current state. |
Implemented in Client.
Referenced by _HandleAuthentication().
|
protectedpure virtual |
Verifies version.
[in] | version | Version sent by client. |
true | Verification succeeded; proceeds to next state. |
false | Verification failed; stays in current state. |
Implemented in Client.
Referenced by _HandleVersion().
|
protectedpure virtual |
Verifies VIP key.
[in] | vipKey | VIP key sent by client. |
true | Verification succeeded; proceeds to next state. |
false | Verification failed; stays in current state. |
Implemented in Client.
Referenced by _HandleCommand().
|
inline |
Disconnects client from the server.
Definition at line 93 of file EVESession.h.
References TCPConnection::Disconnect(), and mNet.
Referenced by Client::DisconnectClient(), and Client::SelectCharacter().
|
inline |
Wrapper of TCPConnection::GetAddress().
Definition at line 67 of file EVESession.h.
References TCPConnection::GetAddress(), and mNet.
Referenced by _HandleAuthentication(), _HandleCommand(), _HandleCrypto(), _HandleFuncResult(), _HandlePacket(), _HandleVersion(), Client::_VerifyLogin(), PopPacket(), and QueuePacket().
|
inline |
Wrapper of TCPConnection::GetState().
Definition at line 65 of file EVESession.h.
References TCPConnection::GetState(), and mNet.
Referenced by Client::ProcessNet(), and Reset().
PyPacket * EVEClientSession::PopPacket | ( | ) |
Pops new packet from queue.
Definition at line 80 of file EVESession.cpp.
References _log, GetAddress(), is_log_enabled, mNet, mPacketHandler, and EVETCPConnection::PopRep().
Referenced by _HandleAuthentication(), _HandleCommand(), _HandleCrypto(), _HandleFuncResult(), _HandlePacket(), _HandleVersion(), and Client::ProcessNet().
void EVEClientSession::QueuePacket | ( | PyPacket * | packet | ) |
Queues new packet, retaking ownership.
[in] | p | Packed to be queued. |
Definition at line 66 of file EVESession.cpp.
References PyPacket::Encode(), GetAddress(), mNet, EVETCPConnection::QueueRep(), and sLog.
Referenced by Client::_SendCallReturn(), Client::_SendException(), Client::_SendPingRequest(), Client::_SendPingResponse(), Client::SendInitialSessionStatus(), Client::SendNotification(), and Client::SendSessionChange().
void EVEClientSession::Reset | ( | ) |
Resets session.
Reset session so we act like client just connected.
Definition at line 50 of file EVESession.cpp.
References _GetVersion(), _HandleVersion(), GetState(), mNet, mPacketHandler, EVETCPConnection::QueueRep(), and TCPConnection::STATE_CONNECTED.
Referenced by _HandleCommand(), and Client::Client().
|
protected |
Connection of this session.
Definition at line 155 of file EVESession.h.
Referenced by _HandleCommand(), Client::_LoginFail(), Client::_VerifyCrypto(), Client::_VerifyFuncResult(), Client::_VerifyLogin(), CloseClientConnection(), GetAddress(), GetState(), PopPacket(), QueuePacket(), Reset(), and ~EVEClientSession().
Definition at line 159 of file EVESession.h.
Referenced by _HandleAuthentication(), _HandleCommand(), _HandleCrypto(), _HandleFuncResult(), _HandleVersion(), PopPacket(), and Reset().