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

Function MultiSendPing

Descent3/multi.cpp:8186–8200  ·  view source on GitHub ↗

Sends a ping request to a player

Source from the content-addressed store, hash-verified

8184
8185// Sends a ping request to a player
8186void MultiSendPing(int slot) {
8187 int count = 0;
8188 uint8_t data[MAX_GAME_DATA_SIZE];
8189 int size_offset;
8190
8191 if (slot == Player_num)
8192 return;
8193 NetPlayers[slot].last_ping_time = timer_GetTime();
8194 size_offset = START_DATA(MP_PLAYER_PING, data, &count);
8195
8196 MultiAddByte(Player_num, data, &count);
8197 MultiAddFloat(NetPlayers[slot].last_ping_time, data, &count);
8198 END_DATA(count, data, size_offset);
8199 nw_Send(&NetPlayers[slot].addr, data, count, 0);
8200}
8201
8202void MultiDoPing(uint8_t *data, network_address *addr) {
8203 uint8_t outdata[MAX_GAME_DATA_SIZE];

Callers 2

MultiDoServerFrameFunction · 0.85
MultiDoClientFrameFunction · 0.85

Calls 5

START_DATAFunction · 0.85
MultiAddByteFunction · 0.85
MultiAddFloatFunction · 0.85
END_DATAFunction · 0.85
nw_SendFunction · 0.85

Tested by

no test coverage detected