git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4656 e016b1c5-ed68-44aa-a2f7-31cac88cffde
30 lines
657 B
C#
30 lines
657 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Xml.Linq;
|
|
|
|
/// <summary>
|
|
/// Summary description for ServerBlacklist
|
|
/// </summary>
|
|
public class ServerBlacklist
|
|
{
|
|
List<string> serverIps = new List<string>();
|
|
|
|
public ServerBlacklist(string blacklistFile)
|
|
{
|
|
XDocument document = XDocument.Load(blacklistFile);
|
|
var servers = document.Descendants("Server");
|
|
foreach (var server in servers)
|
|
{
|
|
serverIps.Add(server.Attribute("IP").Value);
|
|
}
|
|
}
|
|
|
|
public bool IsBlacklisted(string serverIp)
|
|
{
|
|
return serverIps.Contains(serverIp);
|
|
}
|
|
|
|
}
|