FactoryRally / game-client

A Client to play the RoboRally Game
Apache License 2.0
0 stars 0 forks source link

[Research] Invoke Java by C# #4

Closed nbrugger-tgm closed 3 years ago

nbrugger-tgm commented 4 years ago

Research Java execution by C

The game controller (Rest API) is (ow will be) written in java. But as a client should have the option to host a game we need a way to execute the API by C# which is used by the game client.

Tasks

nbrugger-tgm commented 4 years ago

Linux

The best solution here would probably be to provide installers/packages which have java (or openjdk) as dependency. And if this is the case we could simply execute java -jar game-controller.jar

nbrugger-tgm commented 4 years ago

Android

This could be a solution : https://www.itexico.com/blog/
Also this seems viable but the documentation is old : https://docs.unity3d.com/530/Documentation/Manual/PluginsForAndroid.html
A thread about this topic https://answers.unity.com/questions/1425772/calling-a-java-method-in-android-from-unity.html

mborko commented 4 years ago

The game controller (Rest API) is (ow will be) written in java. But as a client should have the option to host a game we need a way to execute the API by C# which is used by the game client.

C# can easily access a ReST-Interface, why do you ask for a C#-Java-Bridge? What are the requirements?

nbrugger-tgm commented 4 years ago

Clarify

It seems that my description was unclear.
The point is not about how to access the ReST interface. The problem is that the ReST (Software) Server is written in Java and the Game which needs to start the api is written in Unity/C#.

The reason for this is that every client should also be able to act as a game host. For this task the C# client needs to execute the java application (ReST Interface) which is actually hosting the game.

The access to the rest interface (HTTP requests) will be done by an auto generated (from OAS3) C# Client for the Api.

ComSubVie commented 4 years ago

Then maybe the evaluation sprint will show that you should not implement the ReST server in Java (or do multiple implementations) ...

nbrugger-tgm commented 4 years ago

Decition

We decided to implement the API using the .NET core (C#). As i am not too experienced in this topic i will need the help of @kdanzer-tgm.