Skip to content

Commit

Permalink
Upgrade default CnCNet service URLs to HTTPS (#624)
Browse files Browse the repository at this point in the history
* Defaults should be https

* Update urls
  • Loading branch information
GrantBartlett authored Jan 5, 2025
1 parent f1f2660 commit b773bda
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
14 changes: 7 additions & 7 deletions ClientCore/ClientConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ public void RefreshSettings()

public string LongGameName => clientDefinitionsIni.GetStringValue(SETTINGS, "LongGameName", "Tiberian Sun");

public string LongSupportURL => clientDefinitionsIni.GetStringValue(SETTINGS, "LongSupportURL", "http://www.moddb.com/members/rampastring");
public string LongSupportURL => clientDefinitionsIni.GetStringValue(SETTINGS, "LongSupportURL", "https://www.moddb.com/members/rampastring");

public string ShortSupportURL => clientDefinitionsIni.GetStringValue(SETTINGS, "ShortSupportURL", "www.moddb.com/members/rampastring");

public string ChangelogURL => clientDefinitionsIni.GetStringValue(SETTINGS, "ChangelogURL", "http://www.moddb.com/mods/the-dawn-of-the-tiberium-age/tutorials/change-log");
public string ChangelogURL => clientDefinitionsIni.GetStringValue(SETTINGS, "ChangelogURL", "https://www.moddb.com/mods/the-dawn-of-the-tiberium-age/tutorials/change-log");

public string CreditsURL => clientDefinitionsIni.GetStringValue(SETTINGS, "CreditsURL", "http://www.moddb.com/mods/the-dawn-of-the-tiberium-age/tutorials/credits#Rampastring");
public string CreditsURL => clientDefinitionsIni.GetStringValue(SETTINGS, "CreditsURL", "https://www.moddb.com/mods/the-dawn-of-the-tiberium-age/tutorials/credits#Rampastring");

public string ManualDownloadURL => clientDefinitionsIni.GetStringValue(SETTINGS, "ManualDownloadURL", string.Empty);

Expand Down Expand Up @@ -400,13 +400,13 @@ public IEnumerable<string> SupplementalMapFileExtensions

#region Network definitions

public string CnCNetTunnelListURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetTunnelListURL", "http://cncnet.org/master-list");
public string CnCNetTunnelListURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetTunnelListURL", "https://cncnet.org/master-list");

public string CnCNetPlayerCountURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetPlayerCountURL", "http://api.cncnet.org/status");
public string CnCNetPlayerCountURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetPlayerCountURL", "https://api.cncnet.org/status");

public string CnCNetMapDBDownloadURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetMapDBDownloadURL", "http://mapdb.cncnet.org");
public string CnCNetMapDBDownloadURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetMapDBDownloadURL", "https://mapdb.cncnet.org");

public string CnCNetMapDBUploadURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetMapDBUploadURL", "http://mapdb.cncnet.org/upload");
public string CnCNetMapDBUploadURL => networkDefinitionsIni.GetStringValue(SETTINGS, "CnCNetMapDBUploadURL", "https://mapdb.cncnet.org/upload");

public bool DisableDiscordIntegration => networkDefinitionsIni.GetBooleanValue(SETTINGS, "DisableDiscordIntegration", false);

Expand Down
2 changes: 1 addition & 1 deletion DXMainClient/DXGUI/Generic/ExtrasWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void BtnExMapEditor_LeftClick(object sender, EventArgs e)

private void BtnExCredits_LeftClick(object sender, EventArgs e)
{
ProcessLauncher.StartShellProcess(MainClientConstants.CREDITS_URL);
ProcessLauncher.StartShellProcess(ClientConfiguration.Instance.CreditsURL);
}

private void BtnExCancel_LeftClick(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion DXMainClient/DXGUI/Generic/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ private void BtnStatistics_LeftClick(object sender, EventArgs e) =>

private void BtnCredits_LeftClick(object sender, EventArgs e)
{
ProcessLauncher.StartShellProcess(MainClientConstants.CREDITS_URL);
ProcessLauncher.StartShellProcess(ClientConfiguration.Instance.CreditsURL);
}

private void BtnExtras_LeftClick(object sender, EventArgs e) =>
Expand Down
12 changes: 0 additions & 12 deletions DXMainClient/Domain/MainClientConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ namespace DTAClient.Domain
{
public static class MainClientConstants
{
public static string CNCNET_TUNNEL_LIST_URL = "http://cncnet.org/master-list";

public static string GAME_NAME_LONG = "CnCNet Client";
public static string GAME_NAME_SHORT = "CnCNet";

public static string CREDITS_URL = "http://rampastring.cncnet.org/TS/Credits.txt";

public static string SUPPORT_URL_SHORT = "www.cncnet.org";

public static bool USE_ISOMETRIC_CELLS = true;
public static int TDRA_WAYPOINT_COEFFICIENT = 128;
public static int MAP_CELL_SIZE_X = 48;
Expand Down Expand Up @@ -87,13 +81,7 @@ public static void Initialize()

GAME_NAME_SHORT = clientConfiguration.LocalGame;
GAME_NAME_LONG = clientConfiguration.LongGameName;

SUPPORT_URL_SHORT = clientConfiguration.ShortSupportURL;

CREDITS_URL = clientConfiguration.CreditsURL;

CNCNET_TUNNEL_LIST_URL = clientConfiguration.CnCNetTunnelListURL;

USE_ISOMETRIC_CELLS = clientConfiguration.UseIsometricCells;
TDRA_WAYPOINT_COEFFICIENT = clientConfiguration.WaypointCoefficient;
MAP_CELL_SIZE_X = clientConfiguration.MapCellSizeX;
Expand Down
1 change: 1 addition & 0 deletions DXMainClient/Domain/Multiplayer/CnCNet/CnCNetTunnel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public List<int> GetPlayerPortInfo(int playerCount)
{
Logger.Log($"Contacting tunnel at {Address}:{Port}");

// Do not use https here as not supported by tunnels
string addressString = $"http://{Address}:{Port}/request?clients={playerCount}";
Logger.Log($"Downloading from {addressString}");

Expand Down
4 changes: 2 additions & 2 deletions DXMainClient/Domain/Multiplayer/CnCNet/TunnelHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ private Task PingCurrentTunnelAsync(bool checkTunnelList = false)
});
}

private bool OnlineTunnelDataAvailable => !string.IsNullOrWhiteSpace(MainClientConstants.CNCNET_TUNNEL_LIST_URL);
private bool OnlineTunnelDataAvailable => !string.IsNullOrWhiteSpace(ClientConfiguration.Instance.CnCNetTunnelListURL);
private bool OfflineTunnelDataAvailable => SafePath.GetFile(ProgramConstants.ClientUserFilesPath, "tunnel_cache").Exists;

private byte[] GetRawTunnelDataOnline()
{
WebClient client = new ExtendedWebClient();
return client.DownloadData(MainClientConstants.CNCNET_TUNNEL_LIST_URL);
return client.DownloadData(ClientConfiguration.Instance.CnCNetTunnelListURL);
}

private byte[] GetRawTunnelDataOffline()
Expand Down

0 comments on commit b773bda

Please sign in to comment.