[MOD/API] X4RestServer - External http API
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
[MOD/API] X4RestServer - External http API
X4 Rest Server
X4 Rest Server aims to provide an external http/rest API for the game
This is mainly focused on other developers, to create external tools that provide extra functionality for second screens or similar.
It should work on Windows and Linux
The project should be primarily focused on data-out, not for interacting with the game from the far, or even cheating.
All without getting "modified"
We'll see how things shake out, however...
It works by loading a shared-library (.dll/.so) into the game.
The mod loads functions from the game, which are exposed via FFI, normally used for lua-scripts managing the game UI, and calls them directly. The results are then sent out as json via an inbuilt http-server
Due to the fact, that most code is generated, almost all endpoints use http-GET requests, even if changing values in the game. (We’ll see how long that stays…)
The project is currently in POC (proof of concept) stage.
A first alpha Release is available below
If you do want to contribute, feel free to check out the Github-Repo
Info / Download
https://alia5.github.io/X4-rest-server/
https://github.com/Alia5/X4-rest-server/releases
Demo:
[ external image ]
(click me)
X4 Rest Server aims to provide an external http/rest API for the game
This is mainly focused on other developers, to create external tools that provide extra functionality for second screens or similar.
It should work on Windows and Linux
The project should be primarily focused on data-out, not for interacting with the game from the far, or even cheating.
All without getting "modified"
We'll see how things shake out, however...
It works by loading a shared-library (.dll/.so) into the game.
The mod loads functions from the game, which are exposed via FFI, normally used for lua-scripts managing the game UI, and calls them directly. The results are then sent out as json via an inbuilt http-server
Due to the fact, that most code is generated, almost all endpoints use http-GET requests, even if changing values in the game. (We’ll see how long that stays…)
The project is currently in POC (proof of concept) stage.
A first alpha Release is available below
If you do want to contribute, feel free to check out the Github-Repo
Info / Download
https://alia5.github.io/X4-rest-server/
https://github.com/Alia5/X4-rest-server/releases
Demo:
[ external image ]
(click me)
Last edited by Alia5 on Thu, 7. May 20, 00:23, edited 6 times in total.
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
Re: [MOD/API] X4RestServer - External http API
07.05.2020
0.1.1
- First Linux POC
04.05.2020
0.1.0
- First alpha release
26.04.2020
- First public announcement / POC
0.1.1
- First Linux POC
04.05.2020
0.1.0
- First alpha release
26.04.2020
- First public announcement / POC
Last edited by Alia5 on Thu, 7. May 20, 00:24, edited 4 times in total.
-
- Posts: 412
- Joined: Fri, 28. Sep 12, 08:30
Re: [MOD/API][POC] X4RestServer - External http API
See a great oportunity for a second monitor info app, or even for example some galaxy news feed app fetching data from https://forum.egosoft.com/viewtopic.php?f=181&t=426035
Hoping that this project will get more attention.
Hoping that this project will get more attention.
X3 AP 3.1 + XRM
X3 AP 3.1 + LU
X3 AP 3.1 + LU
-
- Posts: 158
- Joined: Wed, 26. May 04, 08:49
Re: [MOD/API][POC] X4RestServer - External http API
This sounds really good.
Could potentially also be used to build a "real" map of the current in-game sectors & economy with stations, trade offers etc being browsable in a GUI on a secondary PC or monitor, or to import existing station layouts into a station planner... there's great potential I guess as tools similar to what exists for Elite Dangerous could be build for example to allow better handling and understanding of your current ingame universe.
Could potentially also be used to build a "real" map of the current in-game sectors & economy with stations, trade offers etc being browsable in a GUI on a secondary PC or monitor, or to import existing station layouts into a station planner... there's great potential I guess as tools similar to what exists for Elite Dangerous could be build for example to allow better handling and understanding of your current ingame universe.
-
- Posts: 2
- Joined: Sun, 9. Dec 18, 09:24
Re: [MOD/API][POC] X4RestServer - External http API
This is really, really awesome!! I cannot wait to see what cool things comes out of this.
-
- Posts: 2
- Joined: Sun, 9. Dec 18, 09:24
Re: [MOD/API][POC] X4RestServer - External http API
From a layman perspective, what sort of information can it pull?
And how often can it update the information?
While I do not have the technical expertise to help with coding, I'm a designer and I'd love to design a use case for such a tool.
And how often can it update the information?
While I do not have the technical expertise to help with coding, I'm a designer and I'd love to design a use case for such a tool.
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
Re: [MOD/API][POC] X4RestServer - External http API
Pretty much everything that the ingame UI can show you.
Realtime.
Dev note: In the first iteration this is done via polling. At a later stage it is planned to look at how feasible it is to implement ServerSentEvents (SSE)
-
- Posts: 1463
- Joined: Wed, 27. Jun 18, 19:05
Re: [MOD/API][POC] X4RestServer - External http API
Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
Re: [MOD/API][POC] X4RestServer - External http API
Interacting with the game will definitely be implemented in a later version, but not in the way you imagined.
There are 1200 functions exposed that can probably all be used and I haven't looked through all of them, though.
There are 1200 functions exposed that can probably all be used and I haven't looked through all of them, though.
-
- Posts: 158
- Joined: Fri, 12. Jul 19, 14:03
Re: [MOD/API][POC] X4RestServer - External http API
This is already possible with the amount of progress SirNukes has made with his server. Someone just needs to spend the time making all of it.Max Bain wrote: ↑Fri, 1. May 20, 15:50 Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
-
- Posts: 1463
- Joined: Wed, 27. Jun 18, 19:05
Re: [MOD/API][POC] X4RestServer - External http API
That would be really awesome I think and I think many ppl would like to play a bit together this way (and with mods).teleportationwars wrote: ↑Fri, 1. May 20, 19:13This is already possible with the amount of progress SirNukes has made with his server. Someone just needs to spend the time making all of it.Max Bain wrote: ↑Fri, 1. May 20, 15:50 Would it be possible (maybe in different but similar version) to interact with the game from outside?
What I have in mind is like a venture system where two players connect to each other IF they have the same mods and share their IP, so you can invade or help each other. For me this would put X4 on a completely new level.
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
-
- Posts: 1294
- Joined: Mon, 26. Jan 15, 19:55
Re: [MOD/API] X4RestServer - External http API
Awesome potential here! I've been wondering if the developers would themselves give us some read-only interface, but they may not have time.
Care to see what I've been creating? https://www.youtube.com/user/ytubrute
-
- Posts: 43
- Joined: Tue, 10. Apr 07, 22:32
Re: [MOD/API] X4RestServer - External http API
I've just built a first POC for Linux!
It should be exactly the same as on Windows, functionality-wise.
Although, I haven't really tested this yet, as I cannot fully run X4 in my VM, and I currently don't currently have Linux installed on bare-metal.
https://github.com/Alia5/X4-rest-server ... /tag/0.1.1
Of course, one can build him-/herself
It should be exactly the same as on Windows, functionality-wise.
Although, I haven't really tested this yet, as I cannot fully run X4 in my VM, and I currently don't currently have Linux installed on bare-metal.
https://github.com/Alia5/X4-rest-server ... /tag/0.1.1
Of course, one can build him-/herself
-
- Posts: 208
- Joined: Thu, 2. Oct 14, 15:04
Re: [MOD/API] X4RestServer - External http API
I hope your work will get well.
I can see something like websites with satistic overviews, etc.
I can see something like websites with satistic overviews, etc.
-
- Posts: 13
- Joined: Sat, 6. Feb 16, 08:54
Re: [MOD/API] X4RestServer - External http API
Do we have any indication from the X4 Devs that the DLL injection is not going to possibly be flagged through Steam or anything like that?
-
- Posts: 693
- Joined: Sun, 8. Feb 04, 15:06
Re: [MOD/API] X4RestServer - External http API
Wow this is exciting !!
You have given me a project. (If I get a chance)
Make a website for displaying all the data, I'd look at logging account finance and storing that to an SQL lite data-base and use Google API to make charts showing asset changes over time periods chosen.
What would be interesting is getting global averages for all product prices and seeing how they change over time.
Man this is awesome!
You have given me a project. (If I get a chance)
Make a website for displaying all the data, I'd look at logging account finance and storing that to an SQL lite data-base and use Google API to make charts showing asset changes over time periods chosen.
What would be interesting is getting global averages for all product prices and seeing how they change over time.
Man this is awesome!
they have had almost 1000 years to terraform Aldrin, why are they all still sitting around a giant rock?
Catra wrote:
because you cant terraform a rock.
Catra wrote:
because you cant terraform a rock.
-
- Posts: 24
- Joined: Tue, 2. Dec 03, 22:20
Re: [MOD/API] X4RestServer - External http API
Reading this literally made me jump back into the X universe, after a very long break. Years ago I've made a mod for X3 TC/AP which displayed ingame information on the Saitek X52 Pro's display, and also used the LEDs on the controller for various feedback. Your work could make it possible to port this to X4 now, and it could be even better than the original due to the possibilities in this API. I've waited out with X4 for quite long, but this was a trigger.
So I'm looking forward to see more of your work, and a big thank your for all the time invested in this.
So I'm looking forward to see more of your work, and a big thank your for all the time invested in this.
-
- EGOSOFT
- Posts: 817
- Joined: Sun, 14. Dec 03, 13:05
-
- Posts: 80
- Joined: Thu, 11. Jun 20, 21:14
Re: [MOD/API] X4RestServer - External http API
I want to report a bug: This project is way to exciting!
I got it running on Linux
I got it running on Linux
Spoiler
Show
and may be aroused
