MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / script_vars_export

Function script_vars_export

ogsr_engine/xrGame/script_vars_storage.cpp:599–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599int script_vars_export(lua_State* L) // сохранение таблицы переменных в нет-пакет
600{
601 CMemoryWriter stream;
602 CScriptVarsTable* svt = lua_tosvt(L, 1);
603 svt->save(stream);
604 object_rep* rep = is_class_object(L, 2);
605 if (rep && strstr(rep->crep()->name(), "net_packet"))
606 {
607 NET_Packet* dst = (NET_Packet*)rep->ptr();
608 dst->w(stream.pointer(), stream.size());
609 lua_pushinteger(L, stream.size());
610 }
611 else
612 lua_pushinteger(L, 0);
613 return 1;
614}
615
616int script_vars_import(lua_State* L) // загрузка таблицы переменных из нет-пакета
617{

Callers

nothing calls this directly

Calls 8

lua_tosvtFunction · 0.85
is_class_objectFunction · 0.85
pointerMethod · 0.80
lua_pushintegerFunction · 0.50
saveMethod · 0.45
nameMethod · 0.45
wMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected