BeamMP-Server/include/TConsole.h
2021-11-29 00:37:00 +01:00

33 lines
810 B
C++

#pragma once
#include "Cryptography.h"
#include "commandline.h"
#include <atomic>
#include <fstream>
class TLuaEngine;
class TConsole {
public:
TConsole();
void Write(const std::string& str);
void WriteRaw(const std::string& str);
void InitializeLuaConsole(TLuaEngine& Engine);
void BackupOldLog();
Commandline& Internal() { return mCommandline; }
private:
void ChangeToLuaConsole(const std::string& LuaStateId);
void ChangeToRegularConsole();
Commandline mCommandline;
std::vector<std::string> mCachedLuaHistory;
std::vector<std::string> mCachedRegularHistory;
TLuaEngine* mLuaEngine { nullptr };
bool mIsLuaConsole { false };
bool mFirstTime { true };
std::string mStateId;
const std::string mDefaultStateId = "BEAMMP_SERVER_CONSOLE";
};