diff options
author | Mattes D <github@xoft.cz> | 2016-03-02 10:12:43 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-03-17 19:29:01 +0100 |
commit | eb044e140e593c037976bacd56c5a50f133d3ba2 (patch) | |
tree | f6abe2a3a007cf1490f9c3f285abaef798d7e6cd /src/Bindings/LuaState.cpp | |
parent | Removed cWebPlugin, WebAdmin uses cLuaState::cCallback. (diff) | |
download | cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar.gz cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar.bz2 cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar.lz cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar.xz cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.tar.zst cuberite-eb044e140e593c037976bacd56c5a50f133d3ba2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaState.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 8e4f48275..91a9ef4d6 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -170,6 +170,16 @@ void cLuaState::cCallback::Clear(void) +bool cLuaState::cCallback::IsValid(void) +{ + cCSLock lock(m_CS); + return m_Ref.IsValid(); +} + + + + + void cLuaState::cCallback::Invalidate(void) { cCSLock Lock(m_CS); @@ -935,6 +945,24 @@ bool cLuaState::GetStackValue(int a_StackPos, bool & a_ReturnedVal) +bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback) +{ + return a_Callback.RefStack(*this, a_StackPos); +} + + + + + +bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback) +{ + return a_Callback->RefStack(*this, a_StackPos); +} + + + + + bool cLuaState::GetStackValue(int a_StackPos, cPluginManager::CommandResult & a_Result) { if (lua_isnumber(m_LuaState, a_StackPos)) @@ -959,15 +987,6 @@ bool cLuaState::GetStackValue(int a_StackPos, cRef & a_Ref) -bool cLuaState::GetStackValue(int a_StackPos, cCallback & a_Callback) -{ - return a_Callback.RefStack(*this, a_StackPos); -} - - - - - bool cLuaState::GetStackValue(int a_StackPos, double & a_ReturnedVal) { if (lua_isnumber(m_LuaState, a_StackPos)) |