Exemplo n.º 1
0
        public SpamFilter(GameState.PlayerArrayList players)
        {
            _trackers = new SpamTracker[players.Count];
            for (int x = 0; x < players.Count; x++)
            {
                _trackers[x] = new SpamTracker(players[x]);
            }
            HaloServer server = (HaloServer)ServerManager.ServerList[0];

            server._serverExtensions._logInterpreter
        }
Exemplo n.º 2
0
        public GameStatus()
        {
            players         = new PlayerArrayList();
            RecentPlayers   = new PlayerArrayList();
            CycleInProgress = true;
            CycleInProgress = false;
            matchEnded      = false;

            // If available, read in the map cycle file.  if not, create an empty cycle arraylist
            mapCycle      = new ArrayList();
            MapCycleIndex = 0;
            HaloServer h        = (HaloServer)ServerManager.ServerList[0];
            string     initFile = h._startupFolder + "\\init.txt";

            MaxPlayers = 16;             // Default, in case a value isn't specified in the init.txt
            try
            {
                if (System.IO.File.Exists(initFile))
                {
                    System.IO.StreamReader sr = new System.IO.StreamReader(
                        new System.IO.FileStream(initFile, System.IO.FileMode.Open));
                    string fullFile = sr.ReadToEnd();
                    fullFile = fullFile.Replace("\r\n", "\n");
                    string[] lines = fullFile.Split('\n');

                    for (int x = 0; x < lines.Length - 1; x++)
                    {
                        if (lines[x].StartsWith("sv_mapcycle_add"))
                        {
                            string entry = lines[x].Replace("sv_mapcycle_add ", "");
                            mapCycle.Add(entry);
                        }
                        if (lines[x].StartsWith("sv_maxplayers"))
                        {
                            string entry = lines[x].Replace("sv_maxplayers ", "");
                            MaxPlayers = Convert.ToInt32(MaxPlayers);
                        }
                    }
                }
                else
                {
                    mapCycle.Add("No mapcycle found on this server.");
                }
            }
            catch
            {
                System.Diagnostics.Trace.WriteLine("Error: Failed to read settings from init.txt");
            }
        }