/// <summary> /// Initializes a new instance of the <see cref="EloLimit"/> class. /// </summary> /// <param name="sst">The main class.</param> public EloLimit(SynServerTool sst) { _sst = sst; _configHandler = new ConfigHandler(); _users = new DbUsers(); LoadConfig(); }
/// <summary> /// Initializes a new instance of the <see cref="IrcQlCmd"/> class. /// </summary> /// <param name="sst">The main tool class.</param> /// <param name="irc">The IRC interface.</param> public IrcQlCmd(SynServerTool sst, IrcManager irc) { _irc = irc; var cmds = new CommandList(sst); _cmdList = cmds.Commands; }
/// <summary> /// Initializes a new instance of the <see cref="AccountDateLimit"/> class. /// </summary> /// <param name="sst">The main class.</param> public AccountDateLimit(SynServerTool sst) { _sst = sst; _userDb = new DbUsers(); _configHandler = new ConfigHandler(); LoadConfig(); }
/// <summary> /// Initializes a new instance of the <see cref="CommandList"/> class. /// </summary> /// <param name="sst">The main tool class.</param> /// <param name="irc">The IRC interface.</param> public IrcCommandList(SynServerTool sst, IrcManager irc) { _sst = sst; _irc = irc; Commands = new Dictionary <string, IIrcCommand>(StringComparer.InvariantCultureIgnoreCase); InitializeCommands(); }
/// <summary> /// Initializes a new instance of the <see cref="IrcCommandProcessor"/> class. /// </summary> /// <param name="sst">The main tool class.</param> /// <param name="irc">The IRC interface.</param> public IrcCommandProcessor(SynServerTool sst, IrcManager irc) { _sst = sst; _irc = irc; _ircCmds = new IrcCommandList(_sst, _irc); _ircCommandUserTime = new Dictionary <string, DateTime>(); }
/// <summary> /// Initializes a new instance of the <see cref="Motd"/> class. /// </summary> /// <param name="sst">The main class.</param> public Motd(SynServerTool sst) { _sst = sst; _configHandler = new ConfigHandler(); _motd = new MotdHandler(_sst); LoadConfig(); }
/// <summary> /// Initializes a new instance of the <see cref="ModuleManager"/> class. /// </summary> /// <param name="sst">The main class.</param> public ModuleManager(SynServerTool sst) { var s = sst; _moduleList = new List <IModule>(); EloLimit = new EloLimit(s); _moduleList.Add(EloLimit); AccountDateLimit = new AccountDateLimit(s); _moduleList.Add(AccountDateLimit); Accuracy = new Accuracy(s); _moduleList.Add(Accuracy); AutoVoter = new AutoVoter(s); _moduleList.Add(AutoVoter); EarlyQuit = new EarlyQuit(s); _moduleList.Add(EarlyQuit); Motd = new Motd(s); _moduleList.Add(Motd); Pickup = new Pickup(s); _moduleList.Add(Pickup); Servers = new Servers(s); _moduleList.Add(Servers); Irc = new Irc(s); _moduleList.Add(Irc); }
/// <summary> /// Initializes a new instance of the <see cref="Pickup"/> class. /// </summary> /// <param name="sst">The main class.</param> public Pickup(SynServerTool sst) { _sst = sst; _configHandler = new ConfigHandler(); LoadConfig(); _pickupManager = new PickupManager(_sst); }
/// <summary> /// Initializes a new instance of the <see cref="Irc"/> class. /// </summary> /// <param name="sst">The main class.</param> public Irc(SynServerTool sst) { IsIrcAccessAllowed = false; _sst = sst; _configHandler = new ConfigHandler(); _irc = new IrcManager(_sst); LoadConfig(); }
/// <summary> /// Initializes a new instance of the <see cref="EarlyQuitHandler"/> class. /// </summary> public EarlyQuitHandler(SynServerTool sst) { _sst = sst; _quitsDb = new DbQuits(); _usersDb = new DbUsers(); _bansDb = new DbBans(); GetConfigData(); }
/// <summary> /// Initializes a new instance of the <see cref="Irc"/> class. /// </summary> public IrcManager(SynServerTool sst) { _client = new StandardIrcClient(); _configHandler = new ConfigHandler(); IrcSettings = GetIrcSettingsFromConfig(); var ircCmdProcessor = new IrcCommandProcessor(sst, this); _ircEvent = new IrcEvents(IrcSettings, ircCmdProcessor); _validIrcNick = new Regex(@"^([a-zA-Z\[\]\\`_\^\{\|\}][a-zA-Z0-9\[\]\\`_\^\{\|\}-]{1,15})"); }
/// <summary> /// Initializes a new instance of the <see cref="SuggestTeamsCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public SuggestTeamsCmd(SynServerTool sst) { QlMinArgs = 0; _sst = sst; _qlrHelper = new QlRanksHelper(); _teamBalancer = new TeamBalancer(); _users = new DbUsers(); _balancedRedTeam = new List <PlayerInfo>(); _balancedBlueTeam = new List <PlayerInfo>(); _suggestionTimer = new Timer(); }
/// <summary> /// Initializes a new instance of the <see cref="ModuleCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public ModuleCmd(SynServerTool sst) { _sst = sst; _validModuleNames = new List <string> { AccountDateLimitArg, AccuracyArg, AutoVoteArg, EarlyQuitArg, EloLimitArg, MotdArg, IrcArg, PickupArg, ServersArg }; }
/// <summary> /// Initializes a new instance of the <see cref="AutoVoter"/> class. /// </summary> /// <param name="sst">The main class.</param> public AutoVoter(SynServerTool sst) { _sst = sst; _configHandler = new ConfigHandler(); ValidCallVotes = new List <Vote> { new Vote { Name = "clientkick", Type = VoteType.Clientkick }, new Vote { Name = "fraglimit", Type = VoteType.Fraglimit }, new Vote { Name = "g_gametype", Type = VoteType.GGametype }, new Vote { Name = "kick", Type = VoteType.Kick }, new Vote { Name = "map", Type = VoteType.Map }, new Vote { Name = "map_restart", Type = VoteType.MapRestart }, new Vote { Name = "nextmap", Type = VoteType.Nextmap }, new Vote { Name = "ruleset", Type = VoteType.Ruleset }, new Vote { Name = "shuffle", Type = VoteType.Shuffle }, new Vote { Name = "teamsize", Type = VoteType.Teamsize }, new Vote { Name = "timelimit", Type = VoteType.Timelimit } }; LoadConfig(); }
/// <summary> /// Removes an early quit-related ban. /// </summary> /// <param name="sst">The main class.</param> /// <param name="user">The user.</param> public async Task RemoveQuitRelatedBan(SynServerTool sst, string user) { var banDb = new DbBans(); if (banDb.UserAlreadyBanned(user)) { var bi = banDb.GetBanInfo(user); if (bi.BanType == BanType.AddedByEarlyQuit) { banDb.DeleteUserFromDb(user); if (sst.IsMonitoringServer) { await sst.QlCommands.CmdUnban(user); } Log.Write(string.Format("Removed early quit-related ban for player {0}.", user), _logClassType, _logPrefix); } } }
private static void Main(string[] args) { if (Mutex.WaitOne(TimeSpan.Zero, true)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Create data directory if (!Filepaths.CreateDataDirectory()) { MessageBox.Show( @"Could not create data directory! Make sure that your SST directory is not read-only. Exiting.", @"Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } if (args.Length > 0) { if (args[0].Equals("--restart", StringComparison.InvariantCultureIgnoreCase)) { sst = new SynServerTool(true); } } else { sst = new SynServerTool(false); } // Load the GUI Application.Run(new UserInterface(sst)); } else { MessageBox.Show( @"SST is already running. Only one copy of SST can run at a time!", @"SST is already running", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public UsersCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="VoteYesCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public VoteYesCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="PickupRemoveCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public PickupRemoveCmd(SynServerTool sst) { QlMinArgs = 0; _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="AddUserCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public AddUserCmd(SynServerTool sst) { _sst = sst; _users = new DbUsers(); }
/// <summary> /// Initializes a new instance of the <see cref="AccCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public AccCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="PickupCapCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public PickupPickCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="UnpauseCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public UnpauseCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="UnbanCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public UnbanCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="AccountDateCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public AccountDateCmd(SynServerTool sst) { _sst = sst; _registrationDb = new DbRegistrationDates(); }
/// <summary> /// Initializes a new instance of the <see cref="TeamsizeCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public TeamsizeCmd(SynServerTool sst) { _sst = sst; }
/// <summary> /// Initializes a new instance of the <see cref="AbortCmd"/> class. /// </summary> /// <param name="sst">The main class.</param> public AbortCmd(SynServerTool sst) { _sst = sst; }
public PickupCaptains(SynServerTool sst, PickupManager manager) { _sst = sst; _manager = manager; }
/// <summary> /// Initializes a new instance of the <see cref="IrcModsCmd"/> class. /// </summary> /// <param name="sst">The main tool class.</param> /// <param name="irc">The IRC interface.</param> public IrcModsCmd(SynServerTool sst, IrcManager irc) { _sst = sst; _irc = irc; }
public PickupCmd(SynServerTool sst) { _sst = sst; _userDb = new DbUsers(); }