示例#1
0
    private void HandleMessage(IMessageHandler interface37_0)
    {
        BinaryInformationContract contract;

        if ((interface37_0.Header.MessageType == this.object_0.InformationBySend) || (interface37_0.Header.MessageType == this.object_0.InformationByPost))
        {
            contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
            this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, contract.InformationType, contract.Content);
        }
        else if ((interface37_0.Header.MessageType == this.object_0.BlobInformation) || (interface37_0.Header.MessageType == this.object_0.BlobByRapidEngine))
        {
            BlobFragmentContract contract3   = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0);
            Information          information = this.class76_0.method_1(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract3);
            if (information != null)
            {
                if (interface37_0.Header.MessageType == this.object_0.BlobInformation)
                {
                    this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, information.InformationType, information.Content);
                }
                else if (this.Event_0 != null)
                {
                    BlobAndTagContract contract4 = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information.Content, 0);
                    this.Event_0(interface37_0.Header.UserID, information.InformationType, contract4.Message, contract4.Tag);
                }
            }
        }
        else
        {
            IHeader         interface2;
            IMessageHandler interface3;
            if (interface37_0.Header.MessageType == this.object_0.InformationNeedAck)
            {
                interface2             = this.interface9_0.imethod_7(interface37_0.Header);
                interface2.MessageType = this.object_0.Ack;
                interface3             = this.interface9_0.imethod_2 <Class110>(interface2, null);
                this.interface40_0.imethod_0(interface3, ActionTypeOnChannelIsBusy.Continue);
                contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
                this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, contract.InformationType, contract.Content);
            }
            else if (interface37_0.Header.MessageType == this.object_0.Request)
            {
                interface2             = this.interface9_0.imethod_7(interface37_0.Header);
                interface2.MessageType = this.object_0.Response;
                contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
                BinaryInformationContract body = null;
                try
                {
                    body = new BinaryInformationContract(this.icustomizeHandler_0.HandleQuery(interface37_0.Header.UserID, contract.InformationType, contract.Content));
                }
                finally
                {
                    interface3 = this.interface9_0.imethod_2 <BinaryInformationContract>(interface2, body);
                    this.interface40_0.PostMessage(interface3, interface37_0.Header.UserID, ActionTypeOnChannelIsBusy.Continue);
                }
            }
        }
    }
示例#2
0
    public byte[] Query(string targetUserID, int informationType, byte[] info)
    {
        if (targetUserID == null)
        {
            targetUserID = "_0";
        }
        IMessageHandler           interface2 = this.interface9_0.imethod_4 <BinaryInformationContract>(this.string_0, this.customizeMessageTypeRoom_0.Request, new BinaryInformationContract(informationType, info), targetUserID);
        IMessageHandler           interface3 = this.interface31_0.imethod_1(interface2, new int?(this.customizeMessageTypeRoom_0.Response));
        BinaryInformationContract contract   = this.interface9_0.imethod_1 <BinaryInformationContract>(interface3);

        if (contract == null)
        {
            throw new HandingException(string.Format("There is an exception occured when {0} handing the query of {1}.", targetUserID, informationType));
        }
        return(contract.Content);
    }
示例#3
0
    public byte[] QueryLocalClient(string userID, int informationType, byte[] info)
    {
        if (!this.iuserManager_0.IsUserOnLine(userID))
        {
            throw new Exception(string.Format("Target User {0} is not on current server !", userID));
        }
        IMessageHandler interface2 = this.interface9_0.imethod_4 <BinaryInformationContract>("_0", this.object_0.Request, new BinaryInformationContract(informationType, info), userID);

        this.interface40_0.SendMessage(interface2, userID, ActionTypeOnChannelIsBusy.Continue);
        IMessageHandler           interface3 = this.class72_0.PickupResponse(this.object_0.Response, interface2.Header.MessageID);
        BinaryInformationContract contract   = this.interface9_0.imethod_1 <BinaryInformationContract>(interface3);

        if (contract == null)
        {
            throw new HandingException(string.Format("There is an exception occured when {0} handing the query of {1}.", userID, informationType));
        }
        return(contract.Content);
    }
示例#4
0
    private void method_8(Exception exception_0, IMessageHandler interface37_0, object object_0)
    {
        CallbackState <CallbackHandler> state = (CallbackState <CallbackHandler>)object_0;

        byte[] response = null;
        if (exception_0 == null)
        {
            BinaryInformationContract contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
            if (contract == null)
            {
                exception_0 = new HandingException("There is an exception occured when server handing the query.");
            }
            else
            {
                response = contract.Content;
            }
        }
        if (state.Handler != null)
        {
            state.Handler(exception_0, response, state.Tag);
        }
    }
示例#5
0
 private void HandleMessage(IMessageHandler interface37_0, bool bool_0, ActionTypeOnChannelIsBusy actionTypeOnChannelIsBusy_0)
 {
     if (this.ginterface8_0.IsUserOnLine(interface37_0.Header.DestUserID))
     {
         if (bool_0)
         {
             this.interface40_0.PostMessage(interface37_0, interface37_0.Header.DestUserID, actionTypeOnChannelIsBusy_0);
         }
         else
         {
             this.interface40_0.SendMessage(interface37_0, interface37_0.Header.DestUserID, actionTypeOnChannelIsBusy_0);
         }
     }
     else if ((interface37_0.Header.MessageType != this.object_0.BlobByRapidEngine) && (interface37_0.Header.MessageType != this.object_0.BlobInformation))
     {
         BinaryInformationContract contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
         Information information            = new Information(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract.InformationType, contract.Content);
         if (this.TransmitFailed != null)
         {
             this.TransmitFailed(information);
         }
     }
 }
示例#6
0
    public IMessageHandler ProcessMessage(IMessageHandler interface37_0)
    {
        string                    str;
        IHeader                   interface3;
        IMessageHandler           interface4;
        BinaryInformationContract contract3;

        if ((interface37_0.Header.MessageType == this.object_0.InformationBySend) || (interface37_0.Header.MessageType == this.object_0.InformationByPost))
        {
            contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
            str       = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID;
            this.icustomizeHandler_0.HandleInformation(str, contract3.InformationType, contract3.Content);
            return(null);
        }
        if ((interface37_0.Header.MessageType == this.object_0.BlobInformation) || (interface37_0.Header.MessageType == this.object_0.BlobByRapidEngine))
        {
            BlobFragmentContract contract2   = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0);
            Information          information = this.class76_0.method_1(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract2);
            if (information != null)
            {
                str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID;
                if (interface37_0.Header.MessageType == this.object_0.BlobInformation)
                {
                    this.icustomizeHandler_0.HandleInformation(str, information.InformationType, information.Content);
                }
                else if (this.Event_0 != null)
                {
                    BlobAndTagContract contract = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information.Content, 0);
                    this.Event_0(str, information.InformationType, contract.Message, contract.Tag);
                }
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.InformationNeedAck)
        {
            interface3             = this.interface9_0.imethod_7(interface37_0.Header);
            interface3.MessageType = this.object_0.Ack;
            interface4             = this.interface9_0.imethod_2 <Class110>(interface3, null);
            this.interface31_0.Send(interface4, false, ActionTypeOnChannelIsBusy.Continue);
            contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
            str       = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID;
            this.icustomizeHandler_0.HandleInformation(str, contract3.InformationType, contract3.Content);
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.Request)
        {
            interface3             = this.interface9_0.imethod_7(interface37_0.Header);
            interface3.MessageType = this.object_0.Response;
            contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
            BinaryInformationContract body = null;
            try
            {
                str  = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID;
                body = new BinaryInformationContract(this.icustomizeHandler_0.HandleQuery(str, contract3.InformationType, contract3.Content));
            }
            finally
            {
                interface4 = this.interface9_0.imethod_2 <BinaryInformationContract>(interface3, body);
                this.interface31_0.Send(interface4, true, ActionTypeOnChannelIsBusy.Continue);
            }
            return(null);
        }
        if (interface37_0.Header.MessageType == this.object_0.GetClientTimeRequest)
        {
            interface3             = this.interface9_0.imethod_7(interface37_0.Header);
            interface3.MessageType = this.object_0.GetClientTimeResponse;
            ResGetTimeContract contract4 = new ResGetTimeContract(DateTime.Now);
            return(this.interface9_0.imethod_2 <ResGetTimeContract>(interface3, contract4));
        }
        return(null);
    }
示例#7
0
 public IMessageHandler ProcessMessage(IMessageHandler interface37_0)
 {
     //InformationReceived
     if ((this.InformationReceived != null) && (((interface37_0.Header.MessageType != this.object_0.Ack) && (interface37_0.Header.MessageType != this.object_0.BlobInformation)) && (interface37_0.Header.MessageType != this.object_0.BlobByRapidEngine)))
     {
         BinaryInformationContract contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0);
         Information information            = new Information(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract.InformationType, contract.Content);
         this.InformationReceived(information);
     }
     if ((interface37_0.Header.MessageType == this.object_0.InformationBySend) || (interface37_0.Header.MessageType == this.object_0.InformationByPost))
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.method_18(interface37_0);
         }
         else
         {
             bool flag = interface37_0.Header.MessageType == this.object_0.InformationByPost;
             this.HandleMessage(interface37_0, flag, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if ((interface37_0.Header.MessageType == this.object_0.BlobInformation) || (interface37_0.Header.MessageType == this.object_0.BlobByRapidEngine))
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.method_18(interface37_0);
         }
         else
         {
             this.HandleMessage(interface37_0, true, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if (interface37_0.Header.MessageType == this.object_0.InformationNeedAck)
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.method_18(interface37_0);
         }
         else
         {
             this.HandleMessage(interface37_0, true, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if (interface37_0.Header.MessageType == this.object_0.Response)
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.class72_0.PushResponse(interface37_0);
         }
         else
         {
             this.HandleMessage(interface37_0, true, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if (interface37_0.Header.MessageType == this.object_0.Ack)
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.class72_0.PushResponse(interface37_0);
         }
         else
         {
             this.HandleMessage(interface37_0, true, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if (interface37_0.Header.MessageType == this.object_0.Request)
     {
         if (NetServer.IsServerUser(interface37_0.Header.DestUserID))
         {
             this.method_18(interface37_0);
         }
         else
         {
             this.HandleMessage(interface37_0, true, ActionTypeOnChannelIsBusy.Continue);
         }
         return(null);
     }
     if (interface37_0.Header.MessageType == this.object_0.GetClientTimeResponse)
     {
         this.class72_0.PushResponse(interface37_0);
         return(null);
     }
     return(null);
 }