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

Function MultiSendRequestCountermeasure

Descent3/multi.cpp:6108–6128  ·  view source on GitHub ↗

We're asking the server to create a countermeasure for us

Source from the content-addressed store, hash-verified

6106
6107// We're asking the server to create a countermeasure for us
6108void MultiSendRequestCountermeasure(int16_t objnum, int weapon_index) {
6109 int count = 0;
6110 uint8_t data[MAX_GAME_DATA_SIZE];
6111 int size_offset;
6112
6113 size_offset = START_DATA(MP_REQUEST_COUNTERMEASURE, data, &count);
6114
6115 MultiAddShort(objnum, data, &count);
6116
6117 uint32_t index = MultiGetMatchChecksum(OBJ_WEAPON, weapon_index);
6118 MultiAddUint(index, data, &count);
6119
6120 END_DATA(count, data, size_offset);
6121
6122 if (Netgame.local_role == LR_CLIENT)
6123 nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, false);
6124 else
6125 MultiDoRequestCountermeasure(data);
6126
6127 mprintf(0, "Sending out request for countermeasure!\n");
6128}
6129
6130// Server is telling us about a player who is changing his observer mode
6131void MultiDoObserverChange(uint8_t *data) {

Callers 1

Calls 7

START_DATAFunction · 0.85
MultiAddShortFunction · 0.85
MultiGetMatchChecksumFunction · 0.85
MultiAddUintFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85

Tested by

no test coverage detected