mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 00:05:34 +00:00
fix missing Lua error messages in ResultCheckThread
This commit is contained in:
parent
f21d3d0389
commit
8b57f6e35a
@ -12,6 +12,7 @@
|
||||
- FIXED onInit not being called on hot-reload
|
||||
- FIXED incorrect timing calculation of Lua EventTimer loop
|
||||
- FIXED bug which caused hot-reload not to report syntax errors
|
||||
- FIXED missing error messages on some event handler calls
|
||||
|
||||
# v3.0.2
|
||||
|
||||
|
@ -59,19 +59,21 @@ void TLuaEngine::operator()() {
|
||||
RegisterThread("ResultCheckThread");
|
||||
while (!Application::IsShuttingDown()) {
|
||||
std::unique_lock Lock(mResultsToCheckMutex);
|
||||
mResultsToCheckCond.wait_for(Lock, std::chrono::milliseconds(20));
|
||||
beammp_tracef("Results to check: {}", mResultsToCheck.size());
|
||||
if (!mResultsToCheck.empty()) {
|
||||
mResultsToCheck.remove_if([](const std::shared_ptr<TLuaResult>& Ptr) -> bool {
|
||||
if (Ptr->Ready) {
|
||||
return true;
|
||||
} else if (Ptr->Error) {
|
||||
if (Ptr->Error) {
|
||||
if (Ptr->ErrorMessage != BeamMPFnNotFoundError) {
|
||||
beammp_lua_error(Ptr->Function + ": " + Ptr->ErrorMessage);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
mResultsToCheckCond.wait_for(Lock, std::chrono::milliseconds(20));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -161,7 +163,7 @@ void TLuaEngine::AddResultToCheck(const std::shared_ptr<TLuaResult>& Result) {
|
||||
mResultsToCheckCond.notify_one();
|
||||
}
|
||||
|
||||
std::unordered_map<std::string /*event name */, std::vector<std::string> /* handlers */> TLuaEngine::Debug_GetEventsForState(TLuaStateId StateId) {
|
||||
std::unordered_map<std::string /* event name */, std::vector<std::string> /* handlers */> TLuaEngine::Debug_GetEventsForState(TLuaStateId StateId) {
|
||||
std::unordered_map<std::string, std::vector<std::string>> Result;
|
||||
std::unique_lock Lock(mLuaEventsMutex);
|
||||
for (const auto& EventNameToEventMap : mLuaEvents) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user