MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / SaveMap

Method SaveMap

src/openrct2/network/NetworkBase.cpp:2889–2907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2887 }
2888
2889 bool NetworkBase::SaveMap(IStream* stream, const std::vector<const ObjectRepositoryItem*>& objects) const
2890 {
2891 bool result = false;
2892 PrepareMapForSave();
2893 try
2894 {
2895 auto exporter = std::make_unique<ParkFileExporter>();
2896 exporter->ExportObjectsList = objects;
2897
2898 auto& gameState = getGameState();
2899 exporter->Export(gameState, *stream, kParkFileNetCompressionLevel);
2900 result = true;
2901 }
2902 catch (const std::exception& e)
2903 {
2904 Console::Error::WriteLine("Unable to serialise map: %s", e.what());
2905 }
2906 return result;
2907 }
2908
2909 void NetworkBase::Client_Handle_CHAT([[maybe_unused]] Connection& connection, Packet& packet)
2910 {

Callers

nothing calls this directly

Calls 4

PrepareMapForSaveFunction · 0.85
WriteLineFunction · 0.85
ExportMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected