mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
added userData field to ENetPacket
This commit is contained in:
parent
5ff8ccb74f
commit
8ff344897a
3 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
* added userData field to ENetPacket
|
||||
* changed how random seed is generated on Windows to avoid import warnings
|
||||
* fixed case where disconnects could be generated with no preceding connect event
|
||||
|
||||
|
|
|
@ -143,6 +143,7 @@ typedef struct _ENetPacket
|
|||
enet_uint8 * data; /**< allocated data for packet */
|
||||
size_t dataLength; /**< length of data */
|
||||
ENetPacketFreeCallback freeCallback; /**< function to be called when the packet is no longer in use */
|
||||
void * userData; /**< application private data, may be freely modified */
|
||||
} ENetPacket;
|
||||
|
||||
typedef struct _ENetAcknowledgement
|
||||
|
|
3
packet.c
3
packet.c
|
@ -45,6 +45,7 @@ enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags)
|
|||
packet -> flags = flags;
|
||||
packet -> dataLength = dataLength;
|
||||
packet -> freeCallback = NULL;
|
||||
packet -> userData = NULL;
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
@ -115,7 +116,7 @@ reflect_crc (int val, int bits)
|
|||
}
|
||||
|
||||
static void
|
||||
initialize_crc32 ()
|
||||
initialize_crc32 (void)
|
||||
{
|
||||
int byte;
|
||||
|
||||
|
|
Loading…
Reference in a new issue