I’m pretty sure I’m supposed to know this by now, oh well.
I’m hosting a kryonet game server on a debian vps. How do I stop the program once it is running, from the outside? That is, ideally call a certain method, not just kill it, which is what I’m doing right and is fine for now, but can’t stay this way forever.
I mean, I could do it via kryonet and then send the “turn off” command via a modified client, then the server executes turnOff() and whatever I put in it, but that’s not how it’s supposed to be done I feel? I remember faintly about Scanner and listening to console input from the java tutorials I took when I started out, but IIRC at least the way I saw back then, would have the program actually wait for user input, which obv wouldn’t work here.
So I’m looking for a way I can make it so that I can access methods of my running server directly from the console of the system it’s running on.
Or is the “root kryonet client” not such a bad idea after all? I won’t have a lot of stuff to command except for restarting / shutting down.