add lua engine, lua file, server, client, vehicle data, other stuff

This commit is contained in:
Lion Kortlepel
2021-02-15 02:35:15 +01:00
committed by Anonymous275
parent e5e447c7af
commit 459814a6ec
21 changed files with 1538 additions and 15 deletions

26
include/TServer.h Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include <functional>
#include <memory>
#include <mutex>
#include <unordered_set>
#include "RWMutex.h"
class TClient;
class TServer final {
public:
using TClientSet = std::unordered_set<std::shared_ptr<TClient>>;
TServer(int argc, char** argv);
std::weak_ptr<TClient> InsertNewClient();
void RemoveClient(std::weak_ptr<TClient>);
void ForEachClient(std::function<bool(std::weak_ptr<TClient>)>);
size_t ClientCount() const;
private:
TClientSet _Clients;
mutable RWMutex _ClientsMutex;
};