mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 10:25:36 +00:00
attempt #2
This commit is contained in:
parent
3dd2e1c278
commit
5759a6f80f
@ -6,10 +6,14 @@
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
// necessary as lua relies on global state
|
||||
TLuaEngine* TheEngine;
|
||||
|
||||
TLuaEngine::TLuaEngine(TServer& Server, TTCPServer& TCPServer, TUDPServer& UDPServer)
|
||||
: mTCPServer(TCPServer)
|
||||
, mUDPServer(UDPServer)
|
||||
, mServer(Server) {
|
||||
TheEngine = this;
|
||||
if (!fs::exists(Application::Settings.Resource)) {
|
||||
fs::create_directory(Application::Settings.Resource);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ void SendError(TLuaEngine& Engine, lua_State* L, const std::string& msg);
|
||||
std::any CallFunction(TLuaFile* lua, const std::string& FuncName, std::shared_ptr<TLuaArg> Arg);
|
||||
std::any TriggerLuaEvent(TLuaEngine& Engine, const std::string& Event, bool local, TLuaFile* Caller, std::shared_ptr<TLuaArg> arg, bool Wait);
|
||||
|
||||
static TLuaEngine* TheEngine { nullptr };
|
||||
extern TLuaEngine* TheEngine;
|
||||
|
||||
static TLuaEngine& Engine() {
|
||||
Assert(TheEngine);
|
||||
|
Loading…
x
Reference in New Issue
Block a user