예제 #1
0
        public void Start(string modname, string mapname)
        {
            Stop();

            config.BattleDetails.Validate();
            if (String.IsNullOrEmpty(modname))
            {
                modname = config.DefaultMod;
            }
            if (String.IsNullOrEmpty(mapname))
            {
                mapname = config.DefaultMap;
            }

            if (!spring.UnitSync.HasMap(mapname))
            {
                mapname = spring.UnitSync.MapList[0];
            }
            if (!spring.UnitSync.HasMod(modname))
            {
                IEnumerator <ModInfo> enu = spring.UnitSync.ModList.Values.GetEnumerator();
                enu.MoveNext();
                modname = enu.Current.Name;
            }

            TasClient.Battle b = new TasClient.Battle(config.Password, config.HostingPort, config.MaxPlayers, config.MinRank, mapname, config.GameTitle.Replace("%1", MainConfig.SpringieVersion), spring.UnitSync.GetModInfo(modname), config.BattleDetails);

            for (int i = 0; i < config.DefaultRectangles.Count; ++i)
            {
                b.Rectangles.Add(i, config.DefaultRectangles[i]);
            }
            tas.OpenBattle(b);
            unsyncKicker = new UnSyncKicker(tas);
        }
예제 #2
0
 public void Stop()
 {
     StopVote();
     if (unsyncKicker != null)
     {
         unsyncKicker.Close();
     }
     unsyncKicker = null;
     spring.ExitGame();
     tas.ChangeMyStatus(false, false);
     tas.LeaveBattle();
 }
예제 #3
0
 public void Stop()
 {
   StopVote();
   if (unsyncKicker != null) unsyncKicker.Close();
   unsyncKicker = null;
   spring.ExitGame();
   tas.ChangeMyStatus(false, false);
   tas.LeaveBattle();
 }
예제 #4
0
    public void Start(string modname, string mapname)
    {
      Stop();

      config.BattleDetails.Validate();
      if (String.IsNullOrEmpty(modname)) modname = config.DefaultMod;
      if (String.IsNullOrEmpty(mapname)) mapname = config.DefaultMap;

      if (!spring.UnitSync.HasMap(mapname)) {
        mapname = spring.UnitSync.MapList[0];
      }
      if (!spring.UnitSync.HasMod(modname)) {
        IEnumerator<ModInfo> enu = spring.UnitSync.ModList.Values.GetEnumerator();
        enu.MoveNext();
        modname = enu.Current.Name;
      }

      TasClient.Battle b = new TasClient.Battle(config.Password, config.HostingPort, config.MaxPlayers, config.MinRank, mapname, config.GameTitle.Replace("%1", MainConfig.SpringieVersion), spring.UnitSync.GetModInfo(modname), config.BattleDetails);

      for (int i = 0; i < config.DefaultRectangles.Count; ++i) {
        b.Rectangles.Add(i, config.DefaultRectangles[i]);
      }
      tas.OpenBattle(b);
      unsyncKicker = new UnSyncKicker(tas);
    }