1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 01:19:11 +00:00

Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrint

This commit is contained in:
Rubidium
2021-07-23 22:36:17 +02:00
committed by rubidium42
parent 63116bd59f
commit 92559e6f3a
6 changed files with 79 additions and 2 deletions

View File

@@ -76,6 +76,11 @@ ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler()
_network_admins_connected--;
Debug(net, 3, "[admin] '{}' ({}) has disconnected", this->admin_name, this->admin_version);
if (_redirect_console_to_admin == this->index) _redirect_console_to_admin = INVALID_ADMIN_ID;
if (this->update_frequency[ADMIN_UPDATE_CONSOLE] & ADMIN_FREQUENCY_AUTOMATIC) {
this->update_frequency[ADMIN_UPDATE_CONSOLE] = (AdminUpdateFrequency)0;
DebugReconsiderSendRemoteMessages();
}
}
/**
@@ -688,6 +693,8 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_UPDATE_FREQUENC
this->update_frequency[type] = freq;
if (type == ADMIN_UPDATE_CONSOLE) DebugReconsiderSendRemoteMessages();
return NETWORK_RECV_STATUS_OKAY;
}