ME1312 / SubServers-2

SubServers – The Minecraft Server Management Platform
Apache License 2.0
91 stars 23 forks source link

[FR] HTTP API #82

Open BasToTheMax opened 1 year ago

BasToTheMax commented 1 year ago

What Should Be Added

A http api to manage servers/players/hosts ect

Why It Should be Added

So you can use other languages than java

What's The Alternative

Use the java api

BasToTheMax commented 1 year ago

^

thetayloredman commented 5 months ago

As of now, the best way to interface with SubServers is by directly interfacing with the SubData API launched by SubServers.Bungee. A while back I tried to write a client for SD2 in JS however this project was cancelled due to the complexity of the protocol.

When I cancelled this I spoke with ME1312 about potentially switching SubData to a more traditional protocol instead of writing their own layer, and I believe it was or is backlogged until SS3 to switch to something like a websocket. That will make everything much more manageable.

If you still want to interface with SS, you'll need to write a SubData client. You can look at node-SD3 (linked above) as a reference implementation, but it missed a lot of protocol details I misunderstood.

Alex1607 commented 5 months ago

Depending on what your use case is, you can perhaps do it like we did: We created a plugin which is running on the subserver.bungee instance and listens on a Redis channel. (You can also use something like RabbitMQ or ActiveMQ) With that, we can send messages from every plugin and from external services, which will then be executed by the plugin with access to everything. It's a bit more work than you would have with an HTTP API, but it provides the advantages of abstraction and you don't have to update all plugins and services that interact with SubServers when the is a SubServer API update, as you only manage it at a single point. Its also easier than writing your own SD2 implementation 😄 But in the end its up to you