[Help] send/recv packets in own server

Newbie Spellweaver
Joined
Nov 28, 2009
Messages
36
Reaction score
1
Is there a way to see inbound and outbound packets in your own server? Since you can't sniff your own server with mapleshark, is there a way to do this?
 
Experienced Elementalist
Joined
Mar 21, 2011
Messages
237
Reaction score
118
MapleServerHandler.java, find messageReceived and after short packetId add:
PHP:
System.out.println(" Recv : 0x" + Integer.toHexString(packetId).toUpperCase());

As for sent, depending on whether you use MaplePacket or bytes arrays, you have to handle it in messageSent:
PHP:
    @Override
    public void messageSent(IoSession session, Object message) throws Exception {
        byte[] packet = (byte[]) message;
        short packetId = (short) (packet[0] + (packet[1] << 8));
        System.out.println(" Send: 0x" + Integer.toHexString(packetId).toUpperCase());
        super.messageSent(session, message);
    }
 
Upvote 0
Newbie Spellweaver
Joined
Nov 28, 2009
Messages
36
Reaction score
1
That shows the headers/opcodes but is there a way to see the entire packet? Preferably not in the command since it'll get spammed way too quick.
 
Upvote 0