Sentry: use locked contexts to send data to avoid races

This commit is contained in:
Lion Kortlepel authored and Lion committed 2021-09-08 19:55:03 +03:00
1 parent 51e662fdda
commit 1409d4ef80
5 files changed
+9 -1

No files matched your search

+1
View File
@@ -323,6 +323,7 @@ void TServer::Apply(TClient& c, int VID, const std::string& pckt) {
std::string VD = c.GetCarData(VID);
if (VD.empty()) {
error("Tried to apply change to vehicle that does not exist");
auto Lock = Sentry.CreateExclusiveContext();
Sentry.AddExtra("packet", Packet);
Sentry.AddExtra("vehicle-id", std::to_string(VID));
Sentry.AddExtra("client-car-count", std::to_string(c.GetCarCount()));