mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-20 23:20:31 +00:00
fix windows compiler not understanding a CLEAR AND SIMPLE FUNCTION-STYLE
CONSTRUCTOR CALL AHHHHHHH
This commit is contained in:
@@ -584,27 +584,25 @@ std::pair<sol::table, std::string> TLuaEngine::StateThreadData::Lua_GetPositionR
|
|||||||
std::string VehiclePos = Client->GetCarPositionRaw(VID);
|
std::string VehiclePos = Client->GetCarPositionRaw(VID);
|
||||||
|
|
||||||
if (VehiclePos.empty()) {
|
if (VehiclePos.empty()) {
|
||||||
//return std::make_tuple(sol::lua_nil, sol::make_object(StateView, "Vehicle not found"));
|
// return std::make_tuple(sol::lua_nil, sol::make_object(StateView, "Vehicle not found"));
|
||||||
Result.second = "Vehicle not found";
|
Result.second = "Vehicle not found";
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::table t = Lua_JsonDecode(VehiclePos);
|
sol::table t = Lua_JsonDecode(VehiclePos);
|
||||||
if (t == sol::lua_nil){
|
if (t == sol::lua_nil) {
|
||||||
Result.second = "Packet decode failed";
|
Result.second = "Packet decode failed";
|
||||||
}
|
}
|
||||||
//return std::make_tuple(Result, sol::make_object(StateView, sol::lua_nil));
|
// return std::make_tuple(Result, sol::make_object(StateView, sol::lua_nil));
|
||||||
Result.first = t;
|
Result.first = t;
|
||||||
return Result;
|
return Result;
|
||||||
}
|
} else {
|
||||||
else {
|
// return std::make_tuple(sol::lua_nil, sol::make_object(StateView, "Client expired"));
|
||||||
//return std::make_tuple(sol::lua_nil, sol::make_object(StateView, "Client expired"));
|
|
||||||
Result.second = "Client expired";
|
Result.second = "Client expired";
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sol::table TLuaEngine::StateThreadData::Lua_HttpCreateConnection(const std::string& host, uint16_t port) {
|
sol::table TLuaEngine::StateThreadData::Lua_HttpCreateConnection(const std::string& host, uint16_t port) {
|
||||||
auto table = mStateView.create_table();
|
auto table = mStateView.create_table();
|
||||||
constexpr const char* InternalClient = "__InternalClient";
|
constexpr const char* InternalClient = "__InternalClient";
|
||||||
@@ -953,7 +951,8 @@ void TLuaEngine::StateThreadData::operator()() {
|
|||||||
S.second->Result = std::move(Res);
|
S.second->Result = std::move(Res);
|
||||||
} else {
|
} else {
|
||||||
S.second->Error = true;
|
S.second->Error = true;
|
||||||
S.second->ErrorMessage = std::string(sol::error(Res).what());
|
sol::error Err = Res;
|
||||||
|
S.second->ErrorMessage = Err.what();
|
||||||
}
|
}
|
||||||
S.second->Ready = true;
|
S.second->Ready = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user