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

Function IdlePTrack

netcon/mtclient/mtpilottracker.cpp:418–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418void IdlePTrack() {
419 // socket
420 if (D3ReadState == STATE_READING_PILOT) {
421 if ((DLLtimer_GetTime() - D3FirstSent) >= PILOT_REQ_TIMEOUT) {
422 D3ReadState = STATE_TIMED_OUT;
423
424 } else if ((DLLtimer_GetTime() - D3LastSent) >= PILOT_REQ_RESEND_TIME) {
425 // Send 'da packet
426 // sendto(pilotsock,(char *)&d3_pilot_req,d3_pilot_req.len,0,(SOCKADDR *)&ptrackaddr,sizeof(SOCKADDR_IN));
427 SendPilotTrackerPacket(&d3_pilot_req);
428 D3LastSent = DLLtimer_GetTime();
429 }
430 }
431
432 if (D3WriteState == STATE_SENDING_PILOT) {
433 if ((DLLtimer_GetTime() - D3FirstSentWrite) >= PILOT_REQ_TIMEOUT) {
434 D3WriteState = STATE_TIMED_OUT;
435
436 } else if ((DLLtimer_GetTime() - D3LastSentWrite) >= PILOT_REQ_RESEND_TIME) {
437 // Send 'da packet
438 SendPilotTrackerPacket(&d3_pilot_write);
439 // sendto(pilotsock,(char *)&d3_pilot_write,d3_pilot_write.len,0,(SOCKADDR *)&ptrackaddr,sizeof(SOCKADDR_IN));
440 D3LastSentWrite = DLLtimer_GetTime();
441 }
442 }
443 if (MOTDState == STATE_WAITING_MOTD) {
444 if ((DLLtimer_GetTime() - MOTDFirstSent) >= PILOT_REQ_TIMEOUT) {
445 MOTDState = STATE_TIMED_OUT;
446
447 } else if ((DLLtimer_GetTime() - MOTDLastSent) >= PILOT_REQ_RESEND_TIME) {
448 // Send 'da packet
449 SendPilotTrackerPacket(&motd_req);
450 MOTDLastSent = DLLtimer_GetTime();
451 }
452 }
453}
454
455void PollPTrackNet() {
456 IdlePTrack();

Callers 1

PollPTrackNetFunction · 0.85

Calls 1

SendPilotTrackerPacketFunction · 0.85

Tested by

no test coverage detected