aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_entity.cpp
Commit message (Expand)AuthorAge
* Tell on_punch to expect a return valueDuane Robertson2017-02-01
* Make entity on_punch have same signature and behaviour as player on_punchsapier2017-01-28
* Push error handler afresh each time lua_pcall is usedKahrl2015-08-27
* SAPI: Track last executed mod and include in error messageskwolekr2015-08-12
* Improve Script CPP API diagnosticskwolekr2015-08-05
* Fix object reference pushing functions when called from coroutinesShadowNinja2014-10-07
* Use "core" namespace internallyShadowNinja2014-05-08
* Only push the Lua error handler onceShadowNinja2014-04-27
* Pass a errfunc to lua_pcall to get a tracebackShadowNinja2013-11-15
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Add an option to disable object <-> object collision for Lua entitiesPilzAdam2013-07-20
* Move scriptapi to separate folder (by sapier)sapier2013-05-25
blic License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef S_BASE_H_ #define S_BASE_H_ #include <iostream> #include <string> extern "C" { #include <lua.h> } #include "irrlichttypes.h" #include "jmutex.h" #include "jmutexautolock.h" #include "common/c_types.h" #define SCRIPTAPI_LOCK_DEBUG class Server; class Environment; class GUIEngine; class ServerActiveObject; class ScriptApiBase { public: ScriptApiBase(); virtual ~ScriptApiBase(); bool loadMod(const std::string &scriptpath, const std::string &modname); bool loadScript(const std::string &scriptpath); /* object */ void addObjectReference(ServerActiveObject *cobj); void removeObjectReference(ServerActiveObject *cobj); protected: friend class LuaABM; friend class InvRef; friend class ObjectRef; friend class NodeMetaRef; friend class ModApiBase; friend class ModApiEnvMod; friend class LuaVoxelManip; lua_State* getStack() { return m_luastack; } void realityCheck(); void scriptError(const char *fmt, ...); void stackDump(std::ostream &o); Server* getServer() { return m_server; } void setServer(Server* server) { m_server = server; } Environment* getEnv() { return m_environment; } void setEnv(Environment* env) { m_environment = env; } GUIEngine* getGuiEngine() { return m_guiengine; } void setGuiEngine(GUIEngine* guiengine) { m_guiengine = guiengine; } void objectrefGetOrCreate(ServerActiveObject *cobj); void objectrefGet(u16 id); JMutex m_luastackmutex; #ifdef SCRIPTAPI_LOCK_DEBUG bool m_locked; #endif private: lua_State* m_luastack; Server* m_server; Environment* m_environment; GUIEngine* m_guiengine; }; #endif /* S_BASE_H_ */