C# library on the server

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

Moderators: Lapo, Bax

braza
Posts: 32
Joined: 02 Jan 2014, 21:50

C# library on the server

Postby braza » 06 Jan 2014, 19:48

I think of having model code on both server and client in order to make client more responsive (i.e. show preview of action consequences and cost) but server to be able to validate and actually process the request.

There are solutions that wrap C# library into JAR... This will end up with 2 virtual machines running, as I understand. Are there any fundamntal "cons" for this approach? Thanks
User avatar
Lapo
Site Admin
Posts: 21090
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C# library on the server

Postby Lapo » 07 Jan 2014, 09:42

Hi,
there is no way to use C# on the server side. You can rewrite your classes in Java directly, the syntactic difference between the two is minimal.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
braza
Posts: 32
Joined: 02 Jan 2014, 21:50

Re: C# library on the server

Postby braza » 07 Jan 2014, 11:42

Lapo wrote:Hi,
there is no way to use C# on the server side. You can rewrite your classes in Java directly, the syntactic difference between the two is minimal.

Thanks

Hi,

Hmmm, but I saw solutions about the C#-Java bridge wrappers in any direction. Why wouldn`t they work?

The problem is to sustain both server and client code synchronized if any changes are done through the lifecycle of the model...
User avatar
Lapo
Site Admin
Posts: 21090
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C# library on the server

Postby Lapo » 07 Jan 2014, 11:57

Which C#-Java solutions exactly?
Lapo

--

gotoAndPlay()

...addicted to flash games
braza
Posts: 32
Joined: 02 Jan 2014, 21:50

Re: C# library on the server

Postby braza » 07 Jan 2014, 14:57

I didnt pick any particular solution yet but just stumbled upon http://stackoverflow.com/questions/5039 ... -from-java
User avatar
Lapo
Site Admin
Posts: 21090
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: C# library on the server

Postby Lapo » 07 Jan 2014, 15:08

The problem with the solutions proposed in that thread is that they involve major performance costs to translate calls to and from the two languages.
In addition it will make debugging a nightmare because you have extra layers of translations in between.

IMHO it's much easier to simply write the Java version. None of those solutions seem to be well tested in a high load scenario.
Lapo

--

gotoAndPlay()

...addicted to flash games
braza
Posts: 32
Joined: 02 Jan 2014, 21:50

Re: C# library on the server

Postby braza » 07 Jan 2014, 15:58

ok thank you

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 11 guests