mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
Merge TUDPServer and TTCPServer into TNetwork
this gets rid of a bunch of unclear cases which I mistakenly created while refactoring for this rewrite. One example is having to call into TTCPServer to do UDP sending in some cases.
This commit is contained in:
committed by
Anonymous275
parent
05c5fb047c
commit
40cae31885
@@ -8,8 +8,7 @@
|
||||
#include <unordered_set>
|
||||
|
||||
class TClient;
|
||||
class TUDPServer;
|
||||
class TTCPServer;
|
||||
class TNetwork;
|
||||
class TPPSMonitor;
|
||||
|
||||
class TServer final {
|
||||
@@ -25,12 +24,12 @@ public:
|
||||
void ForEachClient(const std::function<bool(std::weak_ptr<TClient>)>& Fn);
|
||||
size_t ClientCount() const;
|
||||
|
||||
static void GlobalParser(const std::weak_ptr<TClient>& Client, std::string Packet, TPPSMonitor& PPSMonitor, TUDPServer& UDPServer, TTCPServer& TCPServer);
|
||||
static void GlobalParser(const std::weak_ptr<TClient>& Client, std::string Packet, TPPSMonitor& PPSMonitor, TNetwork& Network);
|
||||
static void HandleEvent(TClient& c, const std::string& Data);
|
||||
|
||||
private:
|
||||
TClientSet mClients;
|
||||
mutable RWMutex mClientsMutex;
|
||||
static void ParseVehicle(TClient& c, const std::string& Pckt, TTCPServer& TCPServer, TUDPServer& UDPServer);
|
||||
static void ParseVehicle(TClient& c, const std::string& Pckt, TNetwork& Network);
|
||||
static void Apply(TClient& c, int VID, const std::string& pckt);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user