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

Function MultiClientSendSpecialPacket

Descent3/multi.cpp:5671–5689  ·  view source on GitHub ↗

Sends the special script packet to the server

Source from the content-addressed store, hash-verified

5669
5670// Sends the special script packet to the server
5671void MultiClientSendSpecialPacket(uint8_t *outdata, int size) {
5672 MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER);
5673
5674 int count = 0;
5675 uint8_t data[MAX_GAME_DATA_SIZE];
5676 int size_offset;
5677
5678 size_offset = START_DATA(MP_SPECIAL_PACKET, data, &count);
5679
5680 MultiAddInt(size, data, &count);
5681
5682 // Send special packet data
5683 memcpy(&data[count], outdata, size);
5684 count += size;
5685
5686 END_DATA(count, data, size_offset);
5687
5688 nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, false);
5689}
5690
5691// Server is telling us to remove an object
5692void MultiDoRemoveObject(uint8_t *data) {

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