Skip to content

Commit

Permalink
Print offsets of players/entities in MVD frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Jul 18, 2024
1 parent 1201e49 commit 6f02a98
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/server/mvd/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ static void MVD_ParsePacketEntities(mvd_t *mvd)
edict_t *ent;

while (1) {
#if USE_DEBUG
uint32_t readcount = msg_read.readcount;
#endif
if (msg_read.readcount > msg_read.cursize) {
MVD_Destroyf(mvd, "%s: read past end of message", __func__);
}
Expand All @@ -667,10 +670,10 @@ static void MVD_ParsePacketEntities(mvd_t *mvd)

#if USE_DEBUG
if (mvd_shownet->integer > 2) {
Com_Printf(" %s: %d ", ent->inuse ?
"delta" : "baseline", number);
Com_LPrintf(PRINT_DEVELOPER, "%3u:%s:%d ", readcount,
ent->inuse ? "delta" : "baseline", number);
MSG_ShowDeltaEntityBits(bits);
Com_Printf("\n");
Com_LPrintf(PRINT_DEVELOPER, "\n");
}
#endif

Expand All @@ -686,7 +689,7 @@ static void MVD_ParsePacketEntities(mvd_t *mvd)

// shuffle current origin to old if removed
if (bits & U_REMOVE) {
SHOWNET(2, " remove: %d\n", number);
SHOWNET(2, "%3u:remove:%d\n", readcount, number);
if (!(ent->s.renderfx & RF_BEAM)) {
VectorCopy(ent->s.origin, ent->s.old_origin);
}
Expand All @@ -713,6 +716,9 @@ static void MVD_ParsePacketPlayers(mvd_t *mvd)
mvd_player_t *player;

while (1) {
#if USE_DEBUG
uint32_t readcount = msg_read.readcount;
#endif
if (msg_read.readcount > msg_read.cursize) {
MVD_Destroyf(mvd, "%s: read past end of message", __func__);
}
Expand All @@ -732,17 +738,17 @@ static void MVD_ParsePacketPlayers(mvd_t *mvd)

#if USE_DEBUG
if (mvd_shownet->integer > 2) {
Com_Printf(" %s: %d ", player->inuse ?
"delta" : "baseline", number);
Com_LPrintf(PRINT_DEVELOPER, "%3u:%s:%d ", readcount,
player->inuse ? "delta" : "baseline", number);
MSG_ShowDeltaPlayerstateBits_Packet(bits);
Com_Printf("\n");
Com_LPrintf(PRINT_DEVELOPER, "\n");
}
#endif

MSG_ParseDeltaPlayerstate_Packet(&player->ps, &player->ps, bits, mvd->psFlags);

if (bits & PPS_REMOVE) {
SHOWNET(2, " remove: %d\n", number);
SHOWNET(2, "%3u:remove:%d\n", readcount, number);
player->inuse = false;
continue;
}
Expand Down

0 comments on commit 6f02a98

Please sign in to comment.