1
0
Fork 0
Commit Graph

120 Commits

Author SHA1 Message Date
Tiger Wang ecc8ffbd80 Compile the entire Lua stack as C++
* Fixes #5216
2021-06-25 10:17:53 +01:00
x12xx12x cc9f7c06b3
Add optional prefix parameter to LOG functions (#5229)
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-06-22 23:09:06 +01:00
Tiger Wang 34bf5c0d9d Rename files to match code 2021-05-04 16:11:56 +01:00
nshah25 8be1dd54bb
Add player statistics to API (#5193)
* Fixed issue #5166

Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-05-03 21:07:09 +01:00
Tiger Wang 90369deb5a
Change TimeOfDay to WorldDate (#5160)
* Change TimeOfDay to WorldDate

* Do not wrap at 20 minutes, continue incrementing
* Fixes #4737
* Fixes #5159
2021-03-20 20:58:19 +00:00
Tiger Wang 50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
Tiger Wang 090d8305e4 Warnings improvements
* 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
2020-12-18 21:03:40 +00:00
Tiger Wang f9ac6543ab C++17 stuff 2020-09-30 22:05:17 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* 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
2020-05-14 22:15:35 +00:00
peterbell10 154df6b09d
Cleanup unneeded globals (#4736) 2020-05-10 16:16:38 +00:00
peterbell10 57952505e5
Update fmt to 6.2.0 (#4718)
* Update fmt to 6.2.0
2020-05-05 22:52:14 +01:00
Mattes D 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Mattes D f84bab3bc2
Fixed Lua Vector unification. (#4652) 2020-04-15 00:23:24 +01:00
Mattes D c9a9b3c9d0
Bindings: Allow coercion between Vector3 subtypes. (#4646)
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.
2020-04-14 16:43:21 +02:00
Max Luchterhand 4f60eaabca
Wrong overload of function push() got called when pushing a cEntity*. (#4512)
* 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>
2020-03-21 16:00:26 +00:00
peterbell10 4727ed2084 Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
2018-09-24 21:33:39 +01:00
peterbell10 757231cc6e
Add the fmt library (#4065)
* 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.
2018-01-03 17:41:16 +00:00
peterbell10 e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
LogicParrot 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
mathiascode 02775e52c4 Minor changes (#3909) 2017-08-24 11:19:40 +02:00
peterbell10 b8dda388e0 Represent cItem::m_Lore as an AStringVector (#3882)
* Replace cItem::m_Lore with AStringVector

* Reword deprecation warning

* Fix lua bindings
2017-08-18 11:29:54 +01:00
Lane Kolbly 1ec85a2b2c Add cLuaWindow OnClicked Callback (#3901) 2017-08-17 16:27:43 +02:00
Dan Čermák 028ed77ca9 Fixed compilation for clang 4.0 & gcc 7.1 2017-08-04 11:17:39 +02:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas Pioch 0397535fa7 Removed unused forward declarations (#3888) 2017-08-03 15:10:29 +02:00
peterbell10 a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Mattes D e05ca49459 Moved ApiParamError into cLuaState. 2017-06-26 10:52:59 +02:00
Mattes D fe42538349 cBlockArea supports block entities. (#3795) 2017-06-24 11:58:06 +02:00
Mattes D ea6660721b NetworkSingleton: Fixed a throw warning in VS2017. (#3792)
Also fixed the misleading name.
2017-06-22 21:10:41 +02:00
Mattes D 801084c38c LuaState: Fixed VS2017's throw warnings for destructors. (#3779) 2017-06-19 11:08:08 +02:00
Mattes D 3c4e443ddc Fixed handling Lua errors in nested callbacks (#3755) 2017-06-09 12:16:31 +02:00
Mattes D 3d5ee3e5c7 Fixed Lua bindings for const objects. 2017-05-09 14:10:53 +02:00
Mattes D 7cc3fb098d DeadlockDetect now lists some tracked CS's stats. 2017-01-18 09:03:05 +01:00
Mattes D e9547101b1 LuaState: Fixed untracking references.
One thread may untrack a ref while another thread was closing the LuaState, which had emptied the tracked refs.
2017-01-15 12:54:58 +01:00
Mattes D fb0fc07579 Fixed race conditions and forgotten clear in Lua ref tracking. (#3530)
This fixes occasional crashes on plugin reload.
2017-01-13 10:31:05 +01:00
Mattes D f62711f97c LuaState: Fixed race condition in ref tracking. (#3529) 2017-01-09 15:56:16 +01:00
Mattes D 9af17f7c39 LuaState: Fixed stack balance when calling functions (#3428) 2016-11-10 16:46:31 +01:00
Mattes D 5ca371bb9a cUrlClient: Exported to Lua API. 2016-08-23 13:20:43 +02:00
Mattes D 11682d1386 cLuaState: Moved function param counting to PushCallPop() template.
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.
2016-08-22 20:10:48 +02:00
Mattes D 9493488e48 cLuaState: Added direct support for pushing a nil constant. 2016-08-22 20:09:56 +02:00
Mattes D 89c9c6fe46 cLuaState: Added support for optional params and AStringMap values. 2016-08-22 20:01:23 +02:00
Mattes D d4aff474c2 cLuaState: Added template to push multiple values in a single call. (#3331) 2016-08-21 11:03:10 +02:00
Mattes D 0f51f7e358 Fixed cWorld:ChunkStay bindings. (#3319)
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.
2016-08-14 16:26:31 +02:00
Mattes D 2d58789d66 Converted cLuaState::cTableRef to use cTrackedRef.
This makes the table-based callbacks resistent to LuaState unloads and safer to use.
2016-08-13 21:16:21 +02:00
Mattes D d1dee3c909 Fixed RasPi builds of unit tests.
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.
2016-08-04 20:47:53 +02:00
Mattes D bf88312a16 Converted cLuaState::cCallbackPtr into a UniquePtr. 2016-06-27 20:51:53 +02:00
Mattes D 7a6670d1d1 Removed dead code related to callbacks. 2016-06-27 20:51:52 +02:00