MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiSendSpecialPacket

Function MultiSendSpecialPacket

Descent3/multi.cpp:5650–5668  ·  view source on GitHub ↗

Sends the special script packet to a player

Source from the content-addressed store, hash-verified

5648
5649// Sends the special script packet to a player
5650void MultiSendSpecialPacket(int slot, uint8_t *outdata, int size) {
5651 MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER);
5652
5653 int count = 0;
5654 uint8_t data[MAX_GAME_DATA_SIZE];
5655 int size_offset;
5656
5657 size_offset = START_DATA(MP_SPECIAL_PACKET, data, &count, 1);
5658
5659 MultiAddInt(size, data, &count);
5660
5661 // Send special packet data
5662 memcpy(&data[count], outdata, size);
5663 count += size;
5664
5665 END_DATA(count, data, size_offset);
5666
5667 nw_SendReliable(NetPlayers[slot].reliable_socket, data, count, true);
5668}
5669
5670// Sends the special script packet to the server
5671void MultiClientSendSpecialPacket(uint8_t *outdata, int size) {

Callers

nothing calls this directly

Calls 4

START_DATAFunction · 0.85
MultiAddIntFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85

Tested by

no test coverage detected