Trade results + Map-Ownership & Fishing + P. EXP distribution rework

Fixed an issue where players could lose priority over recently dropped items after switching maps.
Adjusted EXP bonus buffs to also cover party bonus gains.
Fixed items taken back from merchants not properly checking for stacking opportunities in player inventory.
Fixed some merchant references in visitors' player object not being properly cleared when owner closes shop.
Adjusted merchants to automatically close as soon as the merchant owner finishes maintenance process with it having no items in store.
Added trade result opcodes. Trade results now should work almost as intended originally.
Implemented server-side check for portal distance when deploying player shops and merchants.
Implemented server-side check for whether local or remote IP is being used when logging in a local/remote server (this should mitigate a few of the issues people may find when trying to log in game world).
Implemented commands designed for management of opened IO sessions.
Fixed chalkboard not showing up for owner player when changing maps.
Added "time left" functionality for merchant owners managing the opened store.
Fixed skillbooks not showing properly for other players in the map.
Fixed commands using lowercased-version of content inputted by player.
Implemented the Fredrick expected fee on using the Store Bank service.
Implemented "exclusive invitation management" in the system. Inviters are notified the invited players are already managing an invite, should it be visually "in-progress" for that one.
Implemented "map ownership". Non-map owners are unable to farm in an area if they are not party members with the owner or until the ownership rescinds.
Adjusted inventory sort feature, now sorting projectile items in such a fashion that commonly stronger versions comes before the basic ones.
Added a visual effect that shows up when obtaining Aran skills.
Revised party EXP gain system. Party bonuses now accounts a fraction of the accumulated EXP gained by members when defeating a mob, and raw EXP gained by a player is kept the same regardless of him/her being in a party or not (thus a bonus being REALLY a bonus).
Implemented a custom fishing system in the source, on which during "seasonal" times (that gets arbitrarily defined by both day-of-year and time-of-day) fishes are more likely to be hooked. Such likelihood also improved depending on the amount of mesos spent as lure.
This commit is contained in:
ronancpl
2019-03-10 01:30:22 -03:00
parent 799870df63
commit 9538c415e1
86 changed files with 2992 additions and 887 deletions

View File

@@ -118,12 +118,18 @@ public class MapleClient {
private final Semaphore actionsSemaphore = new Semaphore(7);
private final Lock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT, true);
private final Lock encoderLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT_ENCODER, true);
private static final Lock loginLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT_LOGIN, true);
private static final Lock loginLocks[] = new Lock[200]; // thanks Masterrulax & try2hack for pointing out a bottleneck issue here
private int votePoints;
private int voteTime = -1;
private int visibleWorlds;
private long lastNpcClick;
private long sessionId;
static {
for (int i = 0; i < 200; i++) {
loginLocks[i] = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT_LOGIN, true);
}
}
public MapleClient(MapleAESOFB send, MapleAESOFB receive, IoSession session) {
this.send = send;
@@ -434,6 +440,7 @@ public class MapleClient {
}
public int finishLogin() {
Lock loginLock = loginLocks[this.getAccID() % 200];
loginLock.lock();
try {
if (getLoginState() > LOGIN_NOTLOGGEDIN) { // 0 = LOGIN_NOTLOGGEDIN, 1= LOGIN_SERVER_TRANSITION, 2 = LOGIN_LOGGEDIN
@@ -535,8 +542,15 @@ public class MapleClient {
ps.setString(1, login);
rs = ps.executeQuery();
if (rs.next()) {
boolean banned = (rs.getByte("banned") == 1);
accId = rs.getInt("id");
if (accId == 0) {
// odd case where accId is actually attributed as 0 (further on this leads to getLoginState ACCID = 0, an absurd), thanks Thora for finding this issue
return 15;
} else if (accId < 0) {
FilePrinter.printError(FilePrinter.LOGIN_EXCEPTION, "Tried to login with accid " + accId);
}
boolean banned = (rs.getByte("banned") == 1);
gmlevel = 0;
pin = rs.getString("pin");
pic = rs.getString("pic");
@@ -861,6 +875,7 @@ public class MapleClient {
try {
player.setDisconnectedFromChannelWorld();
player.notifyMapTransferToPartner(-1);
player.removeIncomingInvites();
player.cancelAllBuffs(true);
player.closePlayerInteractions();
@@ -1000,8 +1015,8 @@ public class MapleClient {
MapleSessionCoordinator.getInstance().closeSession(session, false);
session.removeAttribute(MapleClient.CLIENT_KEY);
}
engines.clear();
engines = null; // thanks Tochi for pointing out a NPE here
}
}
@@ -1413,7 +1428,7 @@ public class MapleClient {
}
if (player.getTrade() != null) {
MapleTrade.cancelTrade(getPlayer());
MapleTrade.cancelTrade(getPlayer(), MapleTrade.TradeResult.PARTNER_CANCEL);
}
MapleHiredMerchant merchant = player.getHiredMerchant();
@@ -1429,6 +1444,7 @@ public class MapleClient {
server.getPlayerBuffStorage().addDiseasesToStorage(player.getId(), player.getAllDiseases());
player.setDisconnectedFromChannelWorld();
player.notifyMapTransferToPartner(-1);
player.removeIncomingInvites();
player.cancelAllBuffs(true);
player.cancelAllDebuffs();
player.cancelBuffExpireTask();