// Path: Core/src/main/java/com/zhaoxiaodan/mirserver/network/packets/ClientPacket.java
// public class ClientPacket extends Packet {
// 
// 	public byte cmdIndex;  // #号后面紧跟的序号, 响应包的序号要跟请求一直
// 
// 	public ClientPacket() {}
// 
// 	public ClientPacket(Protocol pid, byte cmdIndex) {
// 		super(0, pid, (short) 0, (short) 0, (short) 0);
// 		this.cmdIndex = cmdIndex;
// 	}
// 
// 	@Override
// 	public void readPacket(ByteBuf in) throws Parcelable.WrongFormatException {
// 		cmdIndex = in.readByte();
// 		cmdIndex = (byte) (cmdIndex - '0');
// 		super.readPacket(in);
// 	}
// 
// 	@Override
// 	public void writePacket(ByteBuf out) {
// 		out.writeByte(cmdIndex + '0');
// 		super.writePacket(out);
// 	}
// }


import com.zhaoxiaodan.mirserver.network.packets.ClientPacket;
import io.netty.channel.*;
package com.zhaoxiaodan.mirserver.network;


public class PacketDispatcher extends ChannelHandlerAdapter {

	//handler处理器所在的包名
	private final String handlerPackageName;

	public PacketDispatcher(String handlerPackageName) {
		this.handlerPackageName = handlerPackageName;
	}

	@Override
	public void channelRead(ChannelHandlerContext ctx, Object pakcet) throws Exception {

// Path: Core/src/main/java/com/zhaoxiaodan/mirserver/network/packets/ClientPacket.java
// public class ClientPacket extends Packet {
// 
// 	public byte cmdIndex;  // #号后面紧跟的序号, 响应包的序号要跟请求一直
// 
// 	public ClientPacket() {}
// 
// 	public ClientPacket(Protocol pid, byte cmdIndex) {
// 		super(0, pid, (short) 0, (short) 0, (short) 0);
// 		this.cmdIndex = cmdIndex;
// 	}
// 
// 	@Override
// 	public void readPacket(ByteBuf in) throws Parcelable.WrongFormatException {
// 		cmdIndex = in.readByte();
// 		cmdIndex = (byte) (cmdIndex - '0');
// 		super.readPacket(in);
// 	}
// 
// 	@Override
// 	public void writePacket(ByteBuf out) {
// 		out.writeByte(cmdIndex + '0');
// 		super.writePacket(out);
// 	}
// }


// Path: Core/src/main/java/com/zhaoxiaodan/mirserver/network/PacketDispatcher.java
import com.zhaoxiaodan.mirserver.network.packets.ClientPacket;
import io.netty.channel.*;

package com.zhaoxiaodan.mirserver.network;


public class PacketDispatcher extends ChannelHandlerAdapter {

	//handler处理器所在的包名
	private final String handlerPackageName;

	public PacketDispatcher(String handlerPackageName) {
		this.handlerPackageName = handlerPackageName;
	}

	@Override
	public void channelRead(ChannelHandlerContext ctx, Object pakcet) throws Exception {

		if (!(pakcet instanceof ClientPacket)) {