Commit Graph

1258 Commits

Author SHA1 Message Date
20dka
056827546e assign IDs to new players earlier in the connection process 2022-11-23 09:34:51 +01:00
20dka
6a47521c7c fix lua autocomplete crash when a table contains number keys 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
35b38f35bb replace usages of ForEachClientWeak with ForEachClient 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
dd36299436 add lk/result to includes 2022-11-23 09:34:50 +01:00
Lion Kortlepel
da65e97ed1 add lk/result
a header-only library to deal with results
2022-11-23 09:34:50 +01:00
Lion Kortlepel
4cc163ea1c switch to c++20
this will allow us to use more convenience features of the language, and
leave more legacy code behind - also we can use c++20 libraries ;)
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
c7f6835702 use high_resolution_clock instead of system_clock 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
48135f4544 add new onShutdown timing to changelog 2022-11-23 09:34:50 +01:00
Lion Kortlepel
0411ba533d change onShutdown to be called before all players are kicked 2022-11-23 09:34:50 +01:00
Lion Kortlepel
41dd4ff678 add version to changelog 2022-11-23 09:34:50 +01:00
Lion Kortlepel
e1c2d0d5fb add version command 2022-11-23 09:34:50 +01:00
Lion Kortlepel
69c2868025 fix server not closing after detecting an invalid config (fixes #151) 2022-11-23 09:34:50 +01:00
Lion Kortlepel
c8ca4564a1 fix error which complains about AuthKey not being present before reading the config file 2022-11-23 09:34:50 +01:00
Lion Kortlepel
0c6112c28a add boost to requirements in README for windows 2022-11-23 09:34:50 +01:00
Lion Kortlepel
4860849f2f add boost-uuid to vcpkg on windows 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
Lion Kortlepel
13a86d3e77 add explanative debug messages to parse errors in GetPidVid 2022-11-23 09:34:50 +01:00
Lion Kortlepel
dff94a41be fix potential out of bounds exception in GetPidVid 2022-11-23 09:34:50 +01:00
Lion Kortlepel
79ee5915b4 fix unhandled out of bounds in Authentication 2022-11-23 09:34:50 +01:00
Lion Kortlepel
3fcf23977b fix fix for out-of-bounds crash, add disconnect messages to some failure conditions 2022-11-23 09:34:50 +01:00
Lion Kortlepel
487917482f fix out-of-range crash in SendFile
when the UnsafeName does not contain a `/`, the server would simply
crash, as an invalid substr() index was given, which triggered a
std::out_of_range.
2022-11-23 09:34:50 +01:00
Lion Kortlepel
2ca39a7368 fix cmakelists 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
12245d81a1 fix compilation error and use boost for string lowercase 2022-11-23 09:34:50 +01:00
20dka
a6e0332e3c add command 'quit' as alternative to 'exit' 2022-11-23 09:34:50 +01:00
20dka
c461a63d9d update client pointer lock approach 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
6ebfe5743c add :Wait(timeout_s) function to the result of MP.TriggerGlobalEvent 2022-11-23 09:34:50 +01:00
Lion Kortlepel
3c138e2891 change date format from d/m/y to Y/m/d 2022-11-23 09:34:50 +01:00
Lion Kortlepel
2279ba4d6b attempt to report errors from event triggers 2022-11-23 09:34:50 +01:00
Lion Kortlepel
30b038a6bb revert adding nil to json
it causes issues, not worth it
2022-11-23 09:34:50 +01:00
Lion Kortlepel
c39c7bb0a4 add scripts & dockerfiles to build on multiple platforms 2022-11-23 09:34:50 +01:00
Lion Kortlepel
06b238d63f remove unused code 2022-11-23 09:34:50 +01:00
Lion Kortlepel
1856dd2002 fix various little things in the json encode and decode 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