ID:1602353
 
(See the best response by Jittai.)
Code:
mob
verb
Ban_Player(mob/them in world, reason as text)
world << "<font color=red><B>[src] has banned [them] due to: [reason]"
banlist.Add(them.client.ckey,them.client.computer_id,them.client.address)
var/savefile/sa=new("save/bans.sav")
sa["banlist"]<<banlist
del them
Unban_Player(client/them in banlist)
banlist.Remove(them)
var/savefile/sa=new("save/bans.sav")
sa["banlist"]<<banlist


Problem description:
I understand this is a mess, particularly Unban_Player(), but I'm having trouble understanding how I would save a list that contains client-related information as shown above.

I read info on the << output operator on reference, and it doesn't say it can transfer client data (unless that's relevant to it being able to transfer text). Sometimes, players who get banned are automatically unbanned after the server shuts down and re-opens. Assuming this means the savefile transfer didn't process as I wished it to. While Unban_Player seems to have the same issue with removing client data from a list, and then after the server shuts down, the list goes back to what it was before the verb was used.

What do I need to fix in order to make this work the way I intend to make it work?
Are you loading this list on world/new()?
world
New()
var/banpath="save/bans.sav"
if(fexists(banpath))
var/savefile/sa=new(banpath)
if(sa["banlist"]) sa["banlist"]>>banlist
Best response
The thing is in the unban, you didn't save clients. What you have to do is save what you're saving and then, upon loading it (once hopefully) compare it to clients logging in. Also that mob/ in ban() should be a client too.

BYOND has built in procs for this you can tap into. In case you didn't know.
Are you checking if they are banned in world/IsBanned? I also don't see where you are saving the information--are you doing that?

Jittai also pointed out that you are trying to unban a client, when you are saving keys, addresses and computer ids.