Platform Data Engine 0.0.1
A data-driven game engine for platformers
PlatformDataEngine::Server Class Reference
Inheritance diagram for PlatformDataEngine::Server:
PlatformDataEngine::NetworkHandler

Public Member Functions

 Server ()
 Constructor
 
void start ()
 Starts the server More...
 
void stop ()
 Stops the server (currently does nothing) More...
 
void process (GameWorld *world)
 Process: sends data to the clients, this should be called on a fixed interval More...
 
void recieve (GameWorld *world)
 Checks for new data from the clients More...
 
void broadcastObjectHealth (const std::string &objName, float health)
 Broadcasts health updates, makes sure it's not being sent too frequently More...
 
std::shared_ptr< ConnectionfindConnection (sf::IpAddress ip, std::string id)
 Finds a connection by ip and id More...
 
void addInputManager (std::shared_ptr< Connection > ip, std::shared_ptr< InputManager > input)
 
- Public Member Functions inherited from PlatformDataEngine::NetworkHandler
const std::string & getId ()
 
void setId (const std::string &name)
 
virtual void start ()=0
 
virtual void stop ()=0
 
virtual void process (GameWorld *world)=0
 Process is responsible for sending packets, limited in rate More...
 
virtual void recieve (GameWorld *world)=0
 Recieve checks for new packets, not limited in rate More...
 
std::shared_ptr< ConnectiongetConnection ()
 Gets the current process connection More...
 
void setConnection (std::shared_ptr< Connection > conn)
 Sets the current process connection More...
 

Additional Inherited Members

- Protected Attributes inherited from PlatformDataEngine::NetworkHandler
std::shared_ptr< Connectionm_clientConnection
 

Member Function Documentation

◆ broadcastObjectHealth()

void Server::broadcastObjectHealth ( const std::string &  objName,
float  health 
)

Broadcasts health updates, makes sure it's not being sent too frequently

Parameters
objNamethe object id
healththe new health

◆ findConnection()

std::shared_ptr< Connection > Server::findConnection ( sf::IpAddress  ip,
std::string  id 
)

Finds a connection by ip and id

Parameters
ipthe ip of the connection
idthe id of the connection
Returns

◆ process()

void Server::process ( GameWorld world)
virtual

Process: sends data to the clients, this should be called on a fixed interval

Parameters
worldThe game world

Implements PlatformDataEngine::NetworkHandler.

◆ recieve()

void Server::recieve ( GameWorld world)
virtual

Checks for new data from the clients

Parameters
worldThe game world

Implements PlatformDataEngine::NetworkHandler.

◆ start()

void Server::start ( )
virtual

Starts the server

Implements PlatformDataEngine::NetworkHandler.

◆ stop()

void Server::stop ( )
virtual

Stops the server (currently does nothing)

Implements PlatformDataEngine::NetworkHandler.


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