Login Purification + Optimized currenttime calls + Standardized WZ
Repelled ultimately the game-breaking issue that was introduced recently on the revamp of the login phase. Optimized the getcurrenttime calls to the OS. Made most of the handler calls fetch directly from the Server object instead, the Server itself delegated with periodically updating the current time value. The result is an slightly delayed currenttime, backed with realtime value update within minutes. Protected concurrently inventory sort handlers. Expected no more NullPointers from the sorting feature. Added a server flag to limit cash items being sold on player shops/hired merchants. Stabilized the MapleTV mechanics, and activities properly split by world. Normalized Character.wz: equipments supposed to have the "cash" property now implements it. Normalized String.wz: every item that doesn't have a "name" property now implements it. Normalized the XMLs that lost indentation on the last source update. New tool: MapleInvalidItemWithNoNameFetcher. Fetches and reports itemids throughout the XMLs that doesn't contain the "name" property and equipments that lacks "cash" property. Frolic Omniknight references aside, if you have run into any more issues regarding the new login system, please open an issue and show the steps you've done to reach the problem.
This commit is contained in:
@@ -199,7 +199,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
|
||||
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
|
||||
private int owlSearch;
|
||||
private long lastfametime, lastUsedCashItem, lastHealed, lastBuyback = 0, lastDeathtime, lastMesoDrop = -1, jailExpiration = -1;
|
||||
private long lastfametime, lastUsedCashItem, lastExpression = 0, lastHealed, lastBuyback = 0, lastDeathtime, lastMesoDrop = -1, jailExpiration = -1;
|
||||
private transient int localmaxhp, localmaxmp, localstr, localdex, localluk, localint_, magic, watk;
|
||||
private boolean hidden, canDoor = true, berserk, hasMerchant, hasSandboxItem = false, whiteChat = false;
|
||||
private int linkedLevel = 0;
|
||||
@@ -2369,7 +2369,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean dispelSkills(int skillid) {
|
||||
private static boolean dispelSkills(int skillid) {
|
||||
switch (skillid) {
|
||||
case DarkKnight.BEHOLDER:
|
||||
case FPArchMage.ELQUINES:
|
||||
@@ -2386,6 +2386,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void changeFaceExpression(int emote) {
|
||||
long timeNow = Server.getInstance().getCurrentTime();
|
||||
if(timeNow - lastExpression > 2000) {
|
||||
lastExpression = timeNow;
|
||||
client.getChannelServer().registerFaceExpression(map, this, emote);
|
||||
}
|
||||
}
|
||||
|
||||
private void doHurtHp() {
|
||||
if (!(this.getInventory(MapleInventoryType.EQUIPPED).findById(getMap().getHPDecProtect()) != null || buffMapProtection())) {
|
||||
|
||||
@@ -956,6 +956,7 @@ public class MapleClient {
|
||||
|
||||
Server.getInstance().unregisterLoginState(this);
|
||||
|
||||
this.session.setAttribute(MapleClient.CLIENT_KEY, null);
|
||||
this.accountName = null;
|
||||
this.macs = null;
|
||||
this.hwid = null;
|
||||
@@ -1153,6 +1154,10 @@ public class MapleClient {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
public boolean trylockClient() {
|
||||
return lock.tryLock();
|
||||
}
|
||||
|
||||
public void lockEncoder() {
|
||||
encoderLock.lock();
|
||||
}
|
||||
@@ -1356,12 +1361,16 @@ public class MapleClient {
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public boolean canRequestCharlist(){
|
||||
return lastNpcClick + 877 < Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public boolean canClickNPC(){
|
||||
return lastNpcClick + 500 < System.currentTimeMillis();
|
||||
return lastNpcClick + 500 < Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public void setClickedNPC(){
|
||||
lastNpcClick = System.currentTimeMillis();
|
||||
lastNpcClick = Server.getInstance().getCurrentTime();
|
||||
}
|
||||
|
||||
public void removeClickedNPC(){
|
||||
|
||||
@@ -607,33 +607,40 @@ public class Commands {
|
||||
case "dex":
|
||||
case "int":
|
||||
case "luk":
|
||||
int amount = (sub.length > 1) ? Integer.parseInt(sub[1]) : player.getRemainingAp();
|
||||
int remainingAp = player.getRemainingAp();
|
||||
|
||||
int amount = (sub.length > 1) ? Math.min(Integer.parseInt(sub[1]), remainingAp) : remainingAp;
|
||||
boolean str = sub[0].equalsIgnoreCase("str");
|
||||
boolean Int = sub[0].equalsIgnoreCase("int");
|
||||
boolean luk = sub[0].equalsIgnoreCase("luk");
|
||||
boolean dex = sub[0].equalsIgnoreCase("dex");
|
||||
|
||||
if (amount > 0 && amount <= player.getRemainingAp() && amount <= 32763 || amount < 0 && amount >= -32763 && Math.abs(amount) + player.getRemainingAp() <= 32767) {
|
||||
if (str && amount + player.getStr() <= 32767 && amount + player.getStr() >= 4) {
|
||||
player.setStr(player.getStr() + amount);
|
||||
player.updateSingleStat(MapleStat.STR, player.getStr());
|
||||
player.setRemainingAp(player.getRemainingAp() - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
|
||||
} else if (Int && amount + player.getInt() <= 32767 && amount + player.getInt() >= 4) {
|
||||
player.setInt(player.getInt() + amount);
|
||||
player.updateSingleStat(MapleStat.INT, player.getInt());
|
||||
player.setRemainingAp(player.getRemainingAp() - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
|
||||
} else if (luk && amount + player.getLuk() <= 32767 && amount + player.getLuk() >= 4) {
|
||||
player.setLuk(player.getLuk() + amount);
|
||||
player.updateSingleStat(MapleStat.LUK, player.getLuk());
|
||||
player.setRemainingAp(player.getRemainingAp() - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
|
||||
} else if (dex && amount + player.getDex() <= 32767 && amount + player.getDex() >= 4) {
|
||||
player.setDex(player.getDex() + amount);
|
||||
player.updateSingleStat(MapleStat.DEX, player.getDex());
|
||||
player.setRemainingAp(player.getRemainingAp() - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
|
||||
if (amount > 0 && amount <= remainingAp && amount <= 32763) {
|
||||
int playerStr = player.getStr();
|
||||
int playerDex = player.getDex();
|
||||
int playerInt = player.getInt();
|
||||
int playerLuk = player.getLuk();
|
||||
|
||||
if (str && amount + playerStr <= 32767 && amount + playerStr >= 4) {
|
||||
player.setStr(playerStr + amount);
|
||||
player.updateSingleStat(MapleStat.STR, playerStr);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else if (Int && amount + playerInt <= 32767 && amount + playerInt >= 4) {
|
||||
player.setInt(playerInt + amount);
|
||||
player.updateSingleStat(MapleStat.INT, playerInt);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else if (luk && amount + playerLuk <= 32767 && amount + playerLuk >= 4) {
|
||||
player.setLuk(playerLuk + amount);
|
||||
player.updateSingleStat(MapleStat.LUK, playerLuk);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else if (dex && amount + playerDex <= 32767 && amount + playerDex >= 4) {
|
||||
player.setDex(playerDex + amount);
|
||||
player.updateSingleStat(MapleStat.DEX, playerDex);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else {
|
||||
player.dropMessage("Please make sure the stat you are trying to raise is not over 32,767 or under 4.");
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class CharacterFactory {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
int top = recipe.getTop(), bottom = recipe.getBottom(), shoes = recipe.getShoes(), weapon = recipe.getWeapon();
|
||||
|
||||
|
||||
if(top > 0) {
|
||||
Item eq_top = ii.getEquipById(top);
|
||||
eq_top.setPosition((byte) -5);
|
||||
@@ -85,7 +85,7 @@ public abstract class CharacterFactory {
|
||||
return -2;
|
||||
}
|
||||
c.announce(MaplePacketCreator.addNewCharEntry(newchar));
|
||||
|
||||
|
||||
Server.getInstance().createCharacterEntry(newchar);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[NEW CHAR]: " + c.getAccountName() + " has created a new character with IGN " + name));
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BuybackProcessor {
|
||||
public static void processBuyback(MapleClient c) {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
boolean buyback;
|
||||
|
||||
|
||||
c.lockClient();
|
||||
try {
|
||||
buyback = !chr.isAlive() && chr.couldBuyback();
|
||||
|
||||
Reference in New Issue
Block a user