mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
26 lines
629 B
C++
26 lines
629 B
C++
#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, TTCPServer& TCPServer);
|
|
|
|
void operator()() override;
|
|
|
|
void UDPSend(TClient& Client, std::string Data) const;
|
|
void SendToAll(TClient* c, const std::string& Data, bool Self, bool Rel);
|
|
|
|
private:
|
|
TServer& mServer;
|
|
TPPSMonitor& mPPSMonitor;
|
|
TTCPServer& mTCPServer;
|
|
SOCKET mUDPSock {};
|
|
|
|
std::string UDPRcvFromClient(sockaddr_in& client) const;
|
|
}; |