mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
42
DotNet/Loader/Init.cs
Normal file
42
DotNet/Loader/Init.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user