public override void Init(ITorchBase torch)
        {
            base.Init(torch);
            this.ListenOnGameLoaded(OnGameLoaded);
            this.ListenOnGameUnloading(OnGameUnloading);

            _cancellationTokenSource = new CancellationTokenSource();

            var configPath = this.MakeConfigFilePath();

            _config = Persistent <DotTraceConnectorConfig> .Load(configPath);

            _fileLoggingConfigurator = new FileLoggingConfigurator(
                "TorchDotTraceConnector",
                new[] { "TorchDotTraceConnector.*" },
                Config.LogFilePath);

            _fileLoggingConfigurator.Initialize();
            _fileLoggingConfigurator.Configure(Config);

            _connector       = new DotTraceConnector(Config);
            _simDropObserver = new SimDropObserver(10);

            Config.PropertyChanged += (sender, args) =>
            {
                _fileLoggingConfigurator.Configure(Config);
            };
        }
示例#2
0
        public override void Init(ITorchBase torch)
        {
            base.Init(torch);
            this.ListenOnGameLoaded(OnGameLoaded);
            this.ListenOnGameUnloading(OnGameUnloading);

            _cancellationTokenSource = new CancellationTokenSource();

            var configPath = this.MakeConfigFilePath();

            _config = Persistent <TorchAlertConfig> .Load(configPath);

            Config.PropertyChanged += OnConfigPropertyChanged;

            _fileLoggingConfigurator = new FileLoggingConfigurator(nameof(TorchAlert), new[] { "TorchAlert.*", "Discord.Net.*" }, Config.LogFilePath);
            _fileLoggingConfigurator.Initialize();
            _fileLoggingConfigurator.Configure(Config);

            var linkDbPath  = this.MakeFilePath($"{nameof(DiscordIdentityLinker)}.csv");
            var splitLookup = new ParentsLookupTree <long>();

            TorchAlert = new Core.TorchAlert(Config, linkDbPath, splitLookup);
            MyCubeGridPatch.SplitLookup = splitLookup;

            Log.Info("initialized");
        }
示例#3
0
        public override void Init(ITorchBase torch)
        {
            base.Init(torch);
            this.ListenOnGameLoaded(OnGameLoaded);
            this.ListenOnGameUnloading(OnGameUnloading);

            var configFilePath = this.MakeConfigFilePath();

            _config = Persistent <AutoModeratorConfig> .Load(configFilePath);

            _config.Data.Initialize();
            Config.PropertyChanged += OnConfigChanged;

            _fileLoggingConfigurator = new FileLoggingConfigurator(
                "AutoModerator",
                new[] { "AutoModerator.*", "Utils.TorchEntityGps.*", "Utils.TimeSerieses.*" },
                AutoModeratorConfig.DefaultLogFilePath);

            _fileLoggingConfigurator.Initialize();
            _fileLoggingConfigurator.Configure(Config);

            // Local Gps Mod
            ModAdditionPatch.AddModForServerAndClient(2781829620);
        }