Files
Disco/Disco.Data/Configuration/CommunityHelpers.cs
T
Gary Sharp fb6067afc3 Update: Configuration Optimisation and Caching
Loads entire configuration at start-up (rather than scope-based
loading). Deserialization occurs once, with the resulting value cached
and replayed if the requested type matches.
2014-05-07 22:45:59 +10:00

30 lines
872 B
C#

using System;
using System.Linq;
using System.Net;
namespace Disco.Data.Configuration
{
public static class CommunityHelpers
{
public static string CommunityUrl()
{
// Special case for DiscoCommunity Hosting Network
try
{
var ip = (from addr in Dns.GetHostEntry(Dns.GetHostName()).AddressList
where addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork
&& addr.ToString().StartsWith("10.131.200.")
select addr).FirstOrDefault();
if (ip != null)
{
return "http://hades3:9393/base/";
}
}
catch (Exception)
{ } // Ignore Errors
return "https://discoict.com.au/base/";
}
}
}