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

Function nw_SendReliableAck

networking/networking.cpp:1225–1249  ·  view source on GitHub ↗

MTS: only used in this file

Source from the content-addressed store, hash-verified

1223}
1224// MTS: only used in this file
1225void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_type, float time_sent) {
1226 int ret;
1227 reliable_header ack_header;
1228 ack_header.type = RNT_ACK;
1229 // mprintf(0,"Sending ACK for sig %d.\n",sig);
1230 ack_header.data_len = INTEL_SHORT((int16_t)sizeof(uint32_t));
1231 ack_header.send_time = INTEL_FLOAT(time_sent);
1232 sig = INTEL_INT(sig);
1233 memcpy(&ack_header.data, &sig, sizeof(uint32_t));
1234
1235 network_address send_address;
1236 memset(&send_address, 0, sizeof(network_address));
1237
1238 send_address.connection_type = link_type;
1239
1240 if (NP_TCP == link_type) {
1241 SOCKADDR_IN *inaddr = (SOCKADDR_IN *)raddr;
1242 memcpy(send_address.address, &inaddr->sin_addr, 4);
1243 send_address.port = htons(inaddr->sin_port);
1244 send_address.connection_type = NP_TCP;
1245 }
1246
1247 ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&ack_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + sizeof(uint32_t),
1248 &send_address);
1249}
1250
1251void nw_DoNetworkIdle(void) {
1252 if (!Use_DirectPlay) {

Callers 1

nw_WorkReliableFunction · 0.85

Calls 1

nw_SendWithIDFunction · 0.85

Tested by

no test coverage detected