tanghai před 4 roky
rodič
revize
3ff4b6bc82

+ 8 - 5
Server/Hotfix/Module/Actor/ActorMessageDispatcherComponentSystem.cs

@@ -57,14 +57,17 @@ namespace ET
                 }
 
                 Type messageType = imHandler.GetRequestType();
-                Type responseType = OpcodeTypeComponent.Instance.GetResponseType(messageType);
-
+                
                 Type handleResponseType = imHandler.GetResponseType();
-                if (handleResponseType != null && handleResponseType != responseType)
+                if (handleResponseType != null)
                 {
-                    throw new Exception($"message handler response type error: {messageType.FullName}");
+                    Type responseType = OpcodeTypeComponent.Instance.GetResponseType(messageType);
+                    if (handleResponseType != responseType)
+                    {
+                        throw new Exception($"message handler response type error: {messageType.FullName}");
+                    }
                 }
-                
+
                 self.ActorMessageHandlers.Add(messageType, imHandler);
             }
         }