group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
GlobalServerAdvertiser Class Reference

#include <GlobalServerAdvertiser.hpp>

Collaboration diagram for GlobalServerAdvertiser:
[legend]

Public Member Functions

bool start (const GlobalDiscoveryConfig &cfg, Uint16 gamePort, std::function< int()> currentPlayersFn)
void stop ()
std::uint32_t serverId () const noexcept

Private Member Functions

void loop ()
bool sendRegistration (net::discovery::DirectoryMessage kind)
void sendUdpHello ()
void pollPunchRequests ()
void sendPunchProbes (const net::discovery::UdpPunchPeer &peer)

Private Attributes

GlobalDiscoveryConfig cfg_
Uint16 gamePort_ = 0
std::function< int()> currentPlayersFn_
net::UdpEndpoint udpEndpoint_
std::thread thread_
std::atomic< bool > shouldStop_ {false}
std::atomic< std::uint32_t > serverId_ {0}

Member Function Documentation

◆ loop()

void GlobalServerAdvertiser::loop ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pollPunchRequests()

void GlobalServerAdvertiser::pollPunchRequests ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendPunchProbes()

void GlobalServerAdvertiser::sendPunchProbes ( const net::discovery::UdpPunchPeer & peer)
private
Here is the caller graph for this function:

◆ sendRegistration()

bool GlobalServerAdvertiser::sendRegistration ( net::discovery::DirectoryMessage kind)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendUdpHello()

void GlobalServerAdvertiser::sendUdpHello ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serverId()

std::uint32_t GlobalServerAdvertiser::serverId ( ) const
inlinenodiscardnoexcept

◆ start()

bool GlobalServerAdvertiser::start ( const GlobalDiscoveryConfig & cfg,
Uint16 gamePort,
std::function< int()> currentPlayersFn )
Here is the call graph for this function:

◆ stop()

void GlobalServerAdvertiser::stop ( )

Member Data Documentation

◆ cfg_

GlobalDiscoveryConfig GlobalServerAdvertiser::cfg_
private

◆ currentPlayersFn_

std::function<int()> GlobalServerAdvertiser::currentPlayersFn_
private

◆ gamePort_

Uint16 GlobalServerAdvertiser::gamePort_ = 0
private

◆ serverId_

std::atomic<std::uint32_t> GlobalServerAdvertiser::serverId_ {0}
private

◆ shouldStop_

std::atomic<bool> GlobalServerAdvertiser::shouldStop_ {false}
private

◆ thread_

std::thread GlobalServerAdvertiser::thread_
private

◆ udpEndpoint_

net::UdpEndpoint GlobalServerAdvertiser::udpEndpoint_
private

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