Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

"Invalid command entered" when no command entered #1309

Closed OnsenManju closed 7 years ago

OnsenManju commented 7 years ago

Maybe this was caused by fixing security issues(?), error message is also displayed when I just pressed 'Enter' key (or whitespace only). It's a bit annoying. 2016-10-17

Is there any way to avoid this, something like

if (cmdText.Trim() == "") { return true; }

at HandleCommand() in TShockAPI/Commands.cs?

ivanbiljan commented 7 years ago

I do not see this as an issue honestly, if you're using the command specifier you want to enter a command by some logic, and if you don't type the command correctly or specify the command at all it returns an "Invalid command" message.

hakusaro commented 7 years ago

@ProfessorXZ that's the console, though which expects a command on any line with no specifier at all

ivanbiljan commented 7 years ago

If it doesn't cause problems on the client what's the issue? Isn't this how the console always worked?

Simon311 commented 7 years ago

@ProfessorXZ Empty commands were ignored. Though I am not sure how this is an issue.

Simon311 commented 7 years ago

I will include this fix in an upcoming pull request.

OnsenManju commented 7 years ago

Thanks everyone for considering this. I was using "null line" for separating logs displayed on console screen in order to making clearly understandable when examining behavior of plugin (e.g. testing commands one by one) etc. so far.

So this is not critical at all, just 'a bit' inconvenient.

Simon311 commented 7 years ago

@OnsenManju If this is of any urgency - you may grab the build with this fix here https://travis.tshock.co/general-devel/1321/tshock_release.zip

OnsenManju commented 7 years ago

@Simon311 I have tried that. (Though there is no urgency regarding this, of course)

2016-10-17_2

That's very legitimate, thanks so much!

hakusaro commented 7 years ago

The "Invalid command." is probably a vanilla message.

OnsenManju commented 7 years ago

Oh, that's exactly right. It's same as the original TerrariaServer.exe (not TShock). I have never hosted a server with it.. ^_^;;