mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
移除 重构
移除 重构
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>ET</RootNamespace>
|
||||
<LangVersion>11</LangVersion>
|
||||
<AssemblyName>App</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Loader\DotNet.Loader.csproj" />
|
||||
<ProjectReference Include="..\Model\DotNet.Model.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Entry.Init();
|
||||
Init init = new();
|
||||
init.Start();
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1);
|
||||
try
|
||||
{
|
||||
init.Update();
|
||||
init.LateUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
}
|
||||
}
|
||||
// ReSharper disable once FunctionNeverReturns
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<AssemblyName>Core</AssemblyName>
|
||||
<RootNamespace>ET</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Core\**\*.cs">
|
||||
<Link>Core\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\..\Share\Share.SourceGenerator\Share.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\ThirdParty\DotNet.ThirdParty.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="..\..\Unity\Assets\Scripts\Core\Fiber\Module\Console\">
|
||||
<Link>Core\Fiber\Module\Console</Link>
|
||||
</Folder>
|
||||
<Folder Include="..\..\Unity\Assets\Scripts\Core\World\Module\Console\">
|
||||
<Link>Core\World\Module\Console</Link>
|
||||
</Folder>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -1,48 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>ET</RootNamespace>
|
||||
<LangVersion>11</LangVersion>
|
||||
<AssemblyName>Hotfix</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>false</Optimize>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Hotfix\Client\**\*.cs">
|
||||
<Link>Client\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Hotfix\Server\**\*.cs">
|
||||
<Link>Server\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Hotfix\Share\**\*.cs">
|
||||
<Link>Share\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\..\Share\Share.SourceGenerator\Share.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\Loader\DotNet.Loader.csproj" />
|
||||
<ProjectReference Include="..\Model\DotNet.Model.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Client\LockStep\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
|
||||
public class CodeLoader: Singleton<CodeLoader>, ISingletonAwake
|
||||
{
|
||||
private AssemblyLoadContext assemblyLoadContext;
|
||||
|
||||
private Assembly model;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (Assembly assembly in assemblies)
|
||||
{
|
||||
if (assembly.GetName().Name == "Model")
|
||||
{
|
||||
this.model = assembly;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.LoadHotfix();
|
||||
|
||||
IStaticMethod start = new StaticMethod(this.model, "ET.Entry", "Start");
|
||||
start.Run();
|
||||
}
|
||||
|
||||
public void LoadHotfix()
|
||||
{
|
||||
assemblyLoadContext?.Unload();
|
||||
GC.Collect();
|
||||
assemblyLoadContext = new AssemblyLoadContext("Hotfix", true);
|
||||
byte[] dllBytes = File.ReadAllBytes("./Hotfix.dll");
|
||||
byte[] pdbBytes = File.ReadAllBytes("./Hotfix.pdb");
|
||||
Assembly hotfixAssembly = assemblyLoadContext.LoadFromStream(new MemoryStream(dllBytes), new MemoryStream(pdbBytes));
|
||||
|
||||
Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(Assembly.GetEntryAssembly(), typeof(Init).Assembly, typeof (Fiber).Assembly, this.model, hotfixAssembly);
|
||||
|
||||
World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types);
|
||||
|
||||
World.Instance.Load();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
[Invoke]
|
||||
public class GetAllConfigBytes: AInvokeHandler<ConfigComponent.GetAllConfigBytes, Dictionary<Type, byte[]>>
|
||||
{
|
||||
public override Dictionary<Type, byte[]> Handle(ConfigComponent.GetAllConfigBytes args)
|
||||
{
|
||||
Dictionary<Type, byte[]> output = new Dictionary<Type, byte[]>();
|
||||
List<string> startConfigs = new List<string>()
|
||||
{
|
||||
"StartMachineConfigCategory",
|
||||
"StartProcessConfigCategory",
|
||||
"StartSceneConfigCategory",
|
||||
"StartZoneConfigCategory",
|
||||
};
|
||||
HashSet<Type> configTypes = EventSystem.Instance.GetTypes(typeof (ConfigAttribute));
|
||||
foreach (Type configType in configTypes)
|
||||
{
|
||||
string configFilePath;
|
||||
if (startConfigs.Contains(configType.Name))
|
||||
{
|
||||
configFilePath = $"../Config/Excel/s/{Options.Instance.StartConfig}/{configType.Name}.bytes";
|
||||
}
|
||||
else
|
||||
{
|
||||
configFilePath = $"../Config/Excel/s/{configType.Name}.bytes";
|
||||
}
|
||||
output[configType] = File.ReadAllBytes(configFilePath);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
[Invoke]
|
||||
public class GetOneConfigBytes: AInvokeHandler<ConfigComponent.GetOneConfigBytes, byte[]>
|
||||
{
|
||||
public override byte[] Handle(ConfigComponent.GetOneConfigBytes args)
|
||||
{
|
||||
byte[] configBytes = File.ReadAllBytes($"../Config/Excel/s/{args.ConfigName}.bytes");
|
||||
return configBytes;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>ET</RootNamespace>
|
||||
<LangVersion>11</LangVersion>
|
||||
<AssemblyName>Loader</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\..\Share\Share.SourceGenerator\Share.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\Core\DotNet.Core.csproj" />
|
||||
<ProjectReference Include="..\ThirdParty\DotNet.ThirdParty.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using CommandLine;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public class Init
|
||||
{
|
||||
public void Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
||||
{
|
||||
Log.Error(e.ExceptionObject.ToString());
|
||||
};
|
||||
|
||||
// 命令行参数
|
||||
Parser.Default.ParseArguments<Options>(System.Environment.GetCommandLineArgs())
|
||||
.WithNotParsed(error => throw new Exception($"命令行格式错误! {error}"))
|
||||
.WithParsed((o)=>World.Instance.AddSingleton(o));
|
||||
World.Instance.AddSingleton<Logger>().ILog = new NLogger(Options.Instance.AppType.ToString(), Options.Instance.Process, "../Config/NLog/NLog.config");
|
||||
ETTask.ExceptionHandler += Log.Error;
|
||||
World.Instance.AddSingleton<CodeLoader>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
FiberManager.Instance.Update();
|
||||
}
|
||||
|
||||
public void LateUpdate()
|
||||
{
|
||||
FiberManager.Instance.LateUpdate();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
using System.IO;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
[Invoke]
|
||||
public class RecastFileReader: AInvokeHandler<NavmeshComponent.RecastFileLoader, byte[]>
|
||||
{
|
||||
public override byte[] Handle(NavmeshComponent.RecastFileLoader args)
|
||||
{
|
||||
return File.ReadAllBytes(Path.Combine("../Config/Recast", args.Name));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,54 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>ET</RootNamespace>
|
||||
<LangVersion>11</LangVersion>
|
||||
<AssemblyName>Model</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>DOTNET</DefineConstants>
|
||||
<OutputPath>..\..\Bin\</OutputPath>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Model\Server\**\*.cs">
|
||||
<Link>Server\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Model\Client\**\*.cs">
|
||||
<Link>Client\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Model\Share\**\*.cs">
|
||||
<Link>Share\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
<Compile Include="..\..\Assets\GameScripts\DotNet\Model\Generate\Server\**\*.cs">
|
||||
<Link>Generate\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
</Compile>
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\..\Share\Share.SourceGenerator\Share.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
<ProjectReference Include="..\Core\DotNet.Core.csproj" />
|
||||
<ProjectReference Include="..\ThirdParty\DotNet.ThirdParty.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Client\LockStep\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user