mirror of https://github.com/OpenTTD/OpenTTD
Change: Add separate setting for server sent commands per frame limit (#11023)
Set a higher default value for this setting. Use the higher of this and existing commands per frame limit setting for server-originating commands, e.g. GS. This is to support the GSAsyncMode class. This also avoids undue throttling when more than one script is in operation (e.g. AIs).pull/11075/head
parent
8465559488
commit
55c07eed59
|
@ -392,6 +392,10 @@ static void DistributeQueue(CommandQueue *queue, const NetworkClientSocket *owne
|
||||||
int to_go = UINT16_MAX;
|
int to_go = UINT16_MAX;
|
||||||
#else
|
#else
|
||||||
int to_go = _settings_client.network.commands_per_frame;
|
int to_go = _settings_client.network.commands_per_frame;
|
||||||
|
if (owner == nullptr) {
|
||||||
|
/* This is the server, use the commands_per_frame_server setting if higher */
|
||||||
|
to_go = std::max<int>(to_go, _settings_client.network.commands_per_frame_server);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CommandPacket *cp;
|
CommandPacket *cp;
|
||||||
|
|
|
@ -279,6 +279,7 @@ struct NetworkSettings {
|
||||||
uint16 sync_freq; ///< how often do we check whether we are still in-sync
|
uint16 sync_freq; ///< how often do we check whether we are still in-sync
|
||||||
uint8 frame_freq; ///< how often do we send commands to the clients
|
uint8 frame_freq; ///< how often do we send commands to the clients
|
||||||
uint16 commands_per_frame; ///< how many commands may be sent each frame_freq frames?
|
uint16 commands_per_frame; ///< how many commands may be sent each frame_freq frames?
|
||||||
|
uint16 commands_per_frame_server; ///< how many commands may be sent each frame_freq frames? (server-originating commands)
|
||||||
uint16 max_commands_in_queue; ///< how many commands may there be in the incoming queue before dropping the connection?
|
uint16 max_commands_in_queue; ///< how many commands may there be in the incoming queue before dropping the connection?
|
||||||
uint16 bytes_per_frame; ///< how many bytes may, over a long period, be received per frame?
|
uint16 bytes_per_frame; ///< how many bytes may, over a long period, be received per frame?
|
||||||
uint16 bytes_per_frame_burst; ///< how many bytes may, over a short period, be received?
|
uint16 bytes_per_frame_burst; ///< how many bytes may, over a short period, be received?
|
||||||
|
|
|
@ -66,6 +66,15 @@ min = 1
|
||||||
max = 65535
|
max = 65535
|
||||||
cat = SC_EXPERT
|
cat = SC_EXPERT
|
||||||
|
|
||||||
|
[SDTC_VAR]
|
||||||
|
var = network.commands_per_frame_server
|
||||||
|
type = SLE_UINT16
|
||||||
|
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
|
||||||
|
def = 16
|
||||||
|
min = 1
|
||||||
|
max = 65535
|
||||||
|
cat = SC_EXPERT
|
||||||
|
|
||||||
[SDTC_VAR]
|
[SDTC_VAR]
|
||||||
var = network.max_commands_in_queue
|
var = network.max_commands_in_queue
|
||||||
type = SLE_UINT16
|
type = SLE_UINT16
|
||||||
|
|
Loading…
Reference in New Issue