SubServers-2 icon indicating copy to clipboard operation
SubServers-2 copied to clipboard

[FR] HTTP API

Open BasToTheMax opened this issue 2 years ago • 3 comments

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 avatar Dec 09 '22 14:12 BasToTheMax

^

BasToTheMax avatar Apr 30 '23 15:04 BasToTheMax

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.

thetayloredman avatar Mar 19 '24 16:03 thetayloredman

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

Alex1607 avatar Mar 19 '24 22:03 Alex1607