forked from rosebudai/OpenRCT2-Web
Get basic object downloading working
This commit is contained in:
1 parent
f5e24bd973
commit
27f70e3656
6 files changed
+109
-5
No files matched your search
@@ -339,6 +339,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void AddObjectFromFile(const std::string_view& objectName, const void* data, size_t dataSize) override
|
||||
{
|
||||
utf8 path[MAX_PATH];
|
||||
GetPathForNewObject(path, sizeof(path), std::string(objectName).c_str());
|
||||
|
||||
log_verbose("Adding object: [%s]", objectName);
|
||||
try
|
||||
{
|
||||
File::WriteAllBytes(path, data, dataSize);
|
||||
ScanObject(path);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
Console::Error::WriteLine("Failed saving object: [%s] to '%s'.", objectName, path);
|
||||
}
|
||||
}
|
||||
|
||||
void ExportPackedObject(IStream* stream) override
|
||||
{
|
||||
auto chunkReader = SawyerChunkReader(stream);
|
||||
|
||||
Reference in new issue
Block a user