* Finally fixed /user group and /user password.
* Had to fix UserManager exceptions to UserNotExistException instead of UserExistsException. * Added /user help as well. Commented out the old short circuit for now.
This commit is contained in:
parent
71d05f51ec
commit
3dd7af1a30
2 changed files with 93 additions and 16 deletions
|
|
@ -147,8 +147,8 @@ namespace TShockAPI.DB
|
|||
{
|
||||
try
|
||||
{
|
||||
if (database.Query("UPDATE Users SET Password = @0 WHERE Username = @1;", Tools.HashPassword(password), user.Name) < 1)
|
||||
throw new UserExistsException(user.Name);
|
||||
if (database.Query("UPDATE Users SET Password = @0 WHERE Username = @1;", Tools.HashPassword(password), user.Name) == 0)
|
||||
throw new UserNotExistException(user.Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -168,8 +168,8 @@ namespace TShockAPI.DB
|
|||
if (!TShock.Groups.GroupExists(group))
|
||||
throw new GroupNotExistsException(group);
|
||||
|
||||
if (database.Query("UPDATE Users SET UserGroup = @0 WHERE Username = @1;", group, user.Name) < 1)
|
||||
throw new UserExistsException(user.Name);
|
||||
if (database.Query("UPDATE Users SET UserGroup = @0 WHERE Username = @1;", group, user.Name) == 0)
|
||||
throw new UserNotExistException(user.Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue