Reformat MapleClient
Now uses 4 space indentation
This commit is contained in:
@@ -51,8 +51,8 @@ import tools.*;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.InetAddress;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.*;
|
||||
@@ -615,7 +615,7 @@ public class MapleClient {
|
||||
|
||||
int len = convert.length();
|
||||
for (int i = len - 2; i >= 0; i -= 2) {
|
||||
hwid.append(convert.substring(i, i + 2));
|
||||
hwid.append(convert, i, i + 2);
|
||||
}
|
||||
hwid.insert(4, "-");
|
||||
|
||||
@@ -888,7 +888,9 @@ public class MapleClient {
|
||||
player.saveCharToDB(true);
|
||||
|
||||
player.logOff();
|
||||
if(YamlConfig.config.server.INSTANT_NAME_CHANGE) player.doPendingNameChange();
|
||||
if (YamlConfig.config.server.INSTANT_NAME_CHANGE) {
|
||||
player.doPendingNameChange();
|
||||
}
|
||||
clear();
|
||||
} else {
|
||||
getChannelServer().removePlayer(player);
|
||||
@@ -1201,9 +1203,9 @@ public class MapleClient {
|
||||
private static boolean checkHash(String hash, String type, String password) {
|
||||
try {
|
||||
MessageDigest digester = MessageDigest.getInstance(type);
|
||||
digester.update(password.getBytes("UTF-8"), 0, password.length());
|
||||
digester.update(password.getBytes(StandardCharsets.UTF_8), 0, password.length());
|
||||
return HexTool.toString(digester.digest()).replace(" ", "").toLowerCase().equals(hash);
|
||||
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("Encoding the string failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user