Page 1 of 1

Effects of Ban and Blacklist?

Posted: 06 Jul 2013, 23:24
by slugish
This seems to be a topic of confusion. In searching through threads related to one or the other, knowledge is somewhat conflicted.
  • Bans are temporary and last only until the server is restarted. So they are stored in memory somewhere and are never written to a file. This seems strange to me, but I do understand it.
  • There is a blacklist file in the server. Does this mean that blacklisting someone writes their login to the file and it is then permanent unless removed?
  • The method, GetBlackList(), returns only the login name, so I imagine that blacklisting is based entirely on login name?
  • The method, GetBanList(), returns both the ip address and nickname of those banned. I have seen posts stating that a ban is based solely on IP and not on nickname. Is this true? Or does it prevent that login and/or that ip address from connecting?
Looking to get this cleared up for myself and anyone else that may search for info in the future.

Re: Effects of Ban and Blacklist?

Posted: 07 Jul 2013, 09:03
by Xymph
slugish wrote:This seems to be a topic of confusion. In searching through threads related to one or the other, knowledge is somewhat conflicted.

[*]Bans are temporary and last only until the server is restarted. So they are stored in memory somewhere and are never written to a file. This seems strange to me, but I do understand it.
Right.
slugish wrote: [*]There is a blacklist file in the server. Does this mean that blacklisting someone writes their login to the file and it is then permanent unless removed?
No, the BlackList needs to be followed by a SaveBlackList call to actually write the current list to the specified file. But then it is permanent if you specify that same file in <blacklist_filename> in the server's dedicated_cfg.txt, as that is loaded when the dedicated is restarted. In XAseco1/2, this is what the /admin black command does.

The same applies to AddGuest, SaveGuestList, <guestlist_filename> and /admin addguest, btw.

And in both cases, the default filenames blacklist.txt & guestlist.txt do not need to be explicitly specified in dedicated_cfg.txt, so the easiest way is to just use those filenames for SaveBlackList/SaveGuestList and leave the dedicated_cfg.txt fields empty.
slugish wrote: [*]The method, GetBlackList(), returns only the login name, so I imagine that blacklisting is based entirely on login name?
Yes.
slugish wrote: [*]The method, GetBanList(), returns both the ip address and nickname of those banned. I have seen posts stating that a ban is based solely on IP and not on nickname. Is this true? Or does it prevent that login and/or that ip address from connecting?
Only the IP, because nickname is not related to login and can be changed by players into anything, including other logins' nicks. To prevent joins on both criteria, you'd need to BlackList and Ban.

Also note that while the Ban method bans a player and kicks him/her off the server immediately, for blacklisting to have the same effect you'd need to follow the BlackList with a Kick.

Lastly, permanent banning by IP is possible with server controller code that stores IP addresses in its own file and checks them upon player joins. XAseco1/2 does this with /admin banip.

Re: Effects of Ban and Blacklist?

Posted: 07 Jul 2013, 11:44
by The_Big_Boo
Xymph wrote:No, the BlackList needs to be followed by a SaveBlackList call to actually write the current list to the specified file. But then it is permanent if you specify that same file in <blacklist_filename> in the server's dedicated_cfg.txt, as that is loaded when the dedicated is restarted.
Blacklist and guestlist can also be automatically saved by stopping the server with the QuitGame method.

Re: Effects of Ban and Blacklist?

Posted: 08 Jul 2013, 20:49
by slugish
Xymph wrote:
slugish wrote: [*]The method, GetBanList(), returns both the ip address and nickname of those banned. I have seen posts stating that a ban is based solely on IP and not on nickname. Is this true? Or does it prevent that login and/or that ip address from connecting?
Only the IP, because nickname is not related to login and can be changed by players into anything, including other logins' nicks. To prevent joins on both criteria, you'd need to BlackList and Ban.
Oops... I meant "login" instead of "nickname", but I get your point. I see no real reason to ban by ip. Sure, players could always purchase or acquire another game key... but I doubt many people would put forth that much effort and give up their player accomplishments just to play on my servers. I think login banning should be sufficient.

I think I am just going to go the route of handling bans entirely through the server controller. There will be no worries this way, and I won't have to backup my blacklist file when updating the server.

thx for the info guys. Hopefully this will help others along the way as well.