1er commit

This commit is contained in:
2021-08-21 10:14:47 +02:00
commit a99ecf7c2d
99 changed files with 66605 additions and 0 deletions

36
include/game/Connexion.h Normal file
View File

@@ -0,0 +1,36 @@
#pragma once
#include "network/TCPSocket.h"
#include "protocol/PacketHandler.h"
#include "protocol/PacketDispatcher.h"
#include "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(protocol::Packet* packet);
REMOVE_COPY(Connexion);
};
} // namespace server
} // namespace td