Avoid LINQ for .NET 2.0 compatibility

This commit is contained in:
Goodlyay 2019-10-11 14:57:03 -07:00
parent 7c08f167b6
commit f81d87925d

View File

@ -16,7 +16,6 @@ permissions and limitations under the Licenses.
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using MCGalaxy.DB;
using MCGalaxy.SQL;
@ -49,12 +48,13 @@ namespace MCGalaxy {
public static int NonHiddenUniqueIPCount() {
Player[] players = Online.Items;
List<string> IPs = new List<string>();
Dictionary<string, bool> uniqueIPs = new Dictionary<string, bool>();
foreach (Player p in players) {
if (!p.hidden) {
IPs.Add(p.ip);
uniqueIPs[p.ip] = true;
}
}
return IPs.Distinct().Count();
return uniqueIPs.Count;
}
public static Player FindMatches(Player pl, string name, bool onlyCanSee = true) {