diff options
author | aunsane <aunsane@gmail.com> | 2017-09-28 20:16:27 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-09-29 00:38:40 +0300 |
commit | af9c3d7de7e35632d046575b5e4809a04abec816 (patch) | |
tree | d25ed109332d38540d6b044bd4471e4fc2d1b0c5 /plugins/MirLua/src/mlua_enviroment.h | |
parent | b640e652b54030de26a22f57494fa71561dd4e99 (diff) |
MirLua: added CMLuaEnviroment to execute lua code from extetnal source in sandbox
Diffstat (limited to 'plugins/MirLua/src/mlua_enviroment.h')
-rw-r--r-- | plugins/MirLua/src/mlua_enviroment.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/MirLua/src/mlua_enviroment.h b/plugins/MirLua/src/mlua_enviroment.h new file mode 100644 index 0000000000..4366d58d03 --- /dev/null +++ b/plugins/MirLua/src/mlua_enviroment.h @@ -0,0 +1,26 @@ +#ifndef _LUA_ENVIROMENT_H_ +#define _LUA_ENVIROMENT_H_ + +class CMLuaEnviroment +{ +private: + int id; + + void CreateEnviromentTable(); + +public: + lua_State *L; + + CMLuaEnviroment(lua_State *L); + virtual ~CMLuaEnviroment() { } + + static CMLuaEnviroment* GetEnviroment(lua_State *L); + static int GetEnviromentId(lua_State *L); + + int GetId() const; + + bool Load(int ind); + void Unload(); +}; + +#endif //_LUA_ENVIROMENT_H_ |