Ticket #2745: 2745.diff
File 2745.diff, 1.2 KB (added by , 9 years ago) |
---|
-
source/ps/Replay.cpp
1 /* Copyright (C) 201 4Wildfire Games.1 /* Copyright (C) 2015 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 32 32 #include "scriptinterface/ScriptStats.h" 33 33 #include "simulation2/Simulation2.h" 34 34 #include "simulation2/helpers/SimulationCommand.h" 35 #include "lib/svn_revision.h" 35 36 36 37 #include <sstream> 37 38 #include <fstream> … … 77 78 78 79 void CReplayLogger::StartGame(JS::MutableHandleValue attribs) 79 80 { 81 char svnRevision[32]; 82 sprintf_s(svnRevision, ARRAY_SIZE(svnRevision), "%ls", svn_revision); 83 *m_Stream << "version " << svnRevision << "\n"; 80 84 *m_Stream << "start " << m_ScriptInterface.StringifyJSON(attribs, false) << "\n"; 81 85 } 82 86 … … 243 247 if (turn % 20 == 0) 244 248 g_ProfileViewer.SaveToFile(); 245 249 } 250 else if (type == "version") 251 { 252 std::string s_version; 253 std::getline(*m_Stream, s_version); 254 debug_printf(L"version %hs\n", s_version.c_str()); 255 } 246 256 else 247 257 { 248 258 debug_printf(L"Unrecognised replay token %hs\n", type.c_str());