Removed Tags file

Updated TODO file
TcpClient: Added parameterless contructor, id is now -2 by default which is invalid, Added SendBytes method for C style arrays
TcpServer: Added 2 CloseSocket function, one for TcpClient and another one for id, also added GetClientByID
client is now declared on the stack in VoidNetClient
Made Serializer code smaller, still need to integrate a compressor
This commit is contained in:
xX-TheDoctor-Xx
2016-08-01 14:22:59 +01:00
parent 0ac8b4f6e8
commit 81a065b98b
14 changed files with 78 additions and 40 deletions

View File

@ -16,6 +16,7 @@
class TcpClient
{
public:
TcpClient();
TcpClient(const SOCKET &socket);
TcpClient(const std::string &ip);
TcpClient(const std::string &ip, uint16 port = default_client_port);
@ -43,6 +44,7 @@ public:
const NetworkMessage &ReceiveMessage();
void SendMessage(const NetworkMessage &message);
void SendBytes(const std::vector<byte> &bytes);
void SendBytes(byte *bytes, uint32 lenght);
void SetOnDisconnectCallback(void (*func)(uint16));
void SetOnConnectCallback(void (*func)(uint16));
@ -54,7 +56,7 @@ private:
static void send_network_message(const NetworkMessage &message, TcpClient *client);
bool initialize(const std::string &ip, uint16 port = default_client_port);
uint16 id = 0;
uint16 id = -2;
std::string ip;
uint16 port = 0;
bool initialized = false;