HSendPacket
| 438 | // HSendPacket |
| 439 | // |
| 440 | void HSendPacket (int node, int len) |
| 441 | { |
| 442 | if (debugfile && node != 0) |
| 443 | { |
| 444 | int i, k, realretrans; |
| 445 | |
| 446 | if (netbuffer[0] & NCMD_SETUP) |
| 447 | { |
| 448 | fprintf (debugfile,"%i/%i send %i = SETUP [%3i]", gametic, maketic, node, len); |
| 449 | for (i = 0; i < len; i++) |
| 450 | fprintf (debugfile," %2x", ((uint8_t *)netbuffer)[i]); |
| 451 | } |
| 452 | else if (netbuffer[0] & NCMD_EXIT) |
| 453 | { |
| 454 | fprintf (debugfile,"%i/%i send %i = EXIT [%3i]", gametic, maketic, node, len); |
| 455 | for (i = 0; i < len; i++) |
| 456 | fprintf (debugfile," %2x", ((uint8_t *)netbuffer)[i]); |
| 457 | } |
| 458 | else |
| 459 | { |
| 460 | k = 2; |
| 461 | |
| 462 | if (NetMode == NET_PacketServer && myconnectindex == Net_Arbitrator && |
| 463 | node != 0) |
| 464 | { |
| 465 | k++; |
| 466 | } |
| 467 | |
| 468 | if (netbuffer[0] & NCMD_RETRANSMIT) |
| 469 | realretrans = ExpandTics (netbuffer[k++]); |
| 470 | else |
| 471 | realretrans = -1; |
| 472 | |
| 473 | int numtics = netbuffer[0] & 3; |
| 474 | if (numtics == 3) |
| 475 | numtics += netbuffer[k++]; |
| 476 | |
| 477 | fprintf (debugfile,"%i/%i send %i = (%i + %i, R %i) [%3i]", |
| 478 | gametic, maketic, |
| 479 | node, |
| 480 | ExpandTics(netbuffer[1]), |
| 481 | numtics, realretrans, len); |
| 482 | |
| 483 | for (i = 0; i < len; i++) |
| 484 | fprintf (debugfile, "%c%2x", i==k?'|':' ', ((uint8_t *)netbuffer)[i]); |
| 485 | } |
| 486 | fprintf (debugfile, " [[ "); |
| 487 | for (i = 0; i < doomcom.numnodes; ++i) |
| 488 | { |
| 489 | if (nodeingame[i]) |
| 490 | { |
| 491 | fprintf (debugfile, "%d ", nettics[i]); |
| 492 | } |
| 493 | else |
| 494 | { |
| 495 | fprintf (debugfile, "--- "); |
| 496 | } |
| 497 | } |
no test coverage detected