mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-14 11:46:12 +00:00
add udpserver, tcpserver
This commit is contained in:
committed by
Anonymous275
parent
f19a012509
commit
bf74b1ae32
26
include/TUDPServer.h
Normal file
26
include/TUDPServer.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client.h"
|
||||
#include "Common.h"
|
||||
#include "Compat.h"
|
||||
#include "IThreaded.h"
|
||||
#include "TPPSMonitor.h"
|
||||
#include "TServer.h"
|
||||
|
||||
class TUDPServer : public IThreaded {
|
||||
public:
|
||||
explicit TUDPServer(TServer& Server, TPPSMonitor& PPSMonitor);
|
||||
|
||||
void operator()() override;
|
||||
|
||||
void UDPSend(TClient& Client, std::string Data) const;
|
||||
void SendToAll(TClient* c, const std::string& Data, bool Self, bool Rel);
|
||||
|
||||
private:
|
||||
void UDPParser(TClient& Client, std::string Packet);
|
||||
|
||||
TServer& mServer;
|
||||
TPPSMonitor& mPPSMonitor;
|
||||
SOCKET mUDPSock;
|
||||
std::string UDPRcvFromClient(sockaddr_in& client) const;
|
||||
};
|
||||
Reference in New Issue
Block a user