restructure project
This commit is contained in:
36
include/td/network/Connexion.h
Normal file
36
include/td/network/Connexion.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "td/network/TCPSocket.h"
|
||||
#include "td/protocol/PacketHandler.h"
|
||||
#include "td/protocol/PacketDispatcher.h"
|
||||
#include "td/game/Player.h"
|
||||
|
||||
namespace td {
|
||||
namespace protocol {
|
||||
|
||||
class Connexion : public protocol::PacketHandler {
|
||||
protected:
|
||||
protocol::PacketDispatcher m_Dispatcher;
|
||||
private:
|
||||
network::TCPSocket m_Socket;
|
||||
public:
|
||||
Connexion();
|
||||
Connexion(Connexion&& move);
|
||||
Connexion(protocol::PacketDispatcher* dispatcher);
|
||||
Connexion(protocol::PacketDispatcher* dispatcher, network::TCPSocket& socket);
|
||||
virtual ~Connexion();
|
||||
|
||||
virtual bool UpdateSocket();
|
||||
void CloseConnection();
|
||||
|
||||
bool Connect(const std::string& address, std::uint16_t port);
|
||||
|
||||
network::Socket::Status GetSocketStatus() const { return m_Socket.GetStatus(); }
|
||||
|
||||
void SendPacket(const protocol::Packet* packet);
|
||||
|
||||
REMOVE_COPY(Connexion);
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user