OpenTTD Source 20260421-master-gc2fbc6fdeb
network_gui.h File Reference

GUIs related to networking. More...

Go to the source code of this file.

Data Structures

struct  NetworkCompanyInfo
 Company information stored at the client side. More...

Enumerations

enum  NetworkRelayWindowCloseData : uint8_t { NRWCD_UNHANDLED = 0 , NRWCD_HANDLED = 1 }
 Reasons to close the window that opts you in for relaying the network game. More...

Functions

void ShowNetworkNeedPassword (std::shared_ptr< NetworkAuthenticationPasswordRequest > request)
 Update the NetworkJoinStatusWindow to start requesting the server password.
void ShowNetworkChatQueryWindow (NetworkChatDestinationType type, int dest)
 Show the chat window.
void ShowJoinStatusWindow ()
 Open the window showing the status of joining the server.
void ShowNetworkGameWindow ()
 Show the server list window.
void ShowClientList ()
 Open the client list window.
void ShowNetworkAskRelay (std::string_view server_connection_string, std::string &&relay_connection_string, std::string &&token)
 Show a modal confirmation window with "no" / "yes, once" / "yes, always" buttons.
void ShowNetworkAskSurvey ()
 Show a modal confirmation window with "no" / "preview" / "yes" buttons.
void ShowSurveyResultTextfileWindow (Window *parent)
 Show the surver results as a text file.

Detailed Description

GUIs related to networking.

Definition in file network_gui.h.

Enumeration Type Documentation

◆ NetworkRelayWindowCloseData

Reasons to close the window that opts you in for relaying the network game.

Enumerator
NRWCD_UNHANDLED 

Relay request is unhandled.

NRWCD_HANDLED 

Relay request is handled, either by user or by timeout.

Definition at line 43 of file network_gui.h.

Function Documentation

◆ ShowClientList()

void ShowClientList ( )

◆ ShowJoinStatusWindow()

void ShowJoinStatusWindow ( )

Open the window showing the status of joining the server.

Definition at line 2218 of file network_gui.cpp.

References _network_join_status_window_desc, CloseWindowById(), WC_NETWORK_STATUS_WINDOW, and WN_NETWORK_STATUS_WINDOW_JOIN.

Referenced by NetworkClientJoinGame(), and ClientNetworkGameSocketHandler::ReceiveServerMapDone().

◆ ShowNetworkAskRelay()

void ShowNetworkAskRelay ( std::string_view server_connection_string,
std::string && relay_connection_string,
std::string && token )

Show a modal confirmation window with "no" / "yes, once" / "yes, always" buttons.

Parameters
server_connection_stringThe game server we want to connect to.
relay_connection_stringThe relay server we want to connect to.
tokenThe token for this connection.

Definition at line 2345 of file network_gui.cpp.

References _network_ask_relay_desc, CloseWindowByClass(), GetMainWindow(), NRWCD_HANDLED, and WC_NETWORK_ASK_RELAY.

Referenced by ClientNetworkCoordinatorSocketHandler::ReceiveGameCoordinatorTurnConnect().

◆ ShowNetworkAskSurvey()

void ShowNetworkAskSurvey ( )

Show a modal confirmation window with "no" / "preview" / "yes" buttons.

Definition at line 2447 of file network_gui.cpp.

References _network_ask_survey_desc, CloseWindowByClass(), GetMainWindow(), NetworkSurveyHandler::IsSurveyPossible(), and WC_NETWORK_ASK_SURVEY.

◆ ShowNetworkChatQueryWindow()

void ShowNetworkChatQueryWindow ( NetworkChatDestinationType type,
int dest )

Show the chat window.

Parameters
typeThe type of destination.
destThe actual destination index.

Definition at line 444 of file network_chat_gui.cpp.

References _chat_window_desc, CloseWindowByClass(), and WC_SEND_NETWORK_MSG.

Referenced by NetworkClientListWindow::OnClickClientChat(), NetworkClientListWindow::OnClickCompanyChat(), and MainWindow::OnHotkey().

◆ ShowNetworkGameWindow()

◆ ShowNetworkNeedPassword()

void ShowNetworkNeedPassword ( std::shared_ptr< NetworkAuthenticationPasswordRequest > request)

Update the NetworkJoinStatusWindow to start requesting the server password.

Parameters
requestThe callback for the reply to the request.

Definition at line 2228 of file network_gui.cpp.

References CS_ALPHANUMERAL, FindWindowById(), NETWORK_PASSWORD_LENGTH, NetworkJoinStatusWindow::request, ShowQueryString(), WC_NETWORK_STATUS_WINDOW, and WN_NETWORK_STATUS_WINDOW_JOIN.

Referenced by ClientGamePasswordRequestHandler::AskUserForPassword().

◆ ShowSurveyResultTextfileWindow()

void ShowSurveyResultTextfileWindow ( Window * parent)

Show the surver results as a text file.

Parameters
parentThe parent of the text file window.

Definition at line 2481 of file network_gui.cpp.

References Window::CloseChildWindowById(), TFT_SURVEY_RESULT, and WC_TEXTFILE.

Referenced by GameOptionsWindow::OnClick(), and NetworkAskSurveyWindow::OnClick().