From b09f5a401d8843399e3f31d5edb69e575794e5ff Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 10 Mar 2022 12:17:46 +0100 Subject: [PATCH 1/4] update lionkor/commandline to 1.0.0 (adds cursor left- and right movement) --- deps/commandline | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/commandline b/deps/commandline index 0d3e107..71240f6 160000 --- a/deps/commandline +++ b/deps/commandline @@ -1 +1 @@ -Subproject commit 0d3e1073c1005270dfad851c1f8c59f4ce29d8c1 +Subproject commit 71240f634b211d830679e7d2841b897c7c30dad9 From 299004b14eed773b1744714e50b1ad4e358ccaa6 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 10 Mar 2022 12:21:08 +0100 Subject: [PATCH 2/4] fix msvc /bigobj issue --- CMakeLists.txt | 2 +- Changelog.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cbe134..eedb3a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ set(SENTRY_BACKEND breakpad) add_subdirectory("deps/sentry-native") if (MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /bigobj") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") endif () message(STATUS "Setting compiler flags") diff --git a/Changelog.md b/Changelog.md index 28fb6cf..5bb611a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ # v3.0.1 - ADDED Backup URLs to UpdateCheck (will fail less often now) +- ADDED console cursor left and right movement (with arrow keys) and working HOME and END key (via github.com/lionkor/commandline) - FIXED a bug where, when run with --working-directory, the Server.log would still be in the original directory - FIXED a bug which could cause the plugin reload thread to spin at 100% if the reloaded plugin's didn't terminate - FIXED an issue which would cause servers to crash on mod download via SIGPIPE on POSIX From 359faee6964c6e9fa22c893b95c6cf5daacd7d33 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 10 Mar 2022 01:27:16 +0100 Subject: [PATCH 3/4] Fix Unicycle "infinite spawning" bug --- src/TServer.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/TServer.cpp b/src/TServer.cpp index a4328e2..cee40b3 100644 --- a/src/TServer.cpp +++ b/src/TServer.cpp @@ -174,7 +174,7 @@ bool TServer::IsUnicycle(TClient& c, const std::string& CarJson) { try { auto Car = nlohmann::json::parse(CarJson); const std::string jbm = "jbm"; - if (Car.contains(jbm) && Car["jbm"].is_string() && Car["jbm"] == "unicycle") { + if (Car.contains(jbm) && Car[jbm].is_string() && Car[jbm] == "unicycle") { return true; } } catch (const std::exception& e) { @@ -184,17 +184,12 @@ bool TServer::IsUnicycle(TClient& c, const std::string& CarJson) { } bool TServer::ShouldSpawn(TClient& c, const std::string& CarJson, int ID) { - - if (c.GetUnicycleID() > -1 && (c.GetCarCount() - 1) < Application::Settings.MaxCars) { - return true; - } - - if (IsUnicycle(c, CarJson)) { + if (IsUnicycle(c, CarJson) && c.GetUnicycleID() < 0) { c.SetUnicycleID(ID); return true; + } else { + return c.GetCarCount() < Application::Settings.MaxCars; } - - return Application::Settings.MaxCars > c.GetCarCount(); } void TServer::ParseVehicle(TClient& c, const std::string& Pckt, TNetwork& Network) { From a85fef15c28da6784a499152465793593b8a7864 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 10 Mar 2022 01:40:47 +0100 Subject: [PATCH 4/4] only use sentry if URL is specified, possibly fix stupid microsoft compiler error hey @microsoft, maybe don't have a limit on the size of obj files. --- CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eedb3a0..6a36c83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,19 @@ set(SENTRY_BUILD_SHARED_LIBS OFF) if (MSVC) set(SENTRY_BUILD_RUNTIMESTATIC ON) endif() -set(SENTRY_BACKEND breakpad) +message(STATUS "Checking for Sentry URL") +# this is set by the build system. +# IMPORTANT: if you're building from source, just leave this empty +if (NOT DEFINED BEAMMP_SECRET_SENTRY_URL) + message(WARNING "No sentry URL configured. Sentry logging is disabled for this build. \ + This is not an error, and if you're building the BeamMP-Server yourself, this is expected and can be ignored.") + set(BEAMMP_SECRET_SENTRY_URL "") + set(SENTRY_BACKEND none) +else() + string(LENGTH ${BEAMMP_SECRET_SENTRY_URL} URL_LEN) + message(STATUS "Sentry URL is length ${URL_LEN}") + set(SENTRY_BACKEND breakpad) +endif() add_subdirectory("deps/sentry-native") if (MSVC) @@ -65,17 +77,6 @@ elseif (UNIX) endif (SANITIZE) endif () -message(STATUS "Checking for Sentry URL") -# this is set by the build system. -# IMPORTANT: if you're building from source, just leave this empty -if (NOT DEFINED BEAMMP_SECRET_SENTRY_URL) - message(WARNING "No sentry URL configured. Sentry logging is disabled for this build. \ - This is not an error, and if you're building the BeamMP-Server yourself, this is expected and can be ignored.") - set(BEAMMP_SECRET_SENTRY_URL "") -else() - string(LENGTH ${BEAMMP_SECRET_SENTRY_URL} URL_LEN) - message(STATUS "Sentry URL is length ${URL_LEN}") -endif() message(STATUS "Adding local source dependencies") # this has to happen before -DDEBUG since it wont compile properly with -DDEBUG