Add platform, lua, openssl version to version command, show lua version on startup (#325)

Closes #300
This commit is contained in:
Lion 2024-05-24 12:58:30 +02:00 committed by GitHub
commit a3670bff4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View File

@ -26,7 +26,9 @@
#include "TLuaEngine.h"
#include <ctime>
#include <lua.hpp>
#include <mutex>
#include <openssl/opensslv.h>
#include <sstream>
static inline bool StringStartsWith(const std::string& What, const std::string& StartsWith) {
@ -273,7 +275,25 @@ void TConsole::Command_Version(const std::string& cmd, const std::vector<std::st
return;
}
Application::Console().WriteRaw("Current version: v" + Application::ServerVersionString());
std::string platform;
#if defined(BEAMMP_WINDOWS)
platform = "Windows";
#elif defined(BEAMMP_LINUX)
platform = "Linux";
#elif defined(BEAMMP_FREEBSD)
platform = "FreeBSD";
#elif defined(BEAMMP_APPLE)
platform = "Apple";
#else
platform = "Unknown";
#endif
Application::Console().WriteRaw("Platform: " + platform);
Application::Console().WriteRaw("Server: v" + Application::ServerVersionString());
std::string lua_version = fmt::format("Lua: v{}.{}.{}", LUA_VERSION_MAJOR, LUA_VERSION_MINOR, LUA_VERSION_RELEASE);
Application::Console().WriteRaw(lua_version);
std::string openssl_version = fmt::format("OpenSSL: v{}.{}.{}", OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH);
Application::Console().WriteRaw(openssl_version);
}
void TConsole::Command_Kick(const std::string&, const std::vector<std::string>& args) {

View File

@ -66,6 +66,7 @@ void TLuaEngine::operator()() {
RegisterThread("LuaEngine");
Application::SetSubsystemStatus("LuaEngine", Application::Status::Good);
// lua engine main thread
beammp_infof("Lua v{}.{}.{}", LUA_VERSION_MAJOR, LUA_VERSION_MINOR, LUA_VERSION_RELEASE);
CollectAndInitPlugins();
// now call all onInit's
auto Futures = TriggerEvent("onInit", "");