Exemple #1
0
        static void Main(string[] args)
        {
            NameValueCollection config = ConfigurationManager.AppSettings;
            Uri serverUri = null;

            try {
                serverUri = new Uri(config["Server"]);
            } catch (UriFormatException e) {
                Tools.logError($"Invalid Config Value: Server Uri");
                Environment.Exit(1);
            }

            int refreshMilliseconds = 0;

            try {
                refreshMilliseconds = int.Parse(config["MinimumRefreshMilliseconds"]);
            } catch (FormatException e) {
                Tools.logError($"Invalid Config Value: MinimumRefreshMilliseconds");
                Environment.Exit(2);
            }

            SteamHelper   steamHelper   = new SteamHelper();
            DirectoryInfo saveDirectory = new DirectoryInfo(Path.Combine(steamHelper.getAppInstallDirectory(440).FullName, "tf", "materials", "temp"));

            try {
                SyncEngine syncEngine = new SyncEngine(saveDirectory, serverUri, refreshMilliseconds);
                syncEngine.start();
            } catch (Exception e) {
                Tools.logError($"{e.Message} {e.StackTrace}");
                Console.ReadLine();
            }
        }
        public App(string serverUri, CancellationToken token)
        {
            _token         = token;
            DebounceTimeMs = 10000;

            _modifiedDebouncer.Debounced += ModifiedDebouncer_Debounced;
            _renamedDebouncer.Debounced  += RenamedDebouncer_Debounced;

            InitDatabaseAsync();

            _syncEngine = new SyncEngine(serverUri, "Tom");
            ActionQueue.Instance.Initialise(token, _syncEngine);
        }
Exemple #3
0
 public void Initialise(CancellationToken token, SyncEngine syncEngine)
 {
     _syncEngine = syncEngine;
     Task.Run(() => DequeueTask(), token);
 }