Forráskód Böngészése

客户端消息兼容IL层

tanghai 9 éve
szülő
commit
36218ecfd7
28 módosított fájl, 579 hozzáadás és 399 törlés
  1. 227 0
      Server/Model/Component/EventComponent.cs
  2. 134 0
      Server/Model/Component/MessageDispatherComponent.cs
  3. 1 1
      Server/Model/Helper/DllHelper.cs
  4. 68 0
      Server/Model/Message/AMHandler.cs
  5. 10 0
      Server/Model/Message/IMHandler.cs
  6. 14 0
      Server/Model/Message/MessageHandlerAttribute.cs
  7. 7 14
      Server/Model/Server.Model.csproj
  8. 23 171
      Unity/Assets/Scripts/Component/EventComponent.cs
  9. 2 2
      Unity/Assets/Scripts/Component/EventComponent.cs.meta
  10. 0 80
      Unity/Assets/Scripts/Component/ILEventComponent.cs
  11. 30 72
      Unity/Assets/Scripts/Component/MessageDispatherComponent.cs
  12. 1 1
      Unity/Assets/Scripts/Entity/Game.cs
  13. 1 1
      Unity/Assets/Scripts/Helper/DllHelper.cs
  14. 5 5
      Unity/Assets/Scripts/Helper/EventHelper.cs
  15. 0 25
      Unity/Assets/Scripts/Message/IMHandler.cs
  16. 3 3
      Unity/Assets/Scripts/Message/MessageHandlerAttribute.cs
  17. 27 0
      Unity/Assets/Scripts/Message/MessageInfo.cs
  18. 2 2
      Unity/Assets/Scripts/Message/MessageInfo.cs.meta
  19. 7 7
      Unity/Assets/Scripts/Object/EntityEventManager.cs
  20. 1 1
      Unity/Assets/Scripts/Other/IInstanceMethod.cs
  21. 2 2
      Unity/Assets/Scripts/Other/ILMethod.cs
  22. 2 2
      Unity/Assets/Scripts/Other/MonoMethod.cs
  23. 0 0
      Unity/Hotfix/UI/UILobby/Component/UILobbyComponentE.cs
  24. 0 0
      Unity/Hotfix/UI/UILobby/Event/InitSceneStart_CreateLobbyUI.cs
  25. 0 0
      Unity/Hotfix/UI/UILobby/Factory/UILobbyFactory.cs
  26. 0 0
      Unity/Hotfix/UI/UILobby/Factory/UILoginFactory.cs
  27. 6 3
      Unity/Hotfix/Unity.Hotfix.csproj
  28. 6 7
      Unity/Unity.csproj

+ 227 - 0
Server/Model/Component/EventComponent.cs

@@ -0,0 +1,227 @@
+using System;
+using System.Collections.Generic;
+using Base;
+
+namespace Model
+{
+	/// <summary>
+	/// 事件分发
+	/// </summary>
+	[EntityEvent(EntityEventId.EventComponent)]
+	public class EventComponent: Component
+	{
+		private Dictionary<int, List<object>> allEvents;
+
+		private void Awake()
+		{
+			this.Load();
+		}
+
+		private void Load()
+		{
+			this.allEvents = new Dictionary<int, List<object>>();
+
+			Type[] types = DllHelper.GetMonoTypes();
+			foreach (Type type in types)
+			{
+				object[] attrs = type.GetCustomAttributes(typeof (EventAttribute), false);
+
+				foreach (object attr in attrs)
+				{
+					EventAttribute aEventAttribute = (EventAttribute) attr;
+
+					object obj = Activator.CreateInstance(type);
+					if (!this.allEvents.ContainsKey(aEventAttribute.Type))
+					{
+						this.allEvents.Add(aEventAttribute.Type, new List<object>());
+					}
+					this.allEvents[aEventAttribute.Type].Add(obj);
+				}
+			}
+		}
+
+		public void Run(int type)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					IEvent iEvent = obj as IEvent;
+					if (iEvent == null)
+					{
+						throw new Exception($"event type: {type} is not IEvent");
+					}
+					iEvent.Run();
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A>(int type, A a)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A>;
+					if (iEvent == null)
+					{
+						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}>");
+					}
+					iEvent.Run(a);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A, B>(int type, A a, B b)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A, B>;
+					if (iEvent == null)
+					{
+						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}>");
+					}
+					iEvent.Run(a, b);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A, B, C>(int type, A a, B b, C c)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A, B, C>;
+					if (iEvent == null)
+					{
+						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}>");
+					}
+					iEvent.Run(a, b, c);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A, B, C, D>(int type, A a, B b, C c, D d)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A, B, C, D>;
+					if (iEvent == null)
+					{
+						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}>");
+					}
+					iEvent.Run(a, b, c, d);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A, B, C, D, E>(int type, A a, B b, C c, D d, E e)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A, B, C, D, E>;
+					if (iEvent == null)
+					{
+						throw new Exception(
+								$"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
+					}
+					iEvent.Run(a, b, c, d, e);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+
+		public void Run<A, B, C, D, E, F>(int type, A a, B b, C c, D d, E e, F f)
+		{
+			List<object> iEvents = null;
+			if (!this.allEvents.TryGetValue(type, out iEvents))
+			{
+				return;
+			}
+
+			foreach (object obj in iEvents)
+			{
+				try
+				{
+					var iEvent = obj as IEvent<A, B, C, D, E, F>;
+					if (iEvent == null)
+					{
+						throw new Exception(
+								$"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
+					}
+					iEvent.Run(a, b, c, d, e, f);
+				}
+				catch (Exception err)
+				{
+					Log.Error(err.ToString());
+				}
+			}
+		}
+	}
+}

+ 134 - 0
Server/Model/Component/MessageDispatherComponent.cs

@@ -0,0 +1,134 @@
+using System;
+using System.Collections.Generic;
+using Base;
+
+namespace Model
+{
+	/// <summary>
+	/// 消息分发组件
+	/// </summary>
+	[EntityEvent(EntityEventId.MessageDispatherComponent)]
+	public class MessageDispatherComponent : Component
+	{
+		private AppType AppType;
+		private Dictionary<ushort, List<IMHandler>> handlers;
+		private Dictionary<Type, MessageAttribute> messageOpcode { get; set; }
+		private Dictionary<ushort, Type> opcodeType { get; set; }
+
+		private void Awake(AppType appType)
+		{
+			this.AppType = appType;
+			this.Load();
+		}
+
+		private void Load()
+		{
+			this.handlers = new Dictionary<ushort, List<IMHandler>>();
+			this.messageOpcode = new Dictionary<Type, MessageAttribute>();
+			this.opcodeType = new Dictionary<ushort, Type>();
+			
+			Type[] types = DllHelper.GetMonoTypes();
+			foreach (Type type in types)
+			{
+				object[] attrs = type.GetCustomAttributes(typeof(MessageAttribute), false);
+				if (attrs.Length == 0)
+				{
+					continue;
+				}
+
+				MessageAttribute messageAttribute = (MessageAttribute)attrs[0];
+				this.messageOpcode[type] = messageAttribute;
+				this.opcodeType[messageAttribute.Opcode] = type;
+			}
+
+			foreach (Type type in types)
+			{
+				object[] attrs = type.GetCustomAttributes(typeof(MessageHandlerAttribute), false);
+				if (attrs.Length == 0)
+				{
+					continue;
+				}
+
+				MessageHandlerAttribute messageHandlerAttribute = (MessageHandlerAttribute)attrs[0];
+				if (!messageHandlerAttribute.Type.Is(this.AppType))
+				{
+					continue;
+				}
+
+				object obj = Activator.CreateInstance(type);
+
+				IMHandler imHandler = obj as IMHandler;
+				if (imHandler == null)
+				{
+					throw new Exception($"message handler not inherit AMEvent or AMRpcEvent abstract class: {obj.GetType().FullName}");
+				}
+
+				Type messageType = imHandler.GetMessageType();
+				ushort opcode = this.GetOpcode(messageType);
+				List<IMHandler> list;
+				if (!this.handlers.TryGetValue(opcode, out list))
+				{
+					list = new List<IMHandler>();
+					this.handlers.Add(opcode, list);
+				}
+				list.Add(imHandler);
+			}
+		}
+
+		public ushort GetOpcode(Type type)
+		{
+			MessageAttribute messageAttribute;
+			if (!this.messageOpcode.TryGetValue(type, out messageAttribute))
+			{
+				throw new Exception($"查找Opcode失败: {type.Name}");
+			}
+			return messageAttribute.Opcode;
+		}
+
+		public Type GetType(ushort opcode)
+		{
+			Type messageType;
+			if (!this.opcodeType.TryGetValue(opcode, out messageType))
+			{
+				throw new Exception($"查找Opcode Type失败: {opcode}");
+			}
+			return messageType;
+		}
+
+		public void Handle(Session session, MessageInfo messageInfo)
+		{
+			List<IMHandler> actions;
+			if (!this.handlers.TryGetValue(messageInfo.Opcode, out actions))
+			{
+				Log.Error($"消息 {messageInfo.Opcode} 没有处理");
+				return;
+			}
+
+			Type messageType = this.GetType(messageInfo.Opcode);
+			object message = MongoHelper.FromBson(messageType, messageInfo.MessageBytes, messageInfo.Offset, messageInfo.Count);
+			messageInfo.Message = message;
+
+			foreach (IMHandler ev in actions)
+			{
+				try
+				{
+					ev.Handle(session, messageInfo);
+				}
+				catch (Exception e)
+				{
+					Log.Error(e.ToString());
+				}
+			}
+		}
+
+		public override void Dispose()
+		{
+			if (this.Id == 0)
+			{
+				return;
+			}
+
+			base.Dispose();
+		}
+	}
+}

+ 1 - 1
Server/Model/Helper/DllHelper.cs

@@ -19,7 +19,7 @@ namespace Model
 			return assembly;
 		}
 
-		public static Type[] GetBaseTypes()
+		public static Type[] GetMonoTypes()
 		{
 			List<Type> types = new List<Type>();
 			foreach (Assembly assembly in Game.EntityEventManager.GetAssemblies())

+ 68 - 0
Server/Model/Message/AMHandler.cs

@@ -0,0 +1,68 @@
+using System;
+using Base;
+
+namespace Model
+{
+	public abstract class AMHandler<Message>: IMHandler where Message : AMessage
+	{
+		protected abstract void Run(Session session, Message message);
+
+		public void Handle(Session session, MessageInfo messageInfo)
+		{
+			Message message = messageInfo.Message as Message;
+			if (message == null)
+			{
+				Log.Error($"消息类型转换错误: {messageInfo.Message.GetType().Name} to {typeof (Message).Name}");
+			}
+			this.Run(session, message);
+		}
+
+		public Type GetMessageType()
+		{
+			return typeof (Message);
+		}
+	}
+
+	public abstract class AMRpcHandler<Request, Response>: IMHandler where Request : ARequest where Response : AResponse
+	{
+		protected static void ReplyError(Response response, Exception e, Action<Response> reply)
+		{
+			Log.Error(e.ToString());
+			response.Error = ErrorCode.ERR_RpcFail;
+			response.Message = e.ToString();
+			reply(response);
+		}
+
+		protected abstract void Run(Session session, Request message, Action<Response> reply);
+
+		public void Handle(Session session, MessageInfo messageInfo)
+		{
+			try
+			{
+				Request request = messageInfo.Message as Request;
+				if (request == null)
+				{
+					Log.Error($"消息类型转换错误: {messageInfo.Message.GetType().Name} to {typeof (Request).Name}");
+				}
+				this.Run(session, request, response =>
+				{
+					// 等回调回来,session可以已经断开了,所以需要判断session id是否为0
+					if (session.Id == 0)
+					{
+						return;
+					}
+					session.Reply(messageInfo.RpcId, response);
+				});
+			}
+			catch (Exception e)
+			{
+				throw new Exception($"解释消息失败: {messageInfo.Opcode}", e);
+			}
+		}
+
+		public Type GetMessageType()
+		{
+			return typeof (Request);
+		}
+	}
+}

+ 10 - 0
Server/Model/Message/IMHandler.cs

@@ -0,0 +1,10 @@
+using System;
+
+namespace Model
+{
+	public interface IMHandler
+	{
+		void Handle(Session session, MessageInfo messageInfo);
+		Type GetMessageType();
+	}
+}

+ 14 - 0
Server/Model/Message/MessageHandlerAttribute.cs

@@ -0,0 +1,14 @@
+using System;
+
+namespace Model
+{
+	public class MessageHandlerAttribute : Attribute
+	{
+		public AppType Type { get; }
+
+		public MessageHandlerAttribute(AppType appType)
+		{
+			this.Type = appType;
+		}
+	}
+}

+ 7 - 14
Server/Model/Server.Model.csproj

@@ -56,15 +56,9 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Component\Config\OuterConfig.cs">
       <Link>Component\Config\OuterConfig.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Component\EventComponent.cs">
-      <Link>Component\EventComponent.cs</Link>
-    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Component\KVComponent.cs">
       <Link>Component\KVComponent.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Component\MessageDispatherComponent.cs">
-      <Link>Component\MessageDispatherComponent.cs</Link>
-    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Component\NetInnerComponent.cs">
       <Link>Component\NetInnerComponent.cs</Link>
     </Compile>
@@ -143,23 +137,17 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Message\AMessage.cs">
       <Link>Message\AMessage.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Message\AMHandler.cs">
-      <Link>Message\AMHandler.cs</Link>
-    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Message\AppType.cs">
       <Link>Message\AppType.cs</Link>
     </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Message\ErrorCode.cs">
       <Link>Message\ErrorCode.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Message\IMHandler.cs">
-      <Link>Message\IMHandler.cs</Link>
-    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Message\MessageAttribute.cs">
       <Link>Message\MessageAttribute.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Message\MessageHandlerAttribute.cs">
-      <Link>Message\MessageHandlerAttribute.cs</Link>
+    <Compile Include="..\..\Unity\Assets\Scripts\Message\MessageInfo.cs">
+      <Link>Message\MessageInfo.cs</Link>
     </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Message\OpcodeHelper.cs">
       <Link>Message\OpcodeHelper.cs</Link>
@@ -203,6 +191,8 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Other\Options.cs">
       <Link>Other\Options.cs</Link>
     </Compile>
+    <Compile Include="Component\EventComponent.cs" />
+    <Compile Include="Component\MessageDispatherComponent.cs" />
     <Compile Include="Component\Unit\MasterComponent.cs" />
     <Compile Include="Component\Unit\LockComponent.cs" />
     <Compile Include="Component\AppManagerComponent.cs" />
@@ -212,6 +202,9 @@
     <Compile Include="Component\StartConfigComponent.cs" />
     <Compile Include="Config\ConfigHelper.cs" />
     <Compile Include="Helper\DllHelper.cs" />
+    <Compile Include="Message\AMHandler.cs" />
+    <Compile Include="Message\IMHandler.cs" />
+    <Compile Include="Message\MessageHandlerAttribute.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>

+ 23 - 171
Unity/Assets/Scripts/Component/EventComponent.cs

@@ -1,17 +1,16 @@
 using System;
 using System.Collections.Generic;
-using System.Reflection;
 using Base;
 
 namespace Model
 {
 	/// <summary>
-	/// 事件分发
+	/// 事件分发,可以将事件分发到IL和Mono层,因为是用反射实现的,所以性能较Server用的EventComponent要差
 	/// </summary>
 	[EntityEvent(EntityEventId.EventComponent)]
-	public class EventComponent: Component
+	public class EventComponent : Component
 	{
-		private Dictionary<int, List<object>> allEvents;
+		private Dictionary<int, List<IInstanceMethod>> allEvents;
 
 		private void Awake()
 		{
@@ -20,203 +19,56 @@ namespace Model
 
 		private void Load()
 		{
-			this.allEvents = new Dictionary<int, List<object>>();
+			this.allEvents = new Dictionary<int, List<IInstanceMethod>>();
 
-			Type[] types = DllHelper.GetBaseTypes();
+			Type[] types = DllHelper.GetMonoTypes();
 			foreach (Type type in types)
 			{
-				object[] attrs = type.GetCustomAttributes(typeof (EventAttribute), false);
+				object[] attrs = type.GetCustomAttributes(typeof(EventAttribute), false);
 
 				foreach (object attr in attrs)
 				{
-					EventAttribute aEventAttribute = (EventAttribute) attr;
-
-					object obj = Activator.CreateInstance(type);
+					EventAttribute aEventAttribute = (EventAttribute)attr;
+					IInstanceMethod method = new MonoInstanceMethod(type, "Run");
 					if (!this.allEvents.ContainsKey(aEventAttribute.Type))
 					{
-						this.allEvents.Add(aEventAttribute.Type, new List<object>());
-					}
-					this.allEvents[aEventAttribute.Type].Add(obj);
-				}
-			}
-		}
-
-		public void Run(int type)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (object obj in iEvents)
-			{
-				try
-				{
-					IEvent iEvent = obj as IEvent;
-					if (iEvent == null)
-					{
-						throw new Exception($"event type: {type} is not IEvent");
-					}
-					iEvent.Run();
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
-				}
-			}
-		}
-
-		public void Run<A>(int type, A a)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (object obj in iEvents)
-			{
-				try
-				{
-					var iEvent = obj as IEvent<A>;
-					if (iEvent == null)
-					{
-						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}>");
-					}
-					iEvent.Run(a);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
-				}
-			}
-		}
-
-		public void Run<A, B>(int type, A a, B b)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (object obj in iEvents)
-			{
-				try
-				{
-					var iEvent = obj as IEvent<A, B>;
-					if (iEvent == null)
-					{
-						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}>");
-					}
-					iEvent.Run(a, b);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
-				}
-			}
-		}
-
-		public void Run<A, B, C>(int type, A a, B b, C c)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (object obj in iEvents)
-			{
-				try
-				{
-					var iEvent = obj as IEvent<A, B, C>;
-					if (iEvent == null)
-					{
-						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}>");
-					}
-					iEvent.Run(a, b, c);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
-				}
-			}
-		}
-
-		public void Run<A, B, C, D>(int type, A a, B b, C c, D d)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (object obj in iEvents)
-			{
-				try
-				{
-					var iEvent = obj as IEvent<A, B, C, D>;
-					if (iEvent == null)
-					{
-						throw new Exception($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}>");
+						this.allEvents.Add(aEventAttribute.Type, new List<IInstanceMethod>());
 					}
-					iEvent.Run(a, b, c, d);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
+					this.allEvents[aEventAttribute.Type].Add(method);
 				}
 			}
-		}
 
-		public void Run<A, B, C, D, E>(int type, A a, B b, C c, D d, E e)
-		{
-			List<object> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
+			types = DllHelper.GetHotfixTypes();
+			foreach (Type type in types)
 			{
-				return;
-			}
+				object[] attrs = type.GetCustomAttributes(typeof(EventAttribute), false);
 
-			foreach (object obj in iEvents)
-			{
-				try
+				foreach (object attr in attrs)
 				{
-					var iEvent = obj as IEvent<A, B, C, D, E>;
-					if (iEvent == null)
+					EventAttribute aEventAttribute = (EventAttribute)attr;
+					IInstanceMethod method = new ILInstanceMethod(type, "Run");
+					if (!this.allEvents.ContainsKey(aEventAttribute.Type))
 					{
-						throw new Exception(
-								$"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
+						this.allEvents.Add(aEventAttribute.Type, new List<IInstanceMethod>());
 					}
-					iEvent.Run(a, b, c, d, e);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
+					this.allEvents[aEventAttribute.Type].Add(method);
 				}
 			}
 		}
 
-		public void Run<A, B, C, D, E, F>(int type, A a, B b, C c, D d, E e, F f)
+		public void Run(int type, params object[] param)
 		{
-			List<object> iEvents = null;
+			List<IInstanceMethod> iEvents = null;
 			if (!this.allEvents.TryGetValue(type, out iEvents))
 			{
 				return;
 			}
 
-			foreach (object obj in iEvents)
+			foreach (IInstanceMethod obj in iEvents)
 			{
 				try
 				{
-					var iEvent = obj as IEvent<A, B, C, D, E, F>;
-					if (iEvent == null)
-					{
-						throw new Exception(
-								$"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
-					}
-					iEvent.Run(a, b, c, d, e, f);
+					obj.Run(param);
 				}
 				catch (Exception err)
 				{

+ 2 - 2
Unity/Assets/Scripts/Component/EventComponent.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 2fda74f39a3e29e449d5891c8b62033b
-timeCreated: 1476550922
+guid: fdeabd62f7ad9414fa74891de319729f
+timeCreated: 1487297356
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 0 - 80
Unity/Assets/Scripts/Component/ILEventComponent.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Base;
-
-namespace Model
-{
-	/// <summary>
-	/// 事件分发,可以将事件分发到IL和Mono层,性能较EventComponent要差
-	/// </summary>
-	[EntityEvent(EntityEventId.ILEventComponent)]
-	public class ILEventComponent : Component
-	{
-		private Dictionary<int, List<IInstanceMethod>> allEvents;
-
-		private void Awake()
-		{
-			this.Load();
-		}
-
-		private void Load()
-		{
-			this.allEvents = new Dictionary<int, List<IInstanceMethod>>();
-
-			Type[] types = DllHelper.GetBaseTypes();
-			foreach (Type type in types)
-			{
-				object[] attrs = type.GetCustomAttributes(typeof(EventAttribute), false);
-
-				foreach (object attr in attrs)
-				{
-					EventAttribute aEventAttribute = (EventAttribute)attr;
-					IInstanceMethod method = new MonoInstanceMethod(type, "Run");
-					if (!this.allEvents.ContainsKey(aEventAttribute.Type))
-					{
-						this.allEvents.Add(aEventAttribute.Type, new List<IInstanceMethod>());
-					}
-					this.allEvents[aEventAttribute.Type].Add(method);
-				}
-			}
-
-			types = DllHelper.GetHotfixTypes();
-			foreach (Type type in types)
-			{
-				object[] attrs = type.GetCustomAttributes(typeof(EventAttribute), false);
-
-				foreach (object attr in attrs)
-				{
-					EventAttribute aEventAttribute = (EventAttribute)attr;
-					IInstanceMethod method = new ILInstanceMethod(type, "Run");
-					if (!this.allEvents.ContainsKey(aEventAttribute.Type))
-					{
-						this.allEvents.Add(aEventAttribute.Type, new List<IInstanceMethod>());
-					}
-					this.allEvents[aEventAttribute.Type].Add(method);
-				}
-			}
-		}
-
-		public void Run(int type, params object[] param)
-		{
-			List<IInstanceMethod> iEvents = null;
-			if (!this.allEvents.TryGetValue(type, out iEvents))
-			{
-				return;
-			}
-
-			foreach (IInstanceMethod obj in iEvents)
-			{
-				try
-				{
-					obj.Run(param);
-				}
-				catch (Exception err)
-				{
-					Log.Error(err.ToString());
-				}
-			}
-		}
-	}
-}

+ 30 - 72
Unity/Assets/Scripts/Component/MessageDispatherComponent.cs

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Reflection;
 using Base;
 
 namespace Model
@@ -12,9 +11,8 @@ namespace Model
 	public class MessageDispatherComponent: Component
 	{
 		private AppType AppType;
-		private Dictionary<ushort, List<IMHandler>> handlers;
-		private Dictionary<Type, MessageAttribute> messageOpcode { get; set; }
-		private Dictionary<ushort, Type> opcodeType { get; set; }
+		private Dictionary<ushort, List<IInstanceMethod>> handlers;
+		private DoubleMap<ushort, Type> opcodeTypes = new DoubleMap<ushort, Type>();
 
 		private void Awake(AppType appType)
 		{
@@ -24,105 +22,65 @@ namespace Model
 
 		private void Load()
 		{
-			this.handlers = new Dictionary<ushort, List<IMHandler>>();
-			this.messageOpcode = new Dictionary<Type, MessageAttribute>();
-			this.opcodeType = new Dictionary<ushort, Type>();
+			this.handlers = new Dictionary<ushort, List<IInstanceMethod>>();
+			this.opcodeTypes = new DoubleMap<ushort, Type>();
 
-			Assembly[] assemblies = Game.EntityEventManager.GetAssemblies();
-
-			foreach (Assembly assembly in assemblies)
+			Type[] monoTypes = DllHelper.GetMonoTypes();
+			foreach (Type monoType in monoTypes)
 			{
-				Type[] types = assembly.GetTypes();
-				foreach (Type type in types)
+				object[] attrs = monoType.GetCustomAttributes(typeof(MessageAttribute), false);
+				if (attrs.Length == 0)
 				{
-					object[] attrs = type.GetCustomAttributes(typeof (MessageAttribute), false);
-					if (attrs.Length == 0)
-					{
-						continue;
-					}
-
-					MessageAttribute messageAttribute = (MessageAttribute) attrs[0];
-					this.messageOpcode[type] = messageAttribute;
-					this.opcodeType[messageAttribute.Opcode] = type;
+					continue;
 				}
-			}
 
-			foreach (Assembly assembly in assemblies)
-			{
-				Type[] types = assembly.GetTypes();
-				foreach (Type type in types)
+				MessageAttribute messageAttribute = attrs[0] as MessageAttribute;
+				if (messageAttribute == null)
 				{
-					object[] attrs = type.GetCustomAttributes(typeof (MessageHandlerAttribute), false);
-					if (attrs.Length == 0)
-					{
-						continue;
-					}
-
-					MessageHandlerAttribute messageHandlerAttribute = (MessageHandlerAttribute) attrs[0];
-					if (!messageHandlerAttribute.Type.Is(this.AppType))
-					{
-						continue;
-					}
+					continue;
+				}
 
-					object obj = Activator.CreateInstance(type);
+				this.opcodeTypes.Add(messageAttribute.Opcode, monoType);
+			}
 
-					IMHandler imHandler = obj as IMHandler;
-					if (imHandler == null)
-					{
-						throw new Exception($"message handler not inherit AMEvent or AMRpcEvent abstract class: {obj.GetType().FullName}");
-					}
+			Type[] ilTypes = DllHelper.GetHotfixTypes();
+			foreach (Type type in ilTypes)
+			{
+				object[] attrs = type.GetCustomAttributes(typeof(MessageHandlerAttribute), false);
 
-					Type messageType = imHandler.GetMessageType();
-					ushort opcode = this.GetOpcode(messageType);
-					List<IMHandler> list;
-					if (!this.handlers.TryGetValue(opcode, out list))
-					{
-						list = new List<IMHandler>();
-						this.handlers.Add(opcode, list);
-					}
-					list.Add(imHandler);
+				MessageHandlerAttribute messageHandlerAttribute = (MessageHandlerAttribute)attrs[0];
+				IInstanceMethod method = new ILInstanceMethod(type, "Handle");
+				if (!this.handlers.ContainsKey(messageHandlerAttribute.Opcode))
+				{
+					this.handlers.Add(messageHandlerAttribute.Opcode, new List<IInstanceMethod>());
 				}
+				this.handlers[messageHandlerAttribute.Opcode].Add(method);
 			}
 		}
 
 		public ushort GetOpcode(Type type)
 		{
-			MessageAttribute messageAttribute;
-			if (!this.messageOpcode.TryGetValue(type, out messageAttribute))
-			{
-				throw new Exception($"查找Opcode失败: {type.Name}");
-			}
-			return messageAttribute.Opcode;
-		}
-
-		public Type GetType(ushort opcode)
-		{
-			Type messageType;
-			if (!this.opcodeType.TryGetValue(opcode, out messageType))
-			{
-				throw new Exception($"查找Opcode Type失败: {opcode}");
-			}
-			return messageType;
+			return this.opcodeTypes.GetKeyByValue(type);
 		}
 
 		public void Handle(Session session, MessageInfo messageInfo)
 		{
-			List<IMHandler> actions;
+			List<IInstanceMethod> actions;
 			if (!this.handlers.TryGetValue(messageInfo.Opcode, out actions))
 			{
 				Log.Error($"消息 {messageInfo.Opcode} 没有处理");
 				return;
 			}
 
-			Type messageType = this.GetType(messageInfo.Opcode);
+			Type messageType = this.opcodeTypes.GetValueByKey(messageInfo.Opcode);
 			object message = MongoHelper.FromBson(messageType, messageInfo.MessageBytes, messageInfo.Offset, messageInfo.Count);
 			messageInfo.Message = message;
 
-			foreach (IMHandler ev in actions)
+			foreach (IInstanceMethod ev in actions)
 			{
 				try
 				{
-					ev.Handle(session, messageInfo);
+					ev.Run(session, messageInfo);
 				}
 				catch (Exception e)
 				{

+ 1 - 1
Unity/Assets/Scripts/Entity/Game.cs

@@ -22,7 +22,7 @@ namespace Model
 #if SERVER
 					scene.AddComponent<EventComponent>();
 #else
-					scene.AddComponent<ILEventComponent>();
+					scene.AddComponent<EventComponent>();
 #endif
 					scene.AddComponent<TimerComponent>();
 				}

+ 1 - 1
Unity/Assets/Scripts/Helper/DllHelper.cs

@@ -7,7 +7,7 @@ namespace Model
 {
 	public static class DllHelper
 	{
-		public static Type[] GetBaseTypes()
+		public static Type[] GetMonoTypes()
 		{
 			List<Type> types = new List<Type>();
 			Assembly[] assemblies = Game.EntityEventManager.GetAssemblies();

+ 5 - 5
Unity/Assets/Scripts/Helper/EventHelper.cs

@@ -7,7 +7,7 @@
 #if SERVER
 			Game.Scene.GetComponent<EventComponent>().Run(eventId);
 #else
-			Game.Scene.GetComponent<ILEventComponent>().Run(eventId);
+			Game.Scene.GetComponent<EventComponent>().Run(eventId);
 #endif
 		}
 
@@ -16,7 +16,7 @@
 #if SERVER
 			Game.Scene.GetComponent<EventComponent>().Run(eventId, a);
 #else
-			Game.Scene.GetComponent<ILEventComponent>().Run(eventId, a);
+			Game.Scene.GetComponent<EventComponent>().Run(eventId, a);
 #endif
 		}
 
@@ -25,7 +25,7 @@
 #if SERVER
 			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b);
 #else
-			Game.Scene.GetComponent<ILEventComponent>().Run(eventId, a, b);
+			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b);
 #endif
 		}
 
@@ -34,7 +34,7 @@
 #if SERVER
 			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b, c);
 #else
-			Game.Scene.GetComponent<ILEventComponent>().Run(eventId, a, b, c);
+			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b, c);
 #endif
 		}
 
@@ -43,7 +43,7 @@
 #if SERVER
 			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b, c, d);
 #else
-			Game.Scene.GetComponent<ILEventComponent>().Run(eventId, a, b, c, d);
+			Game.Scene.GetComponent<EventComponent>().Run(eventId, a, b, c, d);
 #endif
 		}
 	}

+ 0 - 25
Unity/Assets/Scripts/Message/IMHandler.cs

@@ -2,31 +2,6 @@
 
 namespace Model
 {
-	public class MessageInfo
-	{
-		public ushort Opcode { get; }
-		public byte[] MessageBytes { get; }
-		public int Offset { get; }
-		public uint RpcId { get; }
-		public object Message { get; set; }
-
-		public MessageInfo(ushort opcode, byte[] messageBytes, int offset, uint rpcId)
-		{
-			this.Opcode = opcode;
-			this.MessageBytes = messageBytes;
-			this.Offset = offset;
-			this.RpcId = rpcId;
-		}
-
-		public int Count
-		{
-			get
-			{
-				return this.MessageBytes.Length - this.Offset;
-			}
-		}
-	}
-
 	public interface IMHandler
 	{
 		void Handle(Session session, MessageInfo messageInfo);

+ 3 - 3
Unity/Assets/Scripts/Message/MessageHandlerAttribute.cs

@@ -7,11 +7,11 @@ namespace Model
 	/// </summary>
 	public class MessageHandlerAttribute: Attribute
 	{
-		public AppType Type { get; }
+		public ushort Opcode { get; }
 
-		public MessageHandlerAttribute(AppType appType)
+		public MessageHandlerAttribute(ushort opcode)
 		{
-			this.Type = appType;
+			this.Opcode = opcode;
 		}
 	}
 }

+ 27 - 0
Unity/Assets/Scripts/Message/MessageInfo.cs

@@ -0,0 +1,27 @@
+namespace Model
+{
+	public class MessageInfo
+	{
+		public ushort Opcode { get; }
+		public byte[] MessageBytes { get; }
+		public int Offset { get; }
+		public uint RpcId { get; }
+		public object Message { get; set; }
+
+		public MessageInfo(ushort opcode, byte[] messageBytes, int offset, uint rpcId)
+		{
+			this.Opcode = opcode;
+			this.MessageBytes = messageBytes;
+			this.Offset = offset;
+			this.RpcId = rpcId;
+		}
+
+		public int Count
+		{
+			get
+			{
+				return this.MessageBytes.Length - this.Offset;
+			}
+		}
+	}
+}

+ 2 - 2
Unity/Assets/Scripts/Component/ILEventComponent.cs.meta → Unity/Assets/Scripts/Message/MessageInfo.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: fdeabd62f7ad9414fa74891de319729f
-timeCreated: 1487297356
+guid: 0b54864d3eb34ee4b90665941ecf5b87
+timeCreated: 1487561850
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2

+ 7 - 7
Unity/Assets/Scripts/Object/EntityEventManager.cs

@@ -30,9 +30,9 @@ namespace Model
 
 	public class EntityTypeInfo
 	{
-		private readonly Dictionary<EntityEventType, ICommonMethod> infos = new Dictionary<EntityEventType, ICommonMethod>();
+		private readonly Dictionary<EntityEventType, IStaticMethod> infos = new Dictionary<EntityEventType, IStaticMethod>();
 
-		public void Add(EntityEventType type, ICommonMethod methodInfo)
+		public void Add(EntityEventType type, IStaticMethod methodInfo)
 		{
 			try
 			{
@@ -44,9 +44,9 @@ namespace Model
 			}
 		}
 
-		public ICommonMethod Get(EntityEventType type)
+		public IStaticMethod Get(EntityEventType type)
 		{
-			ICommonMethod methodInfo;
+			IStaticMethod methodInfo;
 			this.infos.TryGetValue(type, out methodInfo);
 			return methodInfo;
 		}
@@ -105,7 +105,7 @@ namespace Model
 			this.eventInfo = new Dictionary<int, EntityTypeInfo>();
 			this.typeToEntityEventId = new Dictionary<Type, int>();
 
-			Type[] types = DllHelper.GetBaseTypes();
+			Type[] types = DllHelper.GetMonoTypes();
 			List<string> allEntityType = Enum.GetNames(typeof(EntityEventType)).ToList();
 			foreach (Type type in types)
 			{
@@ -144,7 +144,7 @@ namespace Model
 					}
 
 					EntityEventType t = EnumHelper.FromString<EntityEventType>(sn);
-					this.eventInfo[entityEventId].Add(t, new MonoCommonMethod(methodInfo));
+					this.eventInfo[entityEventId].Add(t, new MonoStaticMethod(methodInfo));
 				}
 			}
 
@@ -188,7 +188,7 @@ namespace Model
 					}
 
 					EntityEventType t = EnumHelper.FromString<EntityEventType>(sn);
-					this.eventInfo[entityEventId].Add(t, new ILCommonMethod(methodInfo, n));
+					this.eventInfo[entityEventId].Add(t, new ILStaticMethod(methodInfo, n));
 				}
 			}
 #endif

+ 1 - 1
Unity/Assets/Scripts/Other/IInstanceMethod.cs

@@ -6,7 +6,7 @@
 		public abstract void Run(params object[] param);
 	}
 
-	public abstract class ICommonMethod
+	public abstract class IStaticMethod
 	{
 		public string Name { get; protected set; }
 		public abstract void Run(object instance, params object[] param);

+ 2 - 2
Unity/Assets/Scripts/Other/ILMethod.cs

@@ -24,13 +24,13 @@ namespace Model
 		}
 	}
 
-	public class ILCommonMethod : ICommonMethod
+	public class ILStaticMethod : IStaticMethod
 	{
 		private readonly ILRuntime.Runtime.Enviorment.AppDomain appDomain;
 		private readonly IMethod method;
 		private readonly object[] param;
 
-		public ILCommonMethod(IMethod method, int paramsCount)
+		public ILStaticMethod(IMethod method, int paramsCount)
 		{
 			this.param = new object[paramsCount + 1];
 			this.Name = method.Name;

+ 2 - 2
Unity/Assets/Scripts/Other/MonoMethod.cs

@@ -21,11 +21,11 @@ namespace Model
 		}
 	}
 
-	public class MonoCommonMethod : ICommonMethod
+	public class MonoStaticMethod : IStaticMethod
 	{
 		private readonly MethodInfo methodInfo;
 
-		public MonoCommonMethod(MethodInfo methodInfo)
+		public MonoStaticMethod(MethodInfo methodInfo)
 		{
 			this.methodInfo = methodInfo;
 			this.Name = methodInfo.Name;

+ 0 - 0
Unity/Hotfix/UI/UILogin/Component/UILobbyComponentE.cs → Unity/Hotfix/UI/UILobby/Component/UILobbyComponentE.cs


+ 0 - 0
Unity/Hotfix/UI/UILogin/Event/InitSceneStart_CreateLobbyUI.cs → Unity/Hotfix/UI/UILobby/Event/InitSceneStart_CreateLobbyUI.cs


+ 0 - 0
Unity/Hotfix/UI/UILogin/Factory/UILobbyFactory.cs → Unity/Hotfix/UI/UILobby/Factory/UILobbyFactory.cs


+ 0 - 0
Unity/Hotfix/UI/UILogin/Factory/UILoginFactory.cs → Unity/Hotfix/UI/UILobby/Factory/UILoginFactory.cs


+ 6 - 3
Unity/Hotfix/Unity.Hotfix.csproj

@@ -56,10 +56,10 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Component\UnitComponentE.cs" />
-    <Compile Include="UI\UILogin\Component\UILobbyComponentE.cs" />
-    <Compile Include="UI\UILogin\Event\InitSceneStart_CreateLobbyUI.cs" />
+    <Compile Include="UI\UILobby\Component\UILobbyComponentE.cs" />
+    <Compile Include="UI\UILobby\Event\InitSceneStart_CreateLobbyUI.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="UI\UILogin\Factory\UILobbyFactory.cs" />
+    <Compile Include="UI\UILobby\Factory\UILobbyFactory.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Unity.csproj">
@@ -71,6 +71,9 @@
       <Name>Unity.Plugins</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Handler\" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
     <PostBuildEvent>echo FA | xcopy $(TargetName).dll $(SolutionDir)Assets\Res\Code\$(TargetName).dll.bytes

+ 6 - 7
Unity/Unity.csproj

@@ -384,9 +384,8 @@
     <Compile Include="Assets\Scripts\Component\Config\OuterConfig.cs" />
     <Compile Include="Assets\Scripts\Component\Config\RunServerConfig.cs" />
     <Compile Include="Assets\Scripts\Component\ConfigComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\EventComponent.cs" />
     <Compile Include="Assets\Scripts\Component\GameObjectComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\ILEventComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\EventComponent.cs" />
     <Compile Include="Assets\Scripts\Component\KVComponent.cs" />
     <Compile Include="Assets\Scripts\Component\MessageDispatherComponent.cs" />
     <Compile Include="Assets\Scripts\Component\NetInnerComponent.cs" />
@@ -396,8 +395,8 @@
     <Compile Include="Assets\Scripts\Component\RobotComponent.cs" />
     <Compile Include="Assets\Scripts\Component\TimeComponent.cs" />
     <Compile Include="Assets\Scripts\Component\TimerComponent.cs" />
-    <Compile Include="Assets\Scripts\Component\UIComponent.cs" />
     <Compile Include="Assets\Scripts\Component\UI\UILobbyComponent.cs" />
+    <Compile Include="Assets\Scripts\Component\UIComponent.cs" />
     <Compile Include="Assets\Scripts\Component\UnitComponent.cs" />
     <Compile Include="Assets\Scripts\Config\ACategory.cs" />
     <Compile Include="Assets\Scripts\Config\AConfig.cs" />
@@ -424,9 +423,9 @@
     <Compile Include="Assets\Scripts\Event\EventIdType.cs" />
     <Compile Include="Assets\Scripts\Event\IEvent.cs" />
     <Compile Include="Assets\Scripts\GameObjectHelper.cs" />
+    <Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\AssetBundleHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\DllHelper.cs" />
-    <Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\EventHelper.cs" />
     <Compile Include="Assets\Scripts\ILAdaptor\IAsyncStateMachineAdaptor.cs" />
     <Compile Include="Assets\Scripts\ILAdaptor\IUIFactoryAdaptor.cs" />
@@ -451,6 +450,7 @@
     <Compile Include="Assets\Scripts\Message\IMHandler.cs" />
     <Compile Include="Assets\Scripts\Message\MessageAttribute.cs" />
     <Compile Include="Assets\Scripts\Message\MessageHandlerAttribute.cs" />
+    <Compile Include="Assets\Scripts\Message\MessageInfo.cs" />
     <Compile Include="Assets\Scripts\Message\OpcodeHelper.cs" />
     <Compile Include="Assets\Scripts\Message\RpcException.cs" />
     <Compile Include="Assets\Scripts\Object\Component.cs" />
@@ -463,13 +463,13 @@
     <Compile Include="Assets\Scripts\Other\Define.cs" />
     <Compile Include="Assets\Scripts\Other\EntityEventId.cs" />
     <Compile Include="Assets\Scripts\Other\GameException.cs" />
-    <Compile Include="Assets\Scripts\Other\ILMethod.cs" />
-    <Compile Include="Assets\Scripts\Other\MonoMethod.cs" />
     <Compile Include="Assets\Scripts\Other\IInstanceMethod.cs" />
     <Compile Include="Assets\Scripts\Other\ILAdapterAttribute.cs" />
     <Compile Include="Assets\Scripts\Other\ILBindingAttribute.cs" />
+    <Compile Include="Assets\Scripts\Other\ILMethod.cs" />
     <Compile Include="Assets\Scripts\Other\IUIFactory.cs" />
     <Compile Include="Assets\Scripts\Other\LayerNames.cs" />
+    <Compile Include="Assets\Scripts\Other\MonoMethod.cs" />
     <Compile Include="Assets\Scripts\Other\Options.cs" />
     <Compile Include="Assets\Scripts\Other\UIFactoryAttribute.cs" />
     <Compile Include="Assets\Scripts\Other\UIType.cs" />
@@ -488,7 +488,6 @@
     <None Include="Assets\Plugins\Android\ShareSDK\res\values\ssdk_oks_strings.xml" />
     <None Include="Assets\Plugins\Android\ShareSDK\res\values\ssdk_strings.xml" />
   </ItemGroup>
-  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
 </Project>