Ever considered to add new server apis ?

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

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Ever considered to add new server apis ?

Postby genar » 20 Sep 2020, 16:27

Well the question is pretty simple ^^
have you ever considered to add new server apis ?
For languages like C#, C++, Pyhton ? And if not why ?

An other little question which is clearly not worth its own thread... what exactly do we need to do to use higher java versions ( 10/11 ) with the server api ? I heard that its working, but havent found an upgrade guide... Currently the server tells me upon start up that the version is wrong ^^
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Ever considered to add new server apis ?

Postby Lapo » 21 Sep 2020, 07:46

The server is written in Java. So there is no easy way to introduce languages such as C++ or C# in a Java environment, and the reverse would be true as well (adding Java to a C# or C++ server).

Python and Javascript are actually supported by SFS2X Extensions, but the problem is performance. Both languages add a significant overhead which is not always worth to pay.

In particular Python is not even documented and it's always been just an experimental feature, as it's not a good fit to map the capabilities that Java has. It's mostly fine for prototyping.

On the other hand Javascript is actually not horrible in terms of performance and it can be used for Extensions if you can't really stomach writing Java code.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Ever considered to add new server apis ?

Postby Lapo » 21 Sep 2020, 07:48

An other little question which is clearly not worth its own thread... what exactly do we need to do to use higher java versions ( 10/11 ) with the server api ? I heard that its working, but havent found an upgrade guide... Currently the server tells me upon start up that the version is wrong ^^

In order to run Java 11 code you need a Java 11 runtime. So if you're planning to write Extensions in Java 11 you will need to replace the standard JRE provided with SFS2X, with a JRE version 11.

If you want to learn more, see this article:
https://smartfoxserver.com/blog/java-9- ... server-2x/
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 53 guests