Skip to content

Commit

Permalink
Merge pull request GuckTubeYT#58 from Pode9935/patch-1
Browse files Browse the repository at this point in the history
Update sendPacketRaw
  • Loading branch information
GuckTubeYT authored Dec 23, 2023
2 parents 5e34e8a + 92568bd commit a5c4a11
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 a5c4a11

Please sign in to comment.