1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

[CSM] Client side modding

* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
This commit is contained in:
Loic Blot 2017-01-21 15:02:08 +01:00 committed by Loïc Blot
parent c9492b4d37
commit 2efae3ffd7
37 changed files with 488 additions and 64 deletions

View file

@ -53,7 +53,7 @@ class PlayerSAO;
class IRollbackManager;
struct RollbackAction;
class EmergeManager;
class GameScripting;
class ServerScripting;
class ServerEnvironment;
struct SimpleSoundSpec;
class ServerThread;
@ -274,7 +274,7 @@ public:
Inventory* createDetachedInventory(const std::string &name, const std::string &player="");
// Envlock and conlock should be locked when using scriptapi
GameScripting *getScriptIface(){ return m_script; }
ServerScripting *getScriptIface(){ return m_script; }
// actions: time-reversed list
// Return value: success/failure
@ -295,8 +295,8 @@ public:
IWritableNodeDefManager* getWritableNodeDefManager();
IWritableCraftDefManager* getWritableCraftDefManager();
const std::vector<ModSpec> &getMods() const { return m_mods; }
const ModSpec* getModSpec(const std::string &modname) const;
virtual const std::vector<ModSpec> &getMods() const { return m_mods; }
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; }
@ -540,7 +540,7 @@ private:
// Scripting
// Envlock and conlock should be locked when using Lua
GameScripting *m_script;
ServerScripting *m_script;
// Item definition manager
IWritableItemDefManager *m_itemdef;