Change: Allow dedicated server to use threaded saves. (#10787)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
This commit is contained in:
@@ -112,7 +112,6 @@ struct PacketWriter : SaveFilter {
|
|||||||
* we need to handle the save finish as well as the
|
* we need to handle the save finish as well as the
|
||||||
* next connection might just be requesting a map. */
|
* next connection might just be requesting a map. */
|
||||||
WaitTillSaved();
|
WaitTillSaved();
|
||||||
ProcessAsyncSaveFinish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -548,6 +547,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->status == STATUS_AUTHORIZED) {
|
if (this->status == STATUS_AUTHORIZED) {
|
||||||
|
WaitTillSaved();
|
||||||
this->savegame = new PacketWriter(this);
|
this->savegame = new PacketWriter(this);
|
||||||
|
|
||||||
/* Now send the _frame_counter and how many packets are coming */
|
/* Now send the _frame_counter and how many packets are coming */
|
||||||
|
@@ -3142,7 +3142,7 @@ SaveOrLoadResult SaveOrLoad(const std::string &filename, SaveLoadOperation fop,
|
|||||||
|
|
||||||
if (fop == SLO_SAVE) { // SAVE game
|
if (fop == SLO_SAVE) { // SAVE game
|
||||||
Debug(desync, 1, "save: {:08x}; {:02x}; {}", TimerGameCalendar::date, TimerGameCalendar::date_fract, filename);
|
Debug(desync, 1, "save: {:08x}; {:02x}; {}", TimerGameCalendar::date, TimerGameCalendar::date_fract, filename);
|
||||||
if (_network_server || !_settings_client.gui.threaded_saves) threaded = false;
|
if (!_settings_client.gui.threaded_saves) threaded = false;
|
||||||
|
|
||||||
return DoSave(new FileWriter(fh), threaded);
|
return DoSave(new FileWriter(fh), threaded);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user