From f00711e95e5e01af9a4c9d0df821c217c3a4a143 Mon Sep 17 00:00:00 2001 From: tanghai Date: Mon, 30 Oct 2017 10:21:40 +0800 Subject: [PATCH] =?UTF-8?q?opcode=E4=BD=BF=E7=94=A8=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client-Server.sln.DotSettings.user | 1 + Server/Hotfix/Other/InnerMessageDispatcher.cs | 2 +- Server/Hotfix/Other/OuterMessageDispatcher.cs | 2 +- Server/Model/Base/Message/MessageAttribute.cs | 4 +- Server/Model/Component/OpcodeTypeComponent.cs | 8 +- Server/Model/Entity/Message/InnerOpcode.cs | 49 ----------- .../Scripts/Base/Message/ClientDispatcher.cs | 2 +- .../Base/Message/IMessageDispatcher.cs | 2 +- .../Scripts/Base/Message/MessageAttribute.cs | 4 +- .../Scripts/Base/Message/MessageInfo.cs | 4 +- .../Scripts/Component/ClientFrameComponent.cs | 2 +- .../Component/MessageDispatherComponent.cs | 46 ++-------- .../Scripts/Component/OpcodeTypeComponent.cs | 6 +- Unity/Assets/Scripts/Entity/Message/Opcode.cs | 84 +++++++++++++++---- .../Scripts/Entity/Message/OuterMessage.cs | 10 +-- Unity/Assets/Scripts/Entity/Session.cs | 13 +-- .../Handler/Actor_CreateUnitsHandler.cs | 2 +- .../Scripts/Handler/Actor_TestHandler.cs | 2 +- .../Scripts/Handler/Frame_ClickMapHandler.cs | 2 +- 19 files changed, 107 insertions(+), 138 deletions(-) delete mode 100644 Server/Model/Entity/Message/InnerOpcode.cs diff --git a/Client-Server.sln.DotSettings.user b/Client-Server.sln.DotSettings.user index b966d477..72a14145 100644 --- a/Client-Server.sln.DotSettings.user +++ b/Client-Server.sln.DotSettings.user @@ -6,6 +6,7 @@ ForceIncluded ForceIncluded ForceIncluded + VISIBLE_FILES <?xml version="1.0" encoding="utf-16"?><Profile name="Unity"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSRemoveCodeRedundancies>True</CSRemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>DISABLED</BehavourStyle><LocalVariableStyle>IMPLICIT_WHEN_INITIALIZER_HAS_TYPE</LocalVariableStyle><ForeachVariableStyle>IMPLICIT_EXCEPT_SIMPLE_TYPES</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSUseAutoProperty>True</CSUseAutoProperty><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" /></Profile> 247,-4 0 diff --git a/Server/Hotfix/Other/InnerMessageDispatcher.cs b/Server/Hotfix/Other/InnerMessageDispatcher.cs index 74fdcda7..ebdf1675 100644 --- a/Server/Hotfix/Other/InnerMessageDispatcher.cs +++ b/Server/Hotfix/Other/InnerMessageDispatcher.cs @@ -5,7 +5,7 @@ namespace Hotfix { public class InnerMessageDispatcher: IMessageDispatcher { - public void Dispatch(Session session, ushort opcode, int offset, byte[] messageBytes, AMessage message) + public void Dispatch(Session session, Opcode opcode, int offset, byte[] messageBytes, AMessage message) { // 收到actor rpc request if (message is ActorRpcRequest actorRpcRequest) diff --git a/Server/Hotfix/Other/OuterMessageDispatcher.cs b/Server/Hotfix/Other/OuterMessageDispatcher.cs index 377d2570..4fbbb4e1 100644 --- a/Server/Hotfix/Other/OuterMessageDispatcher.cs +++ b/Server/Hotfix/Other/OuterMessageDispatcher.cs @@ -5,7 +5,7 @@ namespace Hotfix { public class OuterMessageDispatcher: IMessageDispatcher { - public async void Dispatch(Session session, ushort opcode, int offset, byte[] messageBytes, AMessage message) + public async void Dispatch(Session session, Opcode opcode, int offset, byte[] messageBytes, AMessage message) { // gate session收到actor消息直接转发给actor自己去处理 if (message is AActorMessage) diff --git a/Server/Model/Base/Message/MessageAttribute.cs b/Server/Model/Base/Message/MessageAttribute.cs index 0e80ee5a..c79f94db 100644 --- a/Server/Model/Base/Message/MessageAttribute.cs +++ b/Server/Model/Base/Message/MessageAttribute.cs @@ -4,9 +4,9 @@ namespace Model { public class MessageAttribute: Attribute { - public ushort Opcode { get; private set; } + public Opcode Opcode { get; } - public MessageAttribute(ushort opcode) + public MessageAttribute(Opcode opcode) { this.Opcode = opcode; } diff --git a/Server/Model/Component/OpcodeTypeComponent.cs b/Server/Model/Component/OpcodeTypeComponent.cs index 839f091a..77a7496c 100644 --- a/Server/Model/Component/OpcodeTypeComponent.cs +++ b/Server/Model/Component/OpcodeTypeComponent.cs @@ -19,7 +19,7 @@ namespace Model public class OpcodeTypeComponent : Component { - private Dictionary opcodeType { get; set; } + private Dictionary opcodeType { get; set; } private Dictionary messageOpcode { get; set; } public void Awake() @@ -29,7 +29,7 @@ namespace Model public void Load() { - this.opcodeType = new Dictionary(); + this.opcodeType = new Dictionary(); this.messageOpcode = new Dictionary(); Type[] types = DllHelper.GetMonoTypes(); @@ -47,7 +47,7 @@ namespace Model } } - public ushort GetOpcode(Type type) + public Opcode GetOpcode(Type type) { if (!this.messageOpcode.TryGetValue(type, out MessageAttribute messageAttribute)) { @@ -56,7 +56,7 @@ namespace Model return messageAttribute.Opcode; } - public Type GetType(ushort opcode) + public Type GetType(Opcode opcode) { if (!this.opcodeType.TryGetValue(opcode, out Type messageType)) { diff --git a/Server/Model/Entity/Message/InnerOpcode.cs b/Server/Model/Entity/Message/InnerOpcode.cs deleted file mode 100644 index febd6cb1..00000000 --- a/Server/Model/Entity/Message/InnerOpcode.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace Model -{ - // 1-999 - public static partial class Opcode - { - public const ushort ActorRequest = 1; - public const ushort ActorResponse = 2; - public const ushort ActorRpcRequest = 3; - public const ushort ActorRpcResponse = 4; - public const ushort G2G_LockRequest = 10; - public const ushort G2G_LockResponse = 11; - public const ushort G2G_LockReleaseRequest = 12; - public const ushort G2G_LockReleaseResponse = 13; - - public const ushort M2A_Reload = 20; - public const ushort A2M_Reload = 21; - - public const ushort DBSaveRequest = 26; - public const ushort DBSaveResponse = 27; - public const ushort DBQueryRequest = 28; - public const ushort DBQueryResponse = 29; - public const ushort DBSaveBatchResponse = 37; - public const ushort DBSaveBatchRequest = 38; - public const ushort DBQueryBatchRequest = 61; - public const ushort DBQueryBatchResponse = 62; - public const ushort DBQueryJsonRequest = 65; - public const ushort DBQueryJsonResponse = 66; - - public const ushort ObjectAddRequest = 70; - public const ushort ObjectAddResponse = 71; - public const ushort ObjectRemoveRequest = 72; - public const ushort ObjectRemoveResponse = 73; - public const ushort ObjectLockRequest = 74; - public const ushort ObjectLockResponse = 75; - public const ushort ObjectUnLockRequest = 76; - public const ushort ObjectUnLockResponse = 77; - public const ushort ObjectGetRequest = 78; - public const ushort ObjectGetResponse = 79; - - public const ushort R2G_GetLoginKey = 101; - public const ushort G2R_GetLoginKey = 102; - - public const ushort G2M_CreateUnit = 103; - public const ushort M2G_CreateUnit = 104; - - public const ushort M2M_TrasferUnitRequest = 105; - public const ushort M2M_TrasferUnitResponse = 106; - } -} diff --git a/Unity/Assets/Scripts/Base/Message/ClientDispatcher.cs b/Unity/Assets/Scripts/Base/Message/ClientDispatcher.cs index 59c19024..8e126732 100644 --- a/Unity/Assets/Scripts/Base/Message/ClientDispatcher.cs +++ b/Unity/Assets/Scripts/Base/Message/ClientDispatcher.cs @@ -4,7 +4,7 @@ namespace Model { public class ClientDispatcher: IMessageDispatcher { - public void Dispatch(Session session, ushort opcode, int offset, byte[] messageBytes, AMessage message) + public void Dispatch(Session session, Opcode opcode, int offset, byte[] messageBytes, AMessage message) { // 如果是帧同步消息,交给ClientFrameComponent处理 FrameMessage frameMessage = message as FrameMessage; diff --git a/Unity/Assets/Scripts/Base/Message/IMessageDispatcher.cs b/Unity/Assets/Scripts/Base/Message/IMessageDispatcher.cs index 25c62173..195432d7 100644 --- a/Unity/Assets/Scripts/Base/Message/IMessageDispatcher.cs +++ b/Unity/Assets/Scripts/Base/Message/IMessageDispatcher.cs @@ -2,6 +2,6 @@ { public interface IMessageDispatcher { - void Dispatch(Session session, ushort opcode, int offset, byte[] messageBytes, AMessage message); + void Dispatch(Session session, Opcode opcode, int offset, byte[] messageBytes, AMessage message); } } diff --git a/Unity/Assets/Scripts/Base/Message/MessageAttribute.cs b/Unity/Assets/Scripts/Base/Message/MessageAttribute.cs index 0e80ee5a..c79f94db 100644 --- a/Unity/Assets/Scripts/Base/Message/MessageAttribute.cs +++ b/Unity/Assets/Scripts/Base/Message/MessageAttribute.cs @@ -4,9 +4,9 @@ namespace Model { public class MessageAttribute: Attribute { - public ushort Opcode { get; private set; } + public Opcode Opcode { get; } - public MessageAttribute(ushort opcode) + public MessageAttribute(Opcode opcode) { this.Opcode = opcode; } diff --git a/Unity/Assets/Scripts/Base/Message/MessageInfo.cs b/Unity/Assets/Scripts/Base/Message/MessageInfo.cs index 61014264..8bf5c564 100644 --- a/Unity/Assets/Scripts/Base/Message/MessageInfo.cs +++ b/Unity/Assets/Scripts/Base/Message/MessageInfo.cs @@ -2,10 +2,10 @@ { public struct MessageInfo { - public ushort Opcode { get; set; } + public Opcode Opcode { get; set; } public AMessage Message { get; set; } - public MessageInfo(ushort opcode, AMessage message) + public MessageInfo(Opcode opcode, AMessage message) { this.Opcode = opcode; this.Message = message; diff --git a/Unity/Assets/Scripts/Component/ClientFrameComponent.cs b/Unity/Assets/Scripts/Component/ClientFrameComponent.cs index f8e78685..73a6649f 100644 --- a/Unity/Assets/Scripts/Component/ClientFrameComponent.cs +++ b/Unity/Assets/Scripts/Component/ClientFrameComponent.cs @@ -71,7 +71,7 @@ for (int i = 0; i < frameMessage.Messages.Count; ++i) { AFrameMessage message = frameMessage.Messages[i]; - ushort opcode = Game.Scene.GetComponent().GetOpcode(message.GetType()); + Opcode opcode = Game.Scene.GetComponent().GetOpcode(message.GetType()); Game.Scene.GetComponent().Handle(new MessageInfo() { Opcode= opcode, Message = message }); } } diff --git a/Unity/Assets/Scripts/Component/MessageDispatherComponent.cs b/Unity/Assets/Scripts/Component/MessageDispatherComponent.cs index 6a13610b..9f61721e 100644 --- a/Unity/Assets/Scripts/Component/MessageDispatherComponent.cs +++ b/Unity/Assets/Scripts/Component/MessageDispatherComponent.cs @@ -67,40 +67,12 @@ namespace Model } } - public static class Opcode2Name - { - private static Dictionary _init = new Dictionary(); - public static string GetName(int code) - { - if (_init.Count == 0) - { - Type type = typeof(Opcode); - FieldInfo[] fields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); - foreach (FieldInfo field in fields) - { - if (!field.IsStatic) - { - continue; - } - int codeID = (ushort)field.GetValue(null); - if (_init.ContainsKey(codeID)) - { - Log.Warning($"重复的Opcode:{codeID}"); - continue; - } - _init.Add(codeID, field.Name); - } - } - return _init[code]; - } - } - /// /// 消息分发组件 /// public class MessageDispatherComponent : Component { - private Dictionary> handlers; + private Dictionary> handlers; public void Awake() @@ -110,7 +82,7 @@ namespace Model public void Load() { - handlers = new Dictionary>(); + handlers = new Dictionary>(); Type[] types = DllHelper.GetMonoTypes(); @@ -123,11 +95,11 @@ namespace Model } MessageHandlerAttribute messageHandlerAttribute = (MessageHandlerAttribute)attrs[0]; IMHandler iMHandler = (IMHandler)Activator.CreateInstance(type); - if (!this.handlers.ContainsKey(messageHandlerAttribute.Opcode)) + if (!this.handlers.ContainsKey((Opcode)messageHandlerAttribute.Opcode)) { - this.handlers.Add(messageHandlerAttribute.Opcode, new List()); + this.handlers.Add((Opcode)messageHandlerAttribute.Opcode, new List()); } - this.handlers[messageHandlerAttribute.Opcode].Add(new IMessageMonoMethod(iMHandler)); + this.handlers[(Opcode)messageHandlerAttribute.Opcode].Add(new IMessageMonoMethod(iMHandler)); } // hotfix dll @@ -146,11 +118,11 @@ namespace Model IMHandler iMHandler = (IMHandler)Activator.CreateInstance(type); IMessageMethod iMessageMethod = new IMessageMonoMethod(iMHandler); #endif - if (!this.handlers.ContainsKey(messageHandlerAttribute.Opcode)) + if (!this.handlers.ContainsKey((Opcode)messageHandlerAttribute.Opcode)) { - this.handlers.Add(messageHandlerAttribute.Opcode, new List()); + this.handlers.Add((Opcode)messageHandlerAttribute.Opcode, new List()); } - this.handlers[messageHandlerAttribute.Opcode].Add(iMessageMethod); + this.handlers[(Opcode)messageHandlerAttribute.Opcode].Add(iMessageMethod); } } @@ -159,7 +131,7 @@ namespace Model List actions; if (!this.handlers.TryGetValue(messageInfo.Opcode, out actions)) { - Log.Error($"消息 {Opcode2Name.GetName(messageInfo.Opcode)}({messageInfo.Opcode}) 没有处理"); + Log.Error($"消息 {messageInfo.Opcode} 没有处理"); return; } diff --git a/Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs b/Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs index 2a1177c1..8141fe9e 100644 --- a/Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs +++ b/Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs @@ -13,7 +13,7 @@ namespace Model public class OpcodeTypeComponent : Component { - private readonly DoubleMap opcodeTypes = new DoubleMap(); + private readonly DoubleMap opcodeTypes = new DoubleMap(); public void Awake() { @@ -36,12 +36,12 @@ namespace Model } } - public ushort GetOpcode(Type type) + public Opcode GetOpcode(Type type) { return this.opcodeTypes.GetKeyByValue(type); } - public Type GetType(ushort opcode) + public Type GetType(Opcode opcode) { return this.opcodeTypes.GetValueByKey(opcode); } diff --git a/Unity/Assets/Scripts/Entity/Message/Opcode.cs b/Unity/Assets/Scripts/Entity/Message/Opcode.cs index 8222a86a..56f0b543 100644 --- a/Unity/Assets/Scripts/Entity/Message/Opcode.cs +++ b/Unity/Assets/Scripts/Entity/Message/Opcode.cs @@ -1,24 +1,72 @@ namespace Model { // 1000开始 - public static partial class Opcode + public enum Opcode: ushort { - public const ushort FrameMessage = 1000; - public const ushort C2R_Login = 1001; - public const ushort R2C_Login = 1002; - public const ushort R2C_ServerLog = 1003; - public const ushort C2G_LoginGate = 1004; - public const ushort G2C_LoginGate = 1005; - public const ushort C2G_EnterMap = 1006; - public const ushort G2C_EnterMap = 1007; - public const ushort C2M_Reload = 1008; - - public const ushort Actor_Test = 2001; - public const ushort Actor_TestRequest = 2002; - public const ushort Actor_TestResponse = 2003; - public const ushort Actor_TransferRequest = 2004; - public const ushort Actor_TransferResponse = 2005; - public const ushort Frame_ClickMap = 2006; - public const ushort Actor_CreateUnits = 2007; + FrameMessage = 1000, + C2R_Login = 1001, + R2C_Login = 1002, + R2C_ServerLog = 1003, + C2G_LoginGate = 1004, + G2C_LoginGate = 1005, + C2G_EnterMap = 1006, + G2C_EnterMap = 1007, + C2M_Reload = 1008, + M2C_Reload = 1009, + C2R_Ping = 1010, + R2C_Ping = 1011, + + Actor_Test = 2001, + Actor_TestRequest = 2002, + Actor_TestResponse = 2003, + Actor_TransferRequest = 2004, + Actor_TransferResponse = 2005, + Frame_ClickMap = 2006, + Actor_CreateUnits = 2007, + + + // server inner opcode + ActorRequest = 1, + ActorResponse = 2, + ActorRpcRequest = 3, + ActorRpcResponse = 4, + G2G_LockRequest = 10, + G2G_LockResponse = 11, + G2G_LockReleaseRequest = 12, + G2G_LockReleaseResponse = 13, + + M2A_Reload = 20, + A2M_Reload = 21, + + DBSaveRequest = 26, + DBSaveResponse = 27, + DBQueryRequest = 28, + DBQueryResponse = 29, + DBSaveBatchResponse = 37, + DBSaveBatchRequest = 38, + DBQueryBatchRequest = 61, + DBQueryBatchResponse = 62, + DBQueryJsonRequest = 65, + DBQueryJsonResponse = 66, + + ObjectAddRequest = 70, + ObjectAddResponse = 71, + ObjectRemoveRequest = 72, + ObjectRemoveResponse = 73, + ObjectLockRequest = 74, + ObjectLockResponse = 75, + ObjectUnLockRequest = 76, + ObjectUnLockResponse = 77, + ObjectGetRequest = 78, + ObjectGetResponse = 79, + + R2G_GetLoginKey = 101, + G2R_GetLoginKey = 102, + + G2M_CreateUnit = 103, + M2G_CreateUnit = 104, + + M2M_TrasferUnitRequest = 105, + M2M_TrasferUnitResponse = 106, } } diff --git a/Unity/Assets/Scripts/Entity/Message/OuterMessage.cs b/Unity/Assets/Scripts/Entity/Message/OuterMessage.cs index 7393e0db..86e04a2f 100644 --- a/Unity/Assets/Scripts/Entity/Message/OuterMessage.cs +++ b/Unity/Assets/Scripts/Entity/Message/OuterMessage.cs @@ -1,5 +1,3 @@ -// ͻ֮Ϣ Opcode1-9999 - using System.Collections.Generic; using ProtoBuf; @@ -109,7 +107,6 @@ namespace Model public AMessage Message; } - // ˷ͻ,ÿ֡һ [Message(Opcode.FrameMessage)] public class FrameMessage : AActorMessage { @@ -117,7 +114,6 @@ namespace Model public List Messages = new List(); } - // ͻ˵ͼ [ProtoContract] [Message(Opcode.Frame_ClickMap)] public class Frame_ClickMap: AFrameMessage @@ -134,17 +130,17 @@ namespace Model public AppType AppType; } - [Message(11)] + [Message(Opcode.M2C_Reload)] public class M2C_Reload: AResponse { } - [Message(14)] + [Message(Opcode.C2R_Ping)] public class C2R_Ping: ARequest { } - [Message(15)] + [Message(Opcode.R2C_Ping)] public class R2C_Ping: AResponse { } diff --git a/Unity/Assets/Scripts/Entity/Session.cs b/Unity/Assets/Scripts/Entity/Session.cs index 5663cf5d..9a355eac 100644 --- a/Unity/Assets/Scripts/Entity/Session.cs +++ b/Unity/Assets/Scripts/Entity/Session.cs @@ -97,7 +97,8 @@ namespace Model private void RunDecompressedBytes(ushort opcode, byte[] messageBytes, int offset) { - Type messageType = this.network.Entity.GetComponent().GetType(opcode); + Opcode op = (Opcode)opcode; + Type messageType = this.network.Entity.GetComponent().GetType(op); object message = this.network.MessagePacker.DeserializeFrom(messageType, messageBytes, offset, messageBytes.Length - offset); //Log.Debug($"recv: {MongoHelper.ToJson(message)}"); @@ -117,7 +118,7 @@ namespace Model return; } - this.network.MessageDispatcher.Dispatch(this, opcode, offset, messageBytes, (AMessage)message); + this.network.MessageDispatcher.Dispatch(this, op, offset, messageBytes, (AMessage)message); } /// @@ -207,8 +208,8 @@ namespace Model private void SendMessage(object message) { //Log.Debug($"send: {MongoHelper.ToJson(message)}"); - ushort opcode = this.network.Entity.GetComponent().GetOpcode(message.GetType()); - + Opcode opcode = this.network.Entity.GetComponent().GetOpcode(message.GetType()); + ushort op = (ushort)opcode; byte[] messageBytes = this.network.MessagePacker.SerializeToByteArray(message); if (messageBytes.Length > 100) { @@ -216,11 +217,11 @@ namespace Model if (newMessageBytes.Length < messageBytes.Length) { messageBytes = newMessageBytes; - opcode |= 0x8000; + op |= 0x8000; } } - byte[] opcodeBytes = BitConverter.GetBytes(opcode); + byte[] opcodeBytes = BitConverter.GetBytes(op); this.byteses[0] = opcodeBytes; this.byteses[1] = messageBytes; diff --git a/Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs b/Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs index 7cc730ae..c2c829f5 100644 --- a/Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs +++ b/Unity/Assets/Scripts/Handler/Actor_CreateUnitsHandler.cs @@ -2,7 +2,7 @@ namespace Model { - [MessageHandler(Opcode.Actor_CreateUnits)] + [MessageHandler((int)Opcode.Actor_CreateUnits)] public class Actor_CreateUnitsHandler : AMHandler { protected override void Run(Actor_CreateUnits message) diff --git a/Unity/Assets/Scripts/Handler/Actor_TestHandler.cs b/Unity/Assets/Scripts/Handler/Actor_TestHandler.cs index 1b39670d..dfc78b12 100644 --- a/Unity/Assets/Scripts/Handler/Actor_TestHandler.cs +++ b/Unity/Assets/Scripts/Handler/Actor_TestHandler.cs @@ -1,6 +1,6 @@ namespace Model { - [MessageHandler(Opcode.Actor_Test)] + [MessageHandler((int)Opcode.Actor_Test)] public class Actor_TestHandler : AMHandler { protected override void Run(Actor_Test message) diff --git a/Unity/Assets/Scripts/Handler/Frame_ClickMapHandler.cs b/Unity/Assets/Scripts/Handler/Frame_ClickMapHandler.cs index ecb752f5..4df14301 100644 --- a/Unity/Assets/Scripts/Handler/Frame_ClickMapHandler.cs +++ b/Unity/Assets/Scripts/Handler/Frame_ClickMapHandler.cs @@ -2,7 +2,7 @@ namespace Model { - [MessageHandler(Opcode.Frame_ClickMap)] + [MessageHandler((int)Opcode.Frame_ClickMap)] public class Frame_ClickMapHandler : AMHandler { protected override void Run(Frame_ClickMap message) -- GitLab