diff --git a/Proto/OuterMessage.proto b/Proto/OuterMessage.proto index 3ed39cc69d1231003ab71dc3354bdd6700be168c..74197ca1fbbc1c1f9ff7eab45c478dc42c721617 100644 --- a/Proto/OuterMessage.proto +++ b/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; diff --git a/Server/Hotfix/Handler/Actor_TestRequestHandler.cs b/Server/Hotfix/Handler/Actor_TestRequestHandler.cs deleted file mode 100644 index e967f15a28957cb498ec6637d057b585e75f9c1a..0000000000000000000000000000000000000000 --- a/Server/Hotfix/Handler/Actor_TestRequestHandler.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Threading.Tasks; -using ETModel; - -namespace ETHotfix -{ - [ActorMessageHandler(AppType.Map)] - public class Actor_TestRequestHandler : AMActorLocationRpcHandler - { - protected override async ETTask Run(Unit unit, Actor_TestRequest message, Action reply) - { - await ETTask.CompletedTask; - reply(new Actor_TestResponse() {Response = "response actor rpc"}); - } - } -} \ No newline at end of file diff --git a/Server/Hotfix/Handler/C2M_TestRequestHandler.cs b/Server/Hotfix/Handler/C2M_TestRequestHandler.cs new file mode 100644 index 0000000000000000000000000000000000000000..13b0e74156d777789994f3728565dcb1936b2f46 --- /dev/null +++ b/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 + { + protected override async ETTask Run(Unit unit, C2M_TestRequest message, Action reply) + { + await ETTask.CompletedTask; + reply(new M2C_TestResponse() {Response = "response actor rpc"}); + } + } +} \ No newline at end of file diff --git a/Server/Hotfix/Module/Demo/G2M_CreateUnitHandler.cs b/Server/Hotfix/Module/Demo/G2M_CreateUnitHandler.cs index 7c192c24760339b1d2b47108aa7a16b5538b8432..747645767c0c11ecc20d3943f8feaa95031f639e 100644 --- a/Server/Hotfix/Module/Demo/G2M_CreateUnitHandler.cs +++ b/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().GetAll(); foreach (Unit u in units) { diff --git a/Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs.meta b/Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs.meta deleted file mode 100644 index ea0649c9e5b9c49ba40861032b7bd88af600b91a..0000000000000000000000000000000000000000 --- a/Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 14ada40722b476047abbee1b87e7a544 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs b/Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs similarity index 75% rename from Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs rename to Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs index 80d61246c9d33c4026b7f4894f2c823fc63b9f7d..2911021afaf25af9e7537bd5286a8f292c4d906e 100644 --- a/Unity/Assets/Hotfix/Module/Demo/Actor_CreateUnitsHandler.cs +++ b/Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs @@ -5,9 +5,9 @@ using Vector3 = UnityEngine.Vector3; namespace ETHotfix { [MessageHandler] - public class Actor_CreateUnitsHandler : AMHandler + public class M2C_CreateUnitsHandler : AMHandler { - 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(); diff --git a/Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs.meta b/Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs.meta similarity index 83% rename from Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs.meta rename to Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs.meta index 846349b1c333450cbfa2a774dfc13cc643957ea1..aeb0f2f491b3723195663471efcc8c5ce2dcd720 100644 --- a/Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs.meta +++ b/Unity/Assets/Hotfix/Module/Demo/M2C_CreateUnitsHandler.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 49d6836b57f6b4548bc5dc53a02646a9 +guid: 8efe3c1941874624198f5f21d3c9d7f9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Unity/Assets/Model/ILBinding/CLRBindings.cs b/Unity/Assets/Model/ILBinding/CLRBindings.cs index 754bed795490888783df62b473bb5552e8fa29e3..dfceebfba3fe52f408ced6678e4bf216e1667917 100644 --- a/Unity/Assets/Model/ILBinding/CLRBindings.cs +++ b/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); diff --git a/Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs b/Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs deleted file mode 100644 index 8c223ecb07878b64e09694041f4e3d8835a101cd..0000000000000000000000000000000000000000 --- a/Unity/Assets/Model/ILBinding/ETModel_Actor_CreateUnits_Binding.cs +++ /dev/null @@ -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 __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); - } - - - - } -} diff --git a/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs b/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs deleted file mode 100644 index 8f533790eecc1d902613ed5a3e3c1a045c63fe53..0000000000000000000000000000000000000000 --- a/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs +++ /dev/null @@ -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 __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 __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); - } - - - } -} diff --git a/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs.meta b/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs.meta deleted file mode 100644 index 9e3d33ae00ccb7d3dd0e1aceea521fe0929a05c3..0000000000000000000000000000000000000000 --- a/Unity/Assets/Model/ILBinding/ETModel_Actor_TestRequest_Binding.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f0c8211301dd10a49a516e14db1974ca -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/Model/Module/Message/OuterMessage.cs b/Unity/Assets/Model/Module/Message/OuterMessage.cs index 2e5edfa53b118ba78e7889a5d66a763633d4ce3a..53a916d082462e4123b4f30158275ff03430423a 100644 --- a/Unity/Assets/Model/Module/Message/OuterMessage.cs +++ b/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 _parser = new pb::MessageParser(() => (Actor_TestRequest)MessagePool.Instance.Fetch(typeof(Actor_TestRequest))); - public static pb::MessageParser Parser { get { return _parser; } } + public partial class C2M_TestRequest : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => (C2M_TestRequest)MessagePool.Instance.Fetch(typeof(C2M_TestRequest))); + public static pb::MessageParser 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 _parser = new pb::MessageParser(() => (Actor_TestResponse)MessagePool.Instance.Fetch(typeof(Actor_TestResponse))); - public static pb::MessageParser Parser { get { return _parser; } } + public partial class M2C_TestResponse : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => (M2C_TestResponse)MessagePool.Instance.Fetch(typeof(M2C_TestResponse))); + public static pb::MessageParser 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 _parser = new pb::MessageParser(() => (Actor_CreateUnits)MessagePool.Instance.Fetch(typeof(Actor_CreateUnits))); - public static pb::MessageParser Parser { get { return _parser; } } + public partial class M2C_CreateUnits : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => (M2C_CreateUnits)MessagePool.Instance.Fetch(typeof(M2C_CreateUnits))); + public static pb::MessageParser Parser { get { return _parser; } } private int rpcId_; public int RpcId { diff --git a/Unity/Assets/Model/Module/Message/OuterOpcode.cs b/Unity/Assets/Model/Module/Message/OuterOpcode.cs index 78020c585ff8c1afd363cccfa5ccf8dbb0464001..a37a71b0b1b2aa66e3c55a7fb9eeeccb9c4f4f00 100644 --- a/Unity/Assets/Model/Module/Message/OuterOpcode.cs +++ b/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; diff --git a/Unity/Unity.Hotfix.csproj b/Unity/Unity.Hotfix.csproj index ad04981ede36fa637a57deffbbbb5090fbea82d0..4103ef7c7a391610852f3b65fa1a583af8e62ac5 100644 --- a/Unity/Unity.Hotfix.csproj +++ b/Unity/Unity.Hotfix.csproj @@ -89,9 +89,9 @@ - + diff --git a/Unity/Unity.Model.csproj b/Unity/Unity.Model.csproj index 1c4046ee3a376c4513d75177298eaaac9e9a5106..28559e1f0fbea1bd7383bdc85d92355563629361 100644 --- a/Unity/Unity.Model.csproj +++ b/Unity/Unity.Model.csproj @@ -164,9 +164,7 @@ - -