Check all user subcommands for param count

Fixes more problems found in #899 (thanks Marcus)
This commit is contained in:
Lucas Nicodemus 2015-04-12 21:48:34 -06:00
parent 0f1b334d8e
commit 8bcb3ef6bc

View file

@ -971,7 +971,7 @@ namespace TShockAPI
string subcmd = args.Parameters[0];
// Add requires a username, password, and a group specified.
if (subcmd == "add")
if (subcmd == "add" && args.Parameters.Count == 4)
{
var user = new User();
@ -1059,7 +1059,7 @@ namespace TShockAPI
}
}
// Group changing requires a username or IP address, and a new group to set
else if (subcmd == "group")
else if (subcmd == "group" && args.Parameters.Count == 3)
{
var user = new User();
user.Name = args.Parameters[1];