|
Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
|
#include <lobbyfinder.hpp>
Public Member Functions | |
| LobbyFinder (boost::asio::io_context &io_context, const GameConfig &config) | |
| ~LobbyFinder () | |
| void | startSearching () |
| void | stopSearching () |
| Lobbies | getFoundLobbies () |
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.
| LobbyFinder::LobbyFinder | ( | boost::asio::io_context & | io_context, |
| const GameConfig & | config | ||
| ) |
Instantiates the Lobby Finder but doesn't start searching.
| LobbyFinder::~LobbyFinder | ( | ) |
Calls LobbyFinder::stopSearching(), if it hasn't already been called.
| 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.
| void LobbyFinder::startSearching | ( | ) |
Tells the lobby finder to start searching for lobbies.
| 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.