mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 15:26:59 +00:00
The event loop tries to run no faster than every 10ms. If it detects that it goes faster, it would incorrectly calculate the difference, and then wait (what I assume was) way too long or too short. Either way, now it's fixed and it correctly works, even when introducing new lua states.
23 lines
479 B
C++
23 lines
479 B
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include "IThreaded.h"
|
|
|
|
#include <atomic>
|
|
#include <memory>
|
|
#include <unordered_map>
|
|
|
|
class TLuaEngine;
|
|
|
|
class TPluginMonitor : IThreaded, public std::enable_shared_from_this<TPluginMonitor> {
|
|
public:
|
|
TPluginMonitor(const fs::path& Path, std::shared_ptr<TLuaEngine> Engine);
|
|
|
|
void operator()();
|
|
|
|
private:
|
|
std::shared_ptr<TLuaEngine> mEngine;
|
|
fs::path mPath;
|
|
std::unordered_map<std::string, fs::file_time_type> mFileTimes;
|
|
};
|