86 Commits

Author SHA1 Message Date
Tixx
9a0270cb09 Return nil instead of "" when there's no client 2024-09-28 21:05:04 +02:00
Tixx
caafb216c9 Add MP.GetPlayerRole(player_id) 2024-09-19 07:51:07 +02:00
20dka
45bb6ca6f3 fill out lua EventName 2024-08-28 22:15:57 +02:00
SaltySnail
012ce08b91 Add proper lua server stacktraces 2024-07-14 03:18:59 +02:00
Lion
b0cf5c7838
Fix lua assertions crashing the server (#198)
The server would crash on a Lua plugin ASSERT() - this now instead
prints an error. May still lead to weird behavior, but less weird than a
crash.
2024-05-08 11:48:56 +02:00
Lion
586510041d
fix TriggerGlobalEvent not passing event arguments correctly (#307)
This is supposed to close #106 (The code is by @lionkor from
b068a9b48f)
2024-05-08 11:47:23 +02:00
Neptnium
d81087b5af
fix TriggerGlobalEvent not passing event arguments correctly (closes #106) 2024-04-18 18:43:04 +02:00
Lion Kortlepel
946c1362e1 add custom profiling via Debug(Start|Stop)Profile 2024-03-06 10:27:22 +01:00
Lion Kortlepel
7deea900fb add Util.DebugExecutionTime 2024-03-06 10:27:22 +01:00
Lion Kortlepel
aff537afdf add AGPL-3.0 license header 2024-01-23 21:00:11 +01:00
Lion Kortlepel
03307e71fb
use a beammp_lua_errorf instead of a std::terminate on sol2 assertion failure 2023-12-05 18:25:27 +01:00
Lion Kortlepel
667da22b0e
Merge remote-tracking branch 'origin/master' into new-buildsystem 2023-12-05 17:59:05 +01:00
Lion Kortlepel
a6eb2f7bfe
switch to vcpkg+cmake, add debian build to workflows
using lionkor's template (MIT licensed)

This is a combination of 64 commits.
2023-12-05 17:57:19 +01:00
rgnter
b7b578bf3e add conditional variable to LuaResult 2022-12-18 14:45:33 +01:00
Lion Kortlepel
7f5b3919f4
make destructors of virtual classes virtual
this causes warnings in clang, and rightfully so :^)
2022-10-31 11:31:16 +01:00
Lion Kortlepel
5d3dff3c88
add identifiers (beammp id, ip) as an argument to onPlayerAuth 2022-10-03 15:31:32 +02:00
20dka
b71aa2db04
advanced autocomplete for lua 2022-09-26 00:13:16 +02:00
20dka
44b94c9e58 add MP.GetPositionRaw(pid, vid)
fix vehicles sometimes not deleting for all players
2022-09-14 01:54:49 +02:00
Lion Kortlepel
fd7b11f436
fix event loop timing issue
The event loop tries to run no faster than every 10ms. If it detects
that it goes faster, it would incorrectly calculate the difference, and
then wait (what I assume was) way too long or too short.
Either way, now it's fixed and it correctly works, even when introducing
new lua states.
2022-07-20 14:33:19 +02:00
Lion Kortlepel
0a8e7d8e50
add TriggerLocalEvent 2022-07-14 00:27:44 +02:00
Lion Kortlepel
25391fa0c7
thank you toml11 maintainer for naming your header some super generic name that clashes with every single other toml library B) 2022-06-04 16:51:34 +03:00
Lion Kortlepel
0621c0bf82
rebase fixup 2022-05-26 21:13:18 +02:00
Lion Kortlepel
36547d1e9e
Move PluginMonitor out of TLuaEngine 2022-05-26 20:59:53 +02:00
Lion Kortlepel
f06f31c2a0
add moar tests!!! 2022-05-26 16:58:13 +02:00
Lion Kortlepel
2dd181d492
gracefully shutdown on bind() failure 2022-05-26 11:19:48 +02:00
Lion Kortlepel
450f0a6875
Fixup merge 2022-03-31 22:17:10 +02:00
Lion Kortlepel
104737571c
Merge branch 'rc-v3.0.2' into rc-v3.1.0
This is a periodic merge to keep 3.1.0 up to date with 3.0.2
2022-03-31 22:10:49 +02:00
Lion Kortlepel
d4b30a2583
CreateEventTimer: Implement CallStrategy
There are two CallStrategies:

- BestEffort (default): Will try to get your event to trigger at the specified
  interval, but will refuse to queue handlers if a handler takes too
  long.
- Precise: Will enqueue event handlers at the exact interval specified.
  Can lead to the queue filling up if the handler takes longer than the
  interval.
2022-03-31 20:13:59 +02:00
Lion Kortlepel
b97397132d
TLuaEngine: improve result queue handling 2022-03-31 15:59:31 +02:00
Lion Kortlepel
c1e216957b
move Json* to Util, add Random, RandomRange, RandomIntRange, catch
errors in TPluginMonitor
2022-03-18 01:52:31 +01:00
20dka
3c08e54471 Add basic autocomplete (fix #95) 2022-03-15 01:58:26 +01:00
Lion Kortlepel
7d97c3b560
add FS.ListFiles, FS.ListDirectories 2022-03-02 23:41:32 +01:00
Lion Kortlepel
9a0cdc6517
rename JsonSerialize to JsonEncode, JsonDeserialize to JsonDecode 2022-03-02 13:26:53 +01:00
Lion Kortlepel
b52677e585
Add JsonDeserialize 2022-03-02 13:22:26 +01:00
Lion Kortlepel
7b458e3e27
Use yield() where possible
Replaced calls of this_thread::sleep_* with this_thread::yield(), which
yields the thread to the OS' scheduler.
2022-02-03 19:52:18 +01:00
Lion Kortlepel
754053e73f
Use yield() where possible
Replaced calls of this_thread::sleep_* with this_thread::yield(), which
yields the thread to the OS' scheduler.
2022-02-03 18:57:52 +01:00
Lion Kortlepel
fd12ee672d
Add various debug functions 2022-01-26 20:33:12 +01:00
Lion Kortlepel
3555cec5fe
Simplify fix for event argument bug 2021-12-13 13:48:18 +01:00
Lion Kortlepel
71efe30345
Bump to 3.0.0, possible fix for event argument bug 2021-12-13 13:22:58 +01:00
awesome_milou
9d283738aa
Add preliminary work for HTTP health endpoint (#68)
* Add preliminary work for HTTP health endpoint

* Http: Fix infinite loop bug in Tx509KeypairGenerator::generateKey()

* update commandline

* Add TLS Support class for use with http server

* Add preliminary HTTP Server; TLS still broken; fix in later commit

* Fix TLS handshake, due to server being unable to serve key/certfile in 'Http.h/Http.cpp'; Cause was httlib not being threadsafe due to being a blocking http library

* Run clang format

* Add option to configure http server port via ServerConfig

* TConfig: add HTTPServerPort to config parsing step

* Fix SSL Cert / Key path not auto generating when not existing

* Add health endpoint; Fix SSL Cert serial no. not refreshing when regenerating

* Switch arround status codes in /health route

* Run clang format

Co-authored-by: Lion Kortlepel <development@kortlepel.com>
2021-12-05 18:24:55 +01:00
Lion Kortlepel
479bb9f931
TLuaEngine: Make WaitForAll timeout optional 2021-12-05 01:32:15 +01:00
Lion Kortlepel
a289d0e872
Add timeout to WaitForAll 2021-12-05 01:09:41 +01:00
Lion Kortlepel
265dd710cf
add status command 2021-12-02 01:25:17 +01:00
Lion Kortlepel
19d67dee95
Add GetPlayerIDByName, kick, say 2021-11-29 01:14:37 +01:00
Lion Kortlepel
fc440bea2a
Add ability to switch into other lua states 2021-11-29 00:37:00 +01:00
Lucca Jiménez Könings
1a2a123d87 Fix various macOS compatibility issues 2021-11-25 02:01:44 +01:00
Lion Kortlepel
f8af134dc9
start writing http lua stuff, also heartbeat debug printing 2021-11-08 22:08:07 +01:00
Lion Kortlepel
9eabd19e17
Report more errors, better 2021-10-01 03:52:12 +02:00
Lion Kortlepel
243e96d503
Check all futures 2021-10-01 03:27:24 +02:00
Lion Kortlepel
e7f29ce04f
Fix server event timing 2021-10-01 01:40:37 +02:00