Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CNetServerSession Class Reference

The server's end of a network session. More...

#include <NetSession.h>

Inheritance diagram for CNetServerSession:
CFsm INetSession

Public Member Functions

 CNetServerSession (CNetServerWorker &server, ENetPeer *peer)
 
CNetServerWorkerGetServer ()
 
const CStr & GetGUID () const
 
void SetGUID (const CStr &guid)
 
const CStrW & GetUserName () const
 
void SetUserName (const CStrW &name)
 
u32 GetHostID () const
 
void SetHostID (u32 id)
 
void Disconnect (u32 reason)
 Sends a disconnection notification to the client, and sends a NMT_CONNECTION_LOST message to the session FSM. More...
 
void DisconnectNow (u32 reason)
 Sends an unreliable disconnection notification to the client. More...
 
virtual bool SendMessage (const CNetMessage *message)
 Send a message to the client. More...
 
CNetFileTransfererGetFileTransferer ()
 
- Public Member Functions inherited from CFsm
 CFsm (void)
 
virtual ~CFsm (void)
 
virtual void Setup (void)
 Constructs the state machine. More...
 
void Shutdown (void)
 Clear event, action and condition lists and reset state machine. More...
 
void AddState (unsigned int state)
 
CFsmEventAddEvent (unsigned int eventType)
 
CFsmTransitionAddTransition (unsigned int state, unsigned int eventType, unsigned int nextState)
 
CFsmTransitionAddTransition (unsigned int state, unsigned int eventType, unsigned int nextState, void *pAction, void *pContext)
 
CFsmTransitionGetTransition (unsigned int state, unsigned int eventType) const
 
CFsmTransitionGetEventTransition (unsigned int eventType) const
 
void SetFirstState (unsigned int firstState)
 
void SetCurrState (unsigned int state)
 
unsigned int GetCurrState (void) const
 
void SetNextState (unsigned int nextState)
 
unsigned int GetNextState (void) const
 
const StateSetGetStates (void) const
 
const EventMapGetEvents (void) const
 
const TransitionListGetTransitions (void) const
 
bool Update (unsigned int eventType, void *pEventData)
 
bool IsValidState (unsigned int state) const
 
bool IsValidEvent (unsigned int eventType) const
 
virtual bool IsDone (void) const
 
- Public Member Functions inherited from INetSession
virtual ~INetSession ()
 

Private Member Functions

 NONCOPYABLE (CNetServerSession)
 

Private Attributes

CNetServerWorkerm_Server
 
CNetFileTransferer m_FileTransferer
 
ENetPeerm_Peer
 
CStr m_GUID
 
CStrW m_UserName
 
u32 m_HostID
 

Detailed Description

The server's end of a network session.

Represents an abstraction of the state of the client, storing all the per-client data needed by the server.

Thread-safety:

Definition at line 107 of file NetSession.h.

Constructor & Destructor Documentation

CNetServerSession::CNetServerSession ( CNetServerWorker server,
ENetPeer peer 
)

Definition at line 173 of file NetSession.cpp.

Member Function Documentation

void CNetServerSession::Disconnect ( u32  reason)

Sends a disconnection notification to the client, and sends a NMT_CONNECTION_LOST message to the session FSM.

The server will receive a disconnection notification after a while. The server will not receive any further messages sent via this session.

Definition at line 178 of file NetSession.cpp.

void CNetServerSession::DisconnectNow ( u32  reason)

Sends an unreliable disconnection notification to the client.

The server will not receive any disconnection notification. The server will not receive any further messages sent via this session.

Definition at line 185 of file NetSession.cpp.

CNetFileTransferer& CNetServerSession::GetFileTransferer ( )
inline

Definition at line 145 of file NetSession.h.

const CStr& CNetServerSession::GetGUID ( ) const
inline

Definition at line 116 of file NetSession.h.

u32 CNetServerSession::GetHostID ( ) const
inline

Definition at line 122 of file NetSession.h.

CNetServerWorker& CNetServerSession::GetServer ( )
inline

Definition at line 114 of file NetSession.h.

const CStrW& CNetServerSession::GetUserName ( ) const
inline

Definition at line 119 of file NetSession.h.

CNetServerSession::NONCOPYABLE ( CNetServerSession  )
private
bool CNetServerSession::SendMessage ( const CNetMessage message)
virtual

Send a message to the client.

Implements INetSession.

Definition at line 190 of file NetSession.cpp.

void CNetServerSession::SetGUID ( const CStr &  guid)
inline

Definition at line 117 of file NetSession.h.

void CNetServerSession::SetHostID ( u32  id)
inline

Definition at line 123 of file NetSession.h.

void CNetServerSession::SetUserName ( const CStrW &  name)
inline

Definition at line 120 of file NetSession.h.

Member Data Documentation

CNetFileTransferer CNetServerSession::m_FileTransferer
private

Definition at line 150 of file NetSession.h.

CStr CNetServerSession::m_GUID
private

Definition at line 154 of file NetSession.h.

u32 CNetServerSession::m_HostID
private

Definition at line 156 of file NetSession.h.

ENetPeer* CNetServerSession::m_Peer
private

Definition at line 152 of file NetSession.h.

CNetServerWorker& CNetServerSession::m_Server
private

Definition at line 148 of file NetSession.h.

CStrW CNetServerSession::m_UserName
private

Definition at line 155 of file NetSession.h.


The documentation for this class was generated from the following files: