diff --git a/src/client/client.cpp b/src/client/client.cpp index d21de766f..542195ee1 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -162,11 +162,11 @@ Client::Client( } { - //TODO: network packets - //TODO: check that *client_builtin* is not overridden + //FIXME: network packets + //FIXME: check that *client_builtin* is not overridden std::string enable_sscsm = g_settings->get("enable_sscsm"); - if (enable_sscsm == "singleplayer") { + if (enable_sscsm == "singleplayer") { //FIXME: enum auto event1 = std::make_unique(); event1->files.emplace_back("sscsm_test0:init.lua", R"=+=( diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index 984ff0abb..bd4acdf81 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -76,7 +76,7 @@ ScriptApiBase::ScriptApiBase(ScriptingType type): lua_atpanic(m_luastack, &luaPanic); - if (m_type == ScriptingType::Client) + if (m_type == ScriptingType::Client || m_type == ScriptingType::SSCSM) clientOpenLibs(m_luastack); else luaL_openlibs(m_luastack); @@ -213,7 +213,8 @@ void ScriptApiBase::checkSetByBuiltin() if (getType() == ScriptingType::Server || (getType() == ScriptingType::Async && m_gamedef) || getType() == ScriptingType::Emerge || - getType() == ScriptingType::Client) { + getType() == ScriptingType::Client || + getType() == ScriptingType::SSCSM) { CHECK(CUSTOM_RIDX_READ_NODE, "read_node"); CHECK(CUSTOM_RIDX_PUSH_NODE, "push_node"); } diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index 31af49186..6f3f35fae 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -392,7 +392,6 @@ void ScriptApiSecurity::initializeSecuritySSCSM() "next", "pairs", "pcall", - "print", //TODO "rawequal", "rawget", "rawset", @@ -403,7 +402,7 @@ void ScriptApiSecurity::initializeSecuritySSCSM() "tonumber", "tostring", "type", - "unpack", //TODO: replace, because of UB in some lua versions + "unpack", "_VERSION", "xpcall", // Completely safe libraries @@ -423,7 +422,6 @@ void ScriptApiSecurity::initializeSecuritySSCSM() "getinfo", // used by builtin and unset before mods load //TODO "traceback" //TODO: is this fine, or does it print paths of C functions? }; - #if USE_LUAJIT static const char *jit_whitelist[] = { "arch", @@ -469,7 +467,7 @@ void ScriptApiSecurity::initializeSecuritySSCSM() lua_pop(L, 1); // Pop old OS - // Copy safe debug functions //TODO + // Copy safe debug functions lua_getglobal(L, "debug"); lua_newtable(L); copy_safe(L, debug_whitelist, sizeof(debug_whitelist)); diff --git a/src/script/lua_api/l_sscsm.h b/src/script/lua_api/l_sscsm.h index d21785ecd..09a70163e 100644 --- a/src/script/lua_api/l_sscsm.h +++ b/src/script/lua_api/l_sscsm.h @@ -9,12 +9,6 @@ class ModApiSSCSM : public ModApiBase { private: - // print(text) - static int l_print(lua_State *L); - - // log([level], text) - static int l_log(lua_State *L); - // get_node_or_nil(pos) static int l_get_node_or_nil(lua_State *L);