Пример #1
0
        protected override void HandleReceviedPackets(NetClientBase client, NetIOCPClient.NetWork.Packet recivedPacket)
        {
            //关联包处理
            ProfInstance pi = Profile.StartProf();
            //ToDo:读取内容

            if (PacketHandles[recivedPacket.PacketID] != null) {
                PacketHandles[recivedPacket.PacketID](0L, recivedPacket);
            }
            else {
                //Debug.Assert(false, p.ToString() + "没有相应的解析委托");
                Console.WriteLine("包" + recivedPacket.PacketID + "没有相应的解析委托");
            }
            pi.EndProf(recivedPacket.ToString(), 1f);
        }
Пример #2
0
 static void nc_OnRecvDataBytes(NetClientBase sender, BufferSegment recvData, int size)
 {
     Console.WriteLine("Recived Data:");
     Console.WriteLine(NetIOCPClient.Util.Utility.ToHex(0, recvData.Buffer.Array, recvData.Offset, size));
 }
Пример #3
0
 static void nc_OnSend(NetClientBase sender, Packet p)
 {
     Console.WriteLine("send:"+(p==null?"byte[]":p.ToString()));
 }
Пример #4
0
 static void nc_OnRecvData(NetClientBase sender, Packet p)
 {
     Console.WriteLine("recived packet:" + p.ToString());
 }