MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NetworkReboot

Function NetworkReboot

src/network/network.cpp:977–994  ·  view source on GitHub ↗

The server is rebooting... * The only difference with NetworkDisconnect, is the packets that is sent */

Source from the content-addressed store, hash-verified

975/* The server is rebooting...
976 * The only difference with NetworkDisconnect, is the packets that is sent */
977void NetworkReboot()
978{
979 if (_network_server) {
980 for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) {
981 cs->SendNewGame();
982 cs->SendPackets();
983 }
984
985 for (ServerNetworkAdminSocketHandler *as : ServerNetworkAdminSocketHandler::IterateActive()) {
986 as->SendNewGame();
987 as->SendPackets();
988 }
989 }
990
991 /* For non-dedicated servers we have to kick the admins as we are not
992 * certain that we will end up in a new network game. */
993 NetworkClose(!_network_dedicated);
994}
995
996/**
997 * We want to disconnect from the host/clients.

Callers 1

SwitchToModeFunction · 0.85

Calls 3

NetworkCloseFunction · 0.85
SendPacketsMethod · 0.80
SendNewGameMethod · 0.45

Tested by

no test coverage detected