Ejemplo n.º 1
0
    public IMessageHandler ProcessMessage(IMessageHandler interface37_0)
    {
        UserAddressInfo           userData;
        PublicIPEResponseContract contract;

        if (interface37_0.Header.MessageType == this.object_0.InviteTcpP2P)
        {
            userData = this.interface30_0.GetUserData(interface37_0.Header.UserID);
            if (this.class42_0 != null)
            {
                this.class42_0.P2PConnectAsyn(userData);
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.InviteUdpP2P)
        {
            userData = this.interface30_0.GetUserData(interface37_0.Header.UserID);
            if (this.FdkyIcOiQh != null)
            {
                this.FdkyIcOiQh.P2PConnectAsyn(userData);
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.Help4UDP_FeedbackVacancy)
        {
            ExpectedVacancyBodyContract contract2 = this.interface9_0.imethod_1 <ExpectedVacancyBodyContract>(interface37_0);
            FeedbackVacancyBody         body      = FeedbackVacancyBody.Parse(contract2.Buff, 0, contract2.Buff.Length);
            if (this.FdkyIcOiQh != null)
            {
                this.FdkyIcOiQh.OnFeedbackVacancyReceived(interface37_0.Header.UserID, body);
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.Help4UDP_SynAck)
        {
            if (this.FdkyIcOiQh != null)
            {
                contract = this.interface9_0.imethod_1 <PublicIPEResponseContract>(interface37_0);
                this.FdkyIcOiQh.OnSynAckReceived(new IPEndPoint(IPAddress.Parse(contract.IP), contract.PublicPort), interface37_0.Header.UserID);
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.Help4UDP_Exit)
        {
            if (this.FdkyIcOiQh != null)
            {
                contract = this.interface9_0.imethod_1 <PublicIPEResponseContract>(interface37_0);
                this.FdkyIcOiQh.OnExitReceived(interface37_0.Header.UserID, new IPEndPoint(IPAddress.Parse(contract.IP), contract.PublicPort));
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.Help4UDP_PMTUTestAck)
        {
            if (this.FdkyIcOiQh != null)
            {
                GClass1 class2 = this.interface9_0.imethod_1 <GClass1>(interface37_0);
                this.FdkyIcOiQh.OnPMTUTestAckReceived(interface37_0.Header.UserID, class2.Pmtu);
            }
            return(null);
        }
        return(null);
    }
Ejemplo n.º 2
0
 private void udpClient_DataReceived(IPEndPoint ipendPoint_0, byte[] byte_0)
 {
     try
     {
         IHeader1 class2 = IHeader1.smethod_0(byte_0);
         if (class2 != null)
         {
             if (class2.method_0() == 0)
             {
                 IPEndPointBody class4 = IPEndPointBody.smethod_0(byte_0, 4, class2.method_4());
                 this.OnUdpSessionOpened(class2.method_2(), class4.method_0(), ipendPoint_0, new AgileIPE(class4.method_2(), class4.method_4()));
             }
             else if (class2.method_0() == 1)
             {
                 this.OnUdpSessionOpened(ipendPoint_0, StringBody.smethod_0(byte_0, 4, class2.method_4()).method_0());
             }
             else
             {
                 Class100 class3;
                 if (class2.method_0() == 2)
                 {
                     class3 = this.safeDictionary_1.Get(ipendPoint_0);
                     if ((class3 != null) && (class3.method_1() == class2.method_2()))
                     {
                         DataFragmentBody class7 = DataFragmentBody.smethod_0(byte_0, 4, class2.method_4());
                         class3.method_8(class7);
                     }
                 }
                 else if (class2.method_0() == 4)
                 {
                     FeedbackVacancyBody body   = FeedbackVacancyBody.Parse(byte_0, 4, class2.method_4());
                     Class116            class5 = this.safeDictionary_0.Get(ipendPoint_0);
                     if (class5 != null)
                     {
                         class5.method_18(body, true);
                     }
                 }
                 else if (class2.method_0() == 5)
                 {
                     this.method_2(ipendPoint_0);
                 }
                 else if (class2.method_0() == 6)
                 {
                     class3 = this.safeDictionary_1.Get(ipendPoint_0);
                     if (class3 != null)
                     {
                         class3.method_9();
                     }
                 }
                 else if (class2.method_0() == 7)
                 {
                     class3 = this.safeDictionary_1.Get(ipendPoint_0);
                     if ((class3 != null) && (class3.method_1() == class2.method_2()))
                     {
                         Class154 class8 = Class154.smethod_0(byte_0, 4, class2.method_4());
                         ushort   num    = (ushort)(0x2c + class8.BodyTotalLength);
                         this.class32_0.imethod_2(class3.imethod_2(), num);
                     }
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.emptyAgileLogger_0.Log(exception, "CJFramework.Engine.Udp.Reliable.ReliableUdpEngine.udpClient_DataReceived", ErrorLevel.Standard);
     }
 }