Exemplo n.º 1
0
 public static BaseNet_Login GetInstance()
 {
     if (BaseNet_Login.instance == null)
     {
         BaseNet_Login.instance = new BaseNet_Login();
     }
     return(BaseNet_Login.instance);
 }
Exemplo n.º 2
0
        protected override int ReceiveBuffer(byte[] btBuffer, int index, int totalSize)
        {
            int          num = 0;
            PacketHeader packetHeader;
            int          num2;
            int          num3;

            while (true)
            {
                packetHeader = (PacketHeader)ReceivePakcet.DeserializePacket(btBuffer, index, out num, typeof(PacketHeader));
                if (index + (int)packetHeader.size + num > totalSize)
                {
                    break;
                }
                index += num;
                num2   = BaseNet_Login.Receive_GamePacket(btBuffer, index, packetHeader);
                if ((int)packetHeader.size != num2)
                {
                    goto Block_2;
                }
                num3 = totalSize - (num2 + index);
                if (num2 + index >= totalSize)
                {
                    goto Block_3;
                }
                index += num2;
            }
            return(index);

Block_2:
            Debug.LogWarning(string.Concat(new object[]
            {
                "Err :Receive_GamePacket Not Match  : ",
                packetHeader.type,
                "Detail-SizeInfo:",
                packetHeader.size,
                " != ",
                num2
            }));
            num2 = (int)packetHeader.size;
            return(index);

Block_3:
            if (num3 != 0)
            {
                Debug.Log("Packet End Remain:" + num3);
            }
            index += num2;
            return(index);
        }