mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
Fix compile issue with asio, implement Lua events
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "LuaAPI.h"
|
||||
#include "TLuaEngine.h"
|
||||
|
||||
static std::string LuaToString(const sol::object& Value) {
|
||||
static std::string LuaToString(const sol::object& Value, size_t Indent = 1) {
|
||||
switch (Value.get_type()) {
|
||||
case sol::type::string:
|
||||
return Value.as<std::string>();
|
||||
@@ -15,10 +15,17 @@ static std::string LuaToString(const sol::object& Value) {
|
||||
Result << "[[table: " << Table.pointer() << "]]: {";
|
||||
if (!Table.empty()) {
|
||||
for (const auto& Entry : Table) {
|
||||
Result << "\n\t" << LuaToString(Entry.first) << ": " << LuaToString(Entry.second) << ",";
|
||||
Result << "\n";
|
||||
for (size_t i = 0; i < Indent; ++i) {
|
||||
Result << "\t";
|
||||
}
|
||||
Result << LuaToString(Entry.first, Indent + 1) << ": " << LuaToString(Entry.second, Indent + 1) << ",";
|
||||
}
|
||||
Result << "\n";
|
||||
}
|
||||
for (size_t i = 0; i < Indent - 1; ++i) {
|
||||
Result << "\t";
|
||||
}
|
||||
Result << "}";
|
||||
return Result.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user