Files
assaultcube-/source/CubeMS/App_Code/ServerBlacklist.cs
T
driAn d0e041bfa7 new masterserver code
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4656 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-10-12 19:00:46 +00:00

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);
}
}