
Originally Posted by
TheJoker
People already spoof their player count in csgo but didn't know they blacklist the server on gmod
Yeah they use a Lua addon to blacklist them.
Code:
local BlackList = {
Addresses = {},
Hostnames = {},
Descripts = {},
Gamemodes = {}
}
steamworks.FileInfo( 580620784, function( result )
if ( !result ) then return end
steamworks.Download( result.fileid, false, function( name )
local fs = file.Open( name, "r", "MOD" )
local data = fs:Read( fs:Size() )
fs:Close()
BlackList = util.JSONToTable( data ) or {}
BlackList.Addresses = BlackList.Addresses or {}
BlackList.Hostnames = BlackList.Hostnames or {}
BlackList.Descripts = BlackList.Descripts or {}
BlackList.Gamemodes = BlackList.Gamemodes or {}
BlackList.Maps = BlackList.Maps or {}
BlackList.Translations = BlackList.Translations or {}
BlackList.TranslatedHostnames = BlackList.TranslatedHostnames or {}
end )
end )
steamworks.Unsubscribe( 580620784 )
local function IsServerBlacklisted( address, hostname, description, gamemode, map )
address = address:match( "[^:]*" )
for k, v in ipairs( BlackList.Addresses ) do
if address == v then
return true
end
end
if ( #BlackList.TranslatedHostnames > 0 && table.Count( BlackList.Translations ) > 1 ) then
local hostname_tr = hostname
for bad, good in pairs( BlackList.Translations ) do
while ( hostname_tr:find( bad ) ) do
local s, e = hostname_tr:find( bad )
hostname_tr = hostname_tr:sub( 0, s - 1 ) .. good .. hostname_tr:sub( e + 1 )
end
end
for k, v in ipairs( BlackList.TranslatedHostnames ) do
if string.match( hostname_tr, v ) then
return true
end
end
end
for k, v in ipairs( BlackList.Hostnames ) do
if string.match( hostname, v ) then
return true
end
end
for k, v in ipairs( BlackList.Descripts ) do
if string.match( description, v ) then
return true
end
end
for k, v in ipairs( BlackList.Gamemodes ) do
if string.match( gamemode, v ) then
return true
end
end
for k, v in ipairs( BlackList.Maps ) do
if string.match( map, v ) then
return true
end
end
return false
end
'garrysmod\lua\menu\mainmenu.lua' lines 222 to 297.