refactor: format code
This commit is contained in:
@@ -12,15 +12,15 @@
|
||||
namespace td {
|
||||
namespace protocol {
|
||||
|
||||
Connexion::Connexion() : protocol::PacketHandler(nullptr){
|
||||
Connexion::Connexion() : protocol::PacketHandler(nullptr) {
|
||||
|
||||
}
|
||||
|
||||
Connexion::Connexion(Connexion&& move) : protocol::PacketHandler(&m_Dispatcher), m_Socket(std::move(move.m_Socket)){
|
||||
Connexion::Connexion(Connexion&& move) : protocol::PacketHandler(&m_Dispatcher), m_Socket(std::move(move.m_Socket)) {
|
||||
|
||||
}
|
||||
|
||||
Connexion::Connexion(protocol::PacketDispatcher* dispatcher) : protocol::PacketHandler(dispatcher){
|
||||
Connexion::Connexion(protocol::PacketDispatcher* dispatcher) : protocol::PacketHandler(dispatcher) {
|
||||
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ Connexion::Connexion(protocol::PacketDispatcher* dispatcher, network::TCPSocket&
|
||||
|
||||
}
|
||||
|
||||
bool Connexion::updateSocket(){
|
||||
if(m_Socket.GetStatus() != network::Socket::Connected)
|
||||
bool Connexion::updateSocket() {
|
||||
if (m_Socket.GetStatus() != network::Socket::Connected)
|
||||
return false;
|
||||
|
||||
DataBuffer buffer;
|
||||
m_Socket.Receive(buffer, sizeof(std::uint64_t));
|
||||
if (buffer.GetSize() > 0){
|
||||
if (buffer.GetSize() > 0) {
|
||||
std::uint64_t packetLenght;
|
||||
buffer >> packetLenght;
|
||||
|
||||
@@ -52,24 +52,24 @@ bool Connexion::updateSocket(){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Connexion::connect(const std::string& address, std::uint16_t port){
|
||||
if(!m_Socket.Connect(address, port)){
|
||||
bool Connexion::connect(const std::string& address, std::uint16_t port) {
|
||||
if (!m_Socket.Connect(address, port)) {
|
||||
return false;
|
||||
}
|
||||
m_Socket.SetBlocking(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Connexion::sendPacket(protocol::Packet* packet){
|
||||
void Connexion::sendPacket(protocol::Packet* packet) {
|
||||
network::SendPacket(packet->Serialize(), m_Socket);
|
||||
}
|
||||
|
||||
void Connexion::closeConnection(){
|
||||
void Connexion::closeConnection() {
|
||||
m_Socket.Disconnect();
|
||||
}
|
||||
|
||||
Connexion::~Connexion(){
|
||||
|
||||
Connexion::~Connexion() {
|
||||
|
||||
}
|
||||
|
||||
} // namespace server
|
||||
|
||||
Reference in New Issue
Block a user