Merge branch 'master' into jgrpp

# Conflicts:
#	src/base_station_base.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/object_gui.cpp
#	src/saveload/settings_sl.cpp
#	src/saveload/station_sl.cpp
#	src/settings.cpp
#	src/settings_internal.h
#	src/timer/timer_game_calendar.cpp
This commit is contained in:
Jonathan G Rennison
2024-03-09 20:10:57 +00:00
19 changed files with 901 additions and 548 deletions

View File

@@ -176,6 +176,21 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
return CHR_ALLOW;
}
/**
* Check whether we are in a multiplayer game and are playing, i.e. we are not the dedicated server.
* @return Are we a client or non-dedicated server in a network game? True when yes, false otherwise.
*/
DEF_CONSOLE_HOOK(ConHookNeedNonDedicatedNetwork)
{
if (!NetworkAvailable(echo)) return CHR_DISALLOW;
if (_network_dedicated) {
if (echo) IConsolePrint(CC_ERROR, "This command is not available to a dedicated network server.");
return CHR_DISALLOW;
}
return CHR_ALLOW;
}
/**
* Check whether we are in singleplayer mode.
* @return True when no network is active.
@@ -4034,7 +4049,7 @@ void IConsoleStdLibRegister()
IConsole::CmdRegister("rcon", ConRcon, ConHookNeedNetwork);
IConsole::CmdRegister("settings_access", ConSettingsAccess, ConHookNeedNetwork);
IConsole::CmdRegister("join", ConJoinCompany, ConHookNeedNetwork);
IConsole::CmdRegister("join", ConJoinCompany, ConHookNeedNonDedicatedNetwork);
IConsole::AliasRegister("spectate", "join 255");
IConsole::CmdRegister("move", ConMoveClient, ConHookServerOnly);
IConsole::CmdRegister("reset_company", ConResetCompany, ConHookServerOnly);