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

1.移除第三方库目录,所有库都放到platform目录下面
2.增加realm server准备试用WCF

tanghai 13 лет назад
Родитель
Сommit
a8cba2e996
41 измененных файлов с 327 добавлено и 42 удалено
  1. 4 4
      CSharp/App/Modules/Robot/Robot.csproj
  2. 69 37
      CSharp/CSharp.sln
  3. 10 0
      CSharp/Contract/RealmContract/ICalculator.cs
  4. 36 0
      CSharp/Contract/RealmContract/Properties/AssemblyInfo.cs
  5. 49 0
      CSharp/Contract/RealmContract/RealmContract.csproj
  6. 1 1
      CSharp/Platform/ENet/ENet.vcxproj
  7. 0 0
      CSharp/Platform/ENet/callbacks.c
  8. 0 0
      CSharp/Platform/ENet/callbacks.h
  9. 0 0
      CSharp/Platform/ENet/compress.c
  10. 0 0
      CSharp/Platform/ENet/enet.h
  11. 0 0
      CSharp/Platform/ENet/host.c
  12. 0 0
      CSharp/Platform/ENet/list.c
  13. 0 0
      CSharp/Platform/ENet/list.h
  14. 0 0
      CSharp/Platform/ENet/packet.c
  15. 0 0
      CSharp/Platform/ENet/peer.c
  16. 0 0
      CSharp/Platform/ENet/protocol.c
  17. 0 0
      CSharp/Platform/ENet/protocol.h
  18. 0 0
      CSharp/Platform/ENet/time.h
  19. 0 0
      CSharp/Platform/ENet/types.h
  20. 0 0
      CSharp/Platform/ENet/unix.c
  21. 0 0
      CSharp/Platform/ENet/unix.h
  22. 0 0
      CSharp/Platform/ENet/utility.h
  23. 0 0
      CSharp/Platform/ENet/win32.c
  24. 0 0
      CSharp/Platform/ENet/win32.h
  25. 0 0
      CSharp/Platform/ENetCS/Address.cs
  26. 0 0
      CSharp/Platform/ENetCS/ENetCS.csproj
  27. 0 0
      CSharp/Platform/ENetCS/ENetException.cs
  28. 0 0
      CSharp/Platform/ENetCS/Event.cs
  29. 0 0
      CSharp/Platform/ENetCS/Host.cs
  30. 0 0
      CSharp/Platform/ENetCS/Library.cs
  31. 0 0
      CSharp/Platform/ENetCS/NativeMethods.cs
  32. 0 0
      CSharp/Platform/ENetCS/NativeStructs.cs
  33. 0 0
      CSharp/Platform/ENetCS/Packages.config
  34. 0 0
      CSharp/Platform/ENetCS/Packet.cs
  35. 0 0
      CSharp/Platform/ENetCS/Peer.cs
  36. 0 0
      CSharp/Platform/ENetCS/PeerEvent.cs
  37. 0 0
      CSharp/Platform/ENetCS/PeersManager.cs
  38. 39 0
      CSharp/Server/Realm/App.config
  39. 12 0
      CSharp/Server/Realm/Calculator.cs
  40. 36 0
      CSharp/Server/Realm/Properties/AssemblyInfo.cs
  41. 71 0
      CSharp/Server/Realm/Realm.csproj

+ 4 - 4
CSharp/App/Modules/Robot/Robot.csproj

@@ -66,6 +66,10 @@
     </Page>
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\Platform\ENetCS\ENetCS.csproj">
+      <Project>{d0b4cfac-a368-4742-9863-68776cfa9938}</Project>
+      <Name>ENetCS</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\Platform\Helper\Helper.csproj">
       <Project>{24233cd5-a5df-484b-a482-b79cb7a0d9cb}</Project>
       <Name>Helper</Name>
@@ -74,10 +78,6 @@
       <Project>{72e16572-fc1f-4a9e-bc96-035417239298}</Project>
       <Name>Log</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\ThirdParty\ENetCS\ENetCS.csproj">
-      <Project>{d0b4cfac-a368-4742-9863-68776cfa9938}</Project>
-      <Name>ENetCS</Name>
-    </ProjectReference>
     <ProjectReference Include="..\..\Infrastructure\Infrastructure.csproj">
       <Project>{48a2e149-0dac-41b4-bb54-dfbccd6d42b3}</Project>
       <Name>Infrastructure</Name>

+ 69 - 37
CSharp/CSharp.sln

@@ -18,21 +18,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BehaviorTree", "App\Modules
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Editor", "App\Editor\Editor.csproj", "{C46F3337-0F48-4A72-84AD-8FDD1F159BB0}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ThirdParty", "ThirdParty", "{9173C593-D63F-49F6-AFA7-028425D13E4B}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robot", "App\Modules\Robot\Robot.csproj", "{5D6ECBCD-BE14-4DCB-BAEC-57089748B164}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ENet", "ThirdParty\ENet\ENet.vcxproj", "{C9992B7C-313E-4C9F-A954-640D01EDFB58}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hooks", "Platform\Hooks\Hooks.csproj", "{3A98B35C-DEA8-489C-9203-263FFB6B065D}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WaiGua", "App\Modules\WaiGua\WaiGua.csproj", "{5AA48F9A-455D-4CD8-A605-A3AC38283E60}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ENetCS", "ThirdParty\ENetCS\ENetCS.csproj", "{D0B4CFAC-A368-4742-9863-68776CFA9938}"
-	ProjectSection(ProjectDependencies) = postProject
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58} = {C9992B7C-313E-4C9F-A954-640D01EDFB58}
-	EndProjectSection
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "App\Infrastructure\Infrastructure.csproj", "{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Log", "Platform\Log\Log.csproj", "{72E16572-FC1F-4A9E-BC96-035417239298}"
@@ -43,6 +34,21 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtobufTool", "Tools\Proto
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helper", "Platform\Helper\Helper.csproj", "{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{4FF1FBF3-F552-4D3D-AD97-E29385069206}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contract", "Contract", "{01501C44-C95B-45B7-A898-76B4A7AC4EE8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realm", "Server\Realm\Realm.csproj", "{15B3E0D2-6217-493A-A690-158C497F5318}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealmContract", "Contract\RealmContract\RealmContract.csproj", "{E62B0633-1767-44A0-9479-C8E9D19DA4B8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ENet", "Platform\ENet\ENet.vcxproj", "{C9992B7C-313E-4C9F-A954-640D01EDFB58}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ENetCS", "Platform\ENetCS\ENetCS.csproj", "{D0B4CFAC-A368-4742-9863-68776CFA9938}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58} = {C9992B7C-313E-4C9F-A954-640D01EDFB58}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -93,20 +99,6 @@ Global
 		{5D6ECBCD-BE14-4DCB-BAEC-57089748B164}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{5D6ECBCD-BE14-4DCB-BAEC-57089748B164}.Release|Win32.ActiveCfg = Release|Any CPU
 		{5D6ECBCD-BE14-4DCB-BAEC-57089748B164}.Release|x86.ActiveCfg = Release|Any CPU
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Any CPU.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Mixed Platforms.Build.0 = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Win32.Build.0 = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.Build.0 = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Any CPU.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Mixed Platforms.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Mixed Platforms.Build.0 = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Win32.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Win32.Build.0 = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.Build.0 = Release|Win32
 		{3A98B35C-DEA8-489C-9203-263FFB6B065D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{3A98B35C-DEA8-489C-9203-263FFB6B065D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3A98B35C-DEA8-489C-9203-263FFB6B065D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -131,18 +123,6 @@ Global
 		{5AA48F9A-455D-4CD8-A605-A3AC38283E60}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{5AA48F9A-455D-4CD8-A605-A3AC38283E60}.Release|Win32.ActiveCfg = Release|Any CPU
 		{5AA48F9A-455D-4CD8-A605-A3AC38283E60}.Release|x86.ActiveCfg = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Win32.ActiveCfg = Release|Any CPU
-		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|x86.ActiveCfg = Release|Any CPU
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{48A2E149-0DAC-41B4-BB54-DFBCCD6D42B3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -191,6 +171,56 @@ Global
 		{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}.Release|Win32.ActiveCfg = Release|Any CPU
 		{24233CD5-A5DF-484B-A482-B79CB7A0D9CB}.Release|x86.ActiveCfg = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|Any CPU.Build.0 = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|Win32.ActiveCfg = Release|Any CPU
+		{15B3E0D2-6217-493A-A690-158C497F5318}.Release|x86.ActiveCfg = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|Win32.ActiveCfg = Release|Any CPU
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8}.Release|x86.ActiveCfg = Release|Any CPU
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Any CPU.ActiveCfg = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Win32.Build.0 = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.ActiveCfg = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.Build.0 = Debug|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Any CPU.ActiveCfg = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Mixed Platforms.Build.0 = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Win32.ActiveCfg = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Win32.Build.0 = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.ActiveCfg = Release|Win32
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.Build.0 = Release|Win32
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|Win32.ActiveCfg = Release|Any CPU
+		{D0B4CFAC-A368-4742-9863-68776CFA9938}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -202,11 +232,13 @@ Global
 		{3A98B35C-DEA8-489C-9203-263FFB6B065D} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
 		{72E16572-FC1F-4A9E-BC96-035417239298} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
 		{24233CD5-A5DF-484B-A482-B79CB7A0D9CB} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
+		{C9992B7C-313E-4C9F-A954-640D01EDFB58} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
+		{D0B4CFAC-A368-4742-9863-68776CFA9938} = {ADBF5F67-B480-4A93-9D50-C81856FC61A9}
 		{6CD185D1-08E0-4729-A999-2D5B57BA8193} = {C4C64188-4FAE-4CC3-A9E6-D9D4AF7429B6}
 		{5D6ECBCD-BE14-4DCB-BAEC-57089748B164} = {C4C64188-4FAE-4CC3-A9E6-D9D4AF7429B6}
 		{5AA48F9A-455D-4CD8-A605-A3AC38283E60} = {C4C64188-4FAE-4CC3-A9E6-D9D4AF7429B6}
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58} = {9173C593-D63F-49F6-AFA7-028425D13E4B}
-		{D0B4CFAC-A368-4742-9863-68776CFA9938} = {9173C593-D63F-49F6-AFA7-028425D13E4B}
 		{87537C92-B2C7-4E46-A6FB-02B73215C100} = {FD5F443E-CBEE-443E-821D-C47C86E09534}
+		{15B3E0D2-6217-493A-A690-158C497F5318} = {4FF1FBF3-F552-4D3D-AD97-E29385069206}
+		{E62B0633-1767-44A0-9479-C8E9D19DA4B8} = {01501C44-C95B-45B7-A898-76B4A7AC4EE8}
 	EndGlobalSection
 EndGlobal

+ 10 - 0
CSharp/Contract/RealmContract/ICalculator.cs

@@ -0,0 +1,10 @@
+using System.ServiceModel;
+
+namespace RealmContract
+{
+	[ServiceContract(Name = "Calculator", Namespace = "http://www.egametang.com/")]
+    public interface ICalculator
+	{
+		double Add(double x, double y);
+	}
+}

+ 36 - 0
CSharp/Contract/RealmContract/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("RealmContract")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("RealmContract")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("6c384393-17fe-4ebb-9b3e-5e913544999c")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      生成号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 49 - 0
CSharp/Contract/RealmContract/RealmContract.csproj

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E62B0633-1767-44A0-9479-C8E9D19DA4B8}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>RealmContract</RootNamespace>
+    <AssemblyName>RealmContract</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\Bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.ServiceModel" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ICalculator.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 1 - 1
CSharp/ThirdParty/ENet/ENet.vcxproj → CSharp/Platform/ENet/ENet.vcxproj

@@ -43,7 +43,7 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)\ThirdParty\;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)\Platform\;$(IncludePath)</IncludePath>
     <OutDir>$(SolutionDir)\Bin\</OutDir>
     <IntDir>$(SolutionDir)\Temp\</IntDir>
     <TargetExt>.dll</TargetExt>

+ 0 - 0
CSharp/ThirdParty/ENet/callbacks.c → CSharp/Platform/ENet/callbacks.c


+ 0 - 0
CSharp/ThirdParty/ENet/callbacks.h → CSharp/Platform/ENet/callbacks.h


+ 0 - 0
CSharp/ThirdParty/ENet/compress.c → CSharp/Platform/ENet/compress.c


+ 0 - 0
CSharp/ThirdParty/ENet/enet.h → CSharp/Platform/ENet/enet.h


+ 0 - 0
CSharp/ThirdParty/ENet/host.c → CSharp/Platform/ENet/host.c


+ 0 - 0
CSharp/ThirdParty/ENet/list.c → CSharp/Platform/ENet/list.c


+ 0 - 0
CSharp/ThirdParty/ENet/list.h → CSharp/Platform/ENet/list.h


+ 0 - 0
CSharp/ThirdParty/ENet/packet.c → CSharp/Platform/ENet/packet.c


+ 0 - 0
CSharp/ThirdParty/ENet/peer.c → CSharp/Platform/ENet/peer.c


+ 0 - 0
CSharp/ThirdParty/ENet/protocol.c → CSharp/Platform/ENet/protocol.c


+ 0 - 0
CSharp/ThirdParty/ENet/protocol.h → CSharp/Platform/ENet/protocol.h


+ 0 - 0
CSharp/ThirdParty/ENet/time.h → CSharp/Platform/ENet/time.h


+ 0 - 0
CSharp/ThirdParty/ENet/types.h → CSharp/Platform/ENet/types.h


+ 0 - 0
CSharp/ThirdParty/ENet/unix.c → CSharp/Platform/ENet/unix.c


+ 0 - 0
CSharp/ThirdParty/ENet/unix.h → CSharp/Platform/ENet/unix.h


+ 0 - 0
CSharp/ThirdParty/ENet/utility.h → CSharp/Platform/ENet/utility.h


+ 0 - 0
CSharp/ThirdParty/ENet/win32.c → CSharp/Platform/ENet/win32.c


+ 0 - 0
CSharp/ThirdParty/ENet/win32.h → CSharp/Platform/ENet/win32.h


+ 0 - 0
CSharp/ThirdParty/ENetCS/Address.cs → CSharp/Platform/ENetCS/Address.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/ENetCS.csproj → CSharp/Platform/ENetCS/ENetCS.csproj


+ 0 - 0
CSharp/ThirdParty/ENetCS/ENetException.cs → CSharp/Platform/ENetCS/ENetException.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/Event.cs → CSharp/Platform/ENetCS/Event.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/Host.cs → CSharp/Platform/ENetCS/Host.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/Library.cs → CSharp/Platform/ENetCS/Library.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/NativeMethods.cs → CSharp/Platform/ENetCS/NativeMethods.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/NativeStructs.cs → CSharp/Platform/ENetCS/NativeStructs.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/Packages.config → CSharp/Platform/ENetCS/Packages.config


+ 0 - 0
CSharp/ThirdParty/ENetCS/Packet.cs → CSharp/Platform/ENetCS/Packet.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/Peer.cs → CSharp/Platform/ENetCS/Peer.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/PeerEvent.cs → CSharp/Platform/ENetCS/PeerEvent.cs


+ 0 - 0
CSharp/ThirdParty/ENetCS/PeersManager.cs → CSharp/Platform/ENetCS/PeersManager.cs


+ 39 - 0
CSharp/Server/Realm/App.config

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+
+	<appSettings>
+		<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
+	</appSettings>
+	<system.web>
+		<compilation debug="true" />
+	</system.web>
+	<!-- 部署服务库项目时,必须将配置文件的内容添加到主机的 app.config 文件中。System.Configuration 不支持库的配置文件。-->
+	<system.serviceModel>
+		<services>
+			<service name="Realm.ICalculator">
+				<endpoint address="" binding="basicHttpBinding" contract="Realm.IService1">
+					<identity>
+						<dns value="localhost" />
+					</identity>
+				</endpoint>
+				<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
+				<host>
+					<baseAddresses>
+						<add baseAddress="http://localhost:8733/Design_Time_Addresses/Realm/Calculator/" />
+					</baseAddresses>
+				</host>
+			</service>
+		</services>
+		<behaviors>
+			<serviceBehaviors>
+				<behavior>
+					<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
+					<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
+					<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为true。在部署前设置为false以避免泄漏异常信息-->
+					<serviceDebug includeExceptionDetailInFaults="False" />
+				</behavior>
+			</serviceBehaviors>
+		</behaviors>
+	</system.serviceModel>
+
+</configuration>

+ 12 - 0
CSharp/Server/Realm/Calculator.cs

@@ -0,0 +1,12 @@
+using RealmContract;
+
+namespace Realm
+{
+	public class Calculator : ICalculator
+	{
+		public double Add(double x, double y)
+		{
+			return x + y;
+		}
+	}
+}

+ 36 - 0
CSharp/Server/Realm/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过下列特性集
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Realm")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Realm")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 False 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 True。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("8948f462-66c0-4a17-9344-7a83f847493a")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 您可以指定所有值,也可以按照如下所示通过使用“*”来使用
+//“生成号”和“修订号”的默认值:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
CSharp/Server/Realm/Realm.csproj

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{15B3E0D2-6217-493A-A690-158C497F5318}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Realm</RootNamespace>
+    <AssemblyName>Realm</AssemblyName>
+    <ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <StartArguments>/client:"WcfTestClient.exe"</StartArguments>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
+    <XsdCodeGenEnabled>True</XsdCodeGenEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\Bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Calculator.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Contract\RealmContract\RealmContract.csproj">
+      <Project>{E62B0633-1767-44A0-9479-C8E9D19DA4B8}</Project>
+      <Name>RealmContract</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\WCF\Microsoft.VisualStudio.ServiceModel.targets" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{3D9AD99F-2412-4246-B90B-4EAA41C64699}">
+        <WcfProjectProperties>
+          <AutoStart>True</AutoStart>
+        </WcfProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>