mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 02:30:54 +00:00
Merge remote-tracking branch 'origin/master' into feature-tags
This commit is contained in:
@@ -76,7 +76,7 @@ public:
|
||||
static void RegisterShutdownHandler(const TShutdownHandler& Handler);
|
||||
// Causes all threads to finish up and exit gracefull gracefully
|
||||
static void GracefullyShutdown();
|
||||
static TConsole& Console() { return *mConsole; }
|
||||
static TConsole& Console() { return mConsole; }
|
||||
static std::string ServerVersionString();
|
||||
static const Version& ServerVersion() { return mVersion; }
|
||||
static uint8_t ClientMajorVersion() { return 2; }
|
||||
@@ -102,9 +102,7 @@ public:
|
||||
static void SleepSafeSeconds(size_t Seconds);
|
||||
|
||||
static void InitializeConsole() {
|
||||
if (!mConsole) {
|
||||
mConsole = std::make_unique<TConsole>();
|
||||
}
|
||||
mConsole.InitializeCommandline();
|
||||
}
|
||||
|
||||
enum class Status {
|
||||
@@ -130,13 +128,13 @@ private:
|
||||
static inline SystemStatusMap mSystemStatusMap {};
|
||||
static inline std::mutex mSystemStatusMapMutex {};
|
||||
static inline std::string mPPS;
|
||||
static inline std::unique_ptr<TConsole> mConsole;
|
||||
static inline TConsole mConsole;
|
||||
static inline std::shared_mutex mShutdownMtx {};
|
||||
static inline bool mShutdown { false };
|
||||
static inline std::mutex mShutdownHandlersMutex {};
|
||||
static inline std::deque<TShutdownHandler> mShutdownHandlers {};
|
||||
|
||||
static inline Version mVersion { 3, 1, 3 };
|
||||
static inline Version mVersion { 3, 2, 0 };
|
||||
};
|
||||
|
||||
std::string ThreadName(bool DebugModeOverride = false);
|
||||
|
||||
@@ -17,12 +17,15 @@ class TConsole {
|
||||
public:
|
||||
TConsole();
|
||||
|
||||
// Initializes the commandline app to take over I/O
|
||||
void InitializeCommandline();
|
||||
|
||||
void Write(const std::string& str);
|
||||
void WriteRaw(const std::string& str);
|
||||
void InitializeLuaConsole(TLuaEngine& Engine);
|
||||
void BackupOldLog();
|
||||
void StartLoggingToFile();
|
||||
Commandline& Internal() { return mCommandline; }
|
||||
Commandline& Internal() { return *mCommandline; }
|
||||
|
||||
private:
|
||||
void RunAsCommand(const std::string& cmd, bool IgnoreNotACommand = false);
|
||||
@@ -56,7 +59,7 @@ private:
|
||||
{ "say", [this](const auto&, const auto&) { Command_Say(""); } }, // shouldn't actually be called
|
||||
};
|
||||
|
||||
Commandline mCommandline;
|
||||
std::unique_ptr<Commandline> mCommandline { nullptr };
|
||||
std::vector<std::string> mCachedLuaHistory;
|
||||
std::vector<std::string> mCachedRegularHistory;
|
||||
TLuaEngine* mLuaEngine { nullptr };
|
||||
|
||||
Reference in New Issue
Block a user