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:
elly1989@rocketmail.com
2012-07-31 20:14:21 +00:00
parent 6cd475fd0b
commit c4dc6fcb0b
2 changed files with 13 additions and 7 deletions

View File

@@ -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

View File

@@ -645,6 +645,11 @@ var/global/BSACooldown = 0
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
if(!reason)
return
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."