mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
add lua engine, lua file, server, client, vehicle data, other stuff
This commit is contained in:
committed by
Anonymous275
parent
e5e447c7af
commit
459814a6ec
26
include/TServer.h
Normal file
26
include/TServer.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user