コード例 #1
0
        void tas_BattleOpened(object sender, Battle battle)
        {
            tas.ChangeMyBattleStatus(true, SyncStatuses.Synced);
            if (hostedMod.IsMission)
            {
                foreach (MissionSlot slot in hostedMod.MissionSlots.Where(x => !x.IsHuman))
                {
                    tas.AddBot(slot.TeamName, slot.AiShortName, slot.AllyID, slot.TeamID);
                }
            }

            tas_MyBattleMapChanged(this, null); // todo really hacky thing

            if (SpawnConfig != null)
            {
                if (!string.IsNullOrEmpty(SpawnConfig.Handle))
                {
                    tas.Say(SayPlace.User, SpawnConfig.Owner, SpawnConfig.Handle, true);
                }
                tas.Say(SayPlace.User, SpawnConfig.Owner, "I'm here! Ready to serve you! Join me!", true);
            }
            else
            {
                ServerVerifyMap(true);
            }
        }
コード例 #2
0
 void tas_BattleOpened(object sender, TasEventArgs e)
 {
     tas.ChangeMyBattleStatus(true, false, SyncStatuses.Synced);
     if (hostedMod.IsMission)
     {
         foreach (MissionSlot slot in hostedMod.MissionSlots.Where(x => !x.IsHuman))
         {
             var ubs = new UserBattleStatus();
             ubs.SyncStatus  = SyncStatuses.Synced;
             ubs.TeamColor   = slot.Color;
             ubs.AllyNumber  = slot.AllyID;
             ubs.TeamNumber  = slot.TeamID;
             ubs.IsReady     = true;
             ubs.IsSpectator = false;
             ubs.Name        = slot.AiShortName;
             tas.AddBot(slot.TeamName, ubs, slot.Color, slot.AiShortName);
         }
     }
     if (SpawnConfig != null)
     {
         if (!string.IsNullOrEmpty(SpawnConfig.Handle))
         {
             tas.Say(TasClient.SayPlace.User, SpawnConfig.Owner, SpawnConfig.Handle, true);
         }
         tas.Say(TasClient.SayPlace.User, SpawnConfig.Owner, "I'm here! Ready to serve you! Join me!", true);
     }
     else
     {
         ServerVerifyMap(true);
     }
 }