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