86 Commits

Author SHA1 Message Date
Lucca Jiménez Könings
8c15b87628
Refactor all references to settings to use new Settings type
Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
2024-05-15 12:52:09 +02:00
Lucca Jiménez Könings
13e641b3a3
Remove interfering legacy code (http,password,etc)
Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
2024-05-15 12:45:19 +02:00
Lion Kortlepel
aff537afdf add AGPL-3.0 license header 2024-01-23 21:00:11 +01:00
Lion Kortlepel
023e968302 refactor position packet handling, add regression tests 2024-01-09 15:34:33 +01:00
Lion Kortlepel
a4eb10b6a4 fix MP.GetPositionRaw 2024-01-09 15:34:33 +01:00
Lion Kortlepel
0836fd3af8 fix bug in HandlePosition which caused the vehicle position not to be
saved properly
2024-01-09 15:34:33 +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
Lion Kortlepel
b10d5d0f4e
fix empty events causing issues in the server
an empty event packet, if sent just right, could crash the server
2022-10-31 11:31:15 +01:00
Lion Kortlepel
5581fd1692
fix chat message impersonation issue
instead of using the supplied name, we ignore it entirely and use the
server's internal name for the client
2022-10-31 11:31:15 +01:00
Lion Kortlepel
d36bb7962c
ignore empty chat messages
this could happen with a malicious client of some kind, we should simply
ignore them
2022-10-31 11:31:15 +01:00
Lion Kortlepel
4e8bd993d5
remove J packet handler
it wasn't used by anything in the launcher, mod, or during the join
sequence, so i removed it for now.
2022-10-31 11:31:15 +01:00
Lion Kortlepel
abff9bfbdb
fix crash when chat message is malformed 2022-10-31 11:31:15 +01:00
Lion Kortlepel
99f41c28cb
fix #135 by making onPlayerDisconnect blocking, and calling it before removing the player
before, the handlers were not waited for, so the client was usually
destructed before lua got to the actual event handler call. Now, the
handler is called and waited on, and once all handlers are done, the
client is properly removed from the players internally, thus making
calls to GetPlayerName, GetPlayerIdentifiers, etc. return nil etc.
2022-10-31 11:31:15 +01:00
Lion Kortlepel
87965433c2
change log levels of common warnings and errors to debug
this hides a lot of the "standard" errors we get behind the debug flag.
for example, disconnecting a disconnected player would be such an error
2022-10-15 23:16:16 +02:00
Lion Kortlepel
95ae0f5d03
fix 'Od' and 'Or' packets not being broadcast 2022-10-05 22:17:56 +02:00
Lion Kortlepel
7d2e4d4581
replace tcp networking with boost::asio tcp networking 2022-10-05 18:17:04 +02:00
Lion Kortlepel
5f1d003077
fix various potential crashes in TServer::HandlePosition 2022-10-03 17:06:32 +02:00
Lion Kortlepel
1f14de2e71
revert 9c6127a105728afca7b1b7a45d7380fc88d2070d and apply proper fix 2022-10-03 15:11:26 +02:00
Lion Kortlepel
d63c84286e
replace logging functions with new fmt versions in ParseVehicle 2022-10-01 22:25:45 +02:00
Lion Kortlepel
9c6127a105
fix bug which may cause a server to crash when a car is spawned
thanks @Anonymous275
2022-10-01 19:10:21 +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
4b242c26fc optimize function argument passing in GetPidVid, TServer::HandlePosition 2022-09-14 18:53:44 +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
d0bb32ec63
cleanup fixme's, todo's 2022-03-24 14:26:02 +01:00
Lion Kortlepel
5180c96e2b
TServer::HandleEvent: Fix mistreatment of ':' in event data 2022-03-24 14:06:50 +01:00
Lion Kortlepel
09c9b24cbf
Fix Unicycle "infinite spawning" bug 2022-03-10 01:27:16 +01:00
Lion Kortlepel
d969c4a2c2
Use nlohmann/json for IsUnicycle 2022-02-11 10:36:10 +01:00
Lion Kortlepel
f26ca6b40d
add nlohmann/json
this will conflict with a change in the http branch, but i dont care
right now
2022-02-11 10:19:10 +01:00
Lion Kortlepel
a1335e8c7d
Add statuses, status messages 2021-12-06 13:17:54 +01:00
Lion Kortlepel
eae27633db
Add commandline arguments, implement --config, --version, --help 2021-11-26 19:04:21 +01:00
Lion Kortlepel
7079e80b71
Lua: Remove leading space in onChatMessage (fix #35) 2021-11-19 12:43:27 +01:00
Lion Kortlepel
fdc205f521
Add ScopedTimer, Remove some comments 2021-10-31 01:27:21 +02:00
Lion Kortlepel
50589fbe3d
send 'Om' to self 2021-10-26 17:39:59 +02:00
Lion Kortlepel
6189aed6e7
broadcast Om packets 2021-10-26 02:08:02 +02:00
Lion Kortlepel
c4d6aab08b
fix MP.HttpGET (was not passing contentType) 2021-10-08 08:44:20 +02: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
f98ef7d41c
Lua: Call local eventhandlers synchronously when TriggerGlobalEvent is called from inside a handling state 2021-09-18 00:05:51 +02:00
Lion Kortlepel
48caae25fd
Finalize master&new-lua-features merge 2021-09-17 14:58:40 +02:00
Lion Kortlepel
1d3958817f
Merge remote-tracking branch 'origin/new-lua-features' into rewrite-lua
This is the first of a few commits to merge the new lua features and the
rewrite
2021-09-17 13:29:44 +02:00
Lion Kortlepel
a44050f0f1
Lua: Almost Working events, all triggers working 2021-09-17 00:21:43 +02:00
Lion Kortlepel
ba0678dade
Continue Lua Rewrite 2021-09-16 03:21:00 +02:00
Lion Kortlepel
dd4e4c4467
Start rewrite of lua, rename all print functions 2021-09-16 01:04:01 +02:00
Lion Kortlepel
ba3fd0e144
add GetServerVersion 2021-09-09 12:14:30 +03:00
Lion Kortlepel
809a851c71 add trace() as DEBUG debug()
Replace DEBUG debug() with trace() everywhere
2021-09-08 19:55:03 +03:00
Lion Kortlepel
8fada3ac04 Sentry: add multiple more logging mechanisms, add [CHAT] 2021-09-08 19:55:03 +03:00
Lion Kortlepel
fe6e1e6266 Heartbeat: Try backup1 and backup2, refactor sentry reporting 2021-09-08 19:55:03 +03:00
Lion Kortlepel
f4ffa2cdda Sentry: remove authkey, use id instead 2021-09-08 19:55:03 +03:00
Lion Kortlepel
1409d4ef80 Sentry: use locked contexts to send data to avoid races 2021-09-08 19:55:03 +03:00
Lion Kortlepel
51e662fdda Compat: fix clash with socket() macro, Sentry: Add LogDebug 2021-09-08 19:55:03 +03:00