Exemple #1
0
 protected override bool PerformInit(TasSayEventArgs e, string[] words, out string question, out int winCount)
 {
     winCount = 0;
     question = null;
     if (words.Length == 0)
     {
         question = "Rehost this game?";
         return(true);
     }
     else
     {
         string[] mods;
         int[]    indexes;
         if (AutoHost.FilterMods(words, ah, out mods, out indexes) == 0)
         {
             AutoHost.Respond(tas, spring, e, "cannot find such mod");
             return(false);
         }
         else
         {
             modname  = mods[0];
             question = "Rehost this game to " + modname + "?";
             return(true);
         }
     }
 }
        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);
                }
            }
        }