Просмотр исходного кода

Actor前缀去掉,改成端到端的命名方式,方便看到消息路径

tanghai 7 лет назад
Родитель
Сommit
61b7f04ba7

+ 3 - 3
Proto/OuterMessage.proto

@@ -8,14 +8,14 @@ message Actor_Test // IActorMessage
 	string Info = 1;
 }
 
-message Actor_TestRequest // IActorLocationRequest
+message C2M_TestRequest // IActorLocationRequest
 {
 	int32 RpcId = 90;
 	int64 ActorId = 93;
 	string request = 1;
 }
 
-message Actor_TestResponse // IActorLocationResponse
+message M2C_TestResponse // IActorLocationResponse
 {
 	int32 RpcId = 90;
 	int32 Error = 91;
@@ -62,7 +62,7 @@ message UnitInfo
 	float Z = 4;
 }
 
-message Actor_CreateUnits // IActorMessage
+message M2C_CreateUnits // IActorMessage
 {
 	int32 RpcId = 90;
 	int64 ActorId = 93;

+ 0 - 16
Server/Hotfix/Handler/Actor_TestRequestHandler.cs

@@ -1,16 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using ETModel;
-
-namespace ETHotfix
-{
-	[ActorMessageHandler(AppType.Map)]
-	public class Actor_TestRequestHandler : AMActorLocationRpcHandler<Unit, Actor_TestRequest, Actor_TestResponse>
-	{
-		protected override async ETTask Run(Unit unit, Actor_TestRequest message, Action<Actor_TestResponse> reply)
-		{
-			await ETTask.CompletedTask;
-			reply(new Actor_TestResponse() {Response = "response actor rpc"});
-		}
-	}
-}

+ 16 - 0
Server/Hotfix/Handler/C2M_TestRequestHandler.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Threading.Tasks;
+using ETModel;
+
+namespace ETHotfix
+{
+	[ActorMessageHandler(AppType.Map)]
+	public class C2M_TestRequestHandler : AMActorLocationRpcHandler<Unit, C2M_TestRequest, M2C_TestResponse>
+	{
+		protected override async ETTask Run(Unit unit, C2M_TestRequest message, Action<M2C_TestResponse> reply)
+		{
+			await ETTask.CompletedTask;
+			reply(new M2C_TestResponse() {Response = "response actor rpc"});
+		}
+	}
+}

+ 1 - 1
Server/Hotfix/Module/Demo/G2M_CreateUnitHandler.cs

@@ -29,7 +29,7 @@ namespace ETHotfix
 				
 				
 				// 广播创建的unit
-				Actor_CreateUnits createUnits = new Actor_CreateUnits();
+				M2C_CreateUnits createUnits = new M2C_CreateUnits();
 				Unit[] units = Game.Scene.GetComponent<UnitComponent>().GetAll();
 				foreach (Unit u in units)
 				{

+ 0 - 11
Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 14ada40722b476047abbee1b87e7a544
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 2 - 2
Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs → Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs

@@ -5,9 +5,9 @@ using Vector3 = UnityEngine.Vector3;
 namespace ETHotfix
 {
 	[MessageHandler]
-	public class Actor_CreateUnitsHandler : AMHandler<Actor_CreateUnits>
+	public class M2C_CreateUnitsHandler : AMHandler<M2C_CreateUnits>
 	{
-		protected override void Run(ETModel.Session session, Actor_CreateUnits message)
+		protected override void Run(ETModel.Session session, M2C_CreateUnits message)
 		{	
 			UnitComponent unitComponent = ETModel.Game.Scene.GetComponent<UnitComponent>();
 			

+ 1 - 1
Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs.meta → Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 49d6836b57f6b4548bc5dc53a02646a9
+guid: 8efe3c1941874624198f5f21d3c9d7f9
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 0 - 2
Unity/Assets/Model/ILBinding/CLRBindings.cs

@@ -53,7 +53,6 @@ namespace ILRuntime.Runtime.Generated
             ETModel_ResourcesComponent_Binding.Register(app);
             ETModel_GameObjectHelper_Binding.Register(app);
             UnityEngine_TextAsset_Binding.Register(app);
-            ETModel_Actor_CreateUnits_Binding.Register(app);
             Google_Protobuf_Collections_RepeatedField_1_UnitInfo_Binding.Register(app);
             System_Collections_Generic_IEnumerator_1_UnitInfo_Binding.Register(app);
             ETModel_UnitComponent_Binding.Register(app);
@@ -117,7 +116,6 @@ namespace ILRuntime.Runtime.Generated
             ReferenceCollector_Binding.Register(app);
             UnityEngine_UI_Button_Binding.Register(app);
             ETModel_ActionHelper_Binding.Register(app);
-            ETModel_Actor_TestRequest_Binding.Register(app);
             System_Threading_Tasks_Task_1_IResponse_Binding.Register(app);
             System_Runtime_CompilerServices_TaskAwaiter_1_IResponse_Binding.Register(app);
             ETModel_Actor_TransferRequest_Binding.Register(app);

+ 0 - 51
Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs

@@ -1,51 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-using ILRuntime.CLR.TypeSystem;
-using ILRuntime.CLR.Method;
-using ILRuntime.Runtime.Enviorment;
-using ILRuntime.Runtime.Intepreter;
-using ILRuntime.Runtime.Stack;
-using ILRuntime.Reflection;
-using ILRuntime.CLR.Utils;
-
-namespace ILRuntime.Runtime.Generated
-{
-    unsafe class ETModel_Actor_CreateUnits_Binding
-    {
-        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
-        {
-            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
-            MethodBase method;
-            Type[] args;
-            Type type = typeof(ETModel.Actor_CreateUnits);
-            args = new Type[]{};
-            method = type.GetMethod("get_Units", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, get_Units_0);
-
-
-        }
-
-
-        static StackObject* get_Units_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
-        {
-            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
-            StackObject* ptr_of_this_method;
-            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
-
-            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
-            ETModel.Actor_CreateUnits instance_of_this_method = (ETModel.Actor_CreateUnits)typeof(ETModel.Actor_CreateUnits).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
-            __intp.Free(ptr_of_this_method);
-
-            var result_of_this_method = instance_of_this_method.Units;
-
-            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
-        }
-
-
-
-    }
-}

+ 0 - 68
Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs

@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-using ILRuntime.CLR.TypeSystem;
-using ILRuntime.CLR.Method;
-using ILRuntime.Runtime.Enviorment;
-using ILRuntime.Runtime.Intepreter;
-using ILRuntime.Runtime.Stack;
-using ILRuntime.Reflection;
-using ILRuntime.CLR.Utils;
-
-namespace ILRuntime.Runtime.Generated
-{
-    unsafe class ETModel_Actor_TestRequest_Binding
-    {
-        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
-        {
-            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
-            MethodBase method;
-            Type[] args;
-            Type type = typeof(ETModel.Actor_TestRequest);
-            args = new Type[]{typeof(System.String)};
-            method = type.GetMethod("set_Request", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, set_Request_0);
-
-            args = new Type[]{};
-            method = type.GetConstructor(flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, Ctor_0);
-
-        }
-
-
-        static StackObject* set_Request_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
-        {
-            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
-            StackObject* ptr_of_this_method;
-            StackObject* __ret = ILIntepreter.Minus(__esp, 2);
-
-            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
-            System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
-            __intp.Free(ptr_of_this_method);
-
-            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
-            ETModel.Actor_TestRequest instance_of_this_method = (ETModel.Actor_TestRequest)typeof(ETModel.Actor_TestRequest).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
-            __intp.Free(ptr_of_this_method);
-
-            instance_of_this_method.Request = value;
-
-            return __ret;
-        }
-
-
-        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
-        {
-            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
-            StackObject* __ret = ILIntepreter.Minus(__esp, 0);
-
-            var result_of_this_method = new ETModel.Actor_TestRequest();
-
-            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
-        }
-
-
-    }
-}

+ 0 - 11
Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f0c8211301dd10a49a516e14db1974ca
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 9 - 9
Unity/Assets/Model/Module/Message/OuterMessage.cs

@@ -94,9 +94,9 @@ namespace ETModel {
 
   }
 
-  public partial class Actor_TestRequest : pb::IMessage {
-    private static readonly pb::MessageParser<Actor_TestRequest> _parser = new pb::MessageParser<Actor_TestRequest>(() => (Actor_TestRequest)MessagePool.Instance.Fetch(typeof(Actor_TestRequest)));
-    public static pb::MessageParser<Actor_TestRequest> Parser { get { return _parser; } }
+  public partial class C2M_TestRequest : pb::IMessage {
+    private static readonly pb::MessageParser<C2M_TestRequest> _parser = new pb::MessageParser<C2M_TestRequest>(() => (C2M_TestRequest)MessagePool.Instance.Fetch(typeof(C2M_TestRequest)));
+    public static pb::MessageParser<C2M_TestRequest> Parser { get { return _parser; } }
 
     private int rpcId_;
     public int RpcId {
@@ -179,9 +179,9 @@ namespace ETModel {
 
   }
 
-  public partial class Actor_TestResponse : pb::IMessage {
-    private static readonly pb::MessageParser<Actor_TestResponse> _parser = new pb::MessageParser<Actor_TestResponse>(() => (Actor_TestResponse)MessagePool.Instance.Fetch(typeof(Actor_TestResponse)));
-    public static pb::MessageParser<Actor_TestResponse> Parser { get { return _parser; } }
+  public partial class M2C_TestResponse : pb::IMessage {
+    private static readonly pb::MessageParser<M2C_TestResponse> _parser = new pb::MessageParser<M2C_TestResponse>(() => (M2C_TestResponse)MessagePool.Instance.Fetch(typeof(M2C_TestResponse)));
+    public static pb::MessageParser<M2C_TestResponse> Parser { get { return _parser; } }
 
     private int rpcId_;
     public int RpcId {
@@ -731,9 +731,9 @@ namespace ETModel {
 
   }
 
-  public partial class Actor_CreateUnits : pb::IMessage {
-    private static readonly pb::MessageParser<Actor_CreateUnits> _parser = new pb::MessageParser<Actor_CreateUnits>(() => (Actor_CreateUnits)MessagePool.Instance.Fetch(typeof(Actor_CreateUnits)));
-    public static pb::MessageParser<Actor_CreateUnits> Parser { get { return _parser; } }
+  public partial class M2C_CreateUnits : pb::IMessage {
+    private static readonly pb::MessageParser<M2C_CreateUnits> _parser = new pb::MessageParser<M2C_CreateUnits>(() => (M2C_CreateUnits)MessagePool.Instance.Fetch(typeof(M2C_CreateUnits)));
+    public static pb::MessageParser<M2C_CreateUnits> Parser { get { return _parser; } }
 
     private int rpcId_;
     public int RpcId {

+ 9 - 9
Unity/Assets/Model/Module/Message/OuterOpcode.cs

@@ -4,11 +4,11 @@ namespace ETModel
 	[Message(OuterOpcode.Actor_Test)]
 	public partial class Actor_Test : IActorMessage {}
 
-	[Message(OuterOpcode.Actor_TestRequest)]
-	public partial class Actor_TestRequest : IActorLocationRequest {}
+	[Message(OuterOpcode.C2M_TestRequest)]
+	public partial class C2M_TestRequest : IActorLocationRequest {}
 
-	[Message(OuterOpcode.Actor_TestResponse)]
-	public partial class Actor_TestResponse : IActorLocationResponse {}
+	[Message(OuterOpcode.M2C_TestResponse)]
+	public partial class M2C_TestResponse : IActorLocationResponse {}
 
 	[Message(OuterOpcode.Actor_TransferRequest)]
 	public partial class Actor_TransferRequest : IActorLocationRequest {}
@@ -27,8 +27,8 @@ namespace ETModel
 	[Message(OuterOpcode.UnitInfo)]
 	public partial class UnitInfo {}
 
-	[Message(OuterOpcode.Actor_CreateUnits)]
-	public partial class Actor_CreateUnits : IActorMessage {}
+	[Message(OuterOpcode.M2C_CreateUnits)]
+	public partial class M2C_CreateUnits : IActorMessage {}
 
 	[Message(OuterOpcode.Frame_ClickMap)]
 	public partial class Frame_ClickMap : IActorLocationMessage {}
@@ -57,14 +57,14 @@ namespace ETModel
 	public static partial class OuterOpcode
 	{
 		 public const ushort Actor_Test = 101;
-		 public const ushort Actor_TestRequest = 102;
-		 public const ushort Actor_TestResponse = 103;
+		 public const ushort C2M_TestRequest = 102;
+		 public const ushort M2C_TestResponse = 103;
 		 public const ushort Actor_TransferRequest = 104;
 		 public const ushort Actor_TransferResponse = 105;
 		 public const ushort C2G_EnterMap = 106;
 		 public const ushort G2C_EnterMap = 107;
 		 public const ushort UnitInfo = 108;
-		 public const ushort Actor_CreateUnits = 109;
+		 public const ushort M2C_CreateUnits = 109;
 		 public const ushort Frame_ClickMap = 110;
 		 public const ushort M2C_PathfindingResult = 111;
 		 public const ushort C2R_Ping = 112;

+ 1 - 1
Unity/Unity.Hotfix.csproj

@@ -89,9 +89,9 @@
     <Compile Include="Assets\Hotfix\Module\Config\ConfigComponent.cs" />
     <Compile Include="Assets\Hotfix\Module\Config\ConfigHelper.cs" />
     <Compile Include="Assets\Hotfix\Module\Config\IConfig.cs" />
-    <Compile Include="Assets\Hotfix\Module\Demo\Actor_CreateUnitsHandler.cs" />
     <Compile Include="Assets\Hotfix\Module\Demo\Actor_TestHandler.cs" />
     <Compile Include="Assets\Hotfix\Module\Demo\G2C_TestHotfixHandler.cs" />
+    <Compile Include="Assets\Hotfix\Module\Demo\M2C_CreateUnitsHandler.cs" />
     <Compile Include="Assets\Hotfix\Module\Demo\M2C_PathfindingResultHandler.cs" />
     <Compile Include="Assets\Hotfix\Module\Demo\OperaComponent.cs" />
     <Compile Include="Assets\Hotfix\Module\Demo\TestHotfixSubscribMonoEvent_LogString.cs" />

+ 0 - 2
Unity/Unity.Model.csproj

@@ -164,9 +164,7 @@
     <Compile Include="Assets\Model\Helper\ResourcesHelper.cs" />
     <Compile Include="Assets\Model\ILBinding\CLRBindings.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_ActionHelper_Binding.cs" />
-    <Compile Include="Assets\Model\ILBinding\ETModel_Actor_CreateUnits_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_Actor_Test_Binding.cs" />
-    <Compile Include="Assets\Model\ILBinding\ETModel_Actor_TestRequest_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_Actor_TransferRequest_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_C2G_EnterMap_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_CameraComponent_Binding.cs" />