73 bool Connect(
const CStr& server,
const u16 port,
const bool isLocalClient);
89 void Disconnect(
u32 reason);
99 u32 GetLastReceivedTime()
const;
104 u32 GetMeanRTT()
const;
136 const CStr&
GetGUID()
const {
return m_GUID; }
137 void SetGUID(
const CStr& guid) { m_GUID = guid; }
145 u32 GetIPAddress()
const;
150 bool IsLocalClient()
const;
155 u32 GetLastReceivedTime()
const;
160 u32 GetMeanRTT()
const;
168 void Disconnect(
u32 reason);
175 void DisconnectNow(
u32 reason);
180 void SetLocalClient(
bool isLocalClient);
203 #endif // NETSESSION_H #define NONCOPYABLE(className)
Indicates that a class is noncopyable (usually due to const or reference members, or because the clas...
Definition: code_annotation.h:217
Manages states, events, actions and transitions between states.
Definition: fsm.h:117
CNetFileTransferer m_FileTransferer
Definition: NetSession.h:111
CStr m_GUID
Definition: NetSession.h:196
CNetFileTransferer & GetFileTransferer()
Definition: NetSession.h:187
uint16_t u16
Definition: types.h:38
u32 GetHostID() const
Definition: NetSession.h:142
CNetServerWorker & GetServer()
Definition: NetSession.h:134
void SetHostID(u32 id)
Definition: NetSession.h:143
Interface for sessions to which messages can be sent.
Definition: NetSession.h:54
void SetUserName(const CStrW &name)
Definition: NetSession.h:140
struct _ENetPeer ENetPeer
Definition: NetHost.h:30
CNetFileTransferer m_FileTransferer
Definition: NetSession.h:192
CStrW m_UserName
Definition: NetSession.h:197
const u32 MAXIMUM_HOST_TIMEOUT
Maximum timeout of the local client of the host (milliseconds).
Definition: NetSession.cpp:31
const u32 NETWORK_WARNING_TIMEOUT
Report the peer if we didn't receive a packet after this time (milliseconds).
Definition: NetSession.cpp:29
CNetServerWorker & m_Server
Definition: NetSession.h:190
ENetHost * m_Host
Definition: NetSession.h:113
uint32_t u32
Definition: types.h:39
Various declarations shared by networking code.
ENetPeer * m_Peer
Definition: NetSession.h:194
virtual bool SendMessage(const CNetMessage *message)=0
u32 m_HostID
Definition: NetSession.h:198
ENet connection statistics profiler table.
Definition: NetStats.h:36
The base class for all network messages exchanged within the game.
Definition: NetMessage.h:32
CNetFileTransferer & GetFileTransferer()
Definition: NetSession.h:106
Handles transferring files between clients and servers.
Definition: NetFileTransfer.h:73
const CStrW & GetUserName() const
Definition: NetSession.h:139
const CStr & GetGUID() const
Definition: NetSession.h:136
Network client.
Definition: NetClient.h:57
bool m_IsLocalClient
Definition: NetSession.h:200
struct _ENetHost ENetHost
Definition: NetHost.h:32
CNetStatsTable * m_Stats
Definition: NetSession.h:115
ENetPeer * m_Server
Definition: NetSession.h:114
virtual ~INetSession()
Definition: NetSession.h:57
CNetClient & m_Client
Definition: NetSession.h:109
The client end of a network session.
Definition: NetSession.h:65
Network server worker thread.
Definition: NetServer.h:153
The server's end of a network session.
Definition: NetSession.h:127
void SetGUID(const CStr &guid)
Definition: NetSession.h:137