mirror of
https://github.com/StyledStrike/gmod-custom-loadout.git
synced 2025-03-04 03:03:09 -05:00
Prevent receiving large data
This commit is contained in:
parent
859982989b
commit
acb09337d2
@ -8,6 +8,7 @@ CLoadout.cache = {}
|
||||
-- safe guard against spam
|
||||
CLoadout.cooldown = {}
|
||||
CLoadout.spamCount = {}
|
||||
CLoadout.maxLength = 8192
|
||||
|
||||
function CLoadout:IsAvailableForPlayer( ply )
|
||||
if not IsValid( ply ) then
|
||||
@ -112,6 +113,12 @@ function CLoadout:ReceiveData( len, ply )
|
||||
return
|
||||
end
|
||||
|
||||
if len > CLoadout.maxLength then
|
||||
CLoadout.PrintF( "%s <%s> has sent loadout data that was too big!", ply:Nick(), steamId )
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
self.cooldown[steamId] = t + 1
|
||||
self.spamCount[steamId] = 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user