sledgemapper/Sledgemapper/Program.cs
Michele Scandura 73400b5c9f
All checks were successful
continuous-integration/drone/push Build is passing
cleanup
2021-09-30 11:19:38 +01:00

70 lines
2.5 KiB
C#

using System;
using System.Text;
using Microsoft.Extensions.Configuration;
using Microsoft.Identity.Client;
using Microsoft.Identity.Client.Extensions.Msal;
using Sentry;
namespace Sledgemapper
{
public static class Program
{
private static IConfiguration _configuration;
public static MsalCacheHelper Helper { get; private set; }
[STAThread]
static void Main()
{
var builder = new ConfigurationBuilder()
.SetBasePath(System.IO.Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json");
_configuration = builder.Build();
// Loading PublicClientApplicationOptions from the values set on appsettings.json
// Building StorageCreationProperties
var storageProperties =
new StorageCreationPropertiesBuilder(CacheSettings.CacheFileName, CacheSettings.CacheDir)
.WithLinuxKeyring(
CacheSettings.LinuxKeyRingSchema,
CacheSettings.LinuxKeyRingCollection,
CacheSettings.LinuxKeyRingLabel,
CacheSettings.LinuxKeyRingAttr1,
CacheSettings.LinuxKeyRingAttr2)
.WithMacKeyChain(
CacheSettings.KeyChainServiceName,
CacheSettings.KeyChainAccountName)
.Build();
// storage = Storage.Create(storageProperties);
Helper = MsalCacheHelper.CreateAsync(storageProperties).Result;
using (Sentry.SentrySdk.Init(o =>
{
o.Dsn = "https://973ac1606651454ba7a19f642d0a9bc1@glitchtip.michelescandura.com/1";
//o.Dsn = "https://3a58b39d3d38447a83b647fdb1c68160@o1020733.ingest.sentry.io/5986244";
o.MaxBreadcrumbs = 50;
o.Debug = true;
o.StackTraceMode = StackTraceMode.Enhanced;
o.AttachStacktrace = true;
o.Release = "1.0.0-alpha.3";
o.TracesSampleRate = 1.0;
#if DEBUG
o.Environment = "dev";
#else
o.Environment="production";
#endif
o.ServerName = Settings.Instance.MachineName;
}))
using (var game = new Sledgemapper())
{
Sentry.SentrySdk.CaptureEvent(new Sentry.SentryEvent() { Message = "App starting" });
game.Run();
}
}
}
}