diff options
author | Howaner <franzi.moos@googlemail.com> | 2015-03-09 22:39:11 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2015-03-09 22:39:11 +0100 |
commit | a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24 (patch) | |
tree | 38dba8f86163283d90d1d6d9d2fa420cb4e99231 /src/Bindings/LuaState.h | |
parent | Readded old comment (diff) | |
parent | Fixed client kick/crash if many block changes happend (diff) | |
download | cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.gz cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.bz2 cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.lz cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.xz cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.tar.zst cuberite-a96c21fc0d4326ffda93cc78c5dfcfc4bd034e24.zip |
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r-- | src/Bindings/LuaState.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index 97e6b47e1..159483634 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -59,6 +59,9 @@ class cTNTEntity; class cHopperEntity; class cBlockEntity; class cBoundingBox; +class cLuaTCPLink; +class cLuaServerHandle; +class cLuaUDPEndpoint; typedef cBoundingBox * pBoundingBox; typedef cWorld * pWorld; @@ -83,6 +86,10 @@ public: /** Creates a reference in the specified LuaState for object at the specified StackPos */ cRef(cLuaState & a_LuaState, int a_StackPos); + + /** Moves the reference from the specified instance into a newly created instance. + The old instance is then "!IsValid()". */ + cRef(cRef && a_FromRef); ~cRef(); @@ -178,6 +185,8 @@ public: /** Returns true if a_FunctionName is a valid Lua function that can be called */ bool HasFunction(const char * a_FunctionName); + void PushNil(void); + // Push a const value onto the stack (keep alpha-sorted): void Push(const AString & a_String); void Push(const AStringVector & a_Vector); @@ -202,6 +211,9 @@ public: void Push(cHopperEntity * a_Hopper); void Push(cItem * a_Item); void Push(cItems * a_Items); + void Push(cLuaServerHandle * a_ServerHandle); + void Push(cLuaTCPLink * a_TCPLink); + void Push(cLuaUDPEndpoint * a_UDPEndpoint); void Push(cMonster * a_Monster); void Push(cPickup * a_Pickup); void Push(cPlayer * a_Player); @@ -240,6 +252,9 @@ public: /** Retrieve value at a_StackPos, if it is a valid cWorld class. If not, a_Value is unchanged */ void GetStackValue(int a_StackPos, pWorld & a_Value); + + /** Store the value at a_StackPos as a reference. */ + void GetStackValue(int a_StackPos, cRef & a_Ref); /** Call the specified Lua function. Returns true if call succeeded, false if there was an error. |