@@ -23,9 +23,11 @@ distribution.
2323*/
2424
2525#include " Core.h"
26+ #include " DFHackVersion.h"
2627#include " Debug.h"
2728#include " Internal.h"
2829#include " LuaTools.h"
30+ #include " MemAccess.h"
2931
3032#include " modules/Filesystem.h"
3133#include " modules/Gui.h"
@@ -186,11 +188,26 @@ static std::string getSaveFilePath(const std::string &world, const std::string &
186188}
187189
188190void Persistence::Internal::save (color_ostream& out) {
189- if (!Core::getInstance ().isWorldLoaded ())
191+ Core &core = Core::getInstance ();
192+
193+ if (!core.isWorldLoaded ())
190194 return ;
191195
192196 CoreSuspender suspend;
193197
198+ // write status
199+ {
200+ auto file = std::ofstream (getSaveFilePath (" current" , " status" ));
201+ file << " DF version: " << core.p ->getDescriptor ()->getVersion () << std::endl;
202+ file << " DFHack version: " << Version::dfhack_version () << " (" << Version::git_commit (true ) << " )" << std::endl;
203+ file << " Tagged release: " << (Version::is_release () ? " yes" : " no" ) << std::endl;
204+ file << " Pre-release: " << (Version::is_prerelease () ? " yes" : " no" ) << std::endl;
205+ if (strlen (Version::dfhack_run_url ())) {
206+ file << " Build url: " << Version::dfhack_run_url () << std::endl;
207+ }
208+ }
209+
210+ // write entity data
194211 for (auto & entity_store_entry : store) {
195212 int entity_id = entity_store_entry.first ;
196213 Json::Value json (Json::arrayValue);
@@ -205,6 +222,7 @@ void Persistence::Internal::save(color_ostream& out) {
205222 file << json;
206223 }
207224
225+ // write perf counters
208226 {
209227 auto file = std::ofstream (getSaveFilePath (" current" , " perf-counters" ));
210228 color_ostream_wrapper wrapper (file);
0 commit comments