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.*;
|
||||
@@ -240,7 +240,7 @@ public class MapleClient {
|
||||
voteTime = -1;
|
||||
}
|
||||
|
||||
public boolean hasVotedAlready(){
|
||||
public boolean hasVotedAlready() {
|
||||
Date currentDate = new Date();
|
||||
int timeNow = (int) (currentDate.getTime() / 1000);
|
||||
int difference = (timeNow - getVoteTime());
|
||||
@@ -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, "-");
|
||||
|
||||
@@ -795,7 +795,7 @@ public class MapleClient {
|
||||
if (player.getMap() != null) {
|
||||
int mapId = player.getMapId();
|
||||
player.getMap().removePlayer(player);
|
||||
if(GameConstants.isDojo(mapId)) {
|
||||
if (GameConstants.isDojo(mapId)) {
|
||||
this.getChannelServer().freeDojoSectionIfEmpty(mapId);
|
||||
}
|
||||
}
|
||||
@@ -877,7 +877,7 @@ public class MapleClient {
|
||||
FilePrinter.printError(FilePrinter.ACCOUNT_STUCK, e);
|
||||
} finally {
|
||||
if (!this.serverTransition) {
|
||||
if(chrg != null) {
|
||||
if (chrg != null) {
|
||||
chrg.setCharacter(null);
|
||||
}
|
||||
wserv.removePlayer(player);
|
||||
@@ -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);
|
||||
@@ -977,7 +979,7 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
return MapleCharacter.deleteCharFromDB(chr, senderAccId);
|
||||
} catch(SQLException ex) {
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
@@ -1129,8 +1131,8 @@ public class MapleClient {
|
||||
saveVotePoints();
|
||||
}
|
||||
|
||||
public void useVotePoints(int points){
|
||||
if (points > votePoints){
|
||||
public void useVotePoints(int points) {
|
||||
if (points > votePoints) {
|
||||
//Should not happen, should probably log this
|
||||
return;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1282,7 +1284,7 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
private void announceDisableServerMessage() {
|
||||
if(!this.getWorldServer().registerDisabledServerMessage(player.getId())) {
|
||||
if (!this.getWorldServer().registerDisabledServerMessage(player.getId())) {
|
||||
announce(MaplePacketCreator.serverMessage(""));
|
||||
}
|
||||
}
|
||||
@@ -1295,8 +1297,8 @@ public class MapleClient {
|
||||
long timeNow = System.currentTimeMillis();
|
||||
int targetHash = player.getTargetHpBarHash();
|
||||
|
||||
if(mobHash != targetHash) {
|
||||
if(timeNow - player.getTargetHpBarTime() >= 5 * 1000) {
|
||||
if (mobHash != targetHash) {
|
||||
if (timeNow - player.getTargetHpBarTime() >= 5 * 1000) {
|
||||
// is there a way to INTERRUPT this annoying thread running on the client that drops the boss bar after some time at every attack?
|
||||
announceDisableServerMessage();
|
||||
announce(packet);
|
||||
@@ -1335,14 +1337,14 @@ public class MapleClient {
|
||||
if (!player.isAlive() || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) {
|
||||
announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
} else if(MapleMiniDungeonInfo.isDungeonMap(player.getMapId())) {
|
||||
} else if (MapleMiniDungeonInfo.isDungeonMap(player.getMapId())) {
|
||||
announce(MaplePacketCreator.serverNotice(5, "Changing channels or entering Cash Shop or MTS are disabled when inside a Mini-Dungeon."));
|
||||
announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
String[] socket = Server.getInstance().getInetSocket(this.getSession(), getWorld(), channel);
|
||||
if(socket == null) {
|
||||
if (socket == null) {
|
||||
announce(MaplePacketCreator.serverNotice(1, "Channel " + channel + " is currently disabled. Try another channel."));
|
||||
announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
@@ -1389,23 +1391,23 @@ public class MapleClient {
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public boolean canRequestCharlist(){
|
||||
public boolean canRequestCharlist() {
|
||||
return lastNpcClick + 877 < Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public boolean canClickNPC(){
|
||||
public boolean canClickNPC() {
|
||||
return lastNpcClick + 500 < Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public void setClickedNPC(){
|
||||
public void setClickedNPC() {
|
||||
lastNpcClick = Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public void removeClickedNPC(){
|
||||
public void removeClickedNPC() {
|
||||
lastNpcClick = 0;
|
||||
}
|
||||
|
||||
public int getVisibleWorlds(){
|
||||
public int getVisibleWorlds() {
|
||||
return visibleWorlds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user