20dka
468a6b340e
add event 'onPlayerRequestMods', restructure modloading
...
now every player has their own list of allowed client mods, this can be modified by lua upon joining and is later used as a whitelist to ensure only those files can be sent to each client
2022-11-23 09:34:51 +01:00
20dka
056827546e
assign IDs to new players earlier in the connection process
2022-11-23 09:34:51 +01:00
Lion Kortlepel
eaab5eaf30
fix crash which could happen when closing an invalid socket
...
for some reason boost::asio doesn't account for this and lets us simply
die when/if this happens.
2022-11-23 09:34:51 +01:00
Lion Kortlepel
2572530957
ensure clients are valid when iterated over
2022-11-23 09:34:51 +01:00
Lion Kortlepel
8551e68184
fix bug which could cause multiple players to have the same ID ( closes #154 )
2022-11-23 09:34:51 +01:00
Lion Kortlepel
2f85c708c5
rework GetClient to use new ForEachClient, return shared_ptr
...
this simplifies a lot of functions, and removes a lot of potential
errors when using the function. You now only check whether the return
value is null, and if it's not, you have a valid, reference-counted,
client pointer.
2022-11-23 09:34:51 +01:00
Lion Kortlepel
844b64f5d9
rework ForEachClient to use concepts instead of SFINAE
2022-11-23 09:34:51 +01:00
Lion Kortlepel
d7369c3bc5
deprecate ForEachClientWeak in favor of new ForEachClient
2022-11-23 09:34:51 +01:00
Lion Kortlepel
a8ad9034b2
update lk-result
2022-11-23 09:34:50 +01:00
Lion Kortlepel
b756ce3c3f
fix formatting in all files
2022-11-23 09:34:50 +01:00
Lion Kortlepel
3f05b72cc2
change internal setting names to set apart categories
2022-11-23 09:34:50 +01:00
Lion Kortlepel
152393f8bf
switch boost variant for std::variant for settings, for sol2
2022-11-23 09:34:50 +01:00
Lion Kortlepel
01bcc3d18c
replace all clocks with a generic TimeType
2022-11-23 09:34:50 +01:00
Lion Kortlepel
0327b41611
change to system_clock for times converted to time_t
2022-11-23 09:34:50 +01:00
Lion Kortlepel
e1c2d0d5fb
add version command
2022-11-23 09:34:50 +01:00
Lion Kortlepel
3bd67d959f
handle all exceptions which happen inside a logging macro
...
and print them ;)
2022-11-23 09:34:50 +01:00
20dka
9d8aeef423
refactor of vehicle packet handling
2022-11-23 09:34:50 +01:00
20dka
dee7f74906
remove unused PPSMonitor parameter
2022-11-23 09:34:50 +01:00
20dka
66f014ae42
add autocomplete for lua,kick,settings commands
2022-11-23 09:34:50 +01:00
20dka
69726a9b03
add owner check to other vehicle packets
2022-11-23 09:34:50 +01:00
20dka
9acb6951d6
add owner check to position packets
2022-11-23 09:34:50 +01:00
Lion Kortlepel
b068a9b48f
fix TriggerGlobalEvent not passing event arguments correctly ( closes #106 )
2022-11-23 09:34:50 +01:00
Lion Kortlepel
a44f9b3dba
fix various build warnings and errors with clang++
2022-11-23 09:34:50 +01:00
Lion Kortlepel
c51d713969
add uuid source files
...
were missed last commit related to uuids
2022-11-23 09:34:50 +01:00
Lion Kortlepel
c717037895
add debug command to track statistics and debug client connections
...
The `debug` command shows info useful to develpers of the client and
server
2022-11-23 09:34:49 +01:00
Lion Kortlepel
692129cb81
add ToHumanReadableSize, which formats data sizes into MiB, GiB, etc.
...
this is needed in order to display data sizes in upcoming changes
related to tracking statistics about the server's performance
2022-11-23 09:34:49 +01:00
Lion Kortlepel
6842dccfc3
rework UDP recv loop, add packet statistics tracking
...
The UDPServerMain was badly designed and had multiple potential bugs and
unexpected & silent failures. The changes simplify the code here, and
tracks those unexpected failures in app-wide statistics. Also added,
while at that, some more tracking of how many packets and bytes are
sent & received per client
2022-11-23 09:34:49 +01:00
Lion Kortlepel
3aa6784627
bump version to 3.2.0
2022-11-23 09:34:49 +01:00
Lion Kortlepel
bec09a4761
change settings to be a hash map instead of a fixed struct
...
this makes adding settings and changing settings incredibly easy, both
from the console and from lua.
2022-11-23 09:34:49 +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
a8b1a205f7
bump version to 3.1.1
...
I'm expecting to release a 3.1.1 with some fixes
2022-10-31 11:24:13 +01:00
Lion Kortlepel
7d1318653c
fix boost::system::error_code
2022-10-15 23:16:16 +02:00
Lion Kortlepel
cc6b7846b2
add system include
2022-10-06 00:51:51 +02:00
Lion Kortlepel
231b13a0e7
fix a ghost client bug
2022-10-05 18:17:18 +02:00
Lion Kortlepel
7d2e4d4581
replace tcp networking with boost::asio tcp networking
2022-10-05 18:17:04 +02:00
Lion Kortlepel
6e97a3cd6e
switch udp networking to boost implementation
2022-10-05 12:14:25 +02:00
Lion Kortlepel
5d3dff3c88
add identifiers (beammp id, ip) as an argument to onPlayerAuth
2022-10-03 15:31:32 +02:00
Lion Kortlepel
e638c25f70
change assertions to print the error in release builds
...
this should make it easier to debug crashes in the server remotely in
release builds when sentry is down.
2022-09-26 12:03:57 +02:00
Lion Kortlepel
24c98eb2b2
add more compile-time diagnostics, implement fixes for them
...
Before, a lot of common errors went unnoticed, due to insufficient
compiler diagnostics. This commit fixes this by adding a lot of new
diagnostics, and fixing the issues found by this.
2022-09-26 12:02:05 +02:00
20dka
b71aa2db04
advanced autocomplete for lua
2022-09-26 00:13:16 +02:00
Lion Kortlepel
36a1da3218
fix TServer::HandlePosition declaration
...
it was different from the implementation
2022-09-14 20:59:07 +02:00
20dka
a84d042a8a
add error messages to some lua events
2022-09-14 12:45:40 +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
51ccf31373
add beammp_debugf
2022-07-14 01:38:35 +02:00
Lion Kortlepel
a2cc629153
add onFileChanged ( fixes #116 )
2022-07-14 01:18:50 +02:00
Lion Kortlepel
ad414ec5c9
call onInit on hot-reload, cleanup, remove warnings
...
onInit is now called on hot-reload, for the whole plugin. Arguably, this
is not expected behavior, since only one file is being reloaded, but
this is the easiest way to do it, and the entire hot-reload process is
only for development purposes. Open an issue if this breaks your stuff
:^)
2022-07-14 00:37:47 +02:00
Lion Kortlepel
0a8e7d8e50
add TriggerLocalEvent
2022-07-14 00:27:44 +02:00
Lion Kortlepel
6e46d5aca9
start building the clear command
2022-06-28 03:29:01 +02:00
Lion Kortlepel
817bd4b588
start fixing mod download
2022-06-28 03:20:42 +02:00