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

1.session断开应该让rpc响应错误,否则Call将无法得到返回
2.ObjectEventAttribute.cs改成ObjectSystemAttribute
3.ErrorCode应该客户端服务端共享一个文件

tanghai 8 лет назад
Родитель
Сommit
42b9777df0
75 измененных файлов с 111 добавлено и 102 удалено
  1. 1 1
      Server/Hotfix/Module/Actor/ActorComponentSystem.cs
  2. 1 1
      Server/Hotfix/Module/Network/NetInnerComponentSystem.cs
  3. 1 1
      Server/Hotfix/Module/Network/NetOuterComponentSystem.cs
  4. 1 1
      Server/Hotfix/System/RealmGateAddressComponentSystem.cs
  5. 1 1
      Server/Hotfix/System/ServerFrameComponentSystem.cs
  6. 0 18
      Server/Model/Base/Message/ErrorCode.cs
  7. 1 1
      Server/Model/Base/Object/EventSystem.cs
  8. 1 1
      Server/Model/Component/AppManagerComponent.cs
  9. 1 1
      Server/Model/Component/BenchmarkComponent.cs
  10. 1 1
      Server/Model/Component/HttpComponent.cs
  11. 1 1
      Server/Model/Component/NumericComponent.cs
  12. 1 1
      Server/Model/Component/OpcodeTypeComponent.cs
  13. 1 1
      Server/Model/Component/OptionComponent.cs
  14. 1 1
      Server/Model/Component/PlayerComponent.cs
  15. 1 1
      Server/Model/Component/StartConfigComponent.cs
  16. 1 1
      Server/Model/Component/Unit/LockComponent.cs
  17. 1 1
      Server/Model/Component/Unit/UnitGateComponent.cs
  18. 1 1
      Server/Model/Entity/Player.cs
  19. 1 1
      Server/Model/Entity/Unit.cs
  20. 1 1
      Server/Model/Module/Actor/ActorManagerComponent.cs
  21. 1 1
      Server/Model/Module/Actor/ActorMessageDispatherComponent.cs
  22. 1 1
      Server/Model/Module/Actor/ActorProxy.cs
  23. 1 1
      Server/Model/Module/Actor/ActorProxyComponent.cs
  24. 1 1
      Server/Model/Module/DB/DBCacheComponent.cs
  25. 1 1
      Server/Model/Module/DB/DBComponent.cs
  26. 1 1
      Server/Model/Module/DB/DBProxyComponent.cs
  27. 1 1
      Server/Model/Module/DB/DBQueryBatchTask.cs
  28. 1 1
      Server/Model/Module/DB/DBQueryJsonTask.cs
  29. 1 1
      Server/Model/Module/DB/DBQueryTask.cs
  30. 1 1
      Server/Model/Module/DB/DBSaveBatchTask.cs
  31. 1 1
      Server/Model/Module/DB/DBSaveTask.cs
  32. 1 1
      Server/Model/Module/DB/DBTaskQueue.cs
  33. 1 1
      Server/Model/Module/Location/LocationProxyComponent.cs
  34. 1 1
      Server/Model/Module/Network/MessageDispatherComponent.cs
  35. 2 1
      Server/Model/Server.Model.csproj
  36. 1 1
      Unity/Assets/Editor/BehaviorTreeEditor/Component/BTNodeInfoComponent.cs
  37. 7 0
      Unity/Assets/Scripts/Base/Message/AMessage.cs
  38. 14 5
      Unity/Assets/Scripts/Base/Message/ErrorCode.cs
  39. 1 1
      Unity/Assets/Scripts/Base/Object/EventSystem.cs
  40. 1 1
      Unity/Assets/Scripts/Base/Object/ObjectSystemAttribute.cs
  41. 0 0
      Unity/Assets/Scripts/Base/Object/ObjectSystemAttribute.cs.meta
  42. 1 1
      Unity/Assets/Scripts/Component/AnimatorComponent.cs
  43. 1 1
      Unity/Assets/Scripts/Component/BehaviorTreeComponent.cs
  44. 1 1
      Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs
  45. 1 1
      Unity/Assets/Scripts/Component/CameraComponent.cs
  46. 1 1
      Unity/Assets/Scripts/Component/ClientFrameComponent.cs
  47. 1 1
      Unity/Assets/Scripts/Component/ConfigComponent.cs
  48. 1 1
      Unity/Assets/Scripts/Component/GlobalConfigComponent.cs
  49. 1 1
      Unity/Assets/Scripts/Component/MessageDispatherComponent.cs
  50. 1 1
      Unity/Assets/Scripts/Component/MoveComponent.cs
  51. 1 1
      Unity/Assets/Scripts/Component/NetOuterComponent.cs
  52. 1 1
      Unity/Assets/Scripts/Component/NumericComponent.cs
  53. 1 1
      Unity/Assets/Scripts/Component/NumericWatcherComponent.cs
  54. 1 1
      Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs
  55. 1 1
      Unity/Assets/Scripts/Component/OperaComponent.cs
  56. 1 1
      Unity/Assets/Scripts/Component/PlayerComponent.cs
  57. 1 1
      Unity/Assets/Scripts/Component/SessionComponent.cs
  58. 1 1
      Unity/Assets/Scripts/Component/TimerComponent.cs
  59. 1 1
      Unity/Assets/Scripts/Component/UIComponent.cs
  60. 1 1
      Unity/Assets/Scripts/Component/UnitComponent.cs
  61. 1 1
      Unity/Assets/Scripts/Entity/AssetsBundleLoaderAsync.cs
  62. 1 1
      Unity/Assets/Scripts/Entity/AssetsLoaderAsync.cs
  63. 12 5
      Unity/Assets/Scripts/Entity/Session.cs
  64. 1 1
      Unity/Assets/Scripts/Entity/UI.cs
  65. 1 1
      Unity/Assets/Scripts/Entity/Unit.cs
  66. 1 1
      Unity/Assets/Scripts/Entity/UnityWebRequestAsync.cs
  67. 1 1
      Unity/Assets/Scripts/Entity/WWWAsync.cs
  68. 1 1
      Unity/Assets/Scripts/Init.cs
  69. 1 1
      Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs
  70. 1 1
      Unity/Hotfix/Base/Object/EventSystem.cs
  71. 1 1
      Unity/Hotfix/Component/UIComponent.cs
  72. 1 1
      Unity/Hotfix/Entity/UI.cs
  73. 1 1
      Unity/Hotfix/UI/UILobby/Component/UILobbyComponent.cs
  74. 1 1
      Unity/Hotfix/UI/UILogin/Component/UILoginComponent.cs
  75. 8 5
      Unity/Unity.csproj

+ 1 - 1
Server/Hotfix/Module/Actor/ActorComponentSystem.cs

@@ -5,7 +5,7 @@ using Model;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ActorComponentSystem : ObjectSystem<ActorComponent>, IAwake, IAwake<IEntityActorHandler>, ILoad
 	{
 		public void Awake()

+ 1 - 1
Server/Hotfix/Module/Network/NetInnerComponentSystem.cs

@@ -3,7 +3,7 @@ using Model;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NetInnerComponentSystem : ObjectSystem<NetInnerComponent>, IAwake, IAwake<IPEndPoint>, IUpdate
 	{
 		public void Awake()

+ 1 - 1
Server/Hotfix/Module/Network/NetOuterComponentSystem.cs

@@ -3,7 +3,7 @@ using Model;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NetOuterComponentSystem : ObjectSystem<NetOuterComponent>, IAwake, IAwake<IPEndPoint>, IUpdate
 	{
 		public void Awake()

+ 1 - 1
Server/Hotfix/System/RealmGateAddressComponentSystem.cs

@@ -2,7 +2,7 @@
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class RealmGateAddressComponentSystem : ObjectSystem<RealmGateAddressComponent>, IStart
 	{
 		public void Start()

+ 1 - 1
Server/Hotfix/System/ServerFrameComponentSystem.cs

@@ -2,7 +2,7 @@
 
 namespace Hotfix
 {
-    [ObjectEvent]
+    [ObjectSystem]
     public class ServerFrameComponentSystem : ObjectSystem<ServerFrameComponent>, IAwake
     {
         public void Awake()

+ 0 - 18
Server/Model/Base/Message/ErrorCode.cs

@@ -1,18 +0,0 @@
-namespace Model
-{
-	public static class ErrorCode
-	{
-		public const int ERR_Success = 0;
-
-		public const int ERR_NotFoundActor = 1;
-
-		public const int ERR_RpcFail = 101;
-		public const int ERR_AccountOrPasswordError = 102;
-		public const int ERR_ConnectGateKeyError = 103;
-		public const int ERR_ReloadFail = 104;
-		public const int ERR_NotFoundUnit = 105;
-		public const int ERR_ActorLocationNotFound = 106;
-		public const int ERR_SessionActorError = 107;
-		public const int ERR_ActorError = 108;
-	}
-}

+ 1 - 1
Server/Model/Base/Object/EventSystem.cs

@@ -62,7 +62,7 @@ namespace Model
 			Type[] types = DllHelper.GetMonoTypes();
 			foreach (Type type in types)
 			{
-				object[] attrs = type.GetCustomAttributes(typeof(ObjectEventAttribute), false);
+				object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
 
 				if (attrs.Length == 0)
 				{

+ 1 - 1
Server/Model/Component/AppManagerComponent.cs

@@ -5,7 +5,7 @@ using System.Linq;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class AppManagerComponentSystem : ObjectSystem<AppManagerComponent>, IStart
 	{
 		public void Start()

+ 1 - 1
Server/Model/Component/BenchmarkComponent.cs

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class BenchmarkComponentSystem : ObjectSystem<BenchmarkComponent>, IAwake<IPEndPoint>
 	{
 		public void Awake(IPEndPoint ipEndPoint)

+ 1 - 1
Server/Model/Component/HttpComponent.cs

@@ -4,7 +4,7 @@ using System.Net;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class HttpComponentComponentSystem : ObjectSystem<HttpComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Component/NumericComponent.cs

@@ -4,7 +4,7 @@ using MongoDB.Bson.Serialization.Options;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NumericComponentSystem : ObjectSystem<NumericComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Component/OpcodeTypeComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class OpcodeTypeComponentSystem : ObjectSystem<OpcodeTypeComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Component/OptionComponent.cs

@@ -3,7 +3,7 @@ using CommandLine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class OptionComponentSystem : ObjectSystem<OptionComponent>, IAwake<string[]>
 	{
 		public void Awake(string[] args)

+ 1 - 1
Server/Model/Component/PlayerComponent.cs

@@ -3,7 +3,7 @@ using System.Linq;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class PlayerComponentSystem : ObjectSystem<PlayerComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Component/StartConfigComponent.cs

@@ -5,7 +5,7 @@ using System.Linq;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class StartConfigComponentSystem : ObjectSystem<StartConfigComponent>, IAwake<string, int>
 	{
 		public void Awake(string a, int b)

+ 1 - 1
Server/Model/Component/Unit/LockComponent.cs

@@ -12,7 +12,7 @@ namespace Model
 		Locked,
 	}
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class LockComponentSystem : ObjectSystem<LockComponent>, IAwake<IPEndPoint>
 	{
 		public void Awake(IPEndPoint a)

+ 1 - 1
Server/Model/Component/Unit/UnitGateComponent.cs

@@ -1,6 +1,6 @@
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UnitGateComponentSystem : ObjectSystem<UnitGateComponent>, IAwake<long>
 	{
 		public void Awake(long gateSessionId)

+ 1 - 1
Server/Model/Entity/Player.cs

@@ -1,6 +1,6 @@
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class PlayerSystem : ObjectSystem<Player>, IAwake<string>
 	{
 		public void Awake(string account)

+ 1 - 1
Server/Model/Entity/Unit.cs

@@ -9,7 +9,7 @@ namespace Model
 		Npc
 	}
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UnitSystem : ObjectSystem<Unit>, IAwake<UnitType>
 	{
 		public void Awake(UnitType unitType)

+ 1 - 1
Server/Model/Module/Actor/ActorManagerComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ActorManagerComponentSystem : ObjectSystem<ActorManagerComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/Actor/ActorMessageDispatherComponent.cs

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ActorMessageDispatherComponentSystem : ObjectSystem<ActorMessageDispatherComponent>, IStart, ILoad
 	{
 		public void Start()

+ 1 - 1
Server/Model/Module/Actor/ActorProxy.cs

@@ -76,7 +76,7 @@ namespace Model
 	}
 
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ActorProxySystem : ObjectSystem<ActorProxy>, IAwake, IStart
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/Actor/ActorProxyComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ActorProxyComponentSystem : ObjectSystem<ActorProxyComponent>, IStart
 	{
 		// 每10s扫描一次过期的actorproxy进行回收,过期时间是1分钟

+ 1 - 1
Server/Model/Module/DB/DBCacheComponent.cs

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbCacheComponentSystem : ObjectSystem<DBCacheComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/DB/DBComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbComponentSystem : ObjectSystem<DBComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/DB/DBProxyComponent.cs

@@ -5,7 +5,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbProxyComponentSystem : ObjectSystem<DBProxyComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/DB/DBQueryBatchTask.cs

@@ -6,7 +6,7 @@ using MongoDB.Driver;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbQueryBatchTaskSystem : ObjectSystem<DBQueryBatchTask>, IAwake<List<long>, string, TaskCompletionSource<List<Disposer>>>
 	{
 		public void Awake(List<long> idList, string collectionName, TaskCompletionSource<List<Disposer>> tcs)

+ 1 - 1
Server/Model/Module/DB/DBQueryJsonTask.cs

@@ -5,7 +5,7 @@ using MongoDB.Driver;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbQueryJsonTaskSystem : ObjectSystem<DBQueryJsonTask>, IAwake<string, string, TaskCompletionSource<List<Disposer>>>
 	{
 		public void Awake(string collectionName, string json, TaskCompletionSource<List<Disposer>> tcs)

+ 1 - 1
Server/Model/Module/DB/DBQueryTask.cs

@@ -4,7 +4,7 @@ using MongoDB.Driver;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbQueryTaskSystem : ObjectSystem<DBQueryTask>, IAwake<string, TaskCompletionSource<Disposer>>
 	{
 		public void Awake(string collectionName, TaskCompletionSource<Disposer> tcs)

+ 1 - 1
Server/Model/Module/DB/DBSaveBatchTask.cs

@@ -6,7 +6,7 @@ using MongoDB.Driver;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbSaveBatchTaskSystem : ObjectSystem<DBSaveBatchTask>, IAwake<List<Entity>, string, TaskCompletionSource<bool>>
 	{
 		public void Awake(List<Entity> entitys, string collectionName, TaskCompletionSource<bool> tcs)

+ 1 - 1
Server/Model/Module/DB/DBSaveTask.cs

@@ -5,7 +5,7 @@ using MongoDB.Driver;
 namespace Model
 {
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbSaveTaskSystem : ObjectSystem<DBSaveTask>, IAwake<Disposer, string, TaskCompletionSource<bool>>
 	{
 		public void Awake(Disposer entity, string collectionName, TaskCompletionSource<bool> tcs)

+ 1 - 1
Server/Model/Module/DB/DBTaskQueue.cs

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class DbTaskQueueSystem : ObjectSystem<DBTaskQueue>, IAwake, IStart
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/Location/LocationProxyComponent.cs

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class LocationProxyComponentSystem : ObjectSystem<LocationProxyComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Server/Model/Module/Network/MessageDispatherComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class MessageDispatherComponentSystem : ObjectSystem<MessageDispatherComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 2 - 1
Server/Model/Server.Model.csproj

@@ -39,6 +39,7 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\AActorMessage.cs" Link="Base\Message\AActorMessage.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\AMessage.cs" Link="Base\Message\AMessage.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\AppType.cs" Link="Other\AppType.cs" />
+    <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\ErrorCode.cs" Link="Base\Message\ErrorCode.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\IMessageDispatcher.cs" Link="Module\Network\IMessageDispatcher.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\IMessagePacker.cs" Link="Module\Network\IMessagePacker.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Message\MessageInfo.cs" Link="Base\Message\MessageInfo.cs" />
@@ -68,8 +69,8 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\IStart.cs" Link="Base\Object\IStart.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\IUpdate.cs" Link="Base\Object\IUpdate.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\Object.cs" Link="Base\Object\Object.cs" />
-    <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectEventAttribute.cs" Link="Base\Object\ObjectEventAttribute.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectPool.cs" Link="Base\Object\ObjectPool.cs" />
+    <Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectSystemAttribute.cs" Link="Base\Object\ObjectSystemAttribute.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\QueueDictionary.cs" Link="Base\QueueDictionary.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Base\TryLocker.cs" Link="Base\TryLocker.cs" />
     <Compile Include="..\..\Unity\Assets\Scripts\Component\ConfigComponent.cs" Link="Component\ConfigComponent.cs" />

+ 1 - 1
Unity/Assets/Editor/BehaviorTreeEditor/Component/BTNodeInfoComponent.cs

@@ -4,7 +4,7 @@ using Model;
 
 namespace MyEditor
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class BtNodeInfoComponentSystem : ObjectSystem<BTNodeInfoComponent>, IAwake
 	{
 		public void Awake()

+ 7 - 0
Unity/Assets/Scripts/Base/Message/AMessage.cs

@@ -30,6 +30,7 @@ namespace Model
 	/// </summary>
 	[ProtoContract]
 	[BsonKnownTypes(typeof(AActorResponse))]
+	[BsonKnownTypes(typeof(ErrorResponse))]
 	public abstract partial class AResponse : AMessage
 	{
 		[ProtoMember(90)]
@@ -41,4 +42,10 @@ namespace Model
 		[ProtoMember(92)]
 		public string Message = "";
 	}
+
+	[ProtoContract]
+	public class ErrorResponse: AResponse
+	{
+		
+	}
 }

+ 14 - 5
Unity/Assets/Scripts/Base/Message/ErrorCode.cs

@@ -2,11 +2,20 @@ namespace Model
 {
 	public static class ErrorCode
 	{
+		// 움솥코꼬댄轎
 		public const int ERR_Success = 0;
-		public const int ERR_RpcFail = 1;
-		public const int ERR_AccountOrPasswordError = 2;
-		public const int ERR_ConnectGateKeyError = 3;
-		public const int ERR_ReloadFail = 4;
-		public const int ERR_NotFoundUnit = 5;
+		public const int ERR_NotFoundActor = 2;
+
+		public const int ERR_RpcFail = 101;
+		public const int ERR_SocketDisconnected = 102;
+		public const int ERR_ReloadFail = 103;
+		public const int ERR_ActorLocationNotFound = 104;
+
+		// 쭉서宮밑댄轎
+		public const int ERR_AccountOrPasswordError = 202;
+		public const int ERR_ConnectGateKeyError = 203;
+		public const int ERR_NotFoundUnit = 204;
+		public const int ERR_SessionActorError = 207;
+		
 	}
 }

+ 1 - 1
Unity/Assets/Scripts/Base/Object/EventSystem.cs

@@ -93,7 +93,7 @@ namespace Model
 			Type[] types = DllHelper.GetMonoTypes();
 			foreach (Type type in types)
 			{
-				object[] attrs = type.GetCustomAttributes(typeof(ObjectEventAttribute), false);
+				object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
 
 				if (attrs.Length == 0)
 				{

+ 1 - 1
Unity/Assets/Scripts/Base/Object/ObjectEventAttribute.cs → Unity/Assets/Scripts/Base/Object/ObjectSystemAttribute.cs

@@ -3,7 +3,7 @@
 namespace Model
 {
 	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-	public class ObjectEventAttribute: Attribute
+	public class ObjectSystemAttribute: Attribute
 	{
 	}
 }

+ 0 - 0
Unity/Assets/Scripts/Base/Object/ObjectEventAttribute.cs.meta → Unity/Assets/Scripts/Base/Object/ObjectSystemAttribute.cs.meta


+ 1 - 1
Unity/Assets/Scripts/Component/AnimatorComponent.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class AnimatorComponentSystem : ObjectSystem<AnimatorComponent>, IAwake, IUpdate
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/BehaviorTreeComponent.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class BehaviorTreeComponentSystem : ObjectSystem<BehaviorTreeComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiBundleDownloaderComponentSystem : ObjectSystem<BundleDownloaderComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/CameraComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class CameraComponentSystem : ObjectSystem<CameraComponent>, IAwake, ILateUpdate
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/ClientFrameComponent.cs

@@ -8,7 +8,7 @@ namespace Model
         public FrameMessage FrameMessage;
     }
     
-    [ObjectEvent]
+    [ObjectSystem]
     public class ClientFrameComponentSystem : ObjectSystem<ClientFrameComponent>, IStart
     {
         public void Start()

+ 1 - 1
Unity/Assets/Scripts/Component/ConfigComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class ConfigComponentSystem : ObjectSystem<ConfigComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/GlobalConfigComponent.cs

@@ -1,6 +1,6 @@
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class GlobalConfigComponentSystem : ObjectSystem<GlobalConfigComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/MessageDispatherComponent.cs

@@ -53,7 +53,7 @@ namespace Model
 	}
 
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class MessageDispatherComponentSystem : ObjectSystem<MessageDispatherComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/MoveComponent.cs

@@ -3,7 +3,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class MoveComponentSystem : ObjectSystem<MoveComponent>, IAwake, IUpdate
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/NetOuterComponent.cs

@@ -1,6 +1,6 @@
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NetOuterComponentSystem : ObjectSystem<NetOuterComponent>, IAwake, IUpdate
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/NumericComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NumericComponentSystem : ObjectSystem<NumericComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/NumericWatcherComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class NumericWatcherComponentSystem : ObjectSystem<NumericWatcherComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/OpcodeTypeComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class OpcodeTypeComponentSystem : ObjectSystem<OpcodeTypeComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/OperaComponent.cs

@@ -2,7 +2,7 @@
 
 namespace Model
 {
-    [ObjectEvent]
+    [ObjectSystem]
     public class OperaComponentSystem : ObjectSystem<OperaComponent>, IUpdate, IAwake
     {
         public void Update()

+ 1 - 1
Unity/Assets/Scripts/Component/PlayerComponent.cs

@@ -3,7 +3,7 @@ using System.Linq;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class PlayerComponentSystem : ObjectSystem<PlayerComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/SessionComponent.cs

@@ -1,6 +1,6 @@
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class SessionComponentSystem : ObjectSystem<SessionComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/TimerComponent.cs

@@ -11,7 +11,7 @@ namespace Model
 		public TaskCompletionSource<bool> tcs;
 	}
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class TimerComponentSystem : ObjectSystem<TimerComponent>, IUpdate
 	{
 		public void Update()

+ 1 - 1
Unity/Assets/Scripts/Component/UIComponent.cs

@@ -5,7 +5,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiComponentSystem : ObjectSystem<UIComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Assets/Scripts/Component/UnitComponent.cs

@@ -3,7 +3,7 @@ using System.Linq;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UnitComponentSystem : ObjectSystem<UnitComponent>, IAwake
 	{
 		public void Awake()

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

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class AssetsBundleLoaderAsyncSystem : ObjectSystem<AssetsBundleLoaderAsync>, IUpdate
 	{
 		public void Update()

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

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class AssetsLoaderAsyncSystem : ObjectSystem<AssetsLoaderAsync>, IUpdate, IAwake<AssetBundle>
 	{
 		public void Awake(AssetBundle assetBundle)

+ 12 - 5
Unity/Assets/Scripts/Entity/Session.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class SessionSystem : ObjectSystem<Session>, IAwake<NetworkComponent, AChannel>, IStart
 	{
 		public void Awake(NetworkComponent network, AChannel channel)
@@ -52,6 +52,11 @@ namespace Model
 
 			base.Dispose();
 
+			foreach (KeyValuePair<uint, Action<object>> keyValuePair in this.requestCallback)
+			{
+				keyValuePair.Value.Invoke(new ErrorResponse() { Error = ErrorCode.ERR_SocketDisconnected });
+			}
+
 			this.channel.Dispose();
 			this.network.Remove(id);
 			this.requestCallback.Clear();
@@ -232,14 +237,15 @@ namespace Model
 			{
 				try
 				{
-					Response response = (Response)message;
+					AResponse response = (AResponse)message;
 					if (response.Error > 100)
 					{
 						tcs.SetException(new RpcException(response.Error, response.Message));
 						return;
 					}
+
 					//Log.Debug($"recv: {MongoHelper.ToJson(response)}");
-					tcs.SetResult(response);
+					tcs.SetResult((Response)response);
 				}
 				catch (Exception e)
 				{
@@ -266,14 +272,15 @@ namespace Model
 			{
 				try
 				{
-					Response response = (Response)message;
+					AResponse response = (AResponse)message;
 					if (response.Error > 100)
 					{
 						tcs.SetException(new RpcException(response.Error, response.Message));
 						return;
 					}
+
 					//Log.Debug($"recv: {MongoHelper.ToJson(response)}");
-					tcs.SetResult(response);
+					tcs.SetResult((Response)response);
 				}
 				catch (Exception e)
 				{

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

@@ -3,7 +3,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiSystem : ObjectSystem<UI>, IAwake<Scene, UI, GameObject>
 	{
 		public void Awake(Scene scene, UI parent, GameObject gameObject)

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

@@ -8,7 +8,7 @@ namespace Model
 		Npc
 	}
 
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UnitSystem : ObjectSystem<Unit>
 	{
 	}

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

@@ -6,7 +6,7 @@ using UnityEngine.Networking;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UnityWebRequestSystem : ObjectSystem<UnityWebRequestAsync>, IUpdate
 	{
 		public void Update()

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

@@ -5,7 +5,7 @@ using UnityEngine;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class WwwAsyncSystem : ObjectSystem<WWWAsync>, IUpdate
 	{
 		public void Update()

+ 1 - 1
Unity/Assets/Scripts/Init.cs

@@ -28,7 +28,7 @@ namespace Model
 			{
 				if (Application.unityVersion != "2017.1.0p5")
 				{
-					Log.Error("请使用Unity2017.1.0p5版本");
+					Log.Warning($"当前版本:{Application.unityVersion}, 最好使用运行指南推荐版本!");
 				}
 
 				DontDestroyOnLoad(gameObject);

+ 1 - 1
Unity/Assets/Scripts/UI/UILoading/Component/UILoadingComponent.cs

@@ -3,7 +3,7 @@ using UnityEngine.UI;
 
 namespace Model
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiLoadingComponentSystem : ObjectSystem<UILoadingComponent>, IAwake, IStart
 	{
 		public void Awake()

+ 1 - 1
Unity/Hotfix/Base/Object/EventSystem.cs

@@ -52,7 +52,7 @@ namespace Hotfix
 			Type[] types = DllHelper.GetHotfixTypes();
 			foreach (Type type in types)
 			{
-				object[] attrs = type.GetCustomAttributes(typeof(ObjectEventAttribute), false);
+				object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
 
 				if (attrs.Length == 0)
 				{

+ 1 - 1
Unity/Hotfix/Component/UIComponent.cs

@@ -6,7 +6,7 @@ using UnityEngine;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiComponentSystem : ObjectSystem<UIComponent>, IAwake, ILoad
 	{
 		public void Awake()

+ 1 - 1
Unity/Hotfix/Entity/UI.cs

@@ -3,7 +3,7 @@ using UnityEngine;
 
 namespace Hotfix
 {
-	[Model.ObjectEvent]
+	[Model.ObjectSystem]
 	public class UiSystem : ObjectSystem<UI>, IAwake<Scene, UI, GameObject>
 	{
 		public void Awake(Scene scene, UI parent, GameObject gameObject)

+ 1 - 1
Unity/Hotfix/UI/UILobby/Component/UILobbyComponent.cs

@@ -5,7 +5,7 @@ using UnityEngine.UI;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiLobbyComponentSystem : ObjectSystem<UILobbyComponent>, IAwake
 	{
 		public void Awake()

+ 1 - 1
Unity/Hotfix/UI/UILogin/Component/UILoginComponent.cs

@@ -6,7 +6,7 @@ using UnityEngine.UI;
 
 namespace Hotfix
 {
-	[ObjectEvent]
+	[ObjectSystem]
 	public class UiLoginComponentSystem : ObjectSystem<UILoginComponent>, IAwake
 	{
 		public void Awake()

+ 8 - 5
Unity/Unity.csproj

@@ -12,12 +12,15 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile></TargetFrameworkProfile>
-    <CompilerResponseFile></CompilerResponseFile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <CompilerResponseFile>
+    </CompilerResponseFile>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
     <UnityVersion>2017.1.1p4</UnityVersion>
-    <RootNamespace></RootNamespace>
+    <RootNamespace>
+    </RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup>
@@ -254,7 +257,7 @@
     <Compile Include="Assets\Scripts\Base\Object\IStart.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IUpdate.cs" />
     <Compile Include="Assets\Scripts\Base\Object\Object.cs" />
-    <Compile Include="Assets\Scripts\Base\Object\ObjectEventAttribute.cs" />
+    <Compile Include="Assets\Scripts\Base\Object\ObjectSystemAttribute.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ObjectPool.cs" />
     <Compile Include="Assets\Scripts\Base\QueueDictionary.cs" />
     <Compile Include="Assets\Scripts\Base\TryLocker.cs" />
@@ -579,4 +582,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>