mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Use std::time_t in the replay menu (as 64bit integer conversion are implemented now) and remove the unused filemoddate fallback.
Differential Revision: https://code.wildfiregames.com/D112 Reviewed By: echotangoecho This was SVN commit r19200.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2016 Wildfire Games.
|
||||
/* Copyright (C) 2017 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -54,7 +54,7 @@ CReplayLogger::~CReplayLogger()
|
||||
void CReplayLogger::StartGame(JS::MutableHandleValue attribs)
|
||||
{
|
||||
// Add timestamp, since the file-modification-date can change
|
||||
m_ScriptInterface.SetProperty(attribs, "timestamp", std::to_string(std::time(nullptr)));
|
||||
m_ScriptInterface.SetProperty(attribs, "timestamp", std::time(nullptr));
|
||||
|
||||
// Add engine version and currently loaded mods for sanity checks when replaying
|
||||
m_ScriptInterface.SetProperty(attribs, "engine_version", CStr(engine_version));
|
||||
@@ -73,10 +73,10 @@ void CReplayLogger::Turn(u32 n, u32 turnLength, std::vector<SimulationCommand>&
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
*m_Stream << "turn " << n << " " << turnLength << "\n";
|
||||
for (size_t i = 0; i < commands.size(); ++i)
|
||||
{
|
||||
*m_Stream << "cmd " << commands[i].player << " " << m_ScriptInterface.StringifyJSON(&commands[i].data, false) << "\n";
|
||||
}
|
||||
|
||||
for (SimulationCommand& command : commands)
|
||||
*m_Stream << "cmd " << command.player << " " << m_ScriptInterface.StringifyJSON(&command.data, false) << "\n";
|
||||
|
||||
*m_Stream << "end\n";
|
||||
m_Stream->flush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user