summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-05-09More style checking.Mattes D1-2/+2
Spaces around some operators are checked.
2015-05-09Fixed some Visual Studio warningsTiger Wang1-3/+15
2015-05-07Fixed inter-plugin calls.Mattes D1-9/+4
When an inter-plugin call failed due to function not found, the server would maul the LuaState and "yield". Fixes #1959.
2015-05-07Added support for additional data in the ParticleEffect Packettycho1-0/+41
Also started refactoring how broadcasts are handled
2015-04-29Added cBlockArea:GetNonAirCropRelCoords() API function.Mattes D1-1/+31
Fixes #1915.
2015-04-23Refactored ManualBindings' callbacks using templates.Mattes D1-0/+18
This is a bit easier to read, has better error reporting and fixes a few subtle bugs. Fixes #1889.
2015-04-23Implemented cPluginManager:DoWithPlugin(), fixed ForEachPlugin().Mattes D1-19/+89
Both functions are exported as static.
2015-02-20cNetwork: Added UDP API.Mattes D1-0/+12
2015-02-12LuaAPI: Added client TLS support for TCP links.Mattes D1-0/+12
2015-02-04Exported cServerHandle and cNetwork:Listen to Lua.Mattes D1-0/+33
Also added an example to the NetworkTest plugin.
2015-02-04cNetwork: Exported the Connect() method and cTCPLink class to Lua.Mattes D1-0/+12
2015-01-18Fixed type-conversion warnings.Mattes D1-1/+1
2015-01-11Initial convertion of a_Dt to std::chronoTycho1-0/+7
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-27/+27
2014-10-22LuaState: Projectiles are pushed using their full class.Mattes D1-1/+1
2014-10-21cLuaState: cEntity is pushed with specific type.Mattes D1-7/+48
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-27/+27
2014-10-20Fixed a potential crash in cEntity bindings.Mattes D1-2/+6
2014-10-19cLuaState: cMonster descendants don't push their specific type.Mattes D1-1/+10
The individual mob types aren't exported to Lua, so pushing them would crash the server.
2014-10-19cLuaState: cBlockEntity descendants are pushed with proper class type.Mattes D1-1/+1
2014-10-19LuaState: Pushing a cEntity pushes the correct class name.Mattes D1-1/+3
This makes Lua scripts easier, as they don't need to cast values from cEntity to the specific descendant.
2014-10-06Fixed crash in ForEachEntityInBox API.madmaxoft1-3/+11
Fixes #1511.
2014-09-03LuaState: Fixed class value-getting off the stack.madmaxoft1-4/+4
2014-09-03Added cWorld::ForEachEntityInBox()madmaxoft1-0/+26
2014-08-22cLuaState: Fixed Vector3<> names pushed to Lua.Mattes D1-5/+41
2014-07-19Fixed style: spaces after commas.madmaxoft1-2/+1
2014-07-17Normalized comments.madmaxoft1-2/+2
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-03Changed OnWeatherChanging hook to always read the returned weather.madmaxoft1-0/+12
Ref.: http://forum.mc-server.org/showthread.php?tid=1512
2014-06-03Fixed OnProjectileHitBlock bindings.madmaxoft1-61/+86
Also sorted the various cLuaState::Push() functions.
2014-03-29Fixed error when the hook gets called.STRWarrior1-0/+12
2014-03-25More fixes to get it to compile for me on Mac 10.9. Mostly just newline additions, but some of the unused variables were causing errors, so I wrapped them in #ifndef __APPLE__ calls, since I didn't know if they were going to be used in the future.Samuel Barney1-0/+1
Also had to undefine TOLUA_TEMPLATE_BIND a couple of times.
2014-03-20Made pushing plain pointer to Lua a valid operation, with a warning.madmaxoft1-2/+3
This is used for exotic explosions, and the NORETURNDEBUG macro caused MSVC warnings across the entire cLuaState class (MSVC marked ALL Push() function overloads as non-returning)
2014-03-19Errors in Lua don't include the error handler in the stack trace.madmaxoft1-5/+5
Fixes #817.
2014-03-12Fixed Lua string return values.madmaxoft1-4/+0
Fixes #773.
2014-03-12Moved Lua API registering into a separate function.madmaxoft1-1/+9
This will allow us to use Lua as lite-config files as well, should we want to.
2014-03-11Fixed a load of format string errorsTycho1-1/+3
2014-03-07Fixed warningsTycho1-0/+1
2014-03-04cLuaState: Made public the GetStackValue() functions.madmaxoft1-6/+12
2014-03-02Manually exported g_Block tablesandrew1-0/+2
2014-02-26Attempted fix for several GCC warnings.madmaxoft1-0/+7
2014-02-17Add Lua plugin path to package.path and .cpath.madmaxoft1-0/+26
Fixes #693.
2014-02-11Added cLuaState::CheckParamFunctionOrNil().madmaxoft1-2/+34
Also fixed error reporting for the two function-checking functions.
2014-02-11Fixed nested plugin function calls.madmaxoft1-6/+9
2014-02-10cLuaState: Stack traces don't include ghost 0-th element.madmaxoft1-1/+1
2014-02-09cLuaState::cRef can be unbound and re-bound.madmaxoft1-7/+45
This will allow us to store Lua references as member variables in classes and initialize those later than in the constructor.
2014-02-04Removed a useless check in cLuaState.madmaxoft1-3/+1
2014-02-04Fixed calling plugins with userdata params.madmaxoft1-0/+1
2014-02-04Removed a leftover debug message.madmaxoft1-1/+0
2014-02-04Fixed error handling in cPluginManager:CallPlugin() API.madmaxoft1-2/+5
Fixed: When the called function malfunctioned, the entire plugin's call was aborted.
2014-02-04Improved error resistance in cPluginManager:CallPlugin().madmaxoft1-0/+8
Fixed: If the call failed, all the next plugin calls would fail as well.
2014-01-29Lua: Fixed an error in table-functions callbacks.madmaxoft1-1/+5
2014-01-21Implemented cPluginManager:CallPlugin() API.madmaxoft1-16/+183
This function supersedes cPlugin:Call(), is safer to use in regards to multithreading and once again removes the need for the cPlugin class being exported at all.
2014-01-19cLuaState can now check function params.madmaxoft1-0/+34
2014-01-13cCreeper is no longer available in API.madmaxoft1-12/+0
Has been replaced by cMonster.
2014-01-11Lua errors display stack trace.madmaxoft1-3/+25
Fixes #418.
2014-01-11Removed internal methods from public cLuaState interface.madmaxoft1-9/+17
PushFunction(), CallFunction() and GetReturn() are not to be called independently, but rather only by using the Call() templated overrides. Push() needs to be left in the public part, it is used for pushing results in the ManualBindings. Preparation for #418.
2014-01-07LuaState can push strings with embedded NULs.madmaxoft1-1/+1
This also marginally improves performance, since a strlen() isn't called (inside lua_pushstring()), the string length is stored in the AString object directly.
2013-12-31implemented the recommendations Xoft gave.STRWarrior1-0/+12
2013-12-27Made cmake compilation possible on Windows.madmaxoft1-2/+2
2013-12-08Fixed tolua++ compilation.madmaxoft1-1/+1
Duplicate files, wrong includes, const-incorrect code...
2013-12-08Moved bindings-related to a Bindings subfolder.madmaxoft1-0/+0
Ref.: #407
2013-11-26Fixed loads more of them.Alexander Harkness1-1/+1
2013-11-24Attempt to fix compilationTiger Wang1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-22Added cFile:GetFolderContents().madmaxoft1-0/+33
Fix 162.
2013-11-22Fixed cRoot:GetFurnaceRecipe() Lua binding.madmaxoft1-0/+33
2013-08-21cLuaState: Added LogStackTrace() and GetTypeText() utility functionsmadmaxoft1-0/+43
2013-08-19Finished renaming cPlugin_NewLua to cPluginLua.madmaxoft1-2/+2
2013-08-18Fixed assert failures in cLuaState when using it for pushing a StringVector.madmaxoft1-31/+0
2013-08-15Attempting to fix CentOS / gcc 4.4.7 compilation problem.madmaxoft1-1/+1
Reported by ThijsD in the forum http://forum.mc-server.org/showthread.php?tid=1220
2013-08-11Added the OnHopperPullingItem and OnHopperPushingItem hooks.madmaxoft1-0/+26
Requested in FS 412, slightly modified the params.
2013-08-09Added OnExploding() and OnExploded() hooks.madmaxoft1-0/+64
As requested in FS 413, with extra parameters: World, BlockX, BlockY, BlockZ, Size, CanCauseFire, Source, SourceData OnExploding() can return 3 values: StopHook, CanCauseFire, ExplosionSize
2013-08-08Removed LuaScript.madmaxoft1-0/+26
The WebAdmin now uses LuaState directly to call the one function it needs.
2013-08-08cPlugin_NewLua is now completely rewritten to use templated LuaState calls.madmaxoft1-6/+60
2013-08-08LuaState refactoring: using templates for hook function calls.madmaxoft1-13/+130
This simplifies calling Lua functions considerably, it's almost like calling a C++ function, only with an extra argument to delimit args from returned values.
2013-08-08Addeed OnSpawningEntity, OnSpawnedEntity, OnSpawningMonster, OnSpawnedMonster hooks.madmaxoft1-0/+13
As requested in FS 418.
2013-08-07cLuaState has reference management, param checking and a fixed destructor.madmaxoft1-1/+186
References are now managed as RAII objects, cLuaState::cRef. Destructor now calls correct function, either Close() or Detach(), based on the owned-ness of the lua_State *.
2013-08-06cLuaScript now uses cLuaStatemadmaxoft1-1/+1
2013-08-06cLuaState now tracks the function name and number of argsmadmaxoft1-6/+182
2013-08-06cLuaState can now contain a detached LuaState, too.madmaxoft1-0/+67
This will be useful for cases when we get a lua_State * from the outside and are asked to perform operations on it.
2013-08-04LuaState refactoring: initial part.madmaxoft1-0/+218
The cLuaState class is a wrapper for the lua_State * and for the common functions on it. The cPlugin_NewLua has been rewritten to use it instead of the raw pointer. Part of #33