Kinda works like before
This commit is contained in:
@@ -58,12 +58,15 @@ public:
|
||||
void UpdateSize();
|
||||
char* ReadData(int SizeOfData);
|
||||
void ChangePacketID(unsigned int& packetID);
|
||||
void ChangeSequenceNumber(int sequenceNumber, int sequenceLength);
|
||||
size_t Size() { return m_Offset; };
|
||||
char* Data() { return m_Data; };
|
||||
MessageType GetMessageType();
|
||||
size_t DataReadSize() { return m_ReturnDataOffset; }
|
||||
size_t MaxSize() { return m_MaxPacketSize; }
|
||||
size_t HeaderSize() { return m_HeaderSize; }
|
||||
size_t SequenceNumber();
|
||||
size_t SequenceLength();
|
||||
|
||||
private:
|
||||
char* m_Data;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#ifndef UDPClient_h__
|
||||
#define UDPClient_h__
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include "Network/NetworkClient.h"
|
||||
|
||||
class UDPClient : public NetworkClient
|
||||
{
|
||||
// TODO: add packets to map.
|
||||
public:
|
||||
UDPClient();
|
||||
~UDPClient();
|
||||
@@ -23,6 +25,7 @@ private:
|
||||
boost::shared_ptr<boost::asio::ip::udp::socket> m_Socket;
|
||||
int readBuffer();
|
||||
PacketID m_SendPacketID = 0;
|
||||
std::unordered_map<unsigned int, boost::shared_ptr<char>> packetSegmentMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "NetworkServer.h"
|
||||
#include <boost/asio/ip/udp.hpp>
|
||||
#define MAXPACKETSIZE 32000
|
||||
|
||||
class UDPServer : public NetworkServer
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user