diff --git a/include/TServer.h b/include/TServer.h index 71025d1..2f203d8 100644 --- a/include/TServer.h +++ b/include/TServer.h @@ -36,5 +36,4 @@ private: static bool ShouldSpawn(TClient& c, const std::string& CarJson, int ID); static bool IsUnicycle(TClient& c, const std::string& CarJson); static void Apply(TClient& c, int VID, const std::string& pckt); - TScopedTimer mLifeTimer { "Server" }; }; diff --git a/src/TServer.cpp b/src/TServer.cpp index 6ef4b07..0ac6b0e 100644 --- a/src/TServer.cpp +++ b/src/TServer.cpp @@ -121,7 +121,7 @@ void TServer::GlobalParser(const std::weak_ptr& Client, std::string Pac beammp_trace(std::string(("got 'C' packet: '")) + Packet + ("' (") + std::to_string(Packet.size()) + (")")); if (Packet.length() < 4 || Packet.find(':', 3) == std::string::npos) break; - auto Futures = LuaAPI::MP::Engine->TriggerEvent("onChatMessage", "", LockedClient->GetID(), LockedClient->GetName(), Packet.substr(Packet.find(':', 3) + 1)); + auto Futures = LuaAPI::MP::Engine->TriggerEvent("onChatMessage", "", LockedClient->GetID(), LockedClient->GetName(), Packet.substr(Packet.find(':', 3) + 2)); TLuaEngine::WaitForAll(Futures); LogChatMessage(LockedClient->GetName(), LockedClient->GetID(), Packet.substr(Packet.find(':', 3) + 1)); // FIXME: this needs to be adjusted once lua is merged if (std::any_of(Futures.begin(), Futures.end(), diff --git a/src/main.cpp b/src/main.cpp index 7af0ae9..0fda7eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,8 +21,7 @@ // global, yes, this is ugly, no, it cant be done another way TSentry Sentry {}; -int main(int argc, char** argv) //try { -{ +int main(int argc, char** argv) try { setlocale(LC_ALL, "C"); SetupSignalHandlers(); @@ -62,14 +61,12 @@ int main(int argc, char** argv) //try { Application::Console().InitializeLuaConsole(LuaEngine); Application::CheckForUpdates(); - // TODO: replace while (!Shutdown) { std::this_thread::sleep_for(std::chrono::milliseconds(50)); } beammp_info("Shutdown."); return 0; -//} catch (const std::exception& e) { -// beammp_error(e.what()); -// Sentry.LogException(e, _file_basename, _line); -//} +} catch (const std::exception& e) { + beammp_error(e.what()); + Sentry.LogException(e, _file_basename, _line); }