Esempio n. 1
0
        public TorrentDownload DownloadTorrent(string name)
        {
            Trace.TraceInformation("starting download {0}", name);
            var down = new TorrentDownload(name);

            plasmaService.DownloadFileAsync(name, down);
            return(down);
        }
        public void FindLinks(string[] words, FileType type, TasClient tas, TasSayEventArgs e)
        {
            if (words.Length == 0)
            {
                Battle b = tas.MyBattle;
                if (b == null)
                {
                    return;
                }
                ah.Respond(e, string.Format("Getting Zero-K mirrors for currently hosted {0}", type));
                if (type == FileType.Map)
                {
                    plasmaService.DownloadFileAsync(b.MapName, e);
                }
                else
                {
                    plasmaService.DownloadFileAsync(b.ModName, e);
                }
            }
            else
            {
                int[]    resultIndexes;
                string[] resultVals;
                int      cnt;
                if (type == FileType.Map)
                {
                    cnt = ah.FilterMaps(words, out resultVals, out resultIndexes);
                }
                else
                {
                    cnt = ah.FilterMods(words, out resultVals, out resultIndexes);
                }

                if (cnt == 0)
                {
                    ah.Respond(e, string.Format("No such {0} found", type));
                }
                else
                {
                    ah.Respond(e, string.Format("Getting Zero-K mirrors for {0}, please wait", resultVals[0]));
                    plasmaService.DownloadFileAsync(resultVals[0], e);
                }
            }
        }