MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / CopyPacket

Function CopyPacket

Source/multi.cpp:102–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void CopyPacket(TBuffer *buf, const byte *packet, size_t size)
103{
104 if (buf->dwNextWriteOffset + size + 2 > 0x1000) {
105 return;
106 }
107
108 byte *p = &buf->bData[buf->dwNextWriteOffset];
109 buf->dwNextWriteOffset += size + 1;
110 *p = static_cast<byte>(size);
111 p++;
112 memcpy(p, packet, size);
113 p[size] = byte { 0 };
114}
115
116byte *CopyBufferedPackets(byte *destination, TBuffer *source, size_t *size)
117{

Callers 2

NetSendLoPriFunction · 0.85
NetSendHiPriFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected