コード例 #1
0
        void tas_BattleUserLeft(object sender, TasEventArgs e)
        {
            if (spring.IsRunning)
            {
                CheckForBattleExit();
                spring.SayGame(e.ServerParams[0] + " has left lobby");
            }

            if (tas.GetBattle().IsLocked&& tas.GetBattle().Users.Count < 2) // player left and only 2 remaining (springie itself + some noob) -> unlock
            {
                tas.ChangeLock(false);
            }
        }
コード例 #2
0
 private void spring_SpringStarted(object sender, EventArgs e)
 {
     if (Program.main.config.AllowInGameJoin)
     {
         tas.ChangeMyStatus(false, false);
         tas.ChangeLock(false);
     }
 }
コード例 #3
0
        private void HandleKickSpecServerLocking()
        {
            if (!spring.IsRunning && (KickSpectators || lockedByKickSpec))
            {
                Battle b   = tas.GetBattle();
                int    cnt = 0;
                foreach (UserBattleStatus ubs in b.Users)
                {
                    if (!ubs.IsSpectator)
                    {
                        cnt++;
                    }
                }
                if (KickSpectators && cnt >= b.MaxPlayers)
                {
                    lockedByKickSpec = true;
                    tas.ChangeLock(true);
                }

                if (lockedByKickSpec && cnt < b.MaxPlayers)
                {
                    lockedByKickSpec = false;
                    tas.ChangeLock(false);
                }
            }
        }
コード例 #4
0
        void spring_SpringExited(object sender, EventArgs e)
        {
            StopVote();
            lockedUntil = DateTime.MinValue;
            tas.ChangeLock(false);
            tas.ChangeMyUserStatus(false, false);
            Battle b = tas.MyBattle;

            foreach (string s in toNotify)
            {
                if (b != null && b.Users.Any(x => x.Name == s))
                {
                    tas.Ring(s);
                }
                tas.Say(TasClient.SayPlace.User, s, "** Game just ended, join me! **", false);
            }
            toNotify.Clear();

            if (SpawnConfig == null && DateTime.Now.Subtract(spring.GameStarted).TotalMinutes > 5)
            {
                ServerVerifyMap(true);
            }
        }
コード例 #5
0
        private void HandleAutoLocking()
        {
            if (autoLock > 0 && (!spring.IsRunning || !Program.main.config.AllowInGameJoin))
            {
                var b   = tas.GetBattle();
                int cnt = b.CountPlayers();
                if (cnt >= autoLock)
                {
                    tas.ChangeLock(true);
                }

                if (cnt < autoLock)
                {
                    tas.ChangeLock(false);
                }
            }
        }
コード例 #6
0
        private void HandleAutoLocking()
        {
            if (autoLock > 0 && (!spring.IsRunning))
            {
                var b   = tas.GetBattle();
                int cnt = b.CountPlayers();
                if (cnt >= autoLock)
                {
                    tas.ChangeLock(true);
                }

                if (cnt < autoLock)
                {
                    tas.ChangeLock(false);
                }
            }
        }
コード例 #7
0
        private void HandleKickSpecServerLocking()
        {
            if (!spring.IsRunning && (KickSpectators || lockedByKickSpec))
            {
                Battle b   = tas.GetBattle();
                int    cnt = b.CountPlayers();
                if (KickSpectators && cnt >= b.MaxPlayers)
                {
                    lockedByKickSpec = true;
                    tas.ChangeLock(true);
                }

                if (lockedByKickSpec && cnt < b.MaxPlayers)
                {
                    lockedByKickSpec = false;
                    tas.ChangeLock(false);
                }
            }
        }
コード例 #8
0
 private void spring_SpringStarted(object sender, EventArgs e)
 {
     tas.ChangeLock(false);
 }