protected void UpgradePasswordWorkFactor(string password)
{
// If the destination work factor is not greater, we won't upgrade it or re-hash it
int currentWorkFactor;
try
{
currentWorkFactor = Int32.Parse((Password.Split('$')[2]));
}
catch (FormatException)
{
TShock.Log.ConsoleError("Warning: Not upgrading work factor because bcrypt hash in an invalid format.");
return;
}
if (currentWorkFactor < TShock.Config.BCryptWorkFactor)
{
try
{
TShock.Users.SetUserPassword(this, password);
}
catch (UserManagerException e)
{
TShock.Log.ConsoleError(e.ToString());
}
}
}