IScreen implementation for local server launch settings.
More...
#include <HostConfig.hpp>
|
| bool | init (AppContext &ctx) |
| | Bind App-owned renderer, client, hosted-server, and draft config state.
|
| SDL_AppResult | event (SDL_Event *event) override |
| | Handle an incoming SDL event.
|
| SDL_AppResult | iterate () override |
| | Update the screen state and render the next frame.
|
| void | quit () override |
| | No-op screen shutdown hook; App owns all borrowed services.
|
| bool | consumeLaunchRequest () |
| | True if the user requested server launch, then clear that request.
|
| bool | consumeShutdownRequest () |
| | True if the user requested hosted-server shutdown, then clear that request.
|
| bool | consumeGoToLobbyRequest () |
| | True if the user requested entering the hosted lobby, then clear that request.
|
| bool | consumeBackToMainMenuRequest () |
| | True if the user requested returning to the main menu, then clear that request.
|
| bool | consumeExitRequest () |
| | True if the user requested closing the application, then clear that request.
|
| HostConfigState | draftConfig () const |
| | Current host-screen draft settings.
|
| void | setLaunchError (const std::string &error) |
| | Display a launch or connection error on the host form.
|
| virtual | ~IScreen ()=default |
| virtual void | shutdownAfterRenderer () |
| | Perform cleanup that must happen after the App-owned renderer shuts down.
|
IScreen implementation for local server launch settings.
◆ PendingConfirmAction
| Enumerator |
|---|
| None | |
| DiscardMatchChanges | |
| ShutdownServer | |
◆ canManageCurrentServer()
| bool HostConfig::canManageCurrentServer |
( |
| ) |
const |
|
private |
True if the client is connected and is the current lobby host.
◆ consumeBackToMainMenuRequest()
| bool HostConfig::consumeBackToMainMenuRequest |
( |
| ) |
|
True if the user requested returning to the main menu, then clear that request.
◆ consumeExitRequest()
| bool HostConfig::consumeExitRequest |
( |
| ) |
|
True if the user requested closing the application, then clear that request.
◆ consumeGoToLobbyRequest()
| bool HostConfig::consumeGoToLobbyRequest |
( |
| ) |
|
True if the user requested entering the hosted lobby, then clear that request.
◆ consumeLaunchRequest()
| bool HostConfig::consumeLaunchRequest |
( |
| ) |
|
True if the user requested server launch, then clear that request.
◆ consumeShutdownRequest()
| bool HostConfig::consumeShutdownRequest |
( |
| ) |
|
True if the user requested hosted-server shutdown, then clear that request.
◆ draftConfig()
Current host-screen draft settings.
◆ event()
| SDL_AppResult HostConfig::event |
( |
SDL_Event * | event | ) |
|
|
overridevirtual |
Handle an incoming SDL event.
- Parameters
-
| event | The SDL event to process. |
- Returns
- SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.
Implements IScreen.
◆ hasUnsavedServerChanges()
| bool HostConfig::hasUnsavedServerChanges |
( |
| ) |
const |
|
private |
True if the current draft differs from the last settings sent to or received from the server.
◆ init()
Bind App-owned renderer, client, hosted-server, and draft config state.
- Returns
- True when the required borrowed services are available.
◆ iterate()
| SDL_AppResult HostConfig::iterate |
( |
| ) |
|
|
overridevirtual |
Update the screen state and render the next frame.
- Returns
- SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.
Implements IScreen.
◆ quit()
| void HostConfig::quit |
( |
| ) |
|
|
overridevirtual |
No-op screen shutdown hook; App owns all borrowed services.
Implements IScreen.
◆ requestDiscardMatchChangesConfirm()
| void HostConfig::requestDiscardMatchChangesConfirm |
( |
| ) |
|
|
private |
Ask the host whether to discard unsaved match setting changes before leaving this screen.
◆ requestShutdownConfirm()
| void HostConfig::requestShutdownConfirm |
( |
| ) |
|
|
private |
Ask the host to confirm server shutdown.
◆ setLaunchError()
| void HostConfig::setLaunchError |
( |
const std::string & | error | ) |
|
Display a launch or connection error on the host form.
◆ updateServerSettings()
| bool HostConfig::updateServerSettings |
( |
| ) |
|
|
private |
Send the current host-managed settings to the hosted server.
◆ client
| Client* HostConfig::client = nullptr |
|
private |
Network client owned by App; not owned.
◆ confirm_
Reusable confirmation modal for discarding unsaved changes.
◆ draft
Persistent draft state owned by App; not owned.
◆ hostedServer
Hosted server owned by App; not owned.
◆ lastError
| std::string HostConfig::lastError |
|
private |
Error message shown on the host form; empty when no error.
◆ lastSyncedDiscoverySettings
Last discovery settings acknowledged locally.
◆ lastSyncedMatchConfig
| std::optional<MatchConfig> HostConfig::lastSyncedMatchConfig |
|
private |
Last match config acknowledged locally as server state.
◆ pendingBackToMainMenu
| bool HostConfig::pendingBackToMainMenu = false |
|
private |
Set when the user clicks "Back to Main Menu", cleared by App.
◆ pendingConfirmAction
Action to run after modal confirm.
◆ pendingExitRequest
| bool HostConfig::pendingExitRequest = false |
|
private |
Set when the user confirms "Exit to Desktop", cleared by App.
◆ pendingGoToLobby
| bool HostConfig::pendingGoToLobby = false |
|
private |
Set when the user clicks "Go to Lobby", cleared by App.
◆ pendingLaunch
| bool HostConfig::pendingLaunch = false |
|
private |
Set when the user clicks "Launch", cleared by App.
◆ pendingShutdown
| bool HostConfig::pendingShutdown = false |
|
private |
Set when the user clicks "Shutdown", cleared by App.
◆ renderer
◆ settings
Live user settings; not owned.
◆ settingsPath
| std::string_view HostConfig::settingsPath |
|
private |
Save path for user settings.
◆ systemMenu_
Shared Escape menu for front-end screens.
◆ window
| SDL_Window* HostConfig::window = nullptr |
|
private |
Application window; not owned.
The documentation for this class was generated from the following files: