Pooled Io Write + EXP loss & Detached morph patch + Storages in World

Fixed autocommit getting called early/unavailable in a few catch blocks, when trying to save player.
Fixed the missing variable declaration in several quest scripts that were recently formatted.
Reworked the EXP loss formula applied at a knock-out. The new formula follows past discussions in several MS forums.
Fixed a deadlock issue related with party HP and party doors management.
Refactored management of packets sent to client through an IoSession. New system no longer makes use of a synchronized statement when calling announce(packet), rather makes use of dedicated threads to send queued packets for the respective players.
Fixed SP reset allowing increase of unexpected skills.
Refactored storages, no longer instantiated as coupled with the character, rather instantiated in a map within the world object, with accountid as key.
Reviewed usage of character objects of offline party members, that weren't being properly checked.
Fixed some unexpected cases with buffs and morphs (within the enhanced buff system) making the latter show up as another morph figure.
Added a "priority buff" perspective within the enhanced buff system, to let such priority items/skills take awareness over other buffs. (This would be vital for some quests, as the one reported in #514 )
Fixed EXP gains in certain scenarios showing up with less amount than the expected (due to float point operations).
Fixed a critical bug that have emerged in a recent mount-skill update, issue happened due to an improper object initialization.
Fixed mount information packet not being relayed to the player at world login time, rendering some quests not startable until the mob levels up.
This commit is contained in:
ronancpl
2019-08-28 03:49:05 -03:00
parent 19e70ddf87
commit efbce82a8b
77 changed files with 959 additions and 293 deletions

View File

@@ -54,6 +54,7 @@ import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
import net.MapleServerHandler;
import net.mina.MapleCodecFactory;
import net.server.channel.Channel;
import net.server.coordinator.MapleSessionCoordinator;
import net.server.guild.MapleAlliance;
import net.server.guild.MapleGuild;
import net.server.guild.MapleGuildCharacter;
@@ -70,6 +71,7 @@ import net.server.worker.RankingLoginWorker;
import net.server.worker.ReleaseLockWorker;
import net.server.worker.RespawnWorker;
import net.server.world.World;
import net.server.world.announcer.MapleAnnouncerCoordinator;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.buffer.SimpleBufferAllocator;
@@ -94,7 +96,6 @@ import constants.GameConstants;
import constants.OpcodeConstants;
import constants.ServerConstants;
import java.util.TimeZone;
import net.server.coordinator.MapleSessionCoordinator;
import server.CashShop.CashItemFactory;
import server.MapleSkillbookInformationProvider;
import server.ThreadManager;
@@ -949,12 +950,17 @@ public class Server {
System.exit(0);
}
MapleAnnouncerCoordinator.getInstance().init();
System.out.println();
if(ServerConstants.USE_FAMILY_SYSTEM) {
timeToTake = System.currentTimeMillis();
MapleFamily.loadAllFamilies();
System.out.println("Families loaded in " + ((System.currentTimeMillis() - timeToTake) / 1000.0) + " seconds\r\n");
}
System.out.println();
acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 30);
acceptor.setHandler(new MapleServerHandler());
try {
@@ -964,7 +970,7 @@ public class Server {
}
System.out.println("Listening on port 8484\r\n\r\n");
System.out.println("HeavenMS is now online.\r\n");
online = true;
@@ -1446,6 +1452,11 @@ public class Server {
} finally {
lgnWLock.unlock();
}
for (World wserv : this.getWorlds()) {
wserv.clearAccountCharacterView(accountid);
wserv.unregisterAccountStorage(accountid);
}
}
*/
@@ -1708,6 +1719,32 @@ public class Server {
return gmLevel;
}
public void loadAccountStorages(MapleClient c) {
int accountId = c.getAccID();
Set<Integer> accWorlds = new HashSet<>();
lgnWLock.lock();
try {
Set<Integer> chars = accountChars.get(accountId);
for (Integer cid : chars) {
Integer worldid = worldChars.get(cid);
if (worldid != null) {
accWorlds.add(worldid);
}
}
} finally {
lgnWLock.unlock();
}
List<World> worldList = this.getWorlds();
for (Integer worldid : accWorlds) {
if (worldid < worldList.size()) {
World wserv = worldList.get(worldid);
wserv.registerAccountStorage(accountId);
}
}
}
private static String getRemoteIp(IoSession session) {
return MapleSessionCoordinator.getSessionRemoteAddress(session);
}