ID:2521412
 
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
There should be a way to manage Dream Daemon (remotely or otherwise) via a JSON? API. Perhaps it should be a command line option or config option? Maybe a /world field/proc toggle?

Should require a password or something to be included (or maybe an IP whitelist as an option)
Something like this:
Request
{
"action": "listPlayers",
"password": "hunter2"
}

Response
{
"status": "success",
"players": ["joesmith64", "player42069", "yesman2"]
}


or

Request
{
"action": "start",
"password": "hunter2"
}

Response
{
"status": "success"
}


or error examples:

Request
{
"action": "invalid_command",
"password": "hunter2"
}

Response
{
"status": "error",
"error": "Invalid action 'invalid_command'."
}


Request
{
"action": "start",
"password": "hunter1"
}

Response
{
"status": "error",
"error": "Incorrect password"
}


Request
{
"action": "start",
"password": "hunter2"
}

Response
{
"status": "error",
"error": "Server already running."
}

How would this be any different than what you can already do with SSH and world/Topic()/Export() calls?
In response to Nadrew
Nadrew wrote:
How would this be any different than what you can already do with SSH and world/Topic()/Export() calls?

Because for example, a server's moderators/admins could restart the server if it is experiencing immense lag, without being given full SSH access.

Also this could perhaps start a stopped server, or restart a laggy one. /world/Topic doesn't work when your server is down, and it'll likely also be affected if the server is undergoing intense stress.
If your server is down, then Dream Daemon wouldn't be running (or running and not online), you wouldn't be able to send API commands to it anyways.

And if it is running, you can make your own external control setup with Topic() like I mentioned, while it does require the developer to do their own thing, the engine already provides most of what you need to accomplish what you're asking for already.

If the world isn't running, then DD is effectively cut off from the world, so you're only gonna be able to do something with it from the server itself, like SSH or some other tool you can provide to your admins that's running on the server independent from the game. Not much BYOND can do for you there =P.
In response to Nadrew
Nadrew wrote:
If your server is down, then Dream Daemon wouldn't be running (or running and not online), you wouldn't be able to send API commands to it anyways.

And if it is running, you can make your own external control setup with Topic() like I mentioned, while it does require the developer to do their own thing, the engine already provides most of what you need to accomplish what you're asking for already.

If the world isn't running, then DD is effectively cut off from the world, so you're only gonna be able to do something with it from the server itself, like SSH or some other tool you can provide to your admins that's running on the server independent from the game. Not much BYOND can do for you there =P.

What I'm saying, is that there should be an option to run an API on a seperate port, running separately from the running game.
That would be an entirely different thing, a new program all together, there's also no reason you can't do that yourself too.

There's already plenty of tools available for servers that provide web interfaces to running commands like starting a server. I don't really see why BYOND needs to reinvent the wheel here. You'd get far more control over the process if you did it from the server end and not BYOND's too.
In response to Nadrew
Nadrew wrote:
That would be an entirely different thing, a new program all together, there's also no reason you can't do that yourself too.

There's already plenty of tools available for servers that provide web interfaces to running commands like starting a server. I don't really see why BYOND needs to reinvent the wheel here. You'd get far more control over the process if you did it from the server end and not BYOND's too.

I shouldn't need to run a big [insert freamework here] app just to be able to hook up a discord bot to restart a server easily.

Then make a simple script in python or something to do it that runs as a daemon itself. BYOND shouldn't need to create big [insert redundant API-handling daemon program] when it already provides everything you need to do so yourself.
This is probably overkill but it's used successfully by /tg/ based servers

https://github.com/tgstation/tgstation-server

it's very undocumented and I dont' know how to set it up though.
In response to Optimumtact
Optimumtact wrote:
This is probably overkill but it's used successfully by /tg/ based servers

https://github.com/tgstation/tgstation-server

it's very undocumented and I dont' know how to set it up though.

that is what I was alluding to when I said " I shouldn't need to run a big [insert freamework here] app just to be able to hook up a discord bot to restart a server easily.", lol
oh it's you steamport

you already know this exists lol
yes I was hoping for a less awful solution
make a smaller one in python then, don't expect byond to handle every aspect of OS abstraction for you so you don't have to do any work, that's kinda lazy

Login to reply.