LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg::Player Struct Referenceabstract

Represents a connected client on the server.

#include <nrg_player.h>

Public Member Functions

virtual uint16_t getID () const =0
 Returns the library-assigned player's ID.
 
virtual void kick (const char *reason)=0
 Kick the player from the server, sending them a reason why.
 
virtual const ServergetServer () const =0
 Returns the server associated with this Player.
 
virtual const NetAddressgetRemoteAddress () const =0
 Returns the address the Client associated with this Player is connecting from.
 
virtual void registerMessageHandler (MessageBase &&)=0
 Register a Message containing a callback with this Player (R-Value reference version)
 
virtual void registerMessageHandler (const MessageBase &)=0
 Register a Message containing a callback with this Player (const reference version)
 
virtual void sendMessage (const MessageBase &m)=0
 Send the player a Message with the contents specified in m.
 
virtual bool isConnected () const =0
 Returns true if this player is connected to a Server.
 
virtual int getPing () const =0
 Returns the round-trip latency of this player.
 
virtual ~Player ()
 Default destructor.
 

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