summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Reverted moving Lua to C++.Mattes D2024-03-151-1/+4
|
* Removed all Printf-family functions from StringUtils.Mattes D2023-05-161-22/+3
| | | | | Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code.
* Compile the entire Lua stack as C++Tiger Wang2021-06-251-4/+1
| | | | * Fixes #5216
* Add optional prefix parameter to LOG functions (#5229)x12xx12x2021-06-231-0/+1
| | | Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Rename files to match codeTiger Wang2021-05-041-1/+1
|
* Add player statistics to API (#5193)nshah252021-05-031-0/+2
| | | | | | * Fixed issue #5166 Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Change TimeOfDay to WorldDate (#5160)Tiger Wang2021-03-201-3/+0
| | | | | | | * Change TimeOfDay to WorldDate * Do not wrap at 20 minutes, continue incrementing * Fixes #4737 * Fixes #5159
* Fix debug macro situation (#5114)Tiger Wang2021-01-261-1/+1
| | | Use the standard NDEBUG.
* zlib -> libdeflate (#5085)Tiger Wang2021-01-111-0/+2
| | | | | | + Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite
* Warnings improvementsTiger Wang2020-12-181-3/+2
| | | | | | | | | * Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler
* C++17 stuffTiger Wang2020-09-301-1/+1
|
* Enable some more clang-tidy linter checks (#4738)peterbell102020-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Avoid inefficient AString -> c_str() -> AString round trip * Avoid redundant string init expressions * Avoid unnecessary return, continue, etc. * Add .clang-format to help with clang-tidy fix-its * Avoid unnecessary passing by value * Avoid unnecessary local copying * Avoid copying in range-for loops * Avoid over-complicated boolean expressions * Some violations missed by my local clang-tidy * Allow unnecessary continue statements * Add brackets * Another expression missed locally * Move BindingsProcessor call into clang-tidy.sh and add space * Fix pushd not found error * Different grouping of CheckBlockInteractionRate
* Cleanup unneeded globals (#4736)peterbell102020-05-101-3/+3
|
* Update fmt to 6.2.0 (#4718)peterbell102020-05-051-1/+1
| | | * Update fmt to 6.2.0
* Using Super.Mattes D2020-04-161-3/+4
|
* Fixed Lua Vector unification. (#4652)Mattes D2020-04-151-0/+4
|
* Bindings: Allow coercion between Vector3 subtypes. (#4646)Mattes D2020-04-141-3/+17
| | | | | In manually bound functions, allows one to use any Vector3<T> value, as well as a {x, y, z} table, in Lua as any Vector3<T> parameter. Has example in Debuggers' /vector command. Unfortunately doesn't work in auto-bindings.
* Wrong overload of function push() got called when pushing a cEntity*. (#4512)Max Luchterhand2020-03-211-0/+1
| | | | | | | * Now having two funcs, Push(cEntity* ..) and Push(const cEntity* ...). For now, the const function just casts away the const qualifier and passes to the other. Co-authored-by: mluchterhand <mluchterhand@max.de>
* Add a formatting function for Vector3 (#4282)peterbell102018-09-241-3/+21
| | | | | | | | | | * Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG
* Add the fmt library (#4065)peterbell102018-01-031-1/+2
| | | | | | | * Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style.
* Replace ItemCallbacks with lambdas (#3993)peterbell102017-09-111-2/+3
|
* Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot2017-09-021-1/+1
| | | | This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
* Replace ItemCallbacks with lambdas (#3948)peterbell102017-09-011-1/+1
|
* Add cUUID class (#3871)peterbell102017-08-251-0/+5
|
* Minor changes (#3909)mathiascode2017-08-241-1/+1
|
* Represent cItem::m_Lore as an AStringVector (#3882)peterbell102017-08-181-0/+1
| | | | | | | | * Replace cItem::m_Lore with AStringVector * Reword deprecation warning * Fix lua bindings
* Add cLuaWindow OnClicked Callback (#3901)Lane Kolbly2017-08-171-0/+1
|
* Fixed compilation for clang 4.0 & gcc 7.1Dan Čermák2017-08-041-0/+3
|
* Remove double includes part 2 (#3890)peterbell102017-08-031-2/+0
|
* Removed unused forward declarations (#3888)Lukas Pioch2017-08-031-1/+0
|
* Remove smart pointer macrospeterbell102017-07-211-7/+7
|
* Moved ApiParamError into cLuaState.Mattes D2017-06-261-0/+9
|
* cBlockArea supports block entities. (#3795)Mattes D2017-06-241-0/+4
|
* NetworkSingleton: Fixed a throw warning in VS2017. (#3792)Mattes D2017-06-221-3/+3
| | | Also fixed the misleading name.
* LuaState: Fixed VS2017's throw warnings for destructors. (#3779)Mattes D2017-06-191-3/+3
|
* Fixed handling Lua errors in nested callbacks (#3755)Mattes D2017-06-091-1/+36
|
* Fixed Lua bindings for const objects.Mattes D2017-05-091-8/+2
|
* DeadlockDetect now lists some tracked CS's stats.Mattes D2017-01-181-0/+7
|
* LuaState: Fixed untracking references.Mattes D2017-01-151-1/+2
| | | | One thread may untrack a ref while another thread was closing the LuaState, which had emptied the tracked refs.
* Fixed race conditions and forgotten clear in Lua ref tracking. (#3530)Mattes D2017-01-131-9/+15
| | | This fixes occasional crashes on plugin reload.
* LuaState: Fixed race condition in ref tracking. (#3529)Mattes D2017-01-091-1/+1
|
* LuaState: Fixed stack balance when calling functions (#3428)Mattes D2016-11-101-2/+55
|
* cUrlClient: Exported to Lua API.Mattes D2016-08-231-0/+24
|
* cLuaState: Moved function param counting to PushCallPop() template.Mattes D2016-08-221-0/+2
| | | | The Push() functions can be used not only for function params, but also returns or temporaries, so it doesn't make sense to count the params there.
* cLuaState: Added direct support for pushing a nil constant.Mattes D2016-08-221-3/+9
|
* cLuaState: Added support for optional params and AStringMap values.Mattes D2016-08-221-4/+35
|
* cLuaState: Added template to push multiple values in a single call. (#3331)Mattes D2016-08-211-3/+12
|
* Fixed cWorld:ChunkStay bindings. (#3319)Mattes D2016-08-141-6/+73
| | | | | | Introduced new cLuaState::cOptionalCallback for representing optional callbacks (nil from Lua side). Introduced new cLuaState::cStackTable class for easy access to Lua table's elements. Fixes #3305.
* Converted cLuaState::cTableRef to use cTrackedRef.Mattes D2016-08-131-62/+139
| | | | This makes the table-based callbacks resistent to LuaState unloads and safer to use.
* Fixed RasPi builds of unit tests.Mattes D2016-08-041-2/+1
| | | | | On RasPi with gcc 4.8.2, the asserts wouldn't compile when tests were enabled. Enforced the assumption that ASSERT code is generated only in Debug builds.
* Converted cLuaState::cCallbackPtr into a UniquePtr.Mattes D2016-06-271-1/+3
|
* Removed dead code related to callbacks.Mattes D2016-06-271-9/+1
|
* LuaState: Implemented proper locking for cCallback.Mattes D2016-06-271-14/+43
|
* Changed cLuaWindow callbacks to use cLuaState::cCallback.Mattes D2016-06-271-2/+22
|
* Changed plugin hook registrations to use cLuaState::cCallback.Mattes D2016-06-271-1/+5
|
* Added cLuaState::cCallback for representing (resettable) Lua callbacks.Mattes D2016-06-271-3/+86
|
* LuaState: Inter-plugin calls now support simple tables. (#3220)Mattes D2016-05-311-2/+14
|
* Revert "Lua callback"Mattes D2016-03-211-112/+5
|
* Changed cLuaWindow callbacks to use cLuaState::cCallback.Mattes D2016-03-171-2/+22
|
* Changed plugin hook registrations to use cLuaState::cCallback.Mattes D2016-03-171-1/+5
|
* Added cLuaState::cCallback for representing (resettable) Lua callbacks.Mattes D2016-03-171-3/+86
|
* Bulk clearing of whitespaceLogicParrot2016-02-051-49/+49
|
* Revised the explosion-related Lua API and docs.Mattes D2015-12-181-1/+3
| | | | Fixes #2746.
* Added PieceStructures generator.Mattes D2015-12-011-6/+18
|
* Added LuaState tracker and memory stats logging.Mattes D2015-09-281-0/+37
|
* Extended and fixed the cFile API.Mattes D2015-09-261-0/+1
|
* Silenced and fixed many warning messages across multiple files.Samuel Barney2015-07-291-0/+1
|
* Externalized cPrefabPiecePool self-test.Mattes D2015-06-191-3/+4
|
* LuaState: Added support for config-style usage.Mattes D2015-06-171-26/+123
| | | | | Globals and table values can be queried from the Lua state easily. Use perfect forwarding.
* Made -Weverything an error.tycho2015-05-241-1/+1
|
* Added LuaState support for all integral typestycho2015-05-191-14/+38
| | | | All so added error handling for out of range values
* Lua: Break into ZBS debugger on API errors.Mattes D2015-05-161-0/+3
|
* ToLua now generates cLuaState::Push() and GetStackValue()Mattes D2015-05-121-74/+11
| | | | | For classes exported through ToLua it generates the cLuaState::Push() and cLuaState::GetStackValue() functions, as well as the supporting forward declarations and typedefs. Renamed virtual_method_hooks.lua to BindingsProcessor.lua since it no longer provides virtual method hooks and instead does additional processing when generating the bindings.
* OnExecuteCommand hook can override the command result (crXXX).Mattes D2015-05-101-1/+2
|
* Fixed some Visual Studio warningsTiger Wang2015-05-091-0/+1
|
* Added support for additional data in the ParticleEffect Packettycho2015-05-071-0/+6
| | | | Also started refactoring how broadcasts are handled
* Added cBlockArea:GetNonAirCropRelCoords() API function.Mattes D2015-04-291-0/+4
| | | | Fixes #1915.
* Refactored ManualBindings' callbacks using templates.Mattes D2015-04-231-0/+3
| | | | | This is a bit easier to read, has better error reporting and fixes a few subtle bugs. Fixes #1889.
* Implemented cPluginManager:DoWithPlugin(), fixed ForEachPlugin().Mattes D2015-04-231-39/+36
| | | | Both functions are exported as static.
* cNetwork: Added UDP API.Mattes D2015-02-201-0/+2
|
* LuaAPI: Added client TLS support for TCP links.Mattes D2015-02-121-0/+2
|
* Exported cServerHandle and cNetwork:Listen to Lua.Mattes D2015-02-041-0/+9
| | | | Also added an example to the NetworkTest plugin.
* cNetwork: Exported the Connect() method and cTCPLink class to Lua.Mattes D2015-02-041-0/+2
|
* Switched LuaState to use sizeof...tycho2015-01-311-15/+1
|
* Initial convertion of a_Dt to std::chronoTycho2015-01-111-0/+1
| | | | also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
* cLuaState: Fixed errors on non-existent callbacks.Mattes D2014-10-311-1/+5
| | | | This mostly affected table-based callbacks, such as the cLineBlockTracer. If a callback didn't exist, the code would still push its arguments on the stack, breaking the next callback.
* En masse NULL -> nullptr replaceTiger Wang2014-10-231-3/+3
|
* Fixed minor style issues.Mattes D2014-10-191-1/+1
|
* Use universal referencesworktycho2014-10-161-4/+4
|
* cLuaState::Call() uses variadic templates.Mattes D2014-10-151-3/+75
| | | | (doesn't compile)
* Fixed crash in ForEachEntityInBox API.madmaxoft2014-10-061-1/+1
| | | | Fixes #1511.
* Removed a few unnessicary includesTycho2014-09-261-1/+0
|
* LuaState: Fixed referenced function pushing.madmaxoft2014-09-031-0/+8
| | | | The references are no longer destroyed by the call.
* Added cWorld::ForEachEntityInBox()madmaxoft2014-09-031-0/+10
|
* cLuaState: Fixed Vector3<> names pushed to Lua.Mattes D2014-08-221-0/+3
|
* Normalized comments.madmaxoft2014-07-171-1/+1
| | | | | 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.
* Merge pull request #1144 from mc-server/LuaCodeGenMattes D2014-07-061-622/+7
|\ | | | | Lua code gen
| * Tolua generates LuaState_Call.inc file.madmaxoft2014-07-011-622/+7
| |
* | Changed OnWeatherChanging hook to always read the returned weather.madmaxoft2014-07-031-0/+5
|/ | | | Ref.: http://forum.mc-server.org/showthread.php?tid=1512
* Fixed OnProjectileHitBlock bindings.madmaxoft2014-06-031-20/+24
| | | | Also sorted the various cLuaState::Push() functions.
* Fixed error when the hook gets called.STRWarrior2014-03-291-0/+2
|
* Made pushing plain pointer to Lua a valid operation, with a warning.madmaxoft2014-03-201-1/+1
| | | | 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)
* Errors in Lua don't include the error handler in the stack trace.madmaxoft2014-03-191-2/+2
| | | | Fixes #817.
* Added Noreturn attribtes to a couple of functions and made a missing noreturn an errorTycho2014-03-141-1/+1
|
* Merge remote-tracking branch 'xdot/master'madmaxoft2014-03-121-1/+2
|\
| * Unified Vector classesandrew2014-03-111-1/+2
| |
* | Moved Lua API registering into a separate function.madmaxoft2014-03-121-1/+6
|/ | | | This will allow us to use Lua as lite-config files as well, should we want to.
* cLuaState: Made public the GetStackValue() functions.madmaxoft2014-03-041-48/+49
|
* Add Lua plugin path to package.path and .cpath.madmaxoft2014-02-171-0/+3
| | | | Fixes #693.
* Added cLuaState::CheckParamFunctionOrNil().madmaxoft2014-02-111-0/+3
| | | | Also fixed error reporting for the two function-checking functions.
* cLuaState::cRef can be unbound and re-bound.madmaxoft2014-02-091-2/+15
| | | | This will allow us to store Lua references as member variables in classes and initialize those later than in the constructor.
* Implemented cPluginManager:CallPlugin() API.madmaxoft2014-01-211-58/+85
| | | | 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.
* cLuaState can now check function params.madmaxoft2014-01-191-0/+3
|
* cCreeper is no longer available in API.madmaxoft2014-01-131-1/+0
| | | | Has been replaced by cMonster.
* Lua errors display stack trace.madmaxoft2014-01-111-0/+2
| | | | Fixes #418.
* Removed internal methods from public cLuaState interface.madmaxoft2014-01-111-38/+60
| | | | | | | 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.
* implemented the recommendations Xoft gave.STRWarrior2013-12-311-0/+1
|
* converted commneted paramater names to the unused macroTycho Bickerstaff2013-12-221-20/+41
|
* Merge branch 'master' of github.com:mc-server/MCServerTycho Bickerstaff2013-12-221-0/+19
|\
| * Added HOOK_PLUGINS_LOADED.madmaxoft2013-12-291-0/+19
| | | | | | | | This fixes #482.
* | Root is now warnings cleanTycho Bickerstaff2013-12-211-20/+20
|/
* Moved bindings-related to a Bindings subfolder.madmaxoft2013-12-081-0/+833
Ref.: #407