Tiiffi / mcrcon

Rcon client for Minecraft
https://github.com/Tiiffi/mcrcon/
zlib License
846 stars 116 forks source link

Cant use in Bash/Python #64

Closed TomLewis closed 3 years ago

TomLewis commented 3 years ago

I have a perfect running command, but every time I try and run an mcrcon command in either bash or python, it dousnt accept any of the parameters and just says: mcrcon: error: argument -p/--port: invalid int value: 'password' This is what its running: mcrcon -P 23943 -p paassword spigot:tps

TomLewis commented 3 years ago

Aha, turns out I had mcrcon installed via pip too! So it was a conflict. pip uninstall mcrcon solved this. if anyone else has the issue.

Tiiffi commented 3 years ago

Hi,

Yeah I think there is unfortunate conflict with naming. Pip actually installs Python implementation of rcon client.

I have contemplated if I should change the project name or executable name to make it distinct from Python implementations but it is hard to come up with new decent name (perhaps just "rcon" since I am in process of making it work with all rcon protocol variants).

TomLewis commented 3 years ago

I was looking into clients, so installed both and was using both bash and python to experiment, I went with this one and just parse what I want from commands.

You have the best google search results, so keep the name.

Might be worth the note on the readme page about conflicts maybe?

You could even show examples of how to use in bash/python/php too, to show people they don't need a python package installed.

Ive just ended up using bash as its no extra overhead, not that I need the response time im just building a crappy API to show TPS/Players/Donations on a small 4x20 display from a raspberry pi from my main server! Generate static json file, as im sure as shit not opening rcon up to the world haha

Tiiffi commented 3 years ago

You have good points.

Might be worth the note on the readme page about conflicts maybe?

Yeah, I think this is a good idea.

as im sure as shit not opening rcon up to the world haha

Haha, rcon is really unsecure protocol indeed. I am still gringing for the fact that passwords are cleartext.

I have plans to include small config file parser so passwords could be at least stored in user defined config file with appropriate permissions.

TomLewis commented 3 years ago

I'm down for a config so it dousnt need to pass the password each time! That's one thing I don't like about it, having to pass the password each time. I do have 4 servers, so it would be nice to just have a parameter to say what server you want command output from.

I've never used rcon past today, all I wanted was a way to just get command output without parsing the entire bloody latest.log, rcon Seems perfect being able to run a command and get output without needing to clean it up much!

What else do people use rcon for? I can't see it being used as a console replacement as I don't get any live in game thing like chat or errors when it's in client mode. Unless that's the point of rcon to use it as I am as a type of middle man for grabbing output