get ban list

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

Moderators: Lapo, Bax

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

get ban list

Postby alex2344 » 12 Apr 2019, 16:23

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

Re: get ban list

Postby Lapo » 13 Apr 2019, 10:41

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

Postby alex2344 » 13 Apr 2019, 12:29

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Postby Lapo » 15 Apr 2019, 08:14

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

Postby alex2344 » 16 Apr 2019, 16:13

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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: get ban list

Postby Lapo » 16 Apr 2019, 16:34

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

Postby alex2344 » 16 Apr 2019, 16:59

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

Re: get ban list

Postby Lapo » 16 Apr 2019, 17:09

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

Postby alex2344 » 16 Apr 2019, 17:39

:D :D

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 46 guests