get ban list

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
alex2344
Posts: 15
Joined: 30 Oct 2018, 12:04

get ban list

Post by alex2344 »

:D :D
Last edited by alex2344 on 29 Jun 2019, 20:05, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Post by Lapo »

Hi,
you can use this:

Code: Select all

List<BannedUser> banList = SmartFoxServer.getInstance().getBanList()
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
alex2344
Posts: 15
Joined: 30 Oct 2018, 12:04

Re: get ban list

Post by alex2344 »

hi
i mean something like that
https://www.smartfoxserver.com/docs/1x/ ... /index.htm
Something I can write inside the extension
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Post by Lapo »

Ok. Well the code above is valid for a Java extension :)
In Javascript it translates to:

Code: Select all

var banList = _server.getBanList()
Each item in the list is a Java class (BannedUser) with the following methods:
  • getName()
    getIp()
    getBanDate() (in Unix time format)
Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
alex2344
Posts: 15
Joined: 30 Oct 2018, 12:04

Re: get ban list

Post by alex2344 »

Code: Select all

16:18:19.885 - [ WARNING ] > Error in extension [ admin.as ]: TypeError: Cannot find function getBanList. (admin.as#1627) Internal: 50 -- Line number: 49 in file: admin.as
It seems that the Fincation does not exist
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Post by Lapo »

You're right, this is not accessible via javascript, only Java.
Sorry for the inconvenience. Haven't used SFS PRO in a long time.
Lapo
--
gotoAndPlay()
...addicted to flash games
alex2344
Posts: 15
Joined: 30 Oct 2018, 12:04

Re: get ban list

Post by alex2344 »

np .thanks for your time
I will create a new table in the database for banned people
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Post by Lapo »

Before you do that, try this instead:

Code: Select all

var bannedUsers = _server.instance.getBanList()
the _server.instance object points to the actual Java class that exposes the method.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
alex2344
Posts: 15
Joined: 30 Oct 2018, 12:04

Re: get ban list

Post by alex2344 »

:D :D
Post Reply