Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::net::Network Class Reference

#include <Network.h>

Public Member Functions

 Network ()
 Constructor.
 ~Network ()
 Destructor.
void CreateServer (int maxPlayers, int port)
 Creates a server that clients can connect to.
void ConnectToServer (char *serverip, int port)
 Connects the client to a server.
void Run ()
 Runs the network system and process packets.
void SetNetworkEvents (NetworkEvents *p)
 Sets the NetworkEvents pointer to send events to it.
bool GetIsServer ()
 Returns true if this connection is acting as server.
bool GetIsConnected ()
 Is it connected to server or not.
RakNet::RakPeerInterface * GetRakPeer ()
 Returns the RakPeerInterface pointer.

Protected Attributes

RakNet::RakPeerInterface * m_pPeer
bool m_bIsServer
bool m_bIsConnected
bool m_bIsServerChanged
NetworkEventsm_pEvents

Detailed Description

Definition at line 17 of file Network.h.

Constructor & Destructor Documentation

kge::net::Network::Network ( )

Constructor.

kge::net::Network::~Network ( )

Destructor.

Member Function Documentation

void kge::net::Network::ConnectToServer ( char *  serverip,
int  port 
)

Connects the client to a server.

Parameters
serveripThe server IP that client wants to connect.
portThe server port that client wants to connect.
void kge::net::Network::CreateServer ( int  maxPlayers,
int  port 
)

Creates a server that clients can connect to.

Parameters
maxPlayersThe maximum number of players can connect to this server.
portThe server port that listen to and clients connect to this port.
bool kge::net::Network::GetIsConnected ( )
inline

Is it connected to server or not.

Definition at line 51 of file Network.h.

bool kge::net::Network::GetIsServer ( )
inline

Returns true if this connection is acting as server.

Definition at line 48 of file Network.h.

RakNet::RakPeerInterface* kge::net::Network::GetRakPeer ( )
inline

Returns the RakPeerInterface pointer.

Definition at line 54 of file Network.h.

void kge::net::Network::Run ( )

Runs the network system and process packets.

void kge::net::Network::SetNetworkEvents ( NetworkEvents p)

Sets the NetworkEvents pointer to send events to it.

Member Data Documentation

bool kge::net::Network::m_bIsConnected
protected

Definition at line 59 of file Network.h.

bool kge::net::Network::m_bIsServer
protected

Definition at line 59 of file Network.h.

bool kge::net::Network::m_bIsServerChanged
protected

Definition at line 59 of file Network.h.

NetworkEvents* kge::net::Network::m_pEvents
protected

Definition at line 62 of file Network.h.

RakNet::RakPeerInterface* kge::net::Network::m_pPeer
protected

Definition at line 58 of file Network.h.


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