Esempio n. 1
0
 internal TrinityResponse(TrinityMessage msg)
 {
     // !Note, in this case ErrorCode does not work.
     Buffer = msg.Buffer;
     Offset = TrinityMessage.Offset;
     Size   = msg.Size;
 }
Esempio n. 2
0
        /// <summary>
        /// Determines whether this instance and a specified object, which must also be a <see cref="T:Trinity.Network.Messaging.TrinityMessage"/> object, have the same contents.
        /// </summary>
        /// <param name="obj">The object to compare to this instance.</param>
        /// <returns>true if <paramref name="obj"/> is a <see cref="T:Trinity.Network.Messaging.TrinityMessage"/> and its contents are the same as this instance; otherwise, false.</returns>
        public override bool Equals(object obj)
        {
            TrinityMessage tm = obj as TrinityMessage;

            if (tm == null)
            {
                return(false);
            }

            return(this == tm);
        }
Esempio n. 3
0
 /// <returns>
 /// E_SUCCESS:          The message is successfully processed. The response can be passed down to network.
 /// E_RPC_EXCEPTION:    The message handler throws an exception. The response is disposed and nulled.
 /// </returns>
 internal TrinityErrorCode MessageProcess()
 {
     try
     {
         RequestHandler(this);
         return(TrinityErrorCode.E_SUCCESS);
     }
     catch (Exception e)
     {
         CommunicationInstance._RaiseUnhandledExceptionEvents(this, new MessagingUnhandledExceptionEventArgs(this, e));
         if (Response != null)
         {
             Response.Dispose(); Response = null;
         }
         return(TrinityErrorCode.E_RPC_EXCEPTION);
     }
 }
Esempio n. 4
0
 internal TrinityResponse(TrinityMessage msg)
 {
     Buffer = msg.Buffer;
     Offset = TrinityMessage.Offset;
     Size   = msg.Size;
 }