Log rearrangement + new map scripts
Changed log folders to apply yyyy-MM-dd mask. Created some scripts to fix race conditions involving delayed arrivals to travel events in-game.
This commit is contained in:
@@ -1071,6 +1071,20 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
keymap.remove(Integer.valueOf(key));
|
||||
}
|
||||
}
|
||||
|
||||
protected MapleMap getWarpMap(int map) {
|
||||
MapleMap target;
|
||||
if (getEventInstance() == null) {
|
||||
target = client.getChannelServer().getMapFactory().getMap(map);
|
||||
} else {
|
||||
target = getEventInstance().getMapInstance(map);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public void warp(int map) {
|
||||
changeMap(getWarpMap(map), getWarpMap(map).getPortal(0));
|
||||
}
|
||||
|
||||
public void changeMap(int map) {
|
||||
changeMap(map, 0);
|
||||
|
||||
@@ -60,6 +60,7 @@ import net.server.world.World;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
|
||||
import client.inventory.MapleInventoryType;
|
||||
import scripting.event.EventManager;
|
||||
import scripting.npc.NPCConversationManager;
|
||||
import scripting.npc.NPCScriptManager;
|
||||
import scripting.quest.QuestActionManager;
|
||||
@@ -131,6 +132,10 @@ public class MapleClient {
|
||||
public synchronized IoSession getSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
public EventManager getEventManager(String event) {
|
||||
return getChannelServer().getEventSM().getEventManager(event);
|
||||
}
|
||||
|
||||
public MapleCharacter getPlayer() {
|
||||
return player;
|
||||
|
||||
@@ -139,11 +139,11 @@ public class AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
public EventManager getEventManager(String event) {
|
||||
return getClient().getChannelServer().getEventSM().getEventManager(event);
|
||||
return getClient().getEventManager(event);
|
||||
}
|
||||
|
||||
public MapleInventory getInventory(MapleInventoryType type) {
|
||||
return getPlayer().getInventory(type);
|
||||
return getPlayer().getInventory(type);
|
||||
}
|
||||
|
||||
public boolean hasItem(int itemid){
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FilePrinter {
|
||||
NPC_UNCODED = "uncodedNPCs.txt",
|
||||
QUEST_UNCODED = "uncodedQuests.txt",
|
||||
SAVING_CHARACTER = "saveChar.txt";//more to come (maps)
|
||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
|
||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //for file system purposes, it's nice to use yyyy-MM-dd
|
||||
private static final String FILE_PATH = "logs/" + sdf.format(Calendar.getInstance().getTime()) + "/";// + sdf.format(Calendar.getInstance().getTime()) + "/"
|
||||
private static final String ERROR = "error/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user