コード例 #1
0
        public override bool Parse()
        {
            if (!base.Parse())
            {
                return(false);
            }
            PortType    = (NatPortType)RawRequest[NNRequestBase.Size]; //
            ClientIndex = RawRequest[NNRequestBase.Size + 1];          //00
            UseGamePort = RawRequest[NNRequestBase.Size + 2];          //00

            LocalIP = HtonsExtensions.
                      BytesToIPString(
                ByteTools.SubBytes(RawRequest, NNRequestBase.Size + 3, 4));

            LocalPort = HtonsExtensions.
                        BytesToUshortPort(
                ByteTools.SubBytes(RawRequest, NNRequestBase.Size + 7, 2));

            return(true);
        }
コード例 #2
0
        public override bool Parse(byte[] recv)
        {
            if (!base.Parse(recv))
            {
                return(false);
            }
            PortType    = (NatPortType)recv[BasePacket.Size]; //
            ClientIndex = recv[BasePacket.Size + 1];          //00
            UseGamePort = recv[BasePacket.Size + 2];          //00

            LocalIP = HtonsExtensions.
                      BytesToIPString(
                ByteTools.SubBytes(recv, BasePacket.Size + 3, 4));

            LocalPort = HtonsExtensions.
                        BytesToUshortPort(
                ByteTools.SubBytes(recv, BasePacket.Size + 7, 2));

            return(true);
        }