fCraft.PlayerDB.CountInactivePlayers C# (CSharp) Method

CountInactivePlayers() static private method

static private CountInactivePlayers ( ) : int
return int
        internal static int CountInactivePlayers() {
            int count;
            lock( AddLocker ) {
                playersByIP = new Dictionary<IPAddress, List<PlayerInfo>>();
                PlayerInfo[] playerInfoListCache = PlayerInfoList;
                for( int i = 0; i < playerInfoListCache.Length; i++ ) {
                    if( !playersByIP.ContainsKey( playerInfoListCache[i].LastIP ) ) {
                        playersByIP[playerInfoListCache[i].LastIP] = new List<PlayerInfo>();
                    }
                    playersByIP[playerInfoListCache[i].LastIP].Add( PlayerInfoList[i] );
                }
                count = playerInfoListCache.Count( p => PlayerIsInactive( p, true ) );
                playersByIP = null;
            }
            return count;
        }