Merge remote-tracking branch 'HaHaWTH/master'

This commit is contained in:
MC~蛟龙 2024-07-11 21:28:38 +08:00
commit 08216607cf
2 changed files with 15 additions and 11 deletions

View File

@ -22,6 +22,8 @@ import java.util.Locale;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static fr.xephi.authme.AuthMe.getScheduler;
public class VerificationCodeManager implements SettingsDependent, HasCleanup {
private final EmailService emailService;
@ -133,8 +135,9 @@ public class VerificationCodeManager implements SettingsDependent, HasCleanup {
* @param name the name of the player to generate a code for
*/
private void generateCode(String name) {
getScheduler().runTaskAsynchronously(() -> {
DataSourceValue<String> emailResult = dataSource.getEmail(name);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'年'MM'月'dd'日' HH:mm:ss");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd'-' HH:mm:ss");
Date date = new Date(System.currentTimeMillis());
if (emailResult.rowExists()) {
final String email = emailResult.getValue();
@ -144,6 +147,7 @@ public class VerificationCodeManager implements SettingsDependent, HasCleanup {
emailService.sendVerificationMail(name, email, code, dateFormat.format(date));
}
}
});
}
/**

View File

@ -144,7 +144,7 @@ public class TeleportationService implements Reloadable {
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
Location location = buildLocationFromAuth(player, auth);
Location playerLoc = player.getLocation();
if (location.getX() == playerLoc.getX() && location.getY() == location.getY() && location.getZ() == playerLoc.getZ()
if (location.getX() == playerLoc.getX() && location.getY() == playerLoc.getY() && location.getZ() == playerLoc.getZ()
&& location.getWorld() == playerLoc.getWorld()) return;
logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName());
teleportBackFromSpawn(player, location);