Is it possible to ban a username?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

moonlife
Posts: 40
Joined: 26 Sep 2016, 08:22

Is it possible to ban a username?

Postby moonlife » 22 Jun 2022, 11:07

Hi,

I'm using SFS 2.17.0. It's possible to add usernames to SFS ban list via Ban Manager panel in SFS Admin Tool. But I want to add usernames to this Ban List via server-side Java extension.

There are 2 banUser() methods in SFS API, but both are requesting a User object as parameter, instead of username. I can get that User object using zone.getUserByName(username), but I can't do that if that user is offline. Is there an easy way to do that via API?
moonlife
Posts: 40
Joined: 26 Sep 2016, 08:22

Re: Is it possible to ban a username?

Postby moonlife » 22 Jun 2022, 11:58

Oh, I guess there is a BannedUserManager out there, I will try it out.
User avatar
Lapo
Site Admin
Posts: 22430
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Is it possible to ban a username?

Postby Lapo » 22 Jun 2022, 13:03

Hi,
yes but also see the AdminTool documentation here:
http://docs2x.smartfoxserver.com/Gettin ... BanManager

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 28 guests