RCON can't run commands properly
LadyCailinBot opened this issue ยท 8 comments
CMDHELPER-2799 - Reported by Mateusz.Stefaniak
CH Version: 3.3.1
config.txt: http://paste.thezomg.com/11133/80660313/
(The test command is at the end -> "allplayerslist")
I wanted to riun CH alaises from RCON and GOT OUTPUT from these commands. But:
*Command "reloadaliases" works, but gives no output to RCON, only to console;
*Command "viewalaises" gives output "viewalaises" to RCON; (!?!?)
*Running alaises directry do nothing and nothing is given to RCON output (no "unknowsn command");
*Running alaises by "runalais /alais"/"runalias alias"/"runalias '/alias'" do nothing and nothing is given to RCON output (no "unknowsn command");
Registered command support added: c91577d
Abstraction added: 78e9f3b
Messaging added: 28e461a
Direct alias support added: ead9e49
Keep in mind that this treats it as if it's coming from console. It prints out '~console' when using the player() function, and 'console' should be the 'sendertype' in 'server_command' events.
Comment by wizjany
It's a remote control feature. Sort of like logging into a shell remotely without logging into a shell.
http://wiki.vg/Rcon
This is more likely a feature request than a bug though if it has to be implemented specifically. (maybe it's something bukkit has an api for? or needs to make one for?)
Comment by LadyCailin
Yeah, this looks more like a feature request for bukkit. I'm not supporting rcon (obviously, I didn't even know what it was). If rcon doesn't work properly with /runalias, then there's really nothing I can do anyway. As far as commands go, /runalias (and /reloadaliases for that matter) are "real" bukkit commands, and so should always work. I'll move this to feature requests for now though.
Comment by Mateusz.Stefaniak
RCON is provided by MineCraft, to do commands remotely, so I think that it should be supported...
Comment by LadyCailin
I do not disagree, that's why I moved it to feature requests, not closed it. However, this should work. If not, ideally bukkit would fix it, regardless, if I'm going to have to do extra work to make it work, it's low priority, and a feature request, not a major bug.
To implement this, we need to listen to the RCON event, and treat it like a server command. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/event/server/RemoteServerCommandEvent.java
Further research needs to be done to ensure security, etc, but looks fairly straightforward to implement.