mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 02:30:54 +00:00
Add ability to switch into other lua states
This commit is contained in:
@@ -18,7 +18,7 @@ public:
|
||||
Commandline& Internal() { return mCommandline; }
|
||||
|
||||
private:
|
||||
void ChangeToLuaConsole();
|
||||
void ChangeToLuaConsole(const std::string& LuaStateId);
|
||||
void ChangeToRegularConsole();
|
||||
|
||||
Commandline mCommandline;
|
||||
@@ -27,5 +27,6 @@ private:
|
||||
TLuaEngine* mLuaEngine { nullptr };
|
||||
bool mIsLuaConsole { false };
|
||||
bool mFirstTime { true };
|
||||
const std::string mStateId = "BEAMMP_SERVER_CONSOLE";
|
||||
std::string mStateId;
|
||||
const std::string mDefaultStateId = "BEAMMP_SERVER_CONSOLE";
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
|
||||
static void WaitForAll(std::vector<std::shared_ptr<TLuaResult>>& Results);
|
||||
void ReportErrors(const std::vector<std::shared_ptr<TLuaResult> >& Results);
|
||||
bool HasState(TLuaStateId StateId);
|
||||
[[nodiscard]] std::shared_ptr<TLuaResult> EnqueueScript(TLuaStateId StateID, const TLuaChunk& Script);
|
||||
[[nodiscard]] std::shared_ptr<TLuaResult> EnqueueFunctionCall(TLuaStateId StateID, const std::string& FunctionName, const std::vector<TLuaArgTypes>& Args);
|
||||
void EnsureStateExists(TLuaStateId StateId, const std::string& Name, bool DontCallOnInit = false);
|
||||
|
||||
Reference in New Issue
Block a user