The actual Ban verb.
Ban(mob/M in world)
set category = "Staff"
set name = "Ban"
set desc = "Ban someone's Key/IP."
if(M)
var/BanKey = M.key
var/BanIP = M.client.address
if(!BanIP)BanIP=world.address
switch(alert(usr,"How will you ban [M.key]?","Ban","Key","Ip","Key and Ip"))
if("Key")
var/reason = input(usr,"Why are you banning?","Ban Reason")as null|text
if(!reason) reason = "No reason supplied. - [src]"
if(BanKey in BanList)return
addban(BanKey,null)
if(M)del(M)
info(null,world,"[BanKey] has been banned.([reason] - [src])")
if("Ip")
var/reason = input(usr,"Why are you banning?","Ban Reason")as null|text
if(!reason) reason = "No reason supplied. - [src]"
if(BanIP in IPBanList)return
addban(null,BanIP)
if(M)del(M)
info(null,world,"[BanKey] has been banned.([reason] - [src])")
if("Key and Ip")
var/reason = input(usr,"Why are you banning?","Ban Reason")as null|text
if(!reason) reason = "No reason supplied. - [src]"
if(!(BanKey in BanList))addban(BanKey,null)
if(!(BanIP in IPBanList))addban(null,BanIP)
if(M)del(M)
info(null,world,"[BanKey] has been banned.([reason] - [src])")
The Ban procs and such:
client/proc
isban()
if(BanList.Find("[key]")||IPBanList.Find("[address]"))
src<<"You're banned from this server."
del(src)
proc
addban(BanKey,BanIP)
if(BanKey)BanList+=BanKey
if(BanIP)IPBanList+=BanIP
remban(BanKey,BanIP)
if(BanKey)BanList-=BanKey
if(BanIP)IPBanList-=BanIP
info(mob/s,list/TargList,text)
for(var/mob/p in TargList)
if(!p)continue
var/message
if(s) message += "[s] "
if(text) message += "[text]"
p<<message
client/New()
..()
if(bans.Find("[src.key]")||IPBanList.Find("[src.address]"))
usr << "<b>You've been banned from this game."
usr << "<b>If you think you have been banned incorrectly, contact me at 'digifais@hotmail.com'."
bans.len++
del(src)
var
bans[10]
proc
worldsave()
var/savefile/World = new("save/world.sav")
World["BanList"]<<BanList
World["IPBanList"]<<IPBanList
worldload()
if(fexists("save/world.sav"))
var/savefile/World = new("save/world.sav")
if(World["BanList"])World["BanList"]>>BanList
if(World["IPBanList"])World["IPBanList"]>>IPBanList
var/list
BanList = new/list()
IPBanList = new/list()
Problem description:
When I ban a person, he get deleted and such from the world, just like Boot and he gets added to the Ban list. But he/she seems to be able to login again after I banned him/her. How would I fix this?
Sincerely,
Raimo.