MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / DumpStateToFile

Method DumpStateToFile

Code/CryEngine/CryScriptSystem/ScriptSystem.cpp:2600–2636  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2598
2599//////////////////////////////////////////////////////////////////////////
2600void CScriptSystem::DumpStateToFile(const char* filename)
2601{
2602 CHECK_STACK(L);
2603 SRecursiveLuaDumpToFile sink(filename);
2604 if (sink.file)
2605 {
2606 std::set<void*> tables;
2607 RecursiveTableDump(this, L, LUA_GLOBALSINDEX, 0, &sink, tables);
2608
2609#ifdef DEBUG_LUA_STATE
2610 {
2611 CHECK_STACK(L);
2612 for (std::set<CScriptTable*>::iterator it = gAllScriptTables.begin(); it != gAllScriptTables.end(); ++it)
2613 {
2614 CScriptTable* pTable = *it;
2615
2616 ScriptHandle handle;
2617 if (pTable->GetValue("id", handle) && gEnv->pEntitySystem)
2618 {
2619 EntityId id = handle.n;
2620 IEntity* pEntity = gEnv->pEntitySystem->GetEntity(id);
2621 char str[256];
2622 cry_sprintf(str, "*Entity: %s", pEntity->GetEntityTextDescription());
2623 sink.OnBeginTable(0, str, 0);
2624 }
2625 else
2626 sink.OnBeginTable(0, "*Unknown Table", 0);
2627
2628 pTable->PushRef();
2629 RecursiveTableDump(this, L, lua_gettop(L), 1, &sink, tables);
2630 lua_pop(L, 1);
2631 sink.OnEndTable(0);
2632 }
2633 }
2634#endif
2635 }
2636}
2637
2638//////////////////////////////////////////////////////////////////////////
2639void CScriptSystem::SerializeTimers(ISerialize* pSer)

Callers 1

LuaDumpStateFunction · 0.80

Calls 10

RecursiveTableDumpFunction · 0.85
cry_sprintfFunction · 0.85
OnBeginTableMethod · 0.80
PushRefMethod · 0.80
OnEndTableMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetValueMethod · 0.45
GetEntityMethod · 0.45

Tested by

no test coverage detected