OpenTTD Source 20241224-master-gf74b0cf984
|
Basic functions/variables used all over the place. More...
Go to the source code of this file.
Functions | |
void | NetworkStartUp () |
This tries to launch the network for a given OS. | |
void | NetworkShutDown () |
This shuts the network down. | |
void | NetworkDrawChatMessage () |
Draw the chat message-box. | |
bool | HasClients () |
Return whether there is any client connected or trying to connect at all. | |
Variables | |
bool | _networking |
are we in networking mode? | |
bool | _network_server |
network-server is active | |
bool | _network_available |
is network mode available? | |
bool | _network_dedicated |
are we a dedicated server? | |
bool | _is_network_server |
Does this client wants to be a network-server? | |
Basic functions/variables used all over the place.
Definition in file network.h.
bool HasClients | ( | ) |
Return whether there is any client connected or trying to connect at all.
Definition at line 97 of file network.cpp.
void NetworkDrawChatMessage | ( | ) |
Draw the chat message-box.
Definition at line 181 of file network_chat_gui.cpp.
References _chatmessage_backup, _chatmessage_dirty, _chatmessage_visible, _chatmsg_box, _chatmsg_list, ReusableBuffer< T >::Allocate(), Blitter::CopyToBuffer(), DrawStringMultiLine(), FILLRECT_RECOLOUR, FindWindowByClass(), FS_NORMAL, GetCharacterHeight(), BlitterFactory::GetCurrentBlitter(), VideoDriver::GetInstance(), GetStringLineCount(), GfxFillRect(), HaveChatMessages(), ICONSOLE_FULL, VideoDriver::MakeDirty(), MAX_CHAT_MESSAGES, Blitter::MoveTo(), NETWORK_CHAT_LINE_SPACING, NetworkUndrawChatMessage(), PALETTE_TO_TRANSPARENT, SA_BOTTOM, SA_FORCE, SA_LEFT, ScaleGUITrad(), SetDParamStr(), and WC_SEND_NETWORK_MSG.
Referenced by UpdateWindows().
void NetworkShutDown | ( | ) |
This shuts the network down.
Definition at line 1301 of file network.cpp.
References _network_available, Debug, NetworkCoreShutdown(), NetworkDisconnect(), NetworkHTTPUninitialize(), and NetworkUDPClose().
Referenced by ShutdownGame().
void NetworkStartUp | ( | ) |
This tries to launch the network for a given OS.
Definition at line 1283 of file network.cpp.
References _broadcast_list, _network_available, _network_dedicated, Debug, NetworkCoreInitialize(), NetworkFindBroadcastIPs(), NetworkHTTPInitialize(), and NetworkUDPInitialize().
Referenced by openttd_main().
|
extern |
Does this client wants to be a network-server?
Definition at line 69 of file network.cpp.
Referenced by VideoDriver_Dedicated::MainLoop(), SelectGameWindow::OnClick(), and NetworkStartServerWindow::OnClick().
|
extern |
is network mode available?
Definition at line 67 of file network.cpp.
Referenced by HandleBootstrap(), NetworkAvailable(), NetworkClientConnectGame(), NetworkQueryServer(), NetworkShutDown(), NetworkStartUp(), AIConfigWindow::OnClick(), SaveLoadWindow::OnClick(), GSConfigWindow::OnClick(), SelectGameWindow::OnClick(), NewGRFWindow::OnClick(), GameOptionsWindow::OnInvalidateData(), AfterNewGRFScan::OnNewGRFsScanned(), and ShutdownGame().
|
extern |
are we a dedicated server?
Definition at line 68 of file network.cpp.
Referenced by _GenerateWorld(), AfterLoadGame(), CheckMinActiveClients(), DEF_CONSOLE_HOOK(), IConsolePrint(), VideoDriver_Dedicated::MainLoop(), NetworkAutoCleanCompanies(), NetworkOnGameStart(), NetworkServerDoMove(), NetworkStartUp(), AI::Pause(), ClientNetworkCoordinatorSocketHandler::Receive_GC_REGISTER_ACK(), SafeLoad(), ServerNetworkAdminSocketHandler::SendWelcome(), ShowEndGameChart(), SpecializedVehicle< T, Type >::UpdateViewport(), and UpdateWindows().
|
extern |
network-server is active
Definition at line 66 of file network.cpp.
Referenced by AfterLoadGame(), AfterLoadLinkGraphs(), AI::BroadcastNewEvent(), AI::CanStartNew(), ChangeNetworkRestartTime(), NetworkGameSocketHandler::CloseConnection(), CmdCompanyCtrl(), CmdGoalQuestion(), CmdGoalQuestionAnswer(), CompanyAdminRemove(), CompanyAdminUpdate(), CompanyCheckBankrupt(), ClientNetworkCoordinatorSocketHandler::ConnectSuccess(), DEF_CONSOLE_HOOK(), DEF_CONSOLE_HOOK(), DEF_CONSOLE_HOOK(), DEF_CONSOLE_HOOK(), DoStartupNewCompany(), AI::GameLoop(), Game::GameLoop(), GetSettingsDesc(), SettingDesc::IsEditable(), AIPLChunkHandler::Load(), GSDTChunkHandler::Load(), PATSChunkHandler::Load(), LoadSettings(), MenuClickCompany(), NetworkDisconnect(), NetworkMaxCompaniesAllowed(), NetworkOnGameStart(), NetworkPrintClients(), NetworkReceive(), NetworkSendCommand(), NetworkServerNewCompany(), NetworkServerUpdateGameInfo(), NetworkUpdateClientName(), Game::NewEvent(), AI::NewEvent(), CompanyWindow::OnClick(), NetworkClientListWindow::OnClick(), NetworkClientListWindow::OnClickCompanyJoin(), NetworkClientListWindow::OnDropdownSelect(), MainWindow::OnHotkey(), NetworkClientListWindow::OnInvalidateData(), BuildVehicleWindow::OnPaint(), NetworkClientListWindow::OnQueryTextFinished(), OnTick_LinkGraph(), NetworkClientListWindow::RebuildList(), NetworkClientListWindow::RebuildListCompany(), ClientNetworkCoordinatorSocketHandler::Receive_GC_TURN_CONNECT(), OrderBackup::Reset(), OrderBackup::ResetUser(), SafeLoad(), SanitizeSingleStringHelper(), Game::Save(), BKORChunkHandler::Save(), AI::Save(), SendChat(), ClientNetworkCoordinatorSocketHandler::SendReceive(), SetSettingValue(), NetworkClientListWindow::SetStringParameters(), ShowScriptDebugWindow(), ShowScriptDebugWindowIfScriptError(), Game::StartNew(), AI::StartNew(), StateGameLoop(), AI::Stop(), SurveyConfiguration(), ToolbarOptionsClick(), UpdateClientConfigValues(), and NetworkClientListWindow::UpdateWidgetSize().
|
extern |
are we in networking mode?
Definition at line 65 of file network.cpp.
Referenced by AfterLoadGame(), AfterLoadLinkGraphs(), AI::BroadcastNewEvent(), AI::CanStartNew(), ChangeOwnershipOfCompanyItems(), CheckTrainsLengths(), ClientNetworkGameSocketHandler::ClientError(), SaveLoadWindow::Close(), EndGameWindow::Close(), HighScoreWindow::Close(), NetworkGameSocketHandler::CloseConnection(), CmdBuyCompany(), CmdCompanyCtrl(), CmdGiveMoney(), CmdGoalQuestionAnswer(), CmdPause(), CompanyCheckBankrupt(), DEF_CONSOLE_HOOK(), DEF_CONSOLE_HOOK(), DEF_CONSOLE_HOOK(), DoStartupNewCompany(), AI::GameLoop(), Game::GameLoop(), GetSettingsDesc(), CommandHelperBase::InternalExecuteValidateTestAndPrepExec(), CommandHelperBase::InternalPostBefore(), SettingDesc::IsEditable(), AIPLChunkHandler::Load(), GSDTChunkHandler::Load(), PATSChunkHandler::Load(), LoadNewGRF(), LoadSettings(), MenuClickCompany(), MenuClickSettings(), NetworkHandlePauseChange(), NetworkUpdateServerGameType(), Game::NewEvent(), AI::NewEvent(), TCPClientConnecter::OnConnect(), MainWindow::OnHotkey(), MainToolbarWindow::OnHotkey(), BuildVehicleWindow::OnPaint(), CompanyWindow::OnPaint(), OnTick_Companies(), OnTick_LinkGraph(), OrdersWindow::OrderClick_Delete(), ParamSet(), PopupMainCompanyToolbMenu(), TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::Receive(), ClientNetworkGameSocketHandler::Receive(), RedrawScreenRect(), ReInitAllWindows(), OrderBackup::Reset(), Game::Save(), BKORChunkHandler::Save(), AI::Save(), SetSettingValue(), ShowEndGameChart(), ShowNewGrfVehicleError(), ShowScriptDebugWindow(), ShowScriptDebugWindowIfScriptError(), Game::StartNew(), AI::StartNew(), StateGameLoop(), AI::Stop(), SurveyConfiguration(), VideoDriver::Tick(), ToolbarFastForwardClick(), and ToolbarOptionsClick().