Example #1
0
        static void TotalClear()
        {
            BundlesConfig bcConfig = BundlesConfig.GetInstance();

            if (bcConfig != null)
            {
                bcConfig.Clear();
            }

            BundlesMap map = BundlesMap.GetInstance();

            if (map != null)
            {
                map.Clear();
            }

            UploadList info = UploadList.GetInstance();

            if (info != null)
            {
                info.Clear();
            }

            UtilsAsset.AssetsRefresh();
        }
 protected override void OnDisabled()
 {
     base.OnDisabled();
     CraftAddQueue      = new ConcurrentQueue <CraftChangeEntry>();
     CraftDeleteQueue   = new ConcurrentQueue <CraftChangeEntry>();
     CraftResponseQueue = new ConcurrentQueue <CraftResponseEntry>();
     PlayersWithCrafts.Clear();
     PlayerList.Clear();
     UploadList.Clear();
     SelectedPlayer    = "";
     UploadCraftType   = CraftType.Vab;
     UploadCraftName   = "";
     DownloadCraftType = CraftType.Vab;
     DownloadCraftName = "";
     DeleteCraftType   = CraftType.Vab;
     DeleteCraftName   = "";
 }
Example #3
0
 public override void OnDisabled()
 {
     base.OnDisabled();
     CraftAddQueue.Clear();
     CraftDeleteQueue.Clear();
     CraftResponseQueue.Clear();
     PlayersWithCrafts.Clear();
     PlayerList.Clear();
     UploadList.Clear();
     SelectedPlayer    = "";
     UploadCraftType   = CraftType.VAB;
     UploadCraftName   = "";
     DownloadCraftType = CraftType.VAB;
     DownloadCraftName = "";
     DeleteCraftType   = CraftType.VAB;
     DeleteCraftName   = "";
 }
 public void BuildUploadList()
 {
     UploadList.Clear();
     if (Directory.Exists(VabPath))
     {
         UploadList.Add(CraftType.Vab,
                        Directory.GetFiles(VabPath).Select(Path.GetFileNameWithoutExtension));
     }
     if (Directory.Exists(SphPath))
     {
         UploadList.Add(CraftType.Sph,
                        Directory.GetFiles(SphPath).Select(Path.GetFileNameWithoutExtension));
     }
     if (Directory.Exists(VabPath))
     {
         UploadList.Add(CraftType.Subassembly,
                        Directory.GetFiles(SubassemblyPath).Select(Path.GetFileNameWithoutExtension));
     }
 }
Example #5
0
        public async Task RetryAnyUploads()
        {
            if (RetryList.Count == 0)
            {
                return;
            }

            Log.Information("Retrying for {0} times", MaxRetries);
            for (int i = 0; i < MaxRetries; i++)
            {
                if (RetryList.Count == 0)
                {
                    break;
                }
                Log.Information("Retry #{0}", i);
                UploadList.Clear();
                UploadList = new ConcurrentBag <UploadObject>(RetryList);
                RetryList.Clear();
                await UploadToB2();
            }
        }