Client Timestamp update + Cosmetic NPCs & H Beacon patch + Log rework
Fixed Music command not playing soundtracks at all. Fixed stylish scripts stucking player NPC interactions in certain cases. Reviewed client mistimed view on items, quest expirations, BBS threads, etc. Fixed Homing Beacon skill provoking autoflag in mobs with same objectid in different maps. Solved DB leak cases with removing pets from inventory. Reviewed logging throughout the source, aiming to normalize the varied-spaced log content within the facilities. Fixed a bug that would occur when trying to reaccess Horntail expedition.
This commit is contained in:
@@ -187,7 +187,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private MapleFamily family;
|
||||
private int familyId;
|
||||
private int bookCover;
|
||||
private int markedMonster = 0;
|
||||
private int battleshipHp = 0;
|
||||
private int mesosTraded = 0;
|
||||
private int possibleReports = 10;
|
||||
@@ -2785,11 +2784,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
deletedCoupon = true;
|
||||
}
|
||||
} else {
|
||||
if (item.getPetId() > -1) {
|
||||
int petIdx = getPetIndex(item.getPetId());
|
||||
if(petIdx > -1) unequipPet(getPet(petIdx), true);
|
||||
}
|
||||
|
||||
if (ItemConstants.isExpirablePet(item.getItemId())) {
|
||||
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
||||
toberemove.add(item);
|
||||
@@ -4638,10 +4632,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return mapid;
|
||||
}
|
||||
|
||||
public int getMarkedMonster() {
|
||||
return markedMonster;
|
||||
}
|
||||
|
||||
public MapleRing getMarriageRing() {
|
||||
return partnerId > 0 ? marriageRing : null;
|
||||
}
|
||||
@@ -8003,10 +7993,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
String message = getName() + " received this - " + text;
|
||||
if (Server.getInstance().isGmOnline(this.getWorld())) { //Alert and log if a GM is online
|
||||
Server.getInstance().broadcastGMMessage(this.getWorld(), MaplePacketCreator.sendYellowTip(message));
|
||||
FilePrinter.printError("autobanwarning.txt", message + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, message);
|
||||
} else { //Auto DC and log if no GM is online
|
||||
client.disconnect(false, false);
|
||||
FilePrinter.printError("autobandced.txt", message + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_DC, message);
|
||||
}
|
||||
//Server.getInstance().broadcastGMMessage(0, MaplePacketCreator.serverNotice(1, getName() + " received this - " + text));
|
||||
//announce(MaplePacketCreator.sendPolice(text));
|
||||
@@ -8357,10 +8347,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public void setMap(MapleMap newmap) {
|
||||
this.map = newmap;
|
||||
}
|
||||
|
||||
public void setMarkedMonster(int markedMonster) {
|
||||
this.markedMonster = markedMonster;
|
||||
}
|
||||
|
||||
public void setMessenger(MapleMessenger messenger) {
|
||||
this.messenger = messenger;
|
||||
|
||||
@@ -91,7 +91,7 @@ public enum AutobanFactory {
|
||||
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), MaplePacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
FilePrinter.printError("autobanwarning.txt", (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AutobanManager {
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
// Lets log every single point too.
|
||||
FilePrinter.printError("autobanwarning.txt", MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class CommandsExecutor {
|
||||
private void writeLog(MapleClient client, String command){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
|
||||
FilePrinter.print(FilePrinter.USED_COMMANDS, client.getPlayer().getName() + " used: " + command + " on "
|
||||
+ sdf.format(Calendar.getInstance().getTime()) + "\r\n");
|
||||
+ sdf.format(Calendar.getInstance().getTime()));
|
||||
}
|
||||
|
||||
private void addCommandInfo(String name, Class<? extends Command> commandClass) {
|
||||
@@ -262,7 +262,7 @@ public class CommandsExecutor {
|
||||
addCommand("ignored", 3, IgnoredCommand.class);
|
||||
addCommand("pos", 3, PosCommand.class);
|
||||
addCommand("togglecoupon", 3, ToggleCouponCommand.class);
|
||||
addCommand("chat", 3, ChatCommand.class);
|
||||
addCommand("togglewhitechat", 3, ChatCommand.class);
|
||||
addCommand("fame", 3, FameCommand.class);
|
||||
addCommand("givenx", 3, GiveNxCommand.class);
|
||||
addCommand("givevp", 3, GiveVpCommand.class);
|
||||
|
||||
@@ -61,6 +61,7 @@ public class GachaCommand extends Command {
|
||||
}
|
||||
}
|
||||
talkStr += "\r\nPlease keep in mind that there are items that are in all gachapons and are not listed here.";
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, talkStr, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, talkStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class GmCommand extends Command {
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[GM MESSAGE]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("gm.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.COMMAND_GM, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
|
||||
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ReportBugCommand extends Command {
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[BUG]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("bug.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.COMMAND_BUG, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!");
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GotoCommand extends Command {
|
||||
}
|
||||
|
||||
if (player.getEventInstance() != null || MapleMiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit()) || !player.isAlive()) {
|
||||
player.yellowMessage("This command can not be used in this map.");
|
||||
player.dropMessage(1, "This command can not be used in this map.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ public class WhatDropsFromCommand extends Command {
|
||||
output += "\r\n";
|
||||
}
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ public class WhoDropsCommand extends Command {
|
||||
player.dropMessage(5, "The item you searched for doesn't exist.");
|
||||
return;
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, output);
|
||||
} finally {
|
||||
c.releaseClient();
|
||||
}
|
||||
|
||||
@@ -136,6 +136,6 @@ public class SearchCommand extends Command {
|
||||
}
|
||||
sb.append("\r\n#kLoaded within ").append((double) (System.currentTimeMillis() - start) / 1000).append(" seconds.");//because I can, and it's free
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, sb.toString(), "00 00", (byte) 0));
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMiniDungeonInfo;
|
||||
|
||||
public class WarpCommand extends Command {
|
||||
{
|
||||
@@ -48,6 +50,11 @@ public class WarpCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getEventInstance() != null || MapleMiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit()) || !player.isAlive()) {
|
||||
player.dropMessage(1, "This command cannot be used in this map.");
|
||||
return;
|
||||
}
|
||||
|
||||
// expedition issue with this command detected thanks to Masterrulax
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm3;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import constants.GameConstants;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MusicCommand extends Command {
|
||||
@@ -33,181 +34,42 @@ public class MusicCommand extends Command {
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
private static String getSongList() {
|
||||
String songList = "Song:\r\n";
|
||||
for (String s : GameConstants.GAME_SONGS) {
|
||||
songList += (" " + s + "\r\n");
|
||||
}
|
||||
|
||||
return songList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
final String[] songs = {
|
||||
"Jukebox/Congratulation",
|
||||
"Bgm00/SleepyWood",
|
||||
"Bgm00/FloralLife",
|
||||
"Bgm00/GoPicnic",
|
||||
"Bgm00/Nightmare",
|
||||
"Bgm00/RestNPeace",
|
||||
"Bgm01/AncientMove",
|
||||
"Bgm01/MoonlightShadow",
|
||||
"Bgm01/WhereTheBarlogFrom",
|
||||
"Bgm01/CavaBien",
|
||||
"Bgm01/HighlandStar",
|
||||
"Bgm01/BadGuys",
|
||||
"Bgm02/MissingYou",
|
||||
"Bgm02/WhenTheMorningComes",
|
||||
"Bgm02/EvilEyes",
|
||||
"Bgm02/JungleBook",
|
||||
"Bgm02/AboveTheTreetops",
|
||||
"Bgm03/Subway",
|
||||
"Bgm03/Elfwood",
|
||||
"Bgm03/BlueSky",
|
||||
"Bgm03/Beachway",
|
||||
"Bgm03/SnowyVillage",
|
||||
"Bgm04/PlayWithMe",
|
||||
"Bgm04/WhiteChristmas",
|
||||
"Bgm04/UponTheSky",
|
||||
"Bgm04/ArabPirate",
|
||||
"Bgm04/Shinin'Harbor",
|
||||
"Bgm04/WarmRegard",
|
||||
"Bgm05/WolfWood",
|
||||
"Bgm05/DownToTheCave",
|
||||
"Bgm05/AbandonedMine",
|
||||
"Bgm05/MineQuest",
|
||||
"Bgm05/HellGate",
|
||||
"Bgm06/FinalFight",
|
||||
"Bgm06/WelcomeToTheHell",
|
||||
"Bgm06/ComeWithMe",
|
||||
"Bgm06/FlyingInABlueDream",
|
||||
"Bgm06/FantasticThinking",
|
||||
"Bgm07/WaltzForWork",
|
||||
"Bgm07/WhereverYouAre",
|
||||
"Bgm07/FunnyTimeMaker",
|
||||
"Bgm07/HighEnough",
|
||||
"Bgm07/Fantasia",
|
||||
"Bgm08/LetsMarch",
|
||||
"Bgm08/ForTheGlory",
|
||||
"Bgm08/FindingForest",
|
||||
"Bgm08/LetsHuntAliens",
|
||||
"Bgm08/PlotOfPixie",
|
||||
"Bgm09/DarkShadow",
|
||||
"Bgm09/TheyMenacingYou",
|
||||
"Bgm09/FairyTale",
|
||||
"Bgm09/FairyTalediffvers",
|
||||
"Bgm09/TimeAttack",
|
||||
"Bgm10/Timeless",
|
||||
"Bgm10/TimelessB",
|
||||
"Bgm10/BizarreTales",
|
||||
"Bgm10/TheWayGrotesque",
|
||||
"Bgm10/Eregos",
|
||||
"Bgm11/BlueWorld",
|
||||
"Bgm11/Aquarium",
|
||||
"Bgm11/ShiningSea",
|
||||
"Bgm11/DownTown",
|
||||
"Bgm11/DarkMountain",
|
||||
"Bgm12/AquaCave",
|
||||
"Bgm12/DeepSee",
|
||||
"Bgm12/WaterWay",
|
||||
"Bgm12/AcientRemain",
|
||||
"Bgm12/RuinCastle",
|
||||
"Bgm12/Dispute",
|
||||
"Bgm13/CokeTown",
|
||||
"Bgm13/Leafre",
|
||||
"Bgm13/Minar'sDream",
|
||||
"Bgm13/AcientForest",
|
||||
"Bgm13/TowerOfGoddess",
|
||||
"Bgm14/DragonLoad",
|
||||
"Bgm14/HonTale",
|
||||
"Bgm14/CaveOfHontale",
|
||||
"Bgm14/DragonNest",
|
||||
"Bgm14/Ariant",
|
||||
"Bgm14/HotDesert",
|
||||
"Bgm15/MureungHill",
|
||||
"Bgm15/MureungForest",
|
||||
"Bgm15/WhiteHerb",
|
||||
"Bgm15/Pirate",
|
||||
"Bgm15/SunsetDesert",
|
||||
"Bgm16/Duskofgod",
|
||||
"Bgm16/FightingPinkBeen",
|
||||
"Bgm16/Forgetfulness",
|
||||
"Bgm16/Remembrance",
|
||||
"Bgm16/Repentance",
|
||||
"Bgm16/TimeTemple",
|
||||
"Bgm17/MureungSchool1",
|
||||
"Bgm17/MureungSchool2",
|
||||
"Bgm17/MureungSchool3",
|
||||
"Bgm17/MureungSchool4",
|
||||
"Bgm18/BlackWing",
|
||||
"Bgm18/DrillHall",
|
||||
"Bgm18/QueensGarden",
|
||||
"Bgm18/RaindropFlower",
|
||||
"Bgm18/WolfAndSheep",
|
||||
"Bgm19/BambooGym",
|
||||
"Bgm19/CrystalCave",
|
||||
"Bgm19/MushCatle",
|
||||
"Bgm19/RienVillage",
|
||||
"Bgm19/SnowDrop",
|
||||
"Bgm20/GhostShip",
|
||||
"Bgm20/NetsPiramid",
|
||||
"Bgm20/UnderSubway",
|
||||
"Bgm21/2021year",
|
||||
"Bgm21/2099year",
|
||||
"Bgm21/2215year",
|
||||
"Bgm21/2230year",
|
||||
"Bgm21/2503year",
|
||||
"Bgm21/KerningSquare",
|
||||
"Bgm21/KerningSquareField",
|
||||
"Bgm21/KerningSquareSubway",
|
||||
"Bgm21/TeraForest",
|
||||
"BgmEvent/FunnyRabbit",
|
||||
"BgmEvent/FunnyRabbitFaster",
|
||||
"BgmEvent/wedding",
|
||||
"BgmEvent/weddingDance",
|
||||
"BgmEvent/wichTower",
|
||||
"BgmGL/amoria",
|
||||
"BgmGL/Amorianchallenge",
|
||||
"BgmGL/chapel",
|
||||
"BgmGL/cathedral",
|
||||
"BgmGL/Courtyard",
|
||||
"BgmGL/CrimsonwoodKeep",
|
||||
"BgmGL/CrimsonwoodKeepInterior",
|
||||
"BgmGL/GrandmastersGauntlet",
|
||||
"BgmGL/HauntedHouse",
|
||||
"BgmGL/NLChunt",
|
||||
"BgmGL/NLCtown",
|
||||
"BgmGL/NLCupbeat",
|
||||
"BgmGL/PartyQuestGL",
|
||||
"BgmGL/PhantomForest",
|
||||
"BgmJp/Feeling",
|
||||
"BgmJp/BizarreForest",
|
||||
"BgmJp/Hana",
|
||||
"BgmJp/Yume",
|
||||
"BgmJp/Bathroom",
|
||||
"BgmJp/BattleField",
|
||||
"BgmJp/FirstStepMaster",
|
||||
"BgmMY/Highland",
|
||||
"BgmMY/KualaLumpur",
|
||||
"BgmSG/BoatQuay_field",
|
||||
"BgmSG/BoatQuay_town",
|
||||
"BgmSG/CBD_field",
|
||||
"BgmSG/CBD_town",
|
||||
"BgmSG/Ghostship",
|
||||
"BgmUI/ShopBgm",
|
||||
"BgmUI/Title"
|
||||
};
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !music <song>");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
String sendMsg = "";
|
||||
|
||||
sendMsg += "Syntax: #r!music <song>#k\r\n\r\n";
|
||||
sendMsg += getSongList();
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(1052015, (byte) 0, sendMsg, "00 00", (byte) 0));
|
||||
return;
|
||||
}
|
||||
|
||||
String song = joinStringFrom(params, 0);
|
||||
for (String s : songs) {
|
||||
if (s.equals(song)) {
|
||||
for (String s : GameConstants.GAME_SONGS) {
|
||||
if (s.equalsIgnoreCase(song)) { // thanks Masterrulax for finding an issue here
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.musicChange(s));
|
||||
player.yellowMessage("Now playing song " + song + ".");
|
||||
break;
|
||||
player.yellowMessage("Now playing song " + s + ".");
|
||||
return;
|
||||
}
|
||||
}
|
||||
player.yellowMessage("Song not found, please enter a song below.");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
|
||||
String sendMsg = "";
|
||||
sendMsg += "Song not found, please enter a song below.\r\n\r\n";
|
||||
sendMsg += getSongList();
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(1052015, (byte) 0, sendMsg, "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,18 @@ public class ProItemCommand extends Command {
|
||||
player.yellowMessage("Syntax: !proitem <itemid> <stat value> [<spdjmp value>]");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
int itemid = Integer.parseInt(params[0]);
|
||||
|
||||
if(ii.getName(itemid) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
short stat = (short) Math.max(0, Short.parseShort(params[1]));
|
||||
short spdjmp = params.length >= 3 ? (short) Math.max(0, Short.parseShort(params[2])) : 0;
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
||||
if (type.equals(MapleInventoryType.EQUIP)) {
|
||||
Item it = ii.getEquipById(itemid);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DebugCommand extends Command {
|
||||
msgTypes += ("#L" + i + "#" + debugTypes[i] + "#l\r\n");
|
||||
}
|
||||
|
||||
player.announce(MaplePacketCreator.getNPCTalk(9201143, (byte) 0, msgTypes, "00 00", (byte) 0));
|
||||
c.getAbstractPlayerInteraction().npcTalk(9201143, msgTypes);
|
||||
break;
|
||||
|
||||
case "monster":
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.MapleInventoryType;
|
||||
import constants.ServerConstants;
|
||||
import net.server.Server;
|
||||
import server.MapleItemInformationProvider;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
/**
|
||||
@@ -93,6 +94,7 @@ public abstract class CharacterFactory {
|
||||
|
||||
Server.getInstance().createCharacterEntry(newchar);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[NEW CHAR]: " + c.getAccountName() + " has created a new character with IGN " + name));
|
||||
FilePrinter.print(FilePrinter.CREATED_CHAR + c.getAccountName() + ".txt", c.getAccountName() + " created character with IGN " + name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,17 +81,24 @@ public class MaplePet extends Item {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteFromDb() {
|
||||
|
||||
public static void deleteFromDb(int petid) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM pets WHERE `petid` = ?");
|
||||
ps.setInt(1, this.getUniqueId());
|
||||
ps.setInt(1, petid);
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
|
||||
ps = con.prepareStatement("DELETE FROM petignores WHERE `petid` = ?"); // thanks Vcoc for detecting petignores remaining after deletion
|
||||
ps.setInt(1, petid);
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
|
||||
con.close();
|
||||
|
||||
MapleCashidGenerator.freeCashId(this.getUniqueId());
|
||||
MapleCashidGenerator.freeCashId(petid);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import constants.ItemConstants;
|
||||
@@ -361,14 +362,15 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
|
||||
public static void removeFromSlot(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop, boolean consume) {
|
||||
MapleInventory inv = c.getPlayer().getInventory(type);
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
MapleInventory inv = chr.getInventory(type);
|
||||
Item item = inv.getItem(slot);
|
||||
boolean allowZero = consume && ItemConstants.isRechargeable(item.getItemId());
|
||||
|
||||
if(type == MapleInventoryType.EQUIPPED) {
|
||||
inv.lockInventory();
|
||||
try {
|
||||
c.getPlayer().unequippedItem((Equip) item);
|
||||
chr.unequippedItem((Equip) item);
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
@@ -376,10 +378,25 @@ public class MapleInventoryManipulator {
|
||||
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
} else {
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
int petid = item.getPetId();
|
||||
if (petid > -1) { // thanks Vcoc for finding a d/c issue with equipped pets & pets remaining on DB here
|
||||
int petIdx = chr.getPetIndex(petid);
|
||||
if(petIdx > -1) {
|
||||
MaplePet pet = chr.getPet(petIdx);
|
||||
chr.unequipPet(pet, true);
|
||||
}
|
||||
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
}
|
||||
|
||||
MaplePet.deleteFromDb(petid);
|
||||
} else {
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AssignSPProcessor {
|
||||
boolean isBeginnerSkill = false;
|
||||
if ((!GameConstants.isPqSkillMap(player.getMapId()) && GameConstants.isPqSkill(skillid)) || (!player.isGM() && GameConstants.isGMSkills(skillid)) || (!GameConstants.isInJobTree(skillid, player.getJob().getId()) && !player.isGM())) {
|
||||
AutobanFactory.PACKET_EDIT.alert(player, "tried to packet edit in distributing sp.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skillid + " without it being in their job.\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skillid + " without it being in their job.");
|
||||
|
||||
final MapleClient client = c;
|
||||
ThreadManager.getInstance().newTask(new Runnable() {
|
||||
|
||||
@@ -351,7 +351,7 @@ public class DueyProcessor {
|
||||
final long sendMesos = (long) mesos + fee;
|
||||
if (mesos < 0 || sendMesos > Integer.MAX_VALUE || (amount < 1 && mesos == 0)) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with duey.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ public class DueyProcessor {
|
||||
dp = dueypack;
|
||||
if(dp == null) {
|
||||
c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_UNKNOWN_ERROR.getCode()));
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class FredrickProcessor {
|
||||
Item item = it.getLeft();
|
||||
MapleInventoryManipulator.addFromDrop(chr.getClient(), item, false);
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
}
|
||||
|
||||
chr.announce(MaplePacketCreator.fredrickMessage((byte) 0x1E));
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SpawnPetProcessor {
|
||||
long expiration = chr.getInventory(MapleInventoryType.CASH).getItem(slot).getExpiration();
|
||||
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, petid, (short) 1, false, false);
|
||||
MapleInventoryManipulator.addById(c, evolveid, (short) 1, null, petId, expiration);
|
||||
pet.deleteFromDb();
|
||||
MaplePet.deleteFromDb(petId);
|
||||
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class StorageProcessor {
|
||||
byte slot = slea.readByte();
|
||||
if (slot < 0 || slot > storage.getSlots()) { // removal starts at zero
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with storage.");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to work with storage slot " + slot + "\r\n");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to work with storage slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class StorageProcessor {
|
||||
if (MapleInventoryManipulator.checkSpace(c, item.getItemId(), item.getQuantity(), item.getOwner())) {
|
||||
item = storage.takeOut(slot);//actually the same but idc
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " took out " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " took out " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
chr.setUsedStorage();
|
||||
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
|
||||
MapleInventoryManipulator.addFromDrop(c, item, false);
|
||||
@@ -101,7 +101,7 @@ public class StorageProcessor {
|
||||
MapleInventory Inv = chr.getInventory(slotType);
|
||||
if (slot < 1 || slot > Inv.getSlotLimit()) { //player inv starts at one
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with storage.");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to store item at slot " + slot + "\r\n");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to store item at slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class StorageProcessor {
|
||||
storage.store(item);
|
||||
storage.sendStored(c, ItemConstants.getInventoryType(itemId));
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " stored " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " stored " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
chr.setUsedStorage();
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class StorageProcessor {
|
||||
}
|
||||
storage.setMeso(storageMesos - meso);
|
||||
chr.gainMeso(meso, false, true, false);
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + (meso > 0 ? " took out " : " stored ") + Math.abs(meso) + " mesos\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + (meso > 0 ? " took out " : " stored ") + Math.abs(meso) + " mesos");
|
||||
chr.setUsedStorage();
|
||||
} else {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package constants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import client.MapleJob;
|
||||
@@ -102,6 +104,161 @@ public class GameConstants {
|
||||
put("fm", 910000000);
|
||||
}};
|
||||
|
||||
public static final List<String> GAME_SONGS = new ArrayList<String>(170) {{
|
||||
add("Jukebox/Congratulation");
|
||||
add("Bgm00/SleepyWood");
|
||||
add("Bgm00/FloralLife");
|
||||
add("Bgm00/GoPicnic");
|
||||
add("Bgm00/Nightmare");
|
||||
add("Bgm00/RestNPeace");
|
||||
add("Bgm01/AncientMove");
|
||||
add("Bgm01/MoonlightShadow");
|
||||
add("Bgm01/WhereTheBarlogFrom");
|
||||
add("Bgm01/CavaBien");
|
||||
add("Bgm01/HighlandStar");
|
||||
add("Bgm01/BadGuys");
|
||||
add("Bgm02/MissingYou");
|
||||
add("Bgm02/WhenTheMorningComes");
|
||||
add("Bgm02/EvilEyes");
|
||||
add("Bgm02/JungleBook");
|
||||
add("Bgm02/AboveTheTreetops");
|
||||
add("Bgm03/Subway");
|
||||
add("Bgm03/Elfwood");
|
||||
add("Bgm03/BlueSky");
|
||||
add("Bgm03/Beachway");
|
||||
add("Bgm03/SnowyVillage");
|
||||
add("Bgm04/PlayWithMe");
|
||||
add("Bgm04/WhiteChristmas");
|
||||
add("Bgm04/UponTheSky");
|
||||
add("Bgm04/ArabPirate");
|
||||
add("Bgm04/Shinin'Harbor");
|
||||
add("Bgm04/WarmRegard");
|
||||
add("Bgm05/WolfWood");
|
||||
add("Bgm05/DownToTheCave");
|
||||
add("Bgm05/AbandonedMine");
|
||||
add("Bgm05/MineQuest");
|
||||
add("Bgm05/HellGate");
|
||||
add("Bgm06/FinalFight");
|
||||
add("Bgm06/WelcomeToTheHell");
|
||||
add("Bgm06/ComeWithMe");
|
||||
add("Bgm06/FlyingInABlueDream");
|
||||
add("Bgm06/FantasticThinking");
|
||||
add("Bgm07/WaltzForWork");
|
||||
add("Bgm07/WhereverYouAre");
|
||||
add("Bgm07/FunnyTimeMaker");
|
||||
add("Bgm07/HighEnough");
|
||||
add("Bgm07/Fantasia");
|
||||
add("Bgm08/LetsMarch");
|
||||
add("Bgm08/ForTheGlory");
|
||||
add("Bgm08/FindingForest");
|
||||
add("Bgm08/LetsHuntAliens");
|
||||
add("Bgm08/PlotOfPixie");
|
||||
add("Bgm09/DarkShadow");
|
||||
add("Bgm09/TheyMenacingYou");
|
||||
add("Bgm09/FairyTale");
|
||||
add("Bgm09/FairyTalediffvers");
|
||||
add("Bgm09/TimeAttack");
|
||||
add("Bgm10/Timeless");
|
||||
add("Bgm10/TimelessB");
|
||||
add("Bgm10/BizarreTales");
|
||||
add("Bgm10/TheWayGrotesque");
|
||||
add("Bgm10/Eregos");
|
||||
add("Bgm11/BlueWorld");
|
||||
add("Bgm11/Aquarium");
|
||||
add("Bgm11/ShiningSea");
|
||||
add("Bgm11/DownTown");
|
||||
add("Bgm11/DarkMountain");
|
||||
add("Bgm12/AquaCave");
|
||||
add("Bgm12/DeepSee");
|
||||
add("Bgm12/WaterWay");
|
||||
add("Bgm12/AcientRemain");
|
||||
add("Bgm12/RuinCastle");
|
||||
add("Bgm12/Dispute");
|
||||
add("Bgm13/CokeTown");
|
||||
add("Bgm13/Leafre");
|
||||
add("Bgm13/Minar'sDream");
|
||||
add("Bgm13/AcientForest");
|
||||
add("Bgm13/TowerOfGoddess");
|
||||
add("Bgm14/DragonLoad");
|
||||
add("Bgm14/HonTale");
|
||||
add("Bgm14/CaveOfHontale");
|
||||
add("Bgm14/DragonNest");
|
||||
add("Bgm14/Ariant");
|
||||
add("Bgm14/HotDesert");
|
||||
add("Bgm15/MureungHill");
|
||||
add("Bgm15/MureungForest");
|
||||
add("Bgm15/WhiteHerb");
|
||||
add("Bgm15/Pirate");
|
||||
add("Bgm15/SunsetDesert");
|
||||
add("Bgm16/Duskofgod");
|
||||
add("Bgm16/FightingPinkBeen");
|
||||
add("Bgm16/Forgetfulness");
|
||||
add("Bgm16/Remembrance");
|
||||
add("Bgm16/Repentance");
|
||||
add("Bgm16/TimeTemple");
|
||||
add("Bgm17/MureungSchool1");
|
||||
add("Bgm17/MureungSchool2");
|
||||
add("Bgm17/MureungSchool3");
|
||||
add("Bgm17/MureungSchool4");
|
||||
add("Bgm18/BlackWing");
|
||||
add("Bgm18/DrillHall");
|
||||
add("Bgm18/QueensGarden");
|
||||
add("Bgm18/RaindropFlower");
|
||||
add("Bgm18/WolfAndSheep");
|
||||
add("Bgm19/BambooGym");
|
||||
add("Bgm19/CrystalCave");
|
||||
add("Bgm19/MushCatle");
|
||||
add("Bgm19/RienVillage");
|
||||
add("Bgm19/SnowDrop");
|
||||
add("Bgm20/GhostShip");
|
||||
add("Bgm20/NetsPiramid");
|
||||
add("Bgm20/UnderSubway");
|
||||
add("Bgm21/2021year");
|
||||
add("Bgm21/2099year");
|
||||
add("Bgm21/2215year");
|
||||
add("Bgm21/2230year");
|
||||
add("Bgm21/2503year");
|
||||
add("Bgm21/KerningSquare");
|
||||
add("Bgm21/KerningSquareField");
|
||||
add("Bgm21/KerningSquareSubway");
|
||||
add("Bgm21/TeraForest");
|
||||
add("BgmEvent/FunnyRabbit");
|
||||
add("BgmEvent/FunnyRabbitFaster");
|
||||
add("BgmEvent/wedding");
|
||||
add("BgmEvent/weddingDance");
|
||||
add("BgmEvent/wichTower");
|
||||
add("BgmGL/amoria");
|
||||
add("BgmGL/Amorianchallenge");
|
||||
add("BgmGL/chapel");
|
||||
add("BgmGL/cathedral");
|
||||
add("BgmGL/Courtyard");
|
||||
add("BgmGL/CrimsonwoodKeep");
|
||||
add("BgmGL/CrimsonwoodKeepInterior");
|
||||
add("BgmGL/GrandmastersGauntlet");
|
||||
add("BgmGL/HauntedHouse");
|
||||
add("BgmGL/NLChunt");
|
||||
add("BgmGL/NLCtown");
|
||||
add("BgmGL/NLCupbeat");
|
||||
add("BgmGL/PartyQuestGL");
|
||||
add("BgmGL/PhantomForest");
|
||||
add("BgmJp/Feeling");
|
||||
add("BgmJp/BizarreForest");
|
||||
add("BgmJp/Hana");
|
||||
add("BgmJp/Yume");
|
||||
add("BgmJp/Bathroom");
|
||||
add("BgmJp/BattleField");
|
||||
add("BgmJp/FirstStepMaster");
|
||||
add("BgmMY/Highland");
|
||||
add("BgmMY/KualaLumpur");
|
||||
add("BgmSG/BoatQuay_field");
|
||||
add("BgmSG/BoatQuay_town");
|
||||
add("BgmSG/CBD_field");
|
||||
add("BgmSG/CBD_town");
|
||||
add("BgmSG/Ghostship");
|
||||
add("BgmUI/ShopBgm");
|
||||
add("BgmUI/Title");
|
||||
}};
|
||||
|
||||
// MapleStory default keyset
|
||||
private static final int[] DEFAULT_KEY = {18, 65, 2, 23, 3, 4, 5, 6, 16, 17, 19, 25, 26, 27, 31, 34, 35, 37, 38, 40, 43, 44, 45, 46, 50, 56, 59, 60, 61, 62, 63, 64, 57, 48, 29, 7, 24, 33, 41, 39};
|
||||
private static final int[] DEFAULT_TYPE = {4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 6, 6, 6, 6, 6, 6, 5, 4, 5, 4, 4, 4, 4, 4};
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ThreadTracker {
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
|
||||
FilePrinter.printError(FilePrinter.DEADLOCK_STATE, printThreadTrackerState(dateFormat.format(new Date())));
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_STATE, "[" + dateFormat.format(new Date()) + "] Presenting current lock path for lockid " + lockId.name() + ".\r\n" + printLockStatus(lockId) + "\r\n-------------------------------\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_STATE, "[" + dateFormat.format(new Date()) + "] Presenting current lock path for lockid " + lockId.name() + ".\r\n" + printLockStatus(lockId) + "\r\n-------------------------------");
|
||||
}
|
||||
} else {
|
||||
long tid = Thread.currentThread().getId();
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class TrackerReadLock extends ReentrantReadWriteLock.ReadLock implements
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class TrackerReentrantLock extends ReentrantLock implements MonitoredReen
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getDefault());
|
||||
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "[CRITICAL] " + dateFormat.format(new Date()) + " Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class TrackerWriteLock extends ReentrantReadWriteLock.WriteLock implement
|
||||
if(super.tryLock()) {
|
||||
if(ServerConstants.USE_THREAD_TRACKER) {
|
||||
if(deadlockedState != null) {
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState) + "\r\n\r\n");
|
||||
//FilePrinter.printError(FilePrinter.DEADLOCK_ERROR, "Deadlock occurred when trying to use the '" + id.name() + "' lock resources:\r\n" + printStackTrace(deadlockedState));
|
||||
ThreadTracker.getInstance().accessThreadTracker(true, true, id, hashcode);
|
||||
deadlockedState = null;
|
||||
}
|
||||
|
||||
@@ -326,8 +326,8 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
|
||||
} else if (attack.skill == ILArchMage.ICE_DEMON) {
|
||||
monster.setTempEffectiveness(Element.FIRE, ElementalEffectiveness.WEAK, SkillFactory.getSkill(ILArchMage.ICE_DEMON).getEffect(player.getSkillLevel(SkillFactory.getSkill(ILArchMage.ICE_DEMON))).getDuration() * 1000);
|
||||
} else if (attack.skill == Outlaw.HOMING_BEACON || attack.skill == Corsair.BULLSEYE) {
|
||||
player.setMarkedMonster(monster.getObjectId());
|
||||
player.announce(MaplePacketCreator.giveBuff(1, attack.skill, Collections.singletonList(new Pair<>(MapleBuffStat.HOMING_BEACON, monster.getObjectId()))));
|
||||
MapleStatEffect beacon = SkillFactory.getSkill(attack.skill).getEffect(player.getSkillLevel(attack.skill));
|
||||
beacon.applyBeaconBuff(player, monster.getObjectId());
|
||||
} else if (attack.skill == Outlaw.FLAME_THROWER) {
|
||||
if (!monster.isBoss()) {
|
||||
Skill type = SkillFactory.getSkill(Outlaw.FLAME_THROWER);
|
||||
|
||||
@@ -172,7 +172,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
}
|
||||
if (chr.getStorage().gainSlots(4)) {
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " bought 4 slots to their account storage.\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " bought 4 slots to their account storage.");
|
||||
chr.setUsedStorage();
|
||||
|
||||
c.announce(MaplePacketCreator.showBoughtStorageSlots(chr.getStorage().getSlots()));
|
||||
@@ -187,7 +187,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
}
|
||||
if (chr.getStorage().gainSlots(8)) { // thanks ABaldParrot & Thora for detecting storage issues here
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " bought 8 slots to their account storage.\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " bought 8 slots to their account storage.");
|
||||
chr.setUsedStorage();
|
||||
|
||||
c.announce(MaplePacketCreator.showBoughtStorageSlots(chr.getStorage().getSlots()));
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class GeneralChatHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
if (s.length() > Byte.MAX_VALUE && !chr.isGM()) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit in General Chat.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + s.length() + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + s.length());
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class GiveFameHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
} else if (famechange != 1 && famechange != -1) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit fame.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to fame hack with famechange " + famechange + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to fame hack with famechange " + famechange);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class ItemPickupHandler extends AbstractMaplePacketHandler {
|
||||
Point charPos = chr.getPosition();
|
||||
Point obPos = ob.getPosition();
|
||||
if (Math.abs(charPos.getX() - obPos.getX()) > 800 || Math.abs(charPos.getY() - obPos.getY()) > 600) {
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to pick up an item too far away. Mapid: " + chr.getMapId() + " Player pos: " + charPos + " Object pos: " + obPos + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to pick up an item too far away. Mapid: " + chr.getMapId() + " Player pos: " + charPos + " Object pos: " + obPos);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class KeymapChangeHandler extends AbstractMaplePacketHandler {
|
||||
isBanndedSkill = GameConstants.bannedBindSkills(skill.getId());
|
||||
if (isBanndedSkill || (!c.getPlayer().isGM() && GameConstants.isGMSkills(skill.getId())) || (!GameConstants.isInJobTree(skill.getId(), c.getPlayer().getJob().getId()) && !c.getPlayer().isGM())) { //for those skills are are "technically" in the beginner tab, like bamboo rain in Dojo or skills you find in PYPQ
|
||||
//AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit keymapping.");
|
||||
//FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId() + "\r\n");
|
||||
//FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId());
|
||||
//c.disconnect(true, false);
|
||||
//return;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class MultiChatHandler extends AbstractMaplePacketHandler {
|
||||
String chattext = slea.readMapleAsciiString();
|
||||
if (chattext.length() > Byte.MAX_VALUE && !player.isGM()) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit chats.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + chattext.length() + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + chattext.length());
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class NPCShopHandler extends AbstractMaplePacketHandler {
|
||||
short quantity = slea.readShort();
|
||||
if (quantity < 1) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit a npc shop.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to buy quantity " + quantity + " of item id " + itemId + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to buy quantity " + quantity + " of item id " + itemId);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class NPCTalkHandler extends AbstractMaplePacketHandler {
|
||||
boolean hasNpcScript = NPCScriptManager.getInstance().start(c, npc.getId(), oid, null);
|
||||
if (!hasNpcScript) {
|
||||
if (!npc.hasShop()) {
|
||||
FilePrinter.printError(FilePrinter.NPC_UNCODED, "NPC " + npc.getName() + "(" + npc.getId() + ") is not coded.\r\n");
|
||||
FilePrinter.printError(FilePrinter.NPC_UNCODED, "NPC " + npc.getName() + "(" + npc.getId() + ") is not coded.");
|
||||
return;
|
||||
} else if(c.getPlayer().getShop() != null) {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class PetChatHandler extends AbstractMaplePacketHandler {
|
||||
String text = slea.readMapleAsciiString();
|
||||
if (text.length() > Byte.MAX_VALUE) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with pets.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + text.length() + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + text.length());
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
|
||||
int slot = slea.readShort();
|
||||
if (slot >= shop.getItems().size() || slot < 0) {
|
||||
AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a player shop.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -609,7 +609,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
|
||||
short quantity = slea.readShort();
|
||||
if (quantity < 1) {
|
||||
AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a hired merchant and or player shop.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to buy item " + itemid + " with quantity " + quantity + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to buy item " + itemid + " with quantity " + quantity);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -635,7 +635,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
|
||||
int slot = slea.readShort();
|
||||
if (slot >= merchant.getItems().size() || slot < 0) {
|
||||
AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a hired merchant.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,14 @@
|
||||
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.MapleBuffStat;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
/**
|
||||
@@ -32,6 +38,15 @@ public final class PlayerMapTransitionHandler extends AbstractMaplePacketHandler
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
c.getPlayer().setMapTransitionComplete();
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
chr.setMapTransitionComplete();
|
||||
|
||||
int beaconid = chr.getBuffSource(MapleBuffStat.HOMING_BEACON);
|
||||
if (beaconid != -1) {
|
||||
chr.cancelBuffStats(MapleBuffStat.HOMING_BEACON);
|
||||
|
||||
final List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.HOMING_BEACON, 0));
|
||||
chr.announce(MaplePacketCreator.giveBuff(1, beaconid, stat));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public final class SpecialMoveHandler extends AbstractMaplePacketHandler {
|
||||
/*
|
||||
if ((!GameConstants.isPqSkillMap(chr.getMapId()) && GameConstants.isPqSkill(skillid)) || (!chr.isGM() && GameConstants.isGMSkills(skillid)) || (!GameConstants.isInJobTree(skillid, chr.getJob().getId()) && !chr.isGM())) {
|
||||
AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit skills.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to use skill " + skillid + " without it being in their job.\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to use skill " + skillid + " without it being in their job.");
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public final class WhisperHandler extends AbstractMaplePacketHandler {
|
||||
}
|
||||
if (text.length() > Byte.MAX_VALUE && !player.isGM()) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with whispers.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + text.length() + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to send text with length of " + text.length());
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class DeleteCharHandler extends AbstractMaplePacketHandler {
|
||||
int cid = slea.readInt();
|
||||
if (c.checkPic(pic)) {
|
||||
if(c.deleteCharacter(cid, c.getAccID())) {
|
||||
FilePrinter.print(FilePrinter.DELETED_CHARACTERS + c.getAccountName() + ".txt", c.getAccountName() + " deleted CID: " + cid + "\r\n");
|
||||
FilePrinter.print(FilePrinter.DELETED_CHAR + c.getAccountName() + ".txt", c.getAccountName() + " deleted CID: " + cid);
|
||||
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0));
|
||||
} else {
|
||||
c.announce(MaplePacketCreator.deleteCharResponse(cid, 0x14));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CouponWorker implements Runnable {
|
||||
Server.getInstance().updateActiveCoupons();
|
||||
Server.getInstance().commitActiveCoupons();
|
||||
} catch(SQLException sqle) {
|
||||
FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, "Unexpected SQL error: " + sqle.getMessage() + "\n\n");
|
||||
FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, "Unexpected SQL error: " + sqle.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,6 @@ public class AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
Item tmp = gainItem(afterId, (short) 1, false, true, period, target);
|
||||
getPlayer().unequipPet(target, true, false);
|
||||
|
||||
/*
|
||||
evolved = MaplePet.loadFromDb(tmp.getItemId(), tmp.getPosition(), tmp.getPetId());
|
||||
|
||||
@@ -67,7 +67,7 @@ public class QuestScriptManager extends AbstractScriptManager {
|
||||
if(GameConstants.isMedalQuest(questid)) { // start generic medal quest
|
||||
iv = getInvocable("quest/medalQuest.js", c);
|
||||
} else {
|
||||
FilePrinter.printError(FilePrinter.QUEST_UNCODED, "START Quest " + questid + " is uncoded.\r\n");
|
||||
FilePrinter.printError(FilePrinter.QUEST_UNCODED, "START Quest " + questid + " is uncoded.");
|
||||
}
|
||||
}
|
||||
if (iv == null || QuestScriptManager.getInstance() == null) {
|
||||
@@ -122,7 +122,7 @@ public class QuestScriptManager extends AbstractScriptManager {
|
||||
if(GameConstants.isMedalQuest(questid)) { // start generic medal quest
|
||||
iv = getInvocable("quest/medalQuest.js", c);
|
||||
} else {
|
||||
FilePrinter.printError(FilePrinter.QUEST_UNCODED, "END Quest " + questid + " is uncoded.\r\n");
|
||||
FilePrinter.printError(FilePrinter.QUEST_UNCODED, "END Quest " + questid + " is uncoded.");
|
||||
qm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1659,7 +1659,7 @@ public class MapleItemInformationProvider {
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(equip.getItemId());
|
||||
Server.getInstance().broadcastGMMessage(chr.getWorld(), MaplePacketCreator.sendYellowTip("[WARNING]: " + chr.getName() + " tried to equip " + itemName + " into slot " + dst + "."));
|
||||
AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to forcibly equip an item.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to equip " + itemName + " into " + dst + " slot.\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to equip " + itemName + " into " + dst + " slot.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1016,6 +1016,14 @@ public class MapleStatEffect {
|
||||
applyto.registerEffect(this, starttime, Long.MAX_VALUE, false);
|
||||
}
|
||||
|
||||
public final void applyBeaconBuff(final MapleCharacter applyto, int objectid) { // thanks Thora & Hyun for reporting an issue with homing beacon autoflagging mobs when changing maps
|
||||
final List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.HOMING_BEACON, objectid));
|
||||
applyto.announce(MaplePacketCreator.giveBuff(1, sourceid, stat));
|
||||
|
||||
final long starttime = Server.getInstance().getCurrentTime();
|
||||
applyto.registerEffect(this, starttime, Long.MAX_VALUE, false);
|
||||
}
|
||||
|
||||
public void updateBuffEffect(MapleCharacter target, List<Pair<MapleBuffStat, Integer>> activeStats, long starttime) {
|
||||
int localDuration = getBuffLocalDuration();
|
||||
localDuration = alchemistModifyVal(target, localDuration, false);
|
||||
|
||||
@@ -1952,7 +1952,7 @@ public class MapleMap {
|
||||
} else if (monster.getId() == 9400326 || monster.getId() == 9400331 || monster.getId() == 9400336) {
|
||||
monsterItemDrop(monster, monster.getDropPeriodTime());
|
||||
} else {
|
||||
FilePrinter.printError(FilePrinter.UNHANDLED_EVENT, "UNCODED TIMED MOB DETECTED: " + monster.getId() + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.UNHANDLED_EVENT, "UNCODED TIMED MOB DETECTED: " + monster.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+70
-50
@@ -11,55 +11,67 @@ import java.util.Calendar;
|
||||
public class FilePrinter {
|
||||
|
||||
public static final String
|
||||
ACCOUNT_STUCK = "accountStuck.txt",
|
||||
EXCEPTION_CAUGHT = "exceptionCaught.txt",
|
||||
CLIENT_START = "clientStartError.txt",
|
||||
ADD_PLAYER = "addPlayer.txt",
|
||||
MAPLE_MAP = "mapleMap.txt",
|
||||
ERROR38 = "error38.txt",
|
||||
PACKET_LOG = "log.txt",
|
||||
CASHITEM_BOUGHT = "cashlog.txt",
|
||||
EXCEPTION = "exceptions.txt",
|
||||
SQL_EXCEPTION = "sqlexceptions.txt",
|
||||
PACKET_HANDLER = "PacketHandler/",
|
||||
PORTAL = "portals/",
|
||||
PORTAL_STUCK = "portalblocks/",
|
||||
NPC = "npcs/",
|
||||
INVOCABLE = "invocable/",
|
||||
REACTOR = "reactors/",
|
||||
QUEST = "quests/",
|
||||
ITEM = "items/",
|
||||
MOB_MOVEMENT = "mobmovement.txt",
|
||||
MAP_SCRIPT = "mapscript/",
|
||||
DIRECTION = "directions/",
|
||||
SAVE_CHAR = "saveToDB.txt",
|
||||
INSERT_CHAR = "insertCharacter.txt",
|
||||
LOAD_CHAR = "loadCharFromDB.txt",
|
||||
UNHANDLED_EVENT = "doesNotExist.txt",
|
||||
SESSION = "sessions.txt",
|
||||
EXPLOITS = "exploits/",
|
||||
STORAGE = "storage/",
|
||||
PACKET_LOGS = "packetlogs/",
|
||||
DELETED_CHARACTERS = "deletedchars/",
|
||||
FREDRICK = "fredrick/",
|
||||
NPC_UNCODED = "uncodedNPCs.txt",
|
||||
QUEST_UNCODED = "uncodedQuests.txt",
|
||||
AUTOSAVING_CHARACTER = "saveCharAuto.txt",
|
||||
SAVING_CHARACTER = "saveChar.txt",
|
||||
USED_COMMANDS = "usedCommands.txt",
|
||||
DEADLOCK_ERROR = "deadlocks.txt",
|
||||
DEADLOCK_STACK = "deadlocks/path.txt",
|
||||
DEADLOCK_LOCKS = "deadlocks/locks.txt",
|
||||
DEADLOCK_STATE = "deadlocks/state.txt",
|
||||
DISPOSED_LOCKS = "deadlocks/disposed.txt";
|
||||
AUTOBAN_WARNING = "game/AutoBanWarning.txt", // log naming version by Vcoc
|
||||
AUTOBAN_DC = "game/AutoBanDC.txt",
|
||||
ACCOUNT_STUCK = "players/AccountStuck.txt",
|
||||
COMMAND_GM = "reports/Gm.txt",
|
||||
COMMAND_BUG = "reports/Bug.txt",
|
||||
LOG_TRADE = "interactions/Trades.txt",
|
||||
LOG_EXPEDITION = "interactions/Expeditions.txt",
|
||||
LOG_LEAF = "interactions/MapleLeaves.txt",
|
||||
LOG_GACHAPON = "interactions/Gachapon.txt",
|
||||
LOG_CHAT = "interactions/ChatLog.txt",
|
||||
EXCEPTION_CAUGHT = "game/ExceptionCaught.txt",
|
||||
CLIENT_START = "game/ClientStartError.txt",
|
||||
MAPLE_MAP = "game/MapleMap.txt",
|
||||
ERROR38 = "game/Error38.txt",
|
||||
PACKET_LOG = "game/Log.txt",
|
||||
CASHITEM_BOUGHT = "interactions/CashLog.txt",
|
||||
EXCEPTION = "game/Exceptions.txt",
|
||||
SQL_EXCEPTION = "game/SqlExceptions.txt",
|
||||
PACKET_HANDLER = "game/packethandler/",
|
||||
PORTAL = "game/portals/",
|
||||
PORTAL_STUCK = "game/portalblocks/",
|
||||
NPC = "game/npcs/",
|
||||
INVOCABLE = "game/invocable/",
|
||||
REACTOR = "game/reactors/",
|
||||
QUEST = "game/quests/",
|
||||
ITEM = "game/items/",
|
||||
MOB_MOVEMENT = "game/MobMovement.txt",
|
||||
MAP_SCRIPT = "game/mapscript/",
|
||||
DIRECTION = "game/directions/",
|
||||
SAVE_CHAR = "players/SaveToDB.txt",
|
||||
INSERT_CHAR = "players/InsertCharacter.txt",
|
||||
LOAD_CHAR = "players/LoadCharFromDB.txt",
|
||||
CREATED_CHAR = "players/createdchars/",
|
||||
DELETED_CHAR = "players/deletedchars/",
|
||||
UNHANDLED_EVENT = "game/DoesNotExist.txt",
|
||||
SESSION = "players/Sessions.txt",
|
||||
EXPLOITS = "game/exploits/",
|
||||
STORAGE = "game/storage/",
|
||||
PACKET_LOGS = "game/packetlogs/",
|
||||
FREDRICK = "game/npcs/fredrick/",
|
||||
NPC_UNCODED = "game/npcs/UncodedNPCs.txt",
|
||||
QUEST_UNCODED = "game/quests/UncodedQuests.txt",
|
||||
AUTOSAVING_CHARACTER = "players/SaveCharAuto.txt",
|
||||
SAVING_CHARACTER = "players/SaveChar.txt",
|
||||
USED_COMMANDS = "commands/UsedCommands.txt",
|
||||
DEADLOCK_ERROR = "deadlocks/Deadlocks.txt",
|
||||
DEADLOCK_STACK = "deadlocks/Path.txt",
|
||||
DEADLOCK_LOCKS = "deadlocks/Locks.txt",
|
||||
DEADLOCK_STATE = "deadlocks/State.txt",
|
||||
DISPOSED_LOCKS = "deadlocks/Disposed.txt";
|
||||
|
||||
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/";
|
||||
|
||||
public static void printError(final String name, final Throwable t) {
|
||||
String stringT = getString(t);
|
||||
|
||||
System.out.println("Error thrown: " + name);
|
||||
System.out.println(getString(t));
|
||||
System.out.println(stringT);
|
||||
System.out.println();
|
||||
FileOutputStream out = null;
|
||||
final String file = FILE_PATH + ERROR + name;
|
||||
try {
|
||||
@@ -68,8 +80,9 @@ public class FilePrinter {
|
||||
outputFile.getParentFile().mkdirs();
|
||||
}
|
||||
out = new FileOutputStream(file, true);
|
||||
out.write(getString(t).getBytes());
|
||||
out.write("\n---------------------------------\r\n".getBytes());
|
||||
out.write(stringT.getBytes());
|
||||
out.write("\r\n---------------------------------\r\n".getBytes());
|
||||
out.write("\r\n".getBytes()); // thanks Vcoc for suggesting review body log structure
|
||||
} catch (IOException ess) {
|
||||
ess.printStackTrace();
|
||||
} finally {
|
||||
@@ -84,8 +97,11 @@ public class FilePrinter {
|
||||
}
|
||||
|
||||
public static void printError(final String name, final Throwable t, final String info) {
|
||||
String stringT = getString(t);
|
||||
|
||||
System.out.println("Error thrown: " + name);
|
||||
System.out.println(getString(t));
|
||||
System.out.println(stringT);
|
||||
System.out.println();
|
||||
FileOutputStream out = null;
|
||||
final String file = FILE_PATH + ERROR + name;
|
||||
try {
|
||||
@@ -95,8 +111,9 @@ public class FilePrinter {
|
||||
}
|
||||
out = new FileOutputStream(file, true);
|
||||
out.write((info + "\r\n").getBytes());
|
||||
out.write(getString(t).getBytes());
|
||||
out.write("\n---------------------------------\r\n".getBytes());
|
||||
out.write(stringT.getBytes());
|
||||
out.write("\r\n---------------------------------\r\n".getBytes());
|
||||
out.write("\r\n".getBytes());
|
||||
} catch (IOException ess) {
|
||||
ess.printStackTrace();
|
||||
} finally {
|
||||
@@ -113,6 +130,7 @@ public class FilePrinter {
|
||||
public static void printError(final String name, final String s) {
|
||||
System.out.println("Error thrown: " + name);
|
||||
System.out.println(s);
|
||||
System.out.println();
|
||||
FileOutputStream out = null;
|
||||
final String file = FILE_PATH + ERROR + name;
|
||||
try {
|
||||
@@ -122,7 +140,8 @@ public class FilePrinter {
|
||||
}
|
||||
out = new FileOutputStream(file, true);
|
||||
out.write(s.getBytes());
|
||||
//out.write("\n---------------------------------\n".getBytes());
|
||||
//out.write("\r\n---------------------------------\r\n".getBytes());
|
||||
out.write("\r\n".getBytes());
|
||||
} catch (IOException ess) {
|
||||
ess.printStackTrace();
|
||||
} finally {
|
||||
@@ -143,6 +162,7 @@ public class FilePrinter {
|
||||
public static void print(final String name, final String s, boolean line) {
|
||||
System.out.println("Log: " + name);
|
||||
System.out.println(s);
|
||||
System.out.println();
|
||||
FileOutputStream out = null;
|
||||
String file = FILE_PATH + name;
|
||||
try {
|
||||
@@ -152,10 +172,10 @@ public class FilePrinter {
|
||||
}
|
||||
out = new FileOutputStream(file, true);
|
||||
out.write(s.getBytes());
|
||||
out.write("\r\n".getBytes());
|
||||
if (line) {
|
||||
out.write("---------------------------------\r\n".getBytes());
|
||||
out.write("\r\n---------------------------------\r\n".getBytes());
|
||||
}
|
||||
out.write("\r\n".getBytes());
|
||||
} catch (IOException ess) {
|
||||
ess.printStackTrace();
|
||||
} finally {
|
||||
|
||||
@@ -6,9 +6,6 @@ import java.util.Date;
|
||||
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.world.MapleParty;
|
||||
import net.server.world.MaplePartyCharacter;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.MapleTrade;
|
||||
import server.expeditions.MapleExpedition;
|
||||
@@ -34,7 +31,7 @@ public class LogHelper {
|
||||
log += item.getQuantity() + " " + itemName + " from " + name2 + " to " + name1 + " \r\n";;
|
||||
}
|
||||
log += "\r\n\r\n";
|
||||
FilePrinter.print("trades.txt", log);
|
||||
FilePrinter.print(FilePrinter.LOG_TRADE, log);
|
||||
}
|
||||
|
||||
public static void logExpedition(MapleExpedition expedition) {
|
||||
@@ -50,8 +47,8 @@ public class LogHelper {
|
||||
for (String message: expedition.getBossLogs()){
|
||||
log += message;
|
||||
}
|
||||
log += "\r\n\r\n";
|
||||
FilePrinter.print("expeditions.txt", log);
|
||||
log += "\r\n";
|
||||
FilePrinter.print(FilePrinter.LOG_EXPEDITION, log);
|
||||
}
|
||||
|
||||
public static String getTimeString(long then){
|
||||
@@ -63,20 +60,20 @@ public class LogHelper {
|
||||
|
||||
public static void logLeaf(MapleCharacter player, boolean gotPrize, String operation) {
|
||||
String timeStamp = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss").format(new Date());
|
||||
String log = player.getName() + (gotPrize ? " used a maple leaf to buy " + operation : " redeemed " + operation + " VP for a leaf") + " - " + timeStamp + "\r\n";
|
||||
FilePrinter.print("mapleleaves.txt", log);
|
||||
String log = player.getName() + (gotPrize ? " used a maple leaf to buy " + operation : " redeemed " + operation + " VP for a leaf") + " - " + timeStamp;
|
||||
FilePrinter.print(FilePrinter.LOG_LEAF, log);
|
||||
}
|
||||
|
||||
public static void logGacha(MapleCharacter player, int itemid, String map) {
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(itemid);
|
||||
String timeStamp = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss").format(new Date());
|
||||
String log = player.getName() + " got a " + itemName + "(" + itemid + ") from the " + map + " gachapon. - " + timeStamp + "\r\n";
|
||||
FilePrinter.print("gachapon.txt", log);
|
||||
String log = player.getName() + " got a " + itemName + "(" + itemid + ") from the " + map + " gachapon. - " + timeStamp;
|
||||
FilePrinter.print(FilePrinter.LOG_GACHAPON, log);
|
||||
}
|
||||
|
||||
public static void logChat(MapleClient player, String chatType, String text){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
|
||||
FilePrinter.print("chat.txt", "[" + sdf.format(Calendar.getInstance().getTime()) + "] (" + chatType + ") " +player.getPlayer().getName() + ": " + text + "\r\n");
|
||||
FilePrinter.print(FilePrinter.LOG_CHAT, "[" + sdf.format(Calendar.getInstance().getTime()) + "] (" + chatType + ") " +player.getPlayer().getName() + ": " + text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MapleLogger {
|
||||
return;
|
||||
}
|
||||
String packet = op.toString() + "\r\n" + HexTool.toString((byte[]) message);
|
||||
FilePrinter.printError(FilePrinter.PACKET_LOGS + c.getAccountName() + "-" + c.getPlayer().getName() + ".txt", packet + "\r\n\r\n");
|
||||
FilePrinter.printError(FilePrinter.PACKET_LOGS + c.getAccountName() + "-" + c.getPlayer().getName() + ".txt", packet);
|
||||
}
|
||||
|
||||
private static final boolean isRecvBlocked(RecvOpcode op){
|
||||
|
||||
@@ -120,7 +120,7 @@ import server.maps.AbstractMapleMapObject;
|
||||
public class MaplePacketCreator {
|
||||
|
||||
public static final List<Pair<MapleStat, Integer>> EMPTY_STATUPDATE = Collections.emptyList();
|
||||
private final static long FT_UT_OFFSET = 116444592000000000L; // EDT
|
||||
private final static long FT_UT_OFFSET = 116444628000000000L;
|
||||
private final static long DEFAULT_TIME = 150842304000000000L;//00 80 05 BB 46 E6 17 02
|
||||
public final static long ZERO_TIME = 94354848000000000L;//00 40 E0 FD 3B 37 4F 01
|
||||
private final static long PERMANENT = 150841440000000000L; // 00 C0 9B 90 7D E5 17 02
|
||||
@@ -363,7 +363,7 @@ public class MaplePacketCreator {
|
||||
}
|
||||
|
||||
private static void addExpirationTime(final MaplePacketLittleEndianWriter mplew, long time) {
|
||||
mplew.writeLong(getTime(time));
|
||||
mplew.writeLong(getTime(time)); // offset expiration time issue found thanks to Thora
|
||||
}
|
||||
|
||||
private static void addItemInfo(final MaplePacketLittleEndianWriter mplew, Item item) {
|
||||
@@ -1064,8 +1064,8 @@ public class MaplePacketCreator {
|
||||
mplew.write(spawnPoint);
|
||||
mplew.writeShort(chr.getHp());
|
||||
mplew.writeBool(false);
|
||||
mplew.writeLong(getTime(Server.getInstance().getCurrentTime()));
|
||||
mplew.skip(8);
|
||||
mplew.writeLong(0); // getTime(Server.getInstance().getCurrentTime())?
|
||||
mplew.skip(ServerConstants.DEBUG_VALUES[0]);
|
||||
return mplew.getPacket();
|
||||
}
|
||||
|
||||
@@ -1081,8 +1081,8 @@ public class MaplePacketCreator {
|
||||
mplew.writeBool(true);
|
||||
mplew.writeInt(spawnPosition.x); // spawn position placement thanks to Arnah (Vertisy)
|
||||
mplew.writeInt(spawnPosition.y);
|
||||
mplew.writeLong(getTime(Server.getInstance().getCurrentTime()));
|
||||
mplew.skip(8);
|
||||
mplew.writeLong(0); // getTime(Server.getInstance().getCurrentTime())?
|
||||
mplew.skip(ServerConstants.DEBUG_VALUES[0]);
|
||||
return mplew.getPacket();
|
||||
}
|
||||
|
||||
@@ -2867,7 +2867,7 @@ public class MaplePacketCreator {
|
||||
mplew.write(1);
|
||||
mplew.writeShort(quest);
|
||||
mplew.write(2);
|
||||
mplew.writeLong(time);
|
||||
mplew.writeLong(getTime(time));
|
||||
return mplew.getPacket();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user