Allow configuring heartbeat URL

This commit is contained in:
UnknownShadow200 2018-03-15 11:45:45 +11:00
parent 80cf6c2ced
commit f8ecb00e4e
2 changed files with 6 additions and 5 deletions

View File

@ -25,14 +25,13 @@ namespace MCGalaxy.Network {
/// <summary> Heartbeat to ClassiCube.net's web server. </summary>
public sealed class ClassiCubeBeat : Heartbeat {
string url = "http://www.classicube.net/heartbeat.jsp";
string proxyUrl;
public override string URL { get { return url; } }
public override string URL { get { return ServerConfig.HeartbeatURL; } }
public override void Init() {
try {
IPAddress[] addresses = Dns.GetHostAddresses("www.classicube.net");
string hostUrl = new Uri(URL).Host;
IPAddress[] addresses = Dns.GetHostAddresses(hostUrl);
EnsureIPv4Url(addresses);
} catch (Exception ex) {
Logger.Log(LogType.Warning, "Error while trying to retrieve DNS information for classicube.net");

View File

@ -27,7 +27,9 @@ namespace MCGalaxy {
[ConfigString("server-name", "General", "[MCGalaxy] Default", false, asciiChars, 64)]
public static string Name = "[MCGalaxy] Default";
[ConfigString("motd", "General", "Welcome", false, asciiChars, 128)]
public static string MOTD = "Welcome!";
public static string MOTD = "Welcome!";
[ConfigString("HeartbeatURL", "Other", "http://www.classicube.net/heartbeat.jsp", false, ":/.")]
public static string HeartbeatURL = "http://www.classicube.net/heartbeat.jsp";
[ConfigInt("max-players", "Server", 12, 1, 128)]
public static int MaxPlayers = 12;
[ConfigInt("max-guests", "Server", 10, 1, 128)]