Skip to content

Commit

Permalink
[CSM] storage + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Mar 13, 2017
1 parent a50d07d commit ba66fce
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
4 changes: 3 additions & 1 deletion clientmods/preview/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local modname = core.get_current_modname() or "??"

-- This is an example function to ensure it's working properly, should be removed before merge
core.register_on_shutdown(function()
print("[PREVIEW] shutdown client")
Expand Down Expand Up @@ -38,5 +40,5 @@ core.register_chatcommand("dump", {
})

core.after(2, function()
print("After 2")
print("[PREVIEW] loaded " .. modname .. " mod")
end)
2 changes: 2 additions & 0 deletions src/script/clientscripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client.h"
#include "cpp_api/s_internal.h"
#include "lua_api/l_client.h"
#include "lua_api/l_storage.h"
#include "lua_api/l_sound.h"
#include "lua_api/l_util.h"

Expand Down Expand Up @@ -53,4 +54,5 @@ void ClientScripting::InitializeModApi(lua_State *L, int top)
ModApiUtil::InitializeClient(L, top);
ModApiClient::Initialize(L, top);
ModApiSound::Initialize(L, top);
ModApiStorage::Initialize(L, top);
}
1 change: 1 addition & 0 deletions src/script/lua_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ set(common_SCRIPT_LUA_API_SRCS
set(client_SCRIPT_LUA_API_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/l_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_mainmenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_storage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_sound.cpp
PARENT_SCOPE)
3 changes: 1 addition & 2 deletions src/script/lua_api/l_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include "lua_api/l_base.h"

class ModApiClient:
public ModApiBase
class ModApiClient: public ModApiBase
{
private:
// get_current_modname()
Expand Down
6 changes: 0 additions & 6 deletions src/script/lua_api/l_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,6 @@ void ModApiUtil::InitializeClient(lua_State *L, int top)

API_FCT(get_us_time);

API_FCT(setting_set);
API_FCT(setting_get);
API_FCT(setting_setbool);
API_FCT(setting_getbool);
API_FCT(setting_save);

API_FCT(parse_json);
API_FCT(write_json);

Expand Down
2 changes: 1 addition & 1 deletion src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,7 @@ void Server::getModNames(std::vector<std::string> &modlist)
modlist.push_back(it->name);
}

const std::string Server::getBuiltinLuaPath()
std::string Server::getBuiltinLuaPath()
{
return porting::path_share + DIR_DELIM + "builtin";
}
Expand Down
2 changes: 1 addition & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
virtual const ModSpec* getModSpec(const std::string &modname) const;
void getModNames(std::vector<std::string> &modlist);
std::string getBuiltinLuaPath();
inline const std::string &getWorldPath() const { return m_path_world; }
std::string getWorldPath() const { return m_path_world; }
std::string getModStoragePath() const;

inline bool isSingleplayer()
Expand Down

0 comments on commit ba66fce

Please sign in to comment.