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:
@@ -89,6 +89,7 @@ public final class Channel {
|
||||
private EventScriptManager eventSM;
|
||||
private MobStatusScheduler mobStatusSchedulers[] = new MobStatusScheduler[4];
|
||||
private MobAnimationScheduler mobAnimationSchedulers[] = new MobAnimationScheduler[4];
|
||||
private FaceExpressionScheduler faceExpressionSchedulers[] = new FaceExpressionScheduler[4];
|
||||
private OverallScheduler channelSchedulers[] = new OverallScheduler[4];
|
||||
private Map<Integer, MapleHiredMerchant> hiredMerchants = new HashMap<>();
|
||||
private final Map<Integer, Integer> storedVars = new HashMap<>();
|
||||
@@ -120,6 +121,8 @@ public final class Channel {
|
||||
private ReadLock merchRlock = merchantLock.readLock();
|
||||
private WriteLock merchWlock = merchantLock.writeLock();
|
||||
|
||||
private Lock faceLock[] = new MonitoredReentrantLock[4];
|
||||
|
||||
private Lock lock = new MonitoredReentrantLock(MonitoredLockType.CHANNEL, true);
|
||||
|
||||
public Channel(final int world, final int channel, long startTime) {
|
||||
@@ -157,8 +160,11 @@ public final class Channel {
|
||||
}
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
faceLock[i] = new MonitoredReentrantLock(MonitoredLockType.CHANNEL_FACEEXPRS, true);
|
||||
|
||||
mobStatusSchedulers[i] = new MobStatusScheduler();
|
||||
mobAnimationSchedulers[i] = new MobAnimationScheduler();
|
||||
faceExpressionSchedulers[i] = new FaceExpressionScheduler(faceLock[i]);
|
||||
channelSchedulers[i] = new OverallScheduler();
|
||||
}
|
||||
|
||||
@@ -870,6 +876,40 @@ public final class Channel {
|
||||
channelSchedulers[getChannelSchedulerIndex(mapid)].forceRunDelayedAction(runAction);
|
||||
}
|
||||
|
||||
public void registerFaceExpression(final MapleMap map, final MapleCharacter chr, int emote) {
|
||||
int lockid = getChannelSchedulerIndex(map.getId());
|
||||
|
||||
Runnable cancelAction = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(chr.isLoggedinWorld()) {
|
||||
map.broadcastMessage(chr, MaplePacketCreator.facialExpression(chr, 0), false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
faceLock[lockid].lock();
|
||||
try {
|
||||
if(chr.isLoggedinWorld()) {
|
||||
faceExpressionSchedulers[lockid].registerFaceExpression(chr.getId(), cancelAction);
|
||||
map.broadcastMessage(chr, MaplePacketCreator.facialExpression(chr, emote), false);
|
||||
}
|
||||
} finally {
|
||||
faceLock[lockid].unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterFaceExpression(int mapid, MapleCharacter chr) {
|
||||
int lockid = getChannelSchedulerIndex(mapid);
|
||||
|
||||
faceLock[lockid].lock();
|
||||
try {
|
||||
faceExpressionSchedulers[lockid].unregisterFaceExpression(chr.getId());
|
||||
} finally {
|
||||
faceLock[lockid].unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public void debugMarriageStatus() {
|
||||
System.out.println(" ----- WORLD DATA -----");
|
||||
Server.getInstance().getWorld(world).debugMarriageStatus();
|
||||
|
||||
Reference in New Issue
Block a user