mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Committing this because I just merged it into Facepunch code for like the 49548083603th time ;_; - Added the ability to ban somebody by IP-address when giving permabans.
It's not quite as well done as I'd like it but it works and can be helpful. IP bans are kinda lame so please only use them for multikeyers/extreme-douchebags and such. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4255 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -36,10 +36,10 @@ var/savefile/Banlist
|
||||
if(matches)
|
||||
matches += "/"
|
||||
matches += "id"
|
||||
// if( address == Banlist["ip"] )
|
||||
// if(matches)
|
||||
// matches += "/"
|
||||
// matches += "ip"
|
||||
if( address == Banlist["ip"] )
|
||||
if(matches)
|
||||
matches += "/"
|
||||
matches += "ip"
|
||||
|
||||
if(matches)
|
||||
if(Banlist["temp"])
|
||||
@@ -93,7 +93,7 @@ var/savefile/Banlist
|
||||
return 1
|
||||
|
||||
|
||||
/proc/AddBan(ckey, computerid, reason, bannedby, temp, minutes)
|
||||
/proc/AddBan(ckey, computerid, reason, bannedby, temp, minutes, address)
|
||||
|
||||
var/bantimestamp
|
||||
|
||||
@@ -110,6 +110,7 @@ var/savefile/Banlist
|
||||
Banlist.cd = "/base/[ckey][computerid]"
|
||||
Banlist["key"] << ckey
|
||||
Banlist["id"] << computerid
|
||||
Banlist["ip"] << address
|
||||
Banlist["reason"] << reason
|
||||
Banlist["bannedby"] << bannedby
|
||||
Banlist["temp"] << temp
|
||||
@@ -140,7 +141,7 @@ var/savefile/Banlist
|
||||
usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN)
|
||||
for (var/A in Banlist.dir)
|
||||
Banlist.cd = "/base/[A]"
|
||||
if (key == Banlist["key"] || id == Banlist["id"])
|
||||
if (key == Banlist["key"] /*|| id == Banlist["id"]*/)
|
||||
Banlist.cd = "/base"
|
||||
Banlist.dir.Remove(A)
|
||||
continue
|
||||
|
||||
@@ -645,7 +645,12 @@ var/global/BSACooldown = 0
|
||||
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
|
||||
if(!reason)
|
||||
return
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
||||
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
|
||||
if("Cancel") return
|
||||
if("Yes")
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
|
||||
if("No")
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
||||
M << "\red<BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG>"
|
||||
M << "\red This is a permanent ban."
|
||||
if(config.banappeals)
|
||||
|
||||
Reference in New Issue
Block a user