mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: use infinite-fast-forward when rerunning command-log (#12519)
This commit is contained in:
parent
a09749f6a6
commit
a0636d8200
|
@ -37,6 +37,9 @@
|
|||
#include "../gfx_func.h"
|
||||
#include "../error.h"
|
||||
#include "../misc_cmd.h"
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
# include "../fileio_func.h"
|
||||
#endif
|
||||
#include <charconv>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
@ -44,8 +47,11 @@
|
|||
#include "../safeguards.h"
|
||||
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
#include "../fileio_func.h"
|
||||
/** When running the server till the wait point, run as fast as we can! */
|
||||
/** Helper variable to make the dedicated server go fast until the (first) join.
|
||||
* Used to load the desync debug logs, i.e. for reproducing a desync.
|
||||
* There's basically no need to ever enable this, unless you really know what
|
||||
* you are doing, i.e. debugging a desync.
|
||||
* See docs/desync.txt for details. */
|
||||
bool _ddc_fastforward = true;
|
||||
#endif /* DEBUG_DUMP_COMMANDS */
|
||||
|
||||
|
|
|
@ -37,19 +37,6 @@
|
|||
#define NETWORK_SEND_DOUBLE_SEED
|
||||
#endif /* RANDOM_DEBUG */
|
||||
|
||||
/**
|
||||
* Helper variable to make the dedicated server go fast until the (first) join.
|
||||
* Used to load the desync debug logs, i.e. for reproducing a desync.
|
||||
* There's basically no need to ever enable this, unless you really know what
|
||||
* you are doing, i.e. debugging a desync.
|
||||
* See docs/desync.txt for details.
|
||||
*/
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
extern bool _ddc_fastforward;
|
||||
#else
|
||||
#define _ddc_fastforward (false)
|
||||
#endif /* DEBUG_DUMP_COMMANDS */
|
||||
|
||||
typedef class ServerNetworkGameSocketHandler NetworkClientSocket;
|
||||
|
||||
/** Status of the clients during joining. */
|
||||
|
|
|
@ -219,7 +219,6 @@ void VideoDriver_Dedicated::MainLoop()
|
|||
if (!_dedicated_forks) DedicatedHandleKeyInput();
|
||||
this->DrainCommandQueue();
|
||||
|
||||
ChangeGameSpeed(_ddc_fastforward);
|
||||
this->Tick();
|
||||
this->SleepTillNextTick();
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../gfx_func.h"
|
||||
#include "../settings_type.h"
|
||||
#include "../zoom_type.h"
|
||||
#include "../network/network_func.h"
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
|
@ -311,6 +312,12 @@ protected:
|
|||
|
||||
std::chrono::steady_clock::duration GetGameInterval()
|
||||
{
|
||||
#ifdef DEBUG_DUMP_COMMANDS
|
||||
/* When replaying, run as fast as we can. */
|
||||
extern bool _ddc_fastforward;
|
||||
if (_ddc_fastforward) return std::chrono::microseconds(0);
|
||||
#endif /* DEBUG_DUMP_COMMANDS */
|
||||
|
||||
/* If we are paused, run on normal speed. */
|
||||
if (_pause_mode) return std::chrono::milliseconds(MILLISECONDS_PER_TICK);
|
||||
/* Infinite speed, as quickly as you can. */
|
||||
|
|
Loading…
Reference in New Issue