mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-13 19:58:21 +00:00
08020cd86d
* chore: cleanup LU(W)string writing and add methods for reading remove redunent "packet" from packet reading helpers move write header to bitstreamutils since it's not packet related add tests for reading/writing LU(W)Strings * remove un-needed function defintions in header * make reading and writing more efficient * p p * quotes * remove unneeded default --------- Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
20 lines
599 B
C++
20 lines
599 B
C++
#ifndef PACKETUTILS_H
|
|
#define PACKETUTILS_H
|
|
|
|
#include <MessageIdentifiers.h>
|
|
#include <BitStream.h>
|
|
#include <string>
|
|
|
|
enum class eConnectionType : uint16_t;
|
|
|
|
namespace PacketUtils {
|
|
uint16_t ReadU16(uint32_t startLoc, Packet* packet);
|
|
uint32_t ReadU32(uint32_t startLoc, Packet* packet);
|
|
uint64_t ReadU64(uint32_t startLoc, Packet* packet);
|
|
int64_t ReadS64(uint32_t startLoc, Packet* packet);
|
|
std::string ReadString(uint32_t startLoc, Packet* packet, bool wide, uint32_t maxLen = 33);
|
|
void SavePacket(const std::string& filename, const char* data, size_t length);
|
|
};
|
|
|
|
#endif // PACKETUTILS_H
|