mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-06 16:31:47 +00:00
Added a bit of a fun limitation.
* Made it so (player->availabilities & 1 << skinnum) is only true if skins[skinnum] DOES have an availability method, and always false otherwise. * This means that setting your availabilities to INT32_MAX is no longer the equivalent of having gotten all skins. * This means we can detect and kick cheat engine script kiddies who try to fool the server that they can use everything. * This means availabilities of 0x00 is now valid, so make it all F's for an invalid not-in-game.
This commit is contained in:
parent
ced6cd4349
commit
096921cbbf
3 changed files with 14 additions and 4 deletions
|
@ -1366,8 +1366,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||||
// which is nice and easy for us to detect
|
// which is nice and easy for us to detect
|
||||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||||
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
||||||
// ...except for availabilities, where 00 is nonexistent
|
memset(netbuffer->u.servercfg.playeravailabilities, 0xFF, sizeof(netbuffer->u.servercfg.playeravailabilities));
|
||||||
memset(netbuffer->u.servercfg.playeravailabilities, 0x00, sizeof(netbuffer->u.servercfg.playeravailabilities));
|
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
@ -3498,7 +3497,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
||||||
{
|
{
|
||||||
if (netbuffer->u.servercfg.playerskins[j] == 0xFF
|
if (netbuffer->u.servercfg.playerskins[j] == 0xFF
|
||||||
&& netbuffer->u.servercfg.playercolor[j] == 0xFF
|
&& netbuffer->u.servercfg.playercolor[j] == 0xFF
|
||||||
&& netbuffer->u.servercfg.playeravailabilities[j] == 0x00)
|
&& netbuffer->u.servercfg.playeravailabilities[j] == 0xFFFFFFFF)
|
||||||
continue; // not in game
|
continue; // not in game
|
||||||
|
|
||||||
playeringame[j] = true;
|
playeringame[j] = true;
|
||||||
|
|
|
@ -1329,6 +1329,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||||
if (server && (p != &players[consoleplayer] && p != &players[secondarydisplayplayer]))
|
if (server && (p != &players[consoleplayer] && p != &players[secondarydisplayplayer]))
|
||||||
{
|
{
|
||||||
boolean kick = false;
|
boolean kick = false;
|
||||||
|
INT32 s;
|
||||||
|
|
||||||
// team colors
|
// team colors
|
||||||
if (G_GametypeHasTeams())
|
if (G_GametypeHasTeams())
|
||||||
|
@ -1343,6 +1344,16 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||||
if (!p->skincolor)
|
if (!p->skincolor)
|
||||||
kick = true;
|
kick = true;
|
||||||
|
|
||||||
|
// availabilities
|
||||||
|
for (s = 0; s < MAXSKINS; s++)
|
||||||
|
{
|
||||||
|
if (!skins[s].availability && (p->availabilities & (1 << s)))
|
||||||
|
{
|
||||||
|
kick = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (kick)
|
if (kick)
|
||||||
{
|
{
|
||||||
XBOXSTATIC UINT8 buf[2];
|
XBOXSTATIC UINT8 buf[2];
|
||||||
|
|
|
@ -2561,7 +2561,7 @@ UINT32 R_GetSkinAvailabilities(void)
|
||||||
|
|
||||||
for (s = 0; s < MAXSKINS; s++)
|
for (s = 0; s < MAXSKINS; s++)
|
||||||
{
|
{
|
||||||
if (!skins[s].availability || unlockables[skins[s].availability - 1].unlocked)
|
if (skins[s].availability && unlockables[skins[s].availability - 1].unlocked)
|
||||||
response |= (1 << s);
|
response |= (1 << s);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|
Loading…
Reference in a new issue