ajouts dans netprot

This commit is contained in:
MarcEricMartel
2023-10-24 10:43:30 -04:00
parent cf6e58cd95
commit 4964bc5394
2 changed files with 65 additions and 2 deletions

View File

@@ -19,6 +19,11 @@ namespace netprot {
LAST_PACK
};
struct Packet {
void* ptr;
PACKET_TYPE type;
};
struct Keys {
bool forward,
backward,
@@ -117,6 +122,8 @@ namespace netprot {
PacketType getType(char* buf, uint32_t buflen); // srv/cli
Packet getPack(char* buf, uint32_t buflen);
template <class T> void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen);
template <class T> void sendPackTo(SOCKET sock, T* pack, char** buf, uint32_t* buflen, sockaddr_in* sockad);