Send banned user detailed info

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

Moderators: Lapo, Bax

User avatar
ekrem5353
Posts: 118
Joined: 10 Dec 2015, 15:50

Send banned user detailed info

Postby ekrem5353 » 19 Oct 2020, 13:22

Hi,

Can I inform banned users for how long it has been banned. can I send some info to client side so it can see for how long it should wait

Thanks
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send banned user detailed info

Postby Lapo » 19 Oct 2020, 13:37

You can send a message when the user is banned. So you can give them the details there.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
ekrem5353
Posts: 118
Joined: 10 Dec 2015, 15:50

Re: Send banned user detailed info

Postby ekrem5353 » 20 Oct 2020, 08:14

Hi,
If user is banned where should I send message. It can not trigger join zone event. In custom Login Handler it is still session. There is no user.
User avatar
ekrem5353
Posts: 118
Joined: 10 Dec 2015, 15:50

Re: Send banned user detailed info

Postby ekrem5353 » 20 Oct 2020, 08:39

Hi,
I have one more related question I will check if user is banned I check it via SmartFoxServer.getInstance().getBannedUserManager().isNameBanned()

I need to find BannedUser object instance and .getBanDurationMinutes() so I can tell how long it has been banned. How I can reach this object faster.

List<BannedUser> banned_list = SmartFoxServer.getInstance().getBannedUserManager().getBannedUsersByName(getParentExtension().getParentZone().getName());

I found this but it gives me list of all the banned users I have to loop through it. Is there a map so I can find BannedUser object. Can I get from some kind of map.
So it could be more performant

Thanks
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send banned user detailed info

Postby Lapo » 20 Oct 2020, 13:56

ekrem5353 wrote:Hi,
If user is banned where should I send message. It can not trigger join zone event. In custom Login Handler it is still session. There is no user.

When the user is getting banned, you can send a message that will be received by such User and you can tell them how long the ban will last.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send banned user detailed info

Postby Lapo » 20 Oct 2020, 14:03

ekrem5353 wrote:I found this but it gives me list of all the banned users I have to loop through it. Is there a map so I can find BannedUser object. Can I get from some kind of map.

No there is no such method at the moment.
In terms of performance though it doesn't make much of a difference, since internally the class should create a copy of the internal map data structure to return.

But I understand that it could be more handy. I have added a note in our todo list to add one ore more methods for searching banned Users.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 96 guests