Start rewrite of lua, rename all print functions

This commit is contained in:
Lion Kortlepel
2021-09-16 01:04:01 +02:00
parent d082620525
commit dd4e4c4467
20 changed files with 215 additions and 136 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include "TNetwork.h"
#include "TServer.h"
#include <filesystem>
#include <sol/sol.hpp>
#include <toml11/toml.hpp>
#include <unordered_map>
#include <vector>
namespace fs = std::filesystem;
class TLuaPlugin;
class TLuaEngine : IThreaded {
public:
TLuaEngine(TServer& Server, TNetwork& Network);
void operator()() override;
private:
void CollectPlugins();
void InitializePlugin(const fs::path& folder);
TNetwork& mNetwork;
TServer& mServer;
sol::state mL;
std::atomic_bool mShutdown { false };
fs::path mResourceServerPath;
std::vector<TLuaPlugin> mLuaPlugins;
std::unordered_map<std::string, sol::state> mLuaStates;
};