Add passworded mechanism to change server game settings from client

This commit is contained in:
Jonathan G Rennison
2019-08-20 20:42:17 +01:00
parent 17c054a650
commit ec892879f4
17 changed files with 155 additions and 16 deletions

View File

@@ -275,7 +275,7 @@ static CallBackFunction SelectSignTool()
static CallBackFunction ToolbarPauseClick(Window *w)
{
if (_networking && !_network_server) return CBF_NONE; // only server can pause the game
if (_networking && !(_network_server || _network_settings_access)) return CBF_NONE; // only server can pause the game
if (DoCommandP(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, CMD_PAUSE)) {
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
@@ -2013,7 +2013,6 @@ struct MainToolbarWindow : Window {
_last_started_action = CBF_NONE;
CLRBITS(this->flags, WF_WHITE_BORDER);
this->SetWidgetDisabledState(WID_TN_PAUSE, _networking && !_network_server); // if not server, disable pause button
this->SetWidgetDisabledState(WID_TN_FAST_FORWARD, _networking); // if networking, disable fast-forward button
PositionMainToolbar(this);
DoZoomInOutWindow(ZOOM_NONE, this);
@@ -2041,6 +2040,8 @@ struct MainToolbarWindow : Window {
this->SetWidgetDisabledState(WID_TN_RAILS, !CanBuildVehicleInfrastructure(VEH_TRAIN));
this->SetWidgetDisabledState(WID_TN_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT));
this->SetWidgetDisabledState(WID_TN_PAUSE, _networking && !(_network_server || _network_settings_access)); // if not server, disable pause button
this->DrawWidgets();
}