Added Handshake class

Fixed NetworkBuffer include
Fixed some data types
TcpClient: Added SendBytes, SetOnDisconnectCallback, SetOnConnectCallback, SetOnMessageCallback methods and made callback std::function's private and fixed some method implementations
Added AcceptConnection on TcpServer
Fixed TcpServer AddToClientsList
This commit is contained in:
xX-TheDoctor-Xx
2016-08-01 00:28:22 +01:00
parent e677fdeb59
commit 0ac8b4f6e8
18 changed files with 143 additions and 25 deletions

25
include/Handshake.hpp Normal file
View File

@ -0,0 +1,25 @@
#ifndef HANDSHAKE_HPP
#define HANDSHAKE_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include "Defs.hpp"
#include <vector>
struct Handshake
{
Handshake();
Handshake(uint16 id, byte con_code);
~Handshake();
static const std::vector<byte> &EncodeHandshake(const Handshake &handshake);
static Handshake &DecodeHandshake(const std::vector<byte> &bytes);
uint16 id;
byte con_code;
};
#endif