tanghai 9 лет назад
Родитель
Сommit
98d57911e8

+ 1 - 0
.gitignore

@@ -34,3 +34,4 @@ _ReSharper.CSharp/
 /Unity/CSharp60Support/compilation log.txt
 /CSharp/CSharp.VC.opendb
 /Server/Server.VC.opendb
+/Log

+ 3 - 3
Server/App/Program.cs

@@ -16,7 +16,7 @@ namespace App
 				Log.Info("server start........................");
 
 				Object.ObjectManager.Register("Base", typeof(Game).Assembly);
-				Object.ObjectManager.Register("Model", typeof(Opcode).Assembly);
+				Object.ObjectManager.Register("Model", typeof(ErrorCode).Assembly);
 				byte[] dllBytes = File.ReadAllBytes("./Controller.dll");
 				byte[] pdbBytes = File.ReadAllBytes("./Controller.pdb");
 				Assembly controller = Assembly.Load(dllBytes, pdbBytes);
@@ -32,9 +32,9 @@ namespace App
 				// 根据不同的AppType添加不同的组件
 				switch (options.AppType)
 				{
-					case "realm":
+					case "Realm":
 						break;
-					case "gate":
+					case "Gate":
 						break;
 					default:
 						throw new Exception($"命令行参数没有设置正确的AppType: {options.AppType}");

+ 3 - 0
Server/Base/Server.Base.csproj

@@ -131,6 +131,9 @@
     <Compile Include="..\..\Unity\Assets\Plugins\Base\Message\MessageAttribute.cs">
       <Link>Message\MessageAttribute.cs</Link>
     </Compile>
+    <Compile Include="..\..\Unity\Assets\Plugins\Base\Message\OpcodeAttribute.cs">
+      <Link>Message\OpcodeAttribute.cs</Link>
+    </Compile>
     <Compile Include="..\..\Unity\Assets\Plugins\Base\Message\RpcException.cs">
       <Link>Message\RpcException.cs</Link>
     </Compile>

+ 3 - 3
Server/Controller/C2S_LoginEvent.cs

@@ -3,13 +3,13 @@ using Model;
 
 namespace Controller
 {
-	[Message(AppType.Realm, Opcode.S2C_InitBuffInfo)]
+	[Message(AppType.Realm)]
 	public class C2S_LoginEvent: AMEvent<C2S_Login>
 	{
-		public override void Run(Entity scene, C2S_Login message)
+		public override void Run(Entity scene, C2S_Login message, uint rpcId)
 		{
 			Log.Info(MongoHelper.ToJson(message));
-			scene.GetComponent<MessageComponent>().Send(new S2C_Login {ErrorMessage = new ErrorMessage() });
+			scene.GetComponent<MessageComponent>().Send(rpcId, new S2C_Login {ErrorMessage = new ErrorMessage() });
 		}
 	}
 }

+ 0 - 3
Server/Model/Server.Model.csproj

@@ -68,9 +68,6 @@
     <Compile Include="..\..\Unity\Assets\Scripts\Message\Message.cs">
       <Link>Message\Message.cs</Link>
     </Compile>
-    <Compile Include="..\..\Unity\Assets\Scripts\Message\Opcode.cs">
-      <Link>Message\Opcode.cs</Link>
-    </Compile>
     <Compile Include="..\..\Unity\Assets\Scripts\Message\OpcodeHelper.cs">
       <Link>Message\OpcodeHelper.cs</Link>
     </Compile>

+ 0 - 9
Unity/Assets/Plugins/Base/Component.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: d558fe8e3a6cad64c82e41a65bb3826f
-folderAsset: yes
-timeCreated: 1476427109
-licenseType: Pro
-DefaultImporter:
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
Unity/Assets/Resources/Code.prefab