mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-22 12:16:14 +01:00
IP Banning
Yeah test
This commit is contained in:
@@ -17,6 +17,27 @@ world/IsBanned(key,address,computer_id)
|
||||
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
|
||||
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
|
||||
|
||||
if(config && config.ip_blacklist_enabled)
|
||||
testing("Loading Blacklist")
|
||||
var/text = file2text("data/ip_blacklist.txt")
|
||||
if (!text)
|
||||
error("Failed to load data/ip_blacklist.txt")
|
||||
else
|
||||
var/list/lines = text2list(text, "\n")
|
||||
for(var/line in lines)
|
||||
if (!line)
|
||||
continue
|
||||
|
||||
if (copytext(line, 1, 2) == ";")
|
||||
continue
|
||||
|
||||
var/banned_address = copytext(line, 1, length(line)+1)
|
||||
testing("Blacklist: address:[address] - banned_address:[banned_address]")
|
||||
if(banned_address == address)
|
||||
log_access("Failed Login: [src] - Blacklisted IP (ToR)")
|
||||
message_admins("\blue Failed Login: [src] - Blacklisted IP (ToR)")
|
||||
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
|
||||
return list("reason"="IP Blacklisted", "desc"="\nReason: This IP has been blacklisted from the server.\nIf you believe this is a mistake, please request help at [config.banappeals]")
|
||||
|
||||
if(config.ban_legacy_system)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user