Skip to content

Commit

Permalink
Allow starting the server in a state when the game start is forbidden (
Browse files Browse the repository at this point in the history
  • Loading branch information
kimden authored Jan 26, 2025
2 parents ca12bfa + c2daf46 commit e776a81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NETWORKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ A typical current server configuration xml that fits the current code version is
<!-- File with commands used for this server. Default file is commands.xml which can be changed with new commits, but you can use any other file from data/ folder, or even include contents of one other commands file using external-commands-file tag inside your file. -->
<commands-file value="commands.xml" />

<!-- Whether the game can be started immediately when the server is opened. -->
<start-allowed value="true" />

</server-config>
```

Expand Down
2 changes: 1 addition & 1 deletion src/network/protocols/server_lobby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ ServerLobby::ServerLobby() : LobbyProtocol()
initTournamentPlayers();
m_tournament_game = 0;
}
m_allowed_to_start = true;
m_allowed_to_start = ServerConfig::m_allowed_to_start;
m_game_info = nullptr;
loadTracksQueueFromConfig();
std::string scoring = ServerConfig::m_gp_scoring;
Expand Down
4 changes: 4 additions & 0 deletions src/network/server_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,10 @@ namespace ServerConfig
"from data/ folder, or even include contents of one other commands file "
"using external-commands-file tag inside your file."));

SERVER_CFG_PREFIX BoolServerConfigParam m_allowed_to_start
SERVER_CFG_DEFAULT(BoolServerConfigParam(true, "start-allowed",
"Whether the game can be started immediately when the server is opened."));

// ========================================================================
/** Server version, will be advanced if there are protocol changes. */
static const uint32_t m_server_version = 6;
Expand Down

0 comments on commit e776a81

Please sign in to comment.