Skip to content

Commit

Permalink
Update sendPacketRaw
Browse files Browse the repository at this point in the history
  • Loading branch information
Pode9935 authored Dec 10, 2023
1 parent 5e34e8a commit 92568bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packet/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ void enet_peerSend(ENetPacket* packet, ENetPeer* peer) {
}

void sendPacketRaw(void* packet, int packetSize, ENetPeer* peer) {
ENetPacket* enetPacket = enet_packet_create(NULL, packetSize + 1, ENET_PACKET_FLAG_RELIABLE);
memcpy(enetPacket->data, packet, packetSize);
int typ = NET_MESSAGE_GAME_PACKET;
ENetPacket* enetPacket = enet_packet_create(NULL, packetSize + 5, ENET_PACKET_FLAG_RELIABLE);
memcpy(enetPacket->data, &typ, 4);
memcpy(enetPacket->data + 4, packet, packetSize);
enet_peerSend(enetPacket, peer);
}

Expand Down

0 comments on commit 92568bd

Please sign in to comment.