fix console initializing too early

the console was initialized too early, leading to the server waiting for
it to shut down if the authkey is invalid, among other issues.
This commit is contained in:
Lion Kortlepel
2023-12-21 12:46:50 +01:00
parent a6cbffc774
commit 81299db946
4 changed files with 51 additions and 38 deletions

View File

@@ -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 };