2023-03-18 18:09:36 +03:00
|
|
|
|
using System.IO;
|
|
|
|
|
using DotRecast.Core;
|
2023-03-18 22:36:31 +03:00
|
|
|
|
using Serilog;
|
2023-03-20 18:33:17 +03:00
|
|
|
|
using Serilog.Enrichers;
|
2023-03-18 18:09:36 +03:00
|
|
|
|
|
|
|
|
|
namespace DotRecast.Recast.Demo;
|
2023-03-14 17:56:10 +03:00
|
|
|
|
|
|
|
|
|
public static class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
2023-03-18 22:36:31 +03:00
|
|
|
|
|
2023-03-18 18:09:36 +03:00
|
|
|
|
var path = Loader.ToRPath("dungeon.obj");
|
|
|
|
|
path = Path.GetDirectoryName(path);
|
|
|
|
|
if (!string.IsNullOrEmpty(path))
|
|
|
|
|
{
|
|
|
|
|
var workingDirectory = Path.Combine(path, "..");
|
|
|
|
|
workingDirectory = Path.GetFullPath(workingDirectory);
|
|
|
|
|
Directory.SetCurrentDirectory(workingDirectory);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-16 05:54:50 +03:00
|
|
|
|
var format = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message:lj} [{ThreadName}:{ThreadId}]{NewLine}{Exception}";
|
2023-03-19 08:39:44 +03:00
|
|
|
|
Log.Logger = new LoggerConfiguration()
|
|
|
|
|
.MinimumLevel.Verbose()
|
2023-03-20 18:33:17 +03:00
|
|
|
|
.Enrich.WithThreadId()
|
|
|
|
|
.Enrich.WithThreadName()
|
|
|
|
|
.Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "main")
|
|
|
|
|
.WriteTo.Console(outputTemplate: format)
|
|
|
|
|
.WriteTo.File(
|
|
|
|
|
"logs/log.log",
|
|
|
|
|
rollingInterval: RollingInterval.Day,
|
|
|
|
|
rollOnFileSizeLimit: true,
|
|
|
|
|
outputTemplate: format)
|
2023-03-19 08:39:44 +03:00
|
|
|
|
.CreateLogger();
|
2023-03-20 18:33:17 +03:00
|
|
|
|
|
2023-04-17 18:12:28 +03:00
|
|
|
|
Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Run()
|
|
|
|
|
{
|
2023-03-14 17:56:10 +03:00
|
|
|
|
var demo = new RecastDemo();
|
2023-04-17 18:12:28 +03:00
|
|
|
|
demo.Run();
|
2023-03-14 17:56:10 +03:00
|
|
|
|
}
|
|
|
|
|
}
|