Page 1 of 1

get ban list

Posted: 12 Apr 2019, 16:23
by alex2344
:D :D

Re: get ban list

Posted: 13 Apr 2019, 10:41
by Lapo
Hi,
you can use this:

Code: Select all

List<BannedUser> banList = SmartFoxServer.getInstance().getBanList()


Cheers

Re: get ban list

Posted: 13 Apr 2019, 12:29
by alex2344
hi
i mean something like that
https://www.smartfoxserver.com/docs/1x/ ... /index.htm
Something I can write inside the extension

Re: get ban list

Posted: 15 Apr 2019, 08:14
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

Re: get ban list

Posted: 16 Apr 2019, 16:13
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

Re: get ban list

Posted: 16 Apr 2019, 16:34
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.

Re: get ban list

Posted: 16 Apr 2019, 16:59
by alex2344
np .thanks for your time
I will create a new table in the database for banned people

Re: get ban list

Posted: 16 Apr 2019, 17:09
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

Re: get ban list

Posted: 16 Apr 2019, 17:39
by alex2344
:D :D