Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Member Functions
LobbyFinder Class Reference

#include <lobbyfinder.hpp>

Public Member Functions

 LobbyFinder (boost::asio::io_context &io_context, const GameConfig &config)
 
 ~LobbyFinder ()
 
void startSearching ()
 
void stopSearching ()
 
Lobbies getFoundLobbies ()
 

Detailed Description

Class which abstracts away the logic of listening for lobby broadcast UDP packets sent by the server when broadcasting that there is an available lobby on the LAN.

Constructor & Destructor Documentation

◆ LobbyFinder()

LobbyFinder::LobbyFinder ( boost::asio::io_context &  io_context,
const GameConfig config 
)

Instantiates the Lobby Finder but doesn't start searching.

◆ ~LobbyFinder()

LobbyFinder::~LobbyFinder ( )

Calls LobbyFinder::stopSearching(), if it hasn't already been called.

Member Function Documentation

◆ getFoundLobbies()

Lobbies LobbyFinder::getFoundLobbies ( )

Gets all of the lobbies that the LobbyFinder has found. Explicitly returns a copy because we dont want to pass around a reference to the underlying data member because the worker thread could modify it later.

◆ startSearching()

void LobbyFinder::startSearching ( )

Tells the lobby finder to start searching for lobbies.

◆ stopSearching()

void LobbyFinder::stopSearching ( )

Tells the LobbyFinder to stop trying to look for a lobby. Closes the socket, and exits the background thread. Called automatically in the destructor if not called explicitly beforehand.


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