Opinion: Client Wrapper programming

Hey all, this topic is purely an opinion search.

In my free time I have been working on a simple little java server wrapper that interacts with a shell script over ssh to control a minecraft server. It was the simplest approach I could think of for interacting with the server.

The wrapper is good but it reaches limitations in certain areas, i.e reading/trailing input from multiple sources (Console log, console output). I have implemented it to a point but now these limitations are showing more and more.

Question: Does anyone have any other ideas of other languages or approach ideas that would better suit this end goal?

For your information:
The current implementation is written in Java 8 utilizing JavaFX8(fx3).
Functions
-Start, Stop, Restart Server (Done)
-Send Commands to server and see output (Done)
-Trail console log
-Kick Ban players (Done)
-Edit Server properties (Done)
-System Memory/CPU graph (Done)
-FTP File editing

Notes
The reason behind this project is I find other projects (MCMyAdmin,Multicraft) too be tedious and outside of the scope of a standard user. I.e. The setup is fairly intense and the end state is quite a heavy (resource intense). This project is designed to emulate running a server from command line but with a simple client that can connect and perform operations on the server only when required.

There are fundamental limitations to just interacting with a server through a shell script.

You can onlyuse information printed to the console, and it’s only possible to interact with thee server through commands, instead of an API.

If you’re looking to take this project further, you’d probably want to create a plugin that interacts with the wrapper somehow. This would allow you to make use of APIs that don’t have a corresponding command, as well as eliminating the need to parse command output.

Why not RCON? Besides the file editing (which honestly shouldn’t really be done on a live server), RCON supports everything you’ve listed.

With respect to editing files, you’re better off not doing that via a ssh connection in the back end. I personally would recommend against even editing the files on a running server. However, if you plan to pursue that anyways, I would recommend an existing technology such as (S)FTP which is more platform agnostic, so you’re not relying on commands that don’t exist on some operating systems. It would also help with making your application more portable and less dependency heavy (some operating systems can be weak in the “upload file” department out of the box).

Overall my recommendation is to support as many server-side platforms (operating systems, server implementations, etc) as possible while also permitting as much client-side platform support as possible. This means limiting your dependencies, not relying on operating systems, and requiring the user being fairly knowledgeable on how to set up your application (as it may require a working (S)FTP server).

Although to be completely blunt, I really don’t understand why you would create this application in the first place. Unless you’re managing a complex and difficult network, you don’t need these kinds of tools. For small networked servers (or simple one-server networks) you can generally just SSH into the machine in the first place instead of having an application do it for you.

For file editing I am in the process of implementing SCP. The library I am using (JSch) comes with SFTP, SCP and SSH functionality. The plan was to download the file locally, allow the user to edit, then upload through SCP…

From experience, I have found it difficult to convince some people to not use a html server wrapper (McMyAdmin, Multicraft) when the user doesn’t have linux experience / doesn’t want to learn. I personally am more than capable of doing this 100% through a terminal. But hey, its just a fun project.

RCON, ive given it a shot before in php and it was irritating. I will look into java implementations of it though.

@Aaron1011 i agree but I was struggling to think of ways to start stop the server without a shell script. Possibly If i used the shell script to start stop and rcon for the rest it would be the best of both worlds?

I was under the impression this was for yourself, sorry. I’m all for doing projects for fun (for example, I’m working on a file sync thing in my spare time…) so long as you learn something from it. It’s also nice to potentially have a target audience so you can make it worth your time as well because learning something new is only worth so much.

Try out different things, new languages, technologies, libraries, methods, and approaches. You’ll find that some things won’t work at all while some things will be more than you expected. Not to mention if you do come across a library that looks “meh”, give it a shot in a small proving program. I’ve run into many libraries that look badly managed or have poor documentation but end up being powerful tools for what I was doing (although there is a fair share that are just crap).

Although seriously consider not letting users edit the config files unless the server is stopped. It’s not super dangerous, but things can go wrong from a user’s perspective (“why didn’t the port change when I used /reload?”).

Ok, thanks for the advice. I’ll stick with java and JavaFX for the mean time and try out a few other libraries for the connection. Ill also give RCON a shot .

Point taken on file editing, ill ensure its a restriction in the wrapper.