aboutsummaryrefslogtreecommitdiff
path: root/serialize_lib/serialize.lua
Commit message (Collapse)AuthorAge
* Add 'serialize_lib/' from commit 'a6e8b8b4353863ad563a4d5187f40fea702ea2de'orwell962021-03-13
| | | | | | git-subtree-dir: serialize_lib git-subtree-mainline: b82e10051d69730b7459cceae4e4e8719b4445d0 git-subtree-split: a6e8b8b4353863ad563a4d5187f40fea702ea2de
* Remove serialize_lib in order to re-add it as subtreeorwell962021-03-13
|
* Fix serialisation: breach of contract, file left openBlockhead2021-01-18
| | | | Previous commit did not fix saving, but is kept because there is a corner case for which it is required (see MT forum)
* Some more serializer fixes (backported from new_lzb):orwell962021-01-12
| | | | | | - Move DUMP_DEBUG_SAVE block before the actual saving so it can be used to trace serializer errors - Don't crash on functions in data, ignore them silently - Increase the save interval
* serialize_lib: Allow empty strings in keyorwell962021-01-12
|
* Serialize_lib: finish up and add atomic apiorwell962021-01-12
|
* Implement basic serialization and file openingorwell962021-01-12
include "lua_api/l_minimap.h" #include "lua_api/l_modchannels.h" #include "lua_api/l_particles_local.h" #include "lua_api/l_storage.h" #include "lua_api/l_sound.h" #include "lua_api/l_util.h" #include "lua_api/l_item.h" #include "lua_api/l_nodemeta.h" #include "lua_api/l_localplayer.h" #include "lua_api/l_camera.h" ClientScripting::ClientScripting(Client *client): ScriptApiBase(ScriptingType::Client) { setGameDef(client); SCRIPTAPI_PRECHECKHEADER // Security is mandatory client side initializeSecurityClient(); lua_getglobal(L, "core"); int top = lua_gettop(L); lua_newtable(L); lua_setfield(L, -2, "ui"); InitializeModApi(L, top); lua_pop(L, 1); if (client->getMinimap()) LuaMinimap::create(L, client->getMinimap()); // Push builtin initialization type lua_pushstring(L, "client"); lua_setglobal(L, "INIT"); infostream << "SCRIPTAPI: Initialized client game modules" << std::endl; } void ClientScripting::InitializeModApi(lua_State *L, int top) { LuaItemStack::Register(L); StorageRef::Register(L); LuaMinimap::Register(L); NodeMetaRef::RegisterClient(L); LuaLocalPlayer::Register(L); LuaCamera::Register(L); ModChannelRef::Register(L); ModApiUtil::InitializeClient(L, top); ModApiClient::Initialize(L, top); ModApiStorage::Initialize(L, top); ModApiEnvMod::InitializeClient(L, top); ModApiChannels::Initialize(L, top); ModApiParticlesLocal::Initialize(L, top); } void ClientScripting::on_client_ready(LocalPlayer *localplayer) { lua_State *L = getStack(); LuaLocalPlayer::create(L, localplayer); } void ClientScripting::on_camera_ready(Camera *camera) { LuaCamera::create(getStack(), camera); }