Skip to content

Class netWorth::ClientManager

ClassList > netWorth > ClientManager

More...

  • #include <ClientManager.hpp>

Public Functions

Type Name
ClientManager () = default
Id of client.
void clearActionMap ()
size_t getActionID (size_t id)
size_t getClientID () const
std::string getSerializedAgents ()
bool iDPresent (size_t id)
void packetToActionMap (sf::Packet pkt)
void setClientID (size_t id)
void setUpdatePort (unsigned short port)
void setupGameUpdateSocket (sf::UdpSocket * socket)
void setupSocket (sf::UdpSocket * socket, std::optional< sf::IpAddress > ip)

Detailed Description

The server that will be running and that allows clients to connect to

Public Functions Documentation

function ClientManager

Id of client.

netWorth::ClientManager::ClientManager () = default

Default constructor (AgentBase)

Parameters:

  • id agent ID
  • name agent name

function clearActionMap

inline void netWorth::ClientManager::clearActionMap () 

Clear action map after ClientInterface moves

function getActionID

inline size_t netWorth::ClientManager::getActionID (
    size_t id
) 

Return action ID correspoding to agent ID

Parameters:

  • id Agent ID

Returns:

action ID

function getClientID

inline size_t netWorth::ClientManager::getClientID () const

function getSerializedAgents

inline std::string netWorth::ClientManager::getSerializedAgents () 

Receive serialized agent data for midgame updates

Returns:

serialized data (or empty if no update)

function iDPresent

inline bool netWorth::ClientManager::iDPresent (
    size_t id
) 

Check if Agent ID is present in agent action map

Parameters:

  • id Agent ID

Returns:

true if ID is present

function packetToActionMap

inline void netWorth::ClientManager::packetToActionMap (
    sf::Packet pkt
) 

Turn packet from server into action map for ControlledAgents

Parameters:

  • pkt received packet

function setClientID

inline void netWorth::ClientManager::setClientID (
    size_t id
) 

function setUpdatePort

inline void netWorth::ClientManager::setUpdatePort (
    unsigned short port
) 

function setupGameUpdateSocket

inline void netWorth::ClientManager::setupGameUpdateSocket (
    sf::UdpSocket * socket
) 

Set socket for game updates

Parameters:

  • socket pointer to socket

function setupSocket

inline void netWorth::ClientManager::setupSocket (
    sf::UdpSocket * socket,
    std::optional< sf::IpAddress > ip
) 

Set receiving socket for action map and IP/port info

Parameters:


The documentation for this class was generated from the following file source/Interfaces/NetWorth/client/ClientManager.hpp