mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
add validation flagging for server objects
sets up a generic `ServerAssetValidator` PersistenceManager onServerCreated and saves anything marked dirty after processing. demonstrates looking that up and setting something dirty via shapebase::preload asset tagging
This commit is contained in:
parent
b2495fe957
commit
6408297eb9
2 changed files with 9 additions and 0 deletions
|
|
@ -68,6 +68,7 @@
|
|||
#include "renderInstance/renderOcclusionMgr.h"
|
||||
#include "core/stream/fileStream.h"
|
||||
#include "T3D/accumulationVolume.h"
|
||||
#include "console/persistenceManager.h"
|
||||
|
||||
IMPLEMENT_CO_DATABLOCK_V1(ShapeBaseData);
|
||||
|
||||
|
|
@ -359,6 +360,12 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
|
|||
}
|
||||
}
|
||||
}
|
||||
PersistenceManager *persistMgr;
|
||||
if (!Sim::findObject("ServerAssetValidator", persistMgr)) Con::errorf("ServerAssetValidator not found!");
|
||||
if (server && persistMgr && shapeAssetId == StringTable->EmptyString())
|
||||
{
|
||||
persistMgr->setDirty(this);
|
||||
}
|
||||
|
||||
//Legacy catch
|
||||
if (shapeName != StringTable->EmptyString())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue