Exemplo n.º 1
0
        public void CheckRepository(string arma3SyncPath, string javaPath, Repository repository)
        {
            repository.Status = RepositoryStatus.Checking;

            //Extract A3SDS
            Logger.LogDebug("Arma3SyncService", "Extracting deserializer");
            _fileAccessor.WriteAllBytes(ApplicationConfig.A3SdsPath, Properties.Resources.A3SDS);

            Logger.LogDebug("Arma3SyncService", "Deserializing local repository");
            DeserializeLocalRepository(arma3SyncPath, javaPath, repository);

            Logger.LogDebug("Arma3SyncService", "Deserializing remote repository");
            DeserializeRemoteRepository(javaPath, repository);

            //Delete A3SDS
            Logger.LogDebug("Arma3SyncService", "Cleaning up deserializer");
            _fileAccessor.DeleteFile(ApplicationConfig.A3SdsPath);

            if (repository.LocalRevision != null && repository.RemoteRevision != null)
            {
                repository.Status = repository.LocalRevision.Equals(repository.RemoteRevision)
                    ? RepositoryStatus.Updated
                    : RepositoryStatus.Outdated;
            }
            else
            {
                repository.Status = RepositoryStatus.Unknown;
            }

            Logger.LogDebug("Arma3SyncService", $"Finished checking repository status, status is {repository.Status}");
        }
Exemplo n.º 2
0
 public void RemoveUpdater()
 {
     if (_fileAccessor.FileExists(ApplicationConfig.LegacyUpdaterPath))
     {
         Logger.LogInfo("UpdaterService", "Deleting legacy updater file");
         _fileAccessor.DeleteFile(ApplicationConfig.LegacyUpdaterPath);
     }
     else
     {
         Logger.LogDebug("UpdaterService", "Deleting updater file");
         _fileAccessor.DeleteFile(ApplicationConfig.UpdaterPath);
     }
 }
Exemplo n.º 3
0
        public void DeleteProfile(UserProfile profile)
        {
            Logger.LogDebug("ProfileService", "Deleting profile from disk");

            var profileFile = Path.Combine(ApplicationConfig.ConfigPath, ApplicationConfig.ProfilesFolder, string.Format(ApplicationConfig.ProfileNameFormat, profile.Id));

            try
            {
                if (_fileAccessor.DirectoryExists(profileFile))
                {
                    _fileAccessor.DeleteFile(profileFile);
                }
            }
            catch (Exception e)
            {
                Logger.LogException("ProfileService", "Error deleting profile", e);
            }
        }