Exemplo n.º 1
0
 /// <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();
 }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
 /// <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();
 }
Exemplo n.º 4
0
 /// <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();
 }
Exemplo n.º 5
0
 /// <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>();
 }
Exemplo n.º 6
0
Arquivo: Motd.cs Projeto: syncore/SST
 /// <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();
 }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
0
 /// <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);
 }
Exemplo n.º 9
0
 /// <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();
 }
Exemplo n.º 10
0
 /// <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();
 }
Exemplo n.º 11
0
        /// <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})");
        }
Exemplo n.º 12
0
 /// <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();
 }
Exemplo n.º 13
0
 /// <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
     };
 }
Exemplo n.º 14
0
        /// <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();
        }
Exemplo n.º 15
0
        /// <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);
                }
            }
        }
Exemplo n.º 16
0
        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);
            }
        }
Exemplo n.º 17
0
 public UsersCmd(SynServerTool sst)
 {
     _sst = sst;
 }
Exemplo n.º 18
0
 /// <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;
 }
Exemplo n.º 19
0
 /// <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;
 }
Exemplo n.º 20
0
 /// <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();
 }
Exemplo n.º 21
0
 /// <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;
 }
Exemplo n.º 22
0
 /// <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;
 }
Exemplo n.º 23
0
 /// <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;
 }
Exemplo n.º 24
0
 /// <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;
 }
Exemplo n.º 25
0
 /// <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();
 }
Exemplo n.º 26
0
 /// <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;
 }
Exemplo n.º 27
0
 /// <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;
 }
Exemplo n.º 28
0
 public PickupCaptains(SynServerTool sst, PickupManager manager)
 {
     _sst     = sst;
     _manager = manager;
 }
Exemplo n.º 29
0
 /// <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;
 }
Exemplo n.º 30
0
 public PickupCmd(SynServerTool sst)
 {
     _sst    = sst;
     _userDb = new DbUsers();
 }