mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-03 09:51:15 +00:00
RRID: correct remaining instances of hardcoded sizes to defines
This commit is contained in:
parent
afe3220415
commit
3b67f99d0d
7 changed files with 27 additions and 27 deletions
|
|
@ -937,12 +937,12 @@ static boolean CL_SendJoin(void)
|
|||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
uint8_t signature[64];
|
||||
uint8_t signature[SIGNATURELENGTH];
|
||||
profile_t *localProfile = PR_GetLocalPlayerProfile(i);
|
||||
|
||||
if (PR_IsLocalPlayerGuest(i)) // GUESTS don't have keys
|
||||
{
|
||||
memset(signature, 0, 64);
|
||||
memset(signature, 0, sizeof(signature));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -957,7 +957,7 @@ static boolean CL_SendJoin(void)
|
|||
{
|
||||
CV_AddValue(&cv_badjoin, -1);
|
||||
CONS_Alert(CONS_WARNING, "cv_badjoin enabled, scrubbing signature from CL_SendJoin\n");
|
||||
memset(signature, 0, 64);
|
||||
memset(signature, 0, sizeof(signature));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -979,7 +979,7 @@ static boolean CL_SendKey(void)
|
|||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
// GUEST profiles have all-zero keys. This will be handled at the end of the challenge process, don't worry about it.
|
||||
memcpy(netbuffer->u.clientkey.key[i], PR_GetProfile(cv_lastprofile[i].value)->public_key, 32);
|
||||
memcpy(netbuffer->u.clientkey.key[i], PR_GetProfile(cv_lastprofile[i].value)->public_key, PUBKEYLENGTH);
|
||||
}
|
||||
return HSendPacket(servernode, false, 0, sizeof (clientkey_pak) );
|
||||
}
|
||||
|
|
@ -3808,7 +3808,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
newplayer->jointime = 0;
|
||||
|
||||
READSTRINGN(*p, player_names[newplayernum], MAXPLAYERNAME);
|
||||
READMEM(*p, players[newplayernum].public_key, 32);
|
||||
READMEM(*p, players[newplayernum].public_key, PUBKEYLENGTH);
|
||||
|
||||
console = READUINT8(*p);
|
||||
splitscreenplayer = READUINT8(*p);
|
||||
|
|
@ -3973,7 +3973,7 @@ const char *name, uint8_t *key, const char *name2, uint8_t *key2,
|
|||
const char *name3, uint8_t *key3, const char *name4, uint8_t *key4)
|
||||
{
|
||||
INT32 n, newplayernum, i;
|
||||
UINT8 buf[4 + MAXPLAYERNAME + 32 + MAXAVAILABILITY];
|
||||
UINT8 buf[4 + MAXPLAYERNAME + PUBKEYLENGTH + MAXAVAILABILITY];
|
||||
UINT8 *buf_p = buf;
|
||||
boolean newplayer = false;
|
||||
|
||||
|
|
@ -4036,25 +4036,25 @@ const char *name3, uint8_t *key3, const char *name4, uint8_t *key4)
|
|||
{
|
||||
nodetoplayer[node] = newplayernum;
|
||||
WRITESTRINGN(buf_p, name, MAXPLAYERNAME);
|
||||
WRITEMEM(buf_p, key, 32);
|
||||
WRITEMEM(buf_p, key, PUBKEYLENGTH);
|
||||
}
|
||||
else if (playerpernode[node] < 2)
|
||||
{
|
||||
nodetoplayer2[node] = newplayernum;
|
||||
WRITESTRINGN(buf_p, name2, MAXPLAYERNAME);
|
||||
WRITEMEM(buf_p, key2, 32);
|
||||
WRITEMEM(buf_p, key2, PUBKEYLENGTH);
|
||||
}
|
||||
else if (playerpernode[node] < 3)
|
||||
{
|
||||
nodetoplayer3[node] = newplayernum;
|
||||
WRITESTRINGN(buf_p, name3, MAXPLAYERNAME);
|
||||
WRITEMEM(buf_p, key3, 32);
|
||||
WRITEMEM(buf_p, key3, PUBKEYLENGTH);
|
||||
}
|
||||
else if (playerpernode[node] < 4)
|
||||
{
|
||||
nodetoplayer4[node] = newplayernum;
|
||||
WRITESTRINGN(buf_p, name4, MAXPLAYERNAME);
|
||||
WRITEMEM(buf_p, key4, 32);
|
||||
WRITEMEM(buf_p, key4, PUBKEYLENGTH);
|
||||
}
|
||||
|
||||
WRITEUINT8(buf_p, nodetoplayer[node]); // consoleplayer
|
||||
|
|
@ -5391,7 +5391,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||
|
||||
for (challengeplayers = 0; challengeplayers <= splitscreen; challengeplayers++)
|
||||
{
|
||||
uint8_t signature[64];
|
||||
uint8_t signature[SIGNATURELENGTH];
|
||||
profile_t *localProfile = PR_GetLocalPlayerProfile(challengeplayers);
|
||||
if (!PR_IsLocalPlayerGuest(challengeplayers)) // GUESTS don't have keys
|
||||
{
|
||||
|
|
@ -5407,7 +5407,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||
{
|
||||
CV_AddValue(&cv_badresponse, -1);
|
||||
CONS_Alert(CONS_WARNING, "cv_badresponse enabled, scrubbing signature from PT_RESPONSEALL\n");
|
||||
memset(signature, 0, 64);
|
||||
memset(signature, 0, sizeof(signature));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ struct clientconfig_pak
|
|||
UINT8 mode;
|
||||
char names[MAXSPLITSCREENPLAYERS][MAXPLAYERNAME];
|
||||
UINT8 availabilities[MAXAVAILABILITY];
|
||||
uint8_t challengeResponse[MAXSPLITSCREENPLAYERS][64];
|
||||
uint8_t challengeResponse[MAXSPLITSCREENPLAYERS][SIGNATURELENGTH];
|
||||
} ATTRPACK;
|
||||
|
||||
#define SV_SPEEDMASK 0x03 // used to send kartspeed
|
||||
|
|
@ -367,7 +367,7 @@ struct filesneededconfig_pak
|
|||
|
||||
struct clientkey_pak
|
||||
{
|
||||
uint8_t key[MAXSPLITSCREENPLAYERS][32];
|
||||
uint8_t key[MAXSPLITSCREENPLAYERS][PUBKEYLENGTH];
|
||||
} ATTRPACK;
|
||||
|
||||
struct serverchallenge_pak
|
||||
|
|
@ -382,12 +382,12 @@ struct challengeall_pak
|
|||
|
||||
struct responseall_pak
|
||||
{
|
||||
uint8_t signature[MAXSPLITSCREENPLAYERS][64];
|
||||
uint8_t signature[MAXSPLITSCREENPLAYERS][SIGNATURELENGTH];
|
||||
} ATTRPACK;
|
||||
|
||||
struct resultsall_pak
|
||||
{
|
||||
uint8_t signature[MAXPLAYERS][64];
|
||||
uint8_t signature[MAXPLAYERS][SIGNATURELENGTH];
|
||||
} ATTRPACK;
|
||||
|
||||
//
|
||||
|
|
@ -401,7 +401,7 @@ struct doomdata_t
|
|||
|
||||
UINT8 packettype;
|
||||
#ifdef SIGNGAMETRAFFIC
|
||||
uint8_t signature[MAXSPLITSCREENPLAYERS][64];
|
||||
uint8_t signature[MAXSPLITSCREENPLAYERS][SIGNATURELENGTH];
|
||||
#endif
|
||||
UINT8 reserved; // Padding
|
||||
union
|
||||
|
|
@ -497,11 +497,11 @@ extern boolean acceptnewnode;
|
|||
extern SINT8 servernode;
|
||||
extern char connectedservername[MAXSERVERNAME];
|
||||
extern UINT32 ourIP;
|
||||
extern uint8_t lastReceivedKey[MAXNETNODES][MAXSPLITSCREENPLAYERS][32];
|
||||
extern uint8_t lastReceivedKey[MAXNETNODES][MAXSPLITSCREENPLAYERS][PUBKEYLENGTH];
|
||||
extern uint8_t lastSentChallenge[MAXNETNODES][CHALLENGELENGTH];
|
||||
extern uint8_t lastChallengeAll[CHALLENGELENGTH];
|
||||
extern uint8_t lastReceivedSignature[MAXPLAYERS][64];
|
||||
extern uint8_t knownWhenChallenged[MAXPLAYERS][32];
|
||||
extern uint8_t lastReceivedSignature[MAXPLAYERS][SIGNATURELENGTH];
|
||||
extern uint8_t knownWhenChallenged[MAXPLAYERS][PUBKEYLENGTH];
|
||||
extern boolean expectChallenge;
|
||||
|
||||
// We give clients a chance to verify each other once per race.
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ struct player_t
|
|||
mobj_t *stumbleIndicator;
|
||||
mobj_t *sliptideZipIndicator;
|
||||
|
||||
uint8_t public_key[32];
|
||||
uint8_t public_key[PUBKEYLENGTH];
|
||||
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
|
|
|
|||
|
|
@ -2436,7 +2436,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
|
||||
SINT8 xtralife;
|
||||
|
||||
uint8_t public_key[32];
|
||||
uint8_t public_key[PUBKEYLENGTH];
|
||||
|
||||
// SRB2kart
|
||||
itemroulette_t itemRoulette;
|
||||
|
|
|
|||
|
|
@ -600,7 +600,7 @@ static char rrid_buf[256];
|
|||
char *GetPrettyRRID(const unsigned char *bin, boolean brief)
|
||||
{
|
||||
size_t i;
|
||||
size_t len = 32;
|
||||
size_t len = PUBKEYLENGTH;
|
||||
|
||||
if (brief)
|
||||
len = 8;
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ struct profile_t
|
|||
// Profile header
|
||||
char profilename[PROFILENAMELEN+1]; // Profile name (not to be confused with player name)
|
||||
|
||||
uint8_t public_key[32]; // Netgame authentication
|
||||
uint8_t secret_key[64];
|
||||
uint8_t public_key[PUBKEYLENGTH]; // Netgame authentication
|
||||
uint8_t secret_key[PRIVKEYLENGTH];
|
||||
|
||||
// Player data
|
||||
char playername[MAXPLAYERNAME+1]; // Player name
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].sliptideZipDelay);
|
||||
WRITEUINT16(save->p, players[i].sliptideZipBoost);
|
||||
|
||||
WRITEMEM(save->p, players[i].public_key, 32);
|
||||
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
// respawnvars_t
|
||||
WRITEUINT8(save->p, players[i].respawn.state);
|
||||
|
|
@ -789,7 +789,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].sliptideZipDelay = READUINT8(save->p);
|
||||
players[i].sliptideZipBoost = READUINT16(save->p);
|
||||
|
||||
READMEM(save->p, players[i].public_key, 32);
|
||||
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
// respawnvars_t
|
||||
players[i].respawn.state = READUINT8(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue