public void Add(HaloPlayer p) { try { // Set up a timer safety DateTime dt = DateTime.Now; while (!ready) { // If its been more than 5 seconds, break - we have an infinite loop if (((TimeSpan)DateTime.Now.Subtract(dt)).TotalSeconds > 5) { break; } } // Loop until we have a ready status // Add the player ready = false; if (!base.Contains(p)) { base.Add(p); } ready = true; } catch { ready = true; } }
public void Remove(HaloPlayer p) { if (base.Contains(p)) { base.Remove(p); } }
public int LocateByName(string name) { for (int x = 0; x < base.Count; x++) { HaloPlayer p = (HaloPlayer) base[x]; string baseName = p.Name.ToUpper(); name = name.ToUpper(); // If the strings are equal, return the value if (baseName == name) { return(x); } // Do a LIKE comparison if (StringFunctions.Like(baseName, name, true)) { return(x); } } return(-1); }
public SpamTracker(GameState.HaloPlayer player) { _player = player; _info = new SpamInfo[10]; // We will store 10 samples to compare against; }