Jazz2::Multiplayer::ServerDiscovery class

Allows to monitor publicly-listed running servers for server listing.

Runs on a background thread in one of two roles: when given a NetworkManager it advertises the local server, answering UDP multicast discovery requests on the LAN and publishing the server to the public list; when given an IServerObserver it sends discovery requests and downloads the public list, reporting each discovered server back to the observer.

Constructors, destructors, conversion operators

ServerDiscovery(NetworkManager* server)
Creates an instance to advertise a running local server.
ServerDiscovery(IServerObserver* observer)
Creates an instance to observe remote servers.
~ServerDiscovery()

Public functions

void SetStatusProvider(std::weak_ptr<IServerStatusProvider> statusProvider)
Sets status provider.

Constants

static std::uint16_t DiscoveryPort constexpr
UDP port for server discovery broadcast.
static std::int32_t UniqueIdentifierLength constexpr
Length of server unique identifier.