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); } }
private void spring_SpringStarted(object sender, EventArgs e) { if (Program.main.config.AllowInGameJoin) { tas.ChangeMyStatus(false, false); tas.ChangeLock(false); } }
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); } } }
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); } }
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); } } }
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); } } }
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); } } }
private void spring_SpringStarted(object sender, EventArgs e) { tas.ChangeLock(false); }