Sfoglia il codice sorgente

将ExcelExport跟Proto2CS整合到Server工程中,这两个工具只是两种AppType
启动ExcelExport:
dotnet Server.dll AppType=ExcelExport --Console=1

启动Proto2CS:
dotnet Server.dll AppType=Proto2CS --Console=1

tanghai 4 anni fa
parent
commit
f42bb2443b

+ 2 - 2
Book/1.1运行指南.md

@@ -11,9 +11,9 @@
 
 5. 用vs2019打开 ET/Client-Server.sln 编译(**一定要全部工程编译,右键VS解决方案,全部编译**)
 
-6. 导表工具,编译完成后命令行进入 Tools/ExcelExporter/Bin 目录,执行 dotnet ExcelExporter.dll
+6. 导表工具,编译完成后命令行进入 Bin 目录,执行 dotnet Server.dll AppType=ExcelExport --Console=1  
 
-7. 导出协议工具,编译完成后进入 Tools/Proto2CS/Bin 目录,执行 dotnet  Proto2CS.dll
+7. 导出协议工具,编译完成后进入 Bin 目录,执行 dotnet Server.dll AppType=Proto2CS --Console=1  
 
 # 测试状态同步demo
 

+ 0 - 32
Client-Server.sln

@@ -21,16 +21,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Editor", "Unity\Unity
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.ThirdParty", "Unity\Unity.ThirdParty.csproj", "{CFBC0A95-3456-3439-6B2E-60FDE0FE5EE1}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{4BC66C3C-D55F-4FAA-A2F5-29E8EB1797AE}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.HotfixView", "Unity\Unity.HotfixView.csproj", "{D31345DE-9B88-525C-8E9C-744C99AE7509}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.ModelView", "Unity\Unity.ModelView.csproj", "{2F8409C1-DA01-D464-DBF2-00C6449E459E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proto2CS", "Tools\Proto2CS\Proto2CS.csproj", "{8CE3862F-0F7C-4759-A0E5-266AC3991E32}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelExporter", "Tools\ExcelExporter\ExcelExporter.csproj", "{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Robot", "Robot", "{0CFA1E78-9E36-48A3-A134-6EC704815CC8}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robot.App", "Robot\App\Robot.App.csproj", "{3743C043-A5B7-4D63-8009-19E8C2FB89D4}"
@@ -167,30 +161,6 @@ Global
 		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x64.Build.0 = Release|Any CPU
 		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x86.ActiveCfg = Release|Any CPU
 		{2F8409C1-DA01-D464-DBF2-00C6449E459E}.Release|x86.Build.0 = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x64.Build.0 = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Debug|x86.Build.0 = Debug|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|Any CPU.Build.0 = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x64.ActiveCfg = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x64.Build.0 = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x86.ActiveCfg = Release|Any CPU
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32}.Release|x86.Build.0 = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|x64.Build.0 = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Debug|x86.Build.0 = Debug|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|x64.ActiveCfg = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|x64.Build.0 = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|x86.ActiveCfg = Release|Any CPU
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4}.Release|x86.Build.0 = Release|Any CPU
 		{3743C043-A5B7-4D63-8009-19E8C2FB89D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{3743C043-A5B7-4D63-8009-19E8C2FB89D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3743C043-A5B7-4D63-8009-19E8C2FB89D4}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -289,8 +259,6 @@ Global
 		{CFBC0A95-3456-3439-6B2E-60FDE0FE5EE1} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{D31345DE-9B88-525C-8E9C-744C99AE7509} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
 		{2F8409C1-DA01-D464-DBF2-00C6449E459E} = {914C77C9-212A-4DD0-8D9A-074620E77FAA}
-		{8CE3862F-0F7C-4759-A0E5-266AC3991E32} = {4BC66C3C-D55F-4FAA-A2F5-29E8EB1797AE}
-		{E2F0B649-1A7B-4F01-A48B-A2825223C2B4} = {4BC66C3C-D55F-4FAA-A2F5-29E8EB1797AE}
 		{3743C043-A5B7-4D63-8009-19E8C2FB89D4} = {0CFA1E78-9E36-48A3-A134-6EC704815CC8}
 		{405D6513-704F-4715-ACC9-F1C0C07EE39F} = {0CFA1E78-9E36-48A3-A134-6EC704815CC8}
 		{57098A03-52D4-455F-9B88-3A0951D651DF} = {0CFA1E78-9E36-48A3-A134-6EC704815CC8}

+ 14 - 2
Server/Hotfix/AppStart_Init.cs

@@ -1,5 +1,3 @@
-
-
 using System.Net;
 
 namespace ET
@@ -8,6 +6,20 @@ namespace ET
     {
         protected override async ETTask Run(EventType.AppStart args)
         {
+            switch (Game.Options.AppType)
+            {
+                case AppType.ExcelExporter:
+                {
+                    ExcelExporter.Export();
+                    return;
+                }
+                case AppType.Proto2CS:
+                {
+                    Proto2CS.Export();
+                    return;
+                }
+            }
+
             Game.Scene.AddComponent<ConfigComponent>();
             await ConfigComponent.Instance.LoadAsync();
 

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

@@ -54,7 +54,4 @@
   <ItemGroup>
     <ProjectReference Include="..\Model\Server.Model.csproj" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Helper" />
-  </ItemGroup>
 </Project>

+ 52 - 43
Tools/ExcelExporter/Program.cs → Server/Model/ExcelExporter/ExcelExporter.cs

@@ -1,6 +1,5 @@
-using System;
+using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.IO;
 using System.Reflection;
 using System.Text;
@@ -8,7 +7,6 @@ using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.Emit;
 using MongoDB.Bson.Serialization;
-using MongoDB.Bson.Serialization.Attributes;
 using OfficeOpenXml;
 using ProtoBuf;
 using LicenseContext = OfficeOpenXml.LicenseContext;
@@ -37,39 +35,21 @@ namespace ET
         }
     }
     
-    class Program
+    public static class ExcelExporter
     {
         private static string template;
 
-        private const string clientClassDir = "../../../Unity/Assets/Model/Generate/Config";
-        private const string serverClassDir = "../../../Server/Model/Generate/Config";
+        private const string clientClassDir = "../Unity/Assets/Model/Generate/Config";
+        private const string serverClassDir = "../Server/Model/Generate/Config";
         
-        private const string excelDir = "../../../Excel";
+        private const string excelDir = "../Excel";
         
         private const string jsonDir = "./{0}/Json";
         
-        private const string clientProtoDir = "../../../Unity/Assets/Bundles/Config";
-        private const string serverProtoDir = "../../../Config";
-
-        private static string GetProtoDir(ConfigType configType)
-        {
-            if (configType == ConfigType.Client)
-            {
-                return clientProtoDir;
-            }
-            return serverProtoDir;
-        }
+        private const string clientProtoDir = "../Unity/Assets/Bundles/Config";
+        private const string serverProtoDir = "../Config";
         
-        private static string GetClassDir(ConfigType configType)
-        {
-            if (configType == ConfigType.Client)
-            {
-                return clientClassDir;
-            }
-            return serverClassDir;
-        }
-        
-        static void Main(string[] args)
+        public static void Export()
         {
             try
             {
@@ -99,6 +79,25 @@ namespace ET
             }
         }
 
+        private static string GetProtoDir(ConfigType configType)
+        {
+            if (configType == ConfigType.Client)
+            {
+                return clientProtoDir;
+            }
+            return serverProtoDir;
+        }
+        
+        private static string GetClassDir(ConfigType configType)
+        {
+            if (configType == ConfigType.Client)
+            {
+                return clientClassDir;
+            }
+            return serverClassDir;
+        }
+        
+        
 #region 导出class
         static void ExportExcelClass(ExcelPackage p, string name, ConfigType configType)
         {
@@ -283,21 +282,31 @@ namespace ET
             }
             
             List<PortableExecutableReference> references = new List<PortableExecutableReference>();
-            
-            string assemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location);
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(object).Assembly.Location).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(ProtoMemberAttribute).Assembly.Location).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(BsonDefaultValueAttribute).Assembly.Location).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(IConfig).Assembly.Location).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(Attribute).Assembly.Location).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(Path.Combine(assemblyPath, "mscorlib.dll")).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(Path.Combine(assemblyPath, "System.dll")).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(Path.Combine(assemblyPath, "System.Core.dll")).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(Path.Combine(assemblyPath, "System.Runtime.dll")).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(Path.Combine(assemblyPath, "netstandard.dll")).GetReference());
-            references.Add(AssemblyMetadata.CreateFromFile(typeof(ISupportInitialize).Assembly.Location).GetReference());
-           
-            
+            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
+            foreach (Assembly assembly in assemblies)
+            {
+                try
+                {
+                    if (assembly.IsDynamic)
+                    {
+                        continue;
+                    }
+
+                    if (assembly.Location == "")
+                    {
+                        continue;
+                    }
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                    throw;
+                }
+
+                PortableExecutableReference reference = MetadataReference.CreateFromFile(assembly.Location);
+                references.Add(reference);
+            }
+
             CSharpCompilation compilation = CSharpCompilation.Create(
                 null, 
                 syntaxTrees.ToArray(), 

+ 0 - 0
Tools/ExcelExporter/Template.txt → Server/Model/ExcelExporter/Template.txt


+ 16 - 18
Tools/Proto2CS/Program.cs → Server/Model/Proto2CS/Program.cs

@@ -11,38 +11,35 @@ namespace ET
         public int Opcode;
     }
 
-    public static class Program
+    public static class Proto2CS
     {
-        public static void Main()
+        public static void Export()
         {
             // InnerMessage.proto生成cs代码
             InnerProto2CS.Proto2CS();
-
-            Console.WriteLine("proto2cs succeed!");
+            Log.Console("proto2cs succeed!");
         }
     }
 
     public static class InnerProto2CS
     {
         private const string protoPath = ".";
-        private const string clientMessagePath = "../../../Unity/Assets/Model/Generate/Message/";
-        private const string serverMessagePath = "../../../Server/Model/Generate/Message/";
+        private const string clientMessagePath = "../Unity/Assets/Model/Generate/Message/";
+        private const string serverMessagePath = "../Server/Model/Generate/Message/";
         private static readonly char[] splitChars = { ' ', '\t' };
         private static readonly List<OpcodeInfo> msgOpcode = new List<OpcodeInfo>();
 
         public static void Proto2CS()
         {
             msgOpcode.Clear();
-            Proto2CS("ET", "../../../Proto/InnerMessage.proto", serverMessagePath, "InnerOpcode", 10000);
+            Proto2CS("ET", "../Proto/InnerMessage.proto", serverMessagePath, "InnerOpcode", 10000);
             GenerateOpcode("ET", "InnerOpcode", serverMessagePath);
-            
-            Proto2CS("ET", "../../../Proto/OuterMessage.proto", serverMessagePath, "OuterOpcode", 20000);
+
+            Proto2CS("ET", "../Proto/OuterMessage.proto", serverMessagePath, "OuterOpcode", 20000);
             GenerateOpcode("ET", "OuterOpcode", serverMessagePath);
-            
-            Proto2CS("ET", "../../../Proto/OuterMessage.proto", clientMessagePath, "OuterOpcode", 20000);
+
+            Proto2CS("ET", "../Proto/OuterMessage.proto", clientMessagePath, "OuterOpcode", 20000);
             GenerateOpcode("ET", "OuterOpcode", clientMessagePath);
-            
- 
         }
 
         public static void Proto2CS(string ns, string protoName, string outputPath, string opcodeClassName, int startOpcode)
@@ -51,7 +48,7 @@ namespace ET
             {
                 Directory.CreateDirectory(outputPath);
             }
-            
+
             msgOpcode.Clear();
             string proto = Path.Combine(protoPath, protoName);
             string csPath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(proto) + ".cs");
@@ -74,7 +71,7 @@ namespace ET
                 {
                     continue;
                 }
-                
+
                 if (newline.StartsWith("//ResponseType"))
                 {
                     string responseType = line.Split(" ")[1].TrimEnd('\r', '\n');
@@ -167,6 +164,7 @@ namespace ET
             {
                 Directory.CreateDirectory(outputPath);
             }
+
             StringBuilder sb = new StringBuilder();
             sb.AppendLine($"namespace {ns}");
             sb.AppendLine("{");
@@ -181,7 +179,7 @@ namespace ET
             sb.AppendLine("}");
 
             string csPath = Path.Combine(outputPath, outputFileName + ".cs");
-            
+
             using FileStream txt = new FileStream(csPath, FileMode.Create);
             using StreamWriter sw = new StreamWriter(txt);
             sw.Write(sb.ToString());
@@ -256,7 +254,7 @@ namespace ET
                 string name = ss[1];
                 int n = int.Parse(ss[3]);
                 string typeCs = ConvertType(type);
-                
+
                 sb.Append($"\t\t[ProtoMember({n})]\n");
                 sb.Append($"\t\tpublic {typeCs} {name} {{ get; set; }}\n\n");
             }
@@ -266,4 +264,4 @@ namespace ET
             }
         }
     }
-}
+}

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

@@ -136,7 +136,6 @@
   </ItemGroup>
   
   <ItemGroup>
-    <PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="2.9.0" />
     <PackageReference Include="MongoDB.Driver" Version="2.13.0" />
   </ItemGroup>
   <ItemGroup>
@@ -144,4 +143,9 @@
     <ProjectReference Include="..\..\ThirdParty\ShareLib\ShareLib.csproj" />
     <ProjectReference Include="..\..\ThirdParty\UnityEngine\UnityEngine.csproj" />
   </ItemGroup>
+  <ItemGroup>
+    <None Update="ExcelExporter\Template.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
 </Project>

+ 3 - 0
ThirdParty/ShareLib/ShareLib.csproj

@@ -47,6 +47,9 @@
 
     <ItemGroup>
       <PackageReference Include="CommandLineParser" Version="2.8.0" />
+      <PackageReference Include="EPPlus" Version="5.7.4" />
+      <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.11.0" />
+      <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
       <PackageReference Include="mongocsharpdriver" Version="2.13.0" />
       <PackageReference Include="MongoDB.Bson" Version="2.13.0" />
       <PackageReference Include="NLog" Version="4.7.10" />

+ 0 - 53
Tools/ExcelExporter/ExcelExporter.csproj

@@ -1,53 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-    <PropertyGroup>
-        <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
-        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
-        <RootNamespace>ET</RootNamespace>
-        <LangVersion>8</LangVersion>
-    </PropertyGroup>
-    
-    <PropertyGroup>
-        <OutputType>Exe</OutputType>
-        <TargetFramework>net5.0</TargetFramework>
-    </PropertyGroup>
-    
-    <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>./Bin</OutputPath>
-      <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    </PropertyGroup>
-    
-    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <OutputPath>./Bin</OutputPath>
-      <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    </PropertyGroup>
-    
-    <ItemGroup>
-      <PackageReference Include="EPPlus" Version="5.5.2" />
-      <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.9.0" />
-      <PackageReference Include="MongoDB.Bson" Version="2.13.0" />
-    </ItemGroup>
-    
-    <ItemGroup>
-      <None Update="Template.txt">
-        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-      </None>
-    </ItemGroup>
-    
-    <ItemGroup>
-      <Compile Include="..\..\Unity\Assets\Model\Core\Object\BaseAttribute.cs">
-        <Link>BaseAttribute.cs</Link>
-      </Compile>
-      <Compile Include="..\..\Unity\Assets\Model\Module\Config\ConfigAttribute.cs">
-        <Link>ConfigAttribute.cs</Link>
-      </Compile>
-      <Compile Include="..\..\Unity\Assets\Model\Module\Config\IConfig.cs">
-        <Link>IConfig.cs</Link>
-      </Compile>
-    </ItemGroup>
-    
-    <ItemGroup>
-      <ProjectReference Include="..\..\ThirdParty\protobuf-net\protobuf-net.csproj" />
-    </ItemGroup>
-
-</Project>

+ 0 - 29
Tools/ExcelExporter/ProtoObject.cs

@@ -1,29 +0,0 @@
-using System;
-using System.ComponentModel;
-using ProtoBuf;
-
-namespace ET
-{
-    public abstract class Object: ISupportInitialize, IDisposable
-    {
-        public Object()
-        {
-        }
-
-        public virtual void BeginInit()
-        {
-        }
-
-        public virtual void EndInit()
-        {
-        }
-
-        public virtual void Dispose()
-        {
-        }
-    }
-
-    public class ProtoObject: Object
-    {
-    }
-}

+ 0 - 28
Tools/FileServer/FileServer.csproj

@@ -1,28 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-    <PropertyGroup>
-        <TargetFramework>netcoreapp3.1</TargetFramework>
-        <LangVersion>latest</LangVersion>
-    </PropertyGroup>
-    <PropertyGroup>
-        <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
-    </PropertyGroup>
-    <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>../../FileServer/</OutputPath>
-    </PropertyGroup>
-    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <OutputPath>../../FileServer/</OutputPath>
-    </PropertyGroup>
-
-    <ItemGroup>
-      <_ContentIncludedByDefault Remove="Properties\launchSettings.json" />
-    </ItemGroup>
-
-    <ItemGroup>
-      <Content Update="appsettings.json">
-        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
-        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      </Content>
-    </ItemGroup>
-
-</Project>

+ 0 - 7
Tools/FileServer/FileServer.csproj.user

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ActiveDebugProfile>IIS Express</ActiveDebugProfile>
-    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
-  </PropertyGroup>
-</Project>

+ 0 - 27
Tools/FileServer/Program.cs

@@ -1,27 +0,0 @@
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using System.IO;
-
-
-namespace ETFileServer
-{
-    public class Program
-    {
-        public static IConfigurationRoot mConfig;
-        public static void Main(string[] args)
-        {
-            mConfig = new ConfigurationBuilder()
-                .SetBasePath(Directory.GetCurrentDirectory())
-                .AddJsonFile("appsettings.json", true)
-                .Build();
-            CreateWebHostBuilder(args).Build().Run();
-        }
-
-        public static IWebHostBuilder CreateWebHostBuilder(string[] args)
-        {
-            return WebHost.CreateDefaultBuilder(args).UseUrls(mConfig["urls"])
-                .UseStartup<Startup>();
-        }
-    }
-}

+ 0 - 22
Tools/FileServer/Properties/PublishProfiles/FolderProfile.pubxml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
-自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。 
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <WebPublishMethod>FileSystem</WebPublishMethod>
-    <PublishProvider>FileSystem</PublishProvider>
-    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
-    <LastUsedPlatform>Any CPU</LastUsedPlatform>
-    <SiteUrlToLaunchAfterPublish />
-    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
-    <ExcludeApp_Data>False</ExcludeApp_Data>
-    <ProjectGuid>1c2827bf-aa19-402a-bfd1-1c92e6b8fd84</ProjectGuid>
-    <publishUrl>../../FileServer/</publishUrl>
-    <DeleteExistingFiles>True</DeleteExistingFiles>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
-    <SelfContained>false</SelfContained>
-    <_IsPortable>true</_IsPortable>
-  </PropertyGroup>
-</Project>

+ 0 - 11
Tools/FileServer/Properties/PublishProfiles/FolderProfile.pubxml.user

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
-自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。 
--->
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <TimeStampOfAssociatedLegacyPublishXmlFile />
-    <_PublishTargetUrl>D:\Source\ET\Tools\FileServer\../../FileServer/</_PublishTargetUrl>
-  </PropertyGroup>
-</Project>

+ 0 - 27
Tools/FileServer/Properties/launchSettings.json

@@ -1,27 +0,0 @@
-{
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:56073/",
-      "sslPort": 0
-    }
-  },
-  "profiles": {
-    "IIS Express": {
-      "commandName": "IISExpress",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    },
-    "FileServer": {
-      "commandName": "Project",
-      "launchBrowser": true,
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      },
-      "applicationUrl": "http://localhost:56076/"
-    }
-  }
-}

+ 0 - 52
Tools/FileServer/Startup.cs

@@ -1,52 +0,0 @@
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.StaticFiles;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.FileProviders;
-using Microsoft.Extensions.Hosting;
-using System;
-using System.IO;
-
-namespace ETFileServer
-{
-    public class Startup
-    {
-        public void ConfigureServices(IServiceCollection services)
-        {
-            services.AddDirectoryBrowser();  //开启目录浏览
-        }
-
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
-        {
-            if (env.IsDevelopment()) app.UseDeveloperExceptionPage();
-            
-            string configDir = Program.mConfig["DirectoryPath"];
-            
-            configDir = new DirectoryInfo(configDir).FullName;
-            Console.WriteLine(configDir);
-            UseStaticFiles(app, configDir); 
-            app.Run(async (context) => { await context.Response.WriteAsync("Welcome to the ET file server!"); });
-        }
-
-        private void UseStaticFiles(IApplicationBuilder app, string filePath)
-        {
-            var staticfile = new StaticFileOptions
-            {
-                ServeUnknownFileTypes = true, 
-                FileProvider = new PhysicalFileProvider(filePath),
-                DefaultContentType = "application/x-msdownload"
-            };
-            // 设置MIME类型类型
-            staticfile.ContentTypeProvider = new FileExtensionContentTypeProvider
-            {    
-                Mappings =
-                {
-                    ["*"] = "application/x-msdownload"
-                }
-            };
-            app.UseDirectoryBrowser(new DirectoryBrowserOptions(){ FileProvider = staticfile.FileProvider });
-            app.UseStaticFiles(staticfile);
-        }
-    }
-}

+ 0 - 4
Tools/FileServer/appsettings.json

@@ -1,4 +0,0 @@
-{
-  "urls": "http://*:8088;http://*:8080",
-  "DirectoryPath": "../../Release/"
-}

+ 0 - 37
Tools/Proto2CS/Proto2CS.csproj

@@ -1,37 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-    <PropertyGroup>
-        <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
-        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
-        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
-        <LangVersion>8</LangVersion>
-    </PropertyGroup>
-
-    <PropertyGroup>
-        <OutputType>Exe</OutputType>
-        <TargetFramework>net5.0</TargetFramework>
-    </PropertyGroup>
-
-    <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>./Bin</OutputPath>
-      <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    </PropertyGroup>
-
-    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <OutputPath>./Bin</OutputPath>
-      <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    </PropertyGroup>
-
-    <ItemGroup>
-      <Compile Remove=".vs\**" />
-    </ItemGroup>
-
-    <ItemGroup>
-      <EmbeddedResource Remove=".vs\**" />
-    </ItemGroup>
-
-    <ItemGroup>
-      <None Remove=".vs\**" />
-    </ItemGroup>
-
-</Project>

+ 2 - 0
Unity/Assets/Model/Core/Options.cs

@@ -10,6 +10,8 @@ namespace ET
         Robot,
         Watcher, // 每台物理机一个守护进程,用来启动该物理机上的所有进程
         GameTool,
+        ExcelExporter,
+        Proto2CS
     }
     
     public class Options

+ 1 - 1
Unity/Packages/packages-lock.json

@@ -45,7 +45,7 @@
       "url": "https://packages.unity.cn"
     },
     "com.unity.test-framework": {
-      "version": "1.1.24",
+      "version": "1.1.29",
       "depth": 1,
       "source": "registry",
       "dependencies": {

+ 19 - 0
Unity/ProjectSettings/AutoStreamingSettings.asset

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1200 &1
+AutoStreamingSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  mSearchMode: 7
+  mCustomSearchFile: 
+  mTextures: []
+  mAudios: []
+  mMeshes: []
+  mScenes: []
+  mConfigCCD:
+    useCCD: 0
+    cosKey: 
+    projectGuid: 
+    bucketUuid: 
+    bucketName: 
+    badgeName: 

+ 2 - 2
Unity/ProjectSettings/ProjectVersion.txt

@@ -1,2 +1,2 @@
-m_EditorVersion: 2020.3.11f1c1
-m_EditorVersionWithRevision: 2020.3.11f1c1 (77449f27ef9b)
+m_EditorVersion: 2020.3.18f1c1
+m_EditorVersionWithRevision: 2020.3.18f1c1 (94c5a6b4c040)

File diff suppressed because it is too large
+ 0 - 0
Unity/Unity.Mono.csproj


Some files were not shown because too many files changed in this diff