public static bool IsAuthorizedGameServer(IPAddress RemoteIP)
{
// Local is always authorized
if (IPAddress.IsLoopback(RemoteIP) || HttpServer.LocalIPs.Contains(RemoteIP))
return true;
// Setup local vars
IPAddress Ip;
// Loop through all Config allowed game hosts, and determine if the remote host is allowed
// to post snapshots here
if (!String.IsNullOrWhiteSpace(Program.Config.ASP_GameHosts))
{
string[] Hosts = Program.Config.ASP_GameHosts.Split(',');
foreach (string Host in Hosts)
{
if (IPAddress.TryParse(Host, out Ip) && Ip.Equals(RemoteIP))
{
return true;
}
}
}
return false;
}