'Garthor, the messages that were outputted to the world like you told me to do, they pop up now. So I've tested the ban system out again, the player gets added to the list (as we can see on the messages you made) but he can still login and play.'
Again the codes as of now:
The actual 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."
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 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()
world << "MY KEY IS [key]"
world << "EVERY KEY IN THE BAN LIST:"
for(var/v in BanList)
world << v
if(BanList.Find("[src.key]")||IPBanList.Find("[src.address]"))
src << "<b>You've been banned from this game."
src << "<b>If you think you have been banned incorrectly, contact me at 'digifais@hotmail.com'."
del(src)
if(copytext(src.key,1,7) == "Guest-")//if 'Guest-' is found within the first 7 letters of the key, it doesn't let them through
src<<"<font color=#FF0000>Guest logins are restricted. Please login with a valid BYOND key.</font>"
del(src)//kick them out of the game
..()
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()
world/New()
worldload()
..()
world/Del()
worldsave()
..()