Java documentation variable names

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

Moderators: Lapo, Bax

Hassan Khallouf
Posts: 41
Joined: 06 Jul 2017, 04:35

Java documentation variable names

Postby Hassan Khallouf » 20 Jul 2017, 13:15

Hello everyone,
I find it very annoying that the variable names in the java api for server side scripting don't appear like their docs in web, for example:
the function createRoom in ISFSApi has this signature in documents

Code: Select all

createRoom(Zone zone, CreateRoomSettings settings, User owner, boolean joinIt, Room roomToLeave, boolean fireClientEvent, boolean fireServerEvent)


but in my IDE (I use intellij) this is the sigature that appear in IntelliSense:

Code: Select all

   createRoom(Zone zone, CreateRoomSettings settings, User user, boolean b, Room room, boolean b1, boolean b2)


this is very confusing, I need to refer to the web docs almost every time I want to use an api method, what's the first boolean is for? is fireClientEvent boolean or fireServerEvent first?

am I missing something in my installation ?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Java documentation variable names

Postby Lapo » 20 Jul 2017, 14:31

Hi,
the fact is that variable names are not included in the jar file, so the IDE auto-generates them based on custom logic. Typically what the IDE does is simply to create a lower case variable name with the same name of the variable type.

Such as:

Code: Select all

Room room
User user
boolean b
int i
double d
etc...


In any case you can get the javadoc jar from here, and add it to your IDE so that you have integrated docs. The IDE will still make up the variable names but at least you'll have a reference handy.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Hassan Khallouf
Posts: 41
Joined: 06 Jul 2017, 04:35

Re: Java documentation variable names

Postby Hassan Khallouf » 23 Jul 2017, 07:43

thanks lapo
it worked, although as you said, I need to call upon the help using F1 to get the documentation, I'm more used to Visual Studio, it actually pulls the var names from the docs if they are available

I ended up linking the module to the docs link instead of using the zip you gave me (both worked)
http://docs2x.smartfoxserver.com/api-do ... oc/server/

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 106 guests