- Joined
- Jun 14, 2010
- Messages
- 58
- Reaction score
- 0
I've tried doing this, not sure if i'm doing it right or not. Also, how can i find out the packets that causes Map/Server crash?
Here is what i did for one. Found it in RZ
Here is what i did for one. Found it in RZ
package net.channel.handler;
import client.MapleCharacter;
import client.MapleClient;
import java.rmi.RemoteException;
import net.AbstractMaplePacketHandler;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
public final class PetChatHandler extends AbstractMaplePacketHandler {
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
MapleCharacter player = c.getPlayer();
byte mode = slea.readByte();
if (slea.toString().contains("A8 00 DF 00 00 00 00 00 00 00 01 0D 01 00 31") || slea.toString().contains("A8 00 DF 00 00 00 00 00 00 00 01 0D 01 00 32") ) {
try {
player.getClient().getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, player.getName() + " tried to use packet edit").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
player.getClient().disconnect();
} else { //.. do the regular stuff.
int petId = slea.readInt();
slea.readInt();
slea.readByte();
int act = slea.readByte();
if (act > 0x15) {
return;
}
String text = slea.readMapleAsciiString();
c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.petChat(c.getPlayer().getId(), c.getPlayer().getPetIndex(petId), act, text), true);
}
}
}
import client.MapleCharacter;
import client.MapleClient;
import java.rmi.RemoteException;
import net.AbstractMaplePacketHandler;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
public final class PetChatHandler extends AbstractMaplePacketHandler {
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
MapleCharacter player = c.getPlayer();
byte mode = slea.readByte();
if (slea.toString().contains("A8 00 DF 00 00 00 00 00 00 00 01 0D 01 00 31") || slea.toString().contains("A8 00 DF 00 00 00 00 00 00 00 01 0D 01 00 32") ) {
try {
player.getClient().getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, player.getName() + " tried to use packet edit").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
player.getClient().disconnect();
} else { //.. do the regular stuff.
int petId = slea.readInt();
slea.readInt();
slea.readByte();
int act = slea.readByte();
if (act > 0x15) {
return;
}
String text = slea.readMapleAsciiString();
c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.petChat(c.getPlayer().getId(), c.getPlayer().getPetIndex(petId), act, text), true);
}
}
}