Fixed a glitch in inventory that would happen when trying to put items into storage. Added "Item Raise" functionality. Adjusted Party Search. Token sessions no longer expires due to no players found, rather are sent into a brief "inactivity" period. Fixed Fredrick stored items not being properly erased after a character deletion. Fixed skillbooks in stacked quantities not being useable. New tool: MapleGachaponItemidRetriever. This tool parses the gachapon descriptor file (holding several item names, for several gachapons) and generates files for each defined gachapon with itemids of the loots. Revised Mushroom Empire transition portals that interacts with scripted items (items now are useable through inventory, no longer being automatically removed from inventory upon crossing portals). Fixed script "secretroom" always requiring a new key (quest reward) to access the inner rooms, which would make the room unreachable. Reworked gachapons loots throughout the game. New loots are supposed to represent an old-school MapleSEA-like escalation of gachapon loots. Fixed issues that would show up in the case null PIN/PIC gets checked. Reworked skill Monster Magnet, no longer using "catch success rate" as a skill progression element. This fixes the skill disconnecting caster upon failure. Revised Mystic Doors, no longer crashing players after the caster decides to cancel the buff moments after casting (during portal deploying effect in course). Fixed portal access to Prime Minister crashing when trying to access on a party. Refactored the several "startQuest/completeQuest" methods widely used in the many scripting managers. Methods that does essentially the same thing now are accessed from the superclass. Fixed "rechargeable items" not being properly accounted for slots availability in inventory slot checking. Fixed several issues of late within minigames. Fixed minigames regarding double results when handling some rare scenarios. Implemented "call for leave after finishing game" functionality of minigames.
81 lines
2.2 KiB
Java
81 lines
2.2 KiB
Java
/*
|
|
This file is part of the OdinMS Maple Story Server
|
|
Copyright (C) 2008 ~ 2010 Patrick Huy <[email protected]>
|
|
Matthias Butz <[email protected]>
|
|
Jan Christian Meyer <[email protected]>
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License version 3
|
|
as published by the Free Software Foundation. You may not use, modify
|
|
or distribute this program under any other version of the
|
|
GNU Affero General Public License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package tools;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import net.opcodes.RecvOpcode;
|
|
import client.MapleCharacter;
|
|
import client.MapleClient;
|
|
|
|
/**
|
|
* Logs packets to console and file.
|
|
*
|
|
* @author Alan (SharpAceX)
|
|
*/
|
|
|
|
public class MapleLogger {
|
|
|
|
public static Set<Integer> monitored = new HashSet<>();
|
|
public static Set<Integer> ignored = new HashSet<>();
|
|
|
|
public static void logRecv(MapleClient c, short packetId, Object message) {
|
|
MapleCharacter chr = c.getPlayer();
|
|
if (chr == null){
|
|
return;
|
|
}
|
|
if (!monitored.contains(chr.getId())){
|
|
return;
|
|
}
|
|
RecvOpcode op = getOpcodeFromValue(packetId);
|
|
if (isRecvBlocked(op)){
|
|
return;
|
|
}
|
|
String packet = op.toString() + "\r\n" + HexTool.toString((byte[]) message);
|
|
FilePrinter.printError(FilePrinter.PACKET_LOGS + c.getAccountName() + "-" + chr.getName() + ".txt", packet);
|
|
}
|
|
|
|
private static final boolean isRecvBlocked(RecvOpcode op){
|
|
switch(op){
|
|
case MOVE_PLAYER:
|
|
case GENERAL_CHAT:
|
|
case TAKE_DAMAGE:
|
|
case MOVE_PET:
|
|
case MOVE_LIFE:
|
|
case NPC_ACTION:
|
|
case FACE_EXPRESSION:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static final RecvOpcode getOpcodeFromValue(int value){
|
|
for (RecvOpcode op : RecvOpcode.values()){
|
|
if (op.getValue() == value){
|
|
return op;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|