Merge branch 'fix-avgpwrlvl' into 'master'

Fix avgpwrlvl

Closes #156

See merge request KartKrew/Kart!414
This commit is contained in:
Sal 2021-04-09 19:38:33 -04:00
commit b833907020
2 changed files with 3 additions and 6 deletions

View file

@ -989,13 +989,13 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
netbuffer->u.serverinfo.httpsource[MAX_MIRROR_LENGTH-1] = '\0'; netbuffer->u.serverinfo.httpsource[MAX_MIRROR_LENGTH-1] = '\0';
p = PutFileNeeded(0);
if (cv_kartusepwrlv.value) if (cv_kartusepwrlv.value)
netbuffer->u.serverinfo.avgpwrlv = K_CalculatePowerLevelAvg(); netbuffer->u.serverinfo.avgpwrlv = K_CalculatePowerLevelAvg();
else else
netbuffer->u.serverinfo.avgpwrlv = -1; netbuffer->u.serverinfo.avgpwrlv = -1;
p = PutFileNeeded(0);
HSendPacket(node, false, 0, p - ((UINT8 *)&netbuffer->u)); HSendPacket(node, false, 0, p - ((UINT8 *)&netbuffer->u));
} }

View file

@ -275,11 +275,8 @@ typedef struct
UINT8 actnum; UINT8 actnum;
UINT8 iszone; UINT8 iszone;
char httpsource[MAX_MIRROR_LENGTH]; // HTTP URL to download from, always defined for compatibility char httpsource[MAX_MIRROR_LENGTH]; // HTTP URL to download from, always defined for compatibility
UINT8 fileneeded[MAXFILENEEDED]; // is filled with writexxx (byteptr.h)
// Anything beyond this point won't be read by the normal SRB2 Master Server display.
// The MS uses a simple unpack, so the size of the packet above shouldn't be changed, either.
// As long as those two conditions are met, we can add as much information as we want to the end.
INT16 avgpwrlv; // Kart avg power level INT16 avgpwrlv; // Kart avg power level
UINT8 fileneeded[MAXFILENEEDED]; // is filled with writexxx (byteptr.h)
} ATTRPACK serverinfo_pak; } ATTRPACK serverinfo_pak;
typedef struct typedef struct