log.debug("Got {} packet, {} session will be disconnected", packet.getType().name(), session.getSessionId());
session.disconnect(channel);
} else {
session.acceptPacket(channel, packet);
if (listener != null) {
<BUG>if (packet.getType() == PacketType.MESSAGE) {
listener.onMessage(session, packet.getData());
} else if (packet.getType() == PacketType.JSON) {
listener.onJsonObject(session, packet.getData());</BUG>
}

log.debug("Got {} packet, {} session will be disconnected", packet.getType().name(), session.getSessionId());
session.disconnect(channel);
} else {
session.acceptPacket(channel, packet);
if (listener != null) {
if (packet.getType() == PacketType.MESSAGE || packet.getType() == PacketType.JSON) {
listener.onMessage(session, packet.getData());
