diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index cfcf25b24f2..16c710e2ac8 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -949,11 +949,15 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } catch (SocketException ex) { } currentConnection.setUserIdStr(System.getProperty("user.name") + ":" + System.getProperty("os.name") + ":" + MagePreferences.getUserNames() + ":" + allMAC); - currentConnection.setProxyType(proxyType); - currentConnection.setProxyHost(proxyServer); - currentConnection.setProxyPort(proxyPort); - currentConnection.setProxyUsername(proxyUsername); - currentConnection.setProxyPassword(proxyPassword); + if (PreferencesDialog.NETWORK_ENABLE_PROXY_SUPPORT) { + currentConnection.setProxyType(proxyType); + currentConnection.setProxyHost(proxyServer); + currentConnection.setProxyPort(proxyPort); + currentConnection.setProxyUsername(proxyUsername); + currentConnection.setProxyPassword(proxyPassword); + } else { + currentConnection.setProxyType(ProxyType.NONE); + } setUserPrefsToConnection(currentConnection); } diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form index aeb23125b61..2fb5afdb761 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form @@ -3170,7 +3170,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index 0b3da3c3277..94238a49468 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -55,6 +55,8 @@ public class PreferencesDialog extends javax.swing.JDialog { private static PreferencesDialog instance; // shared dialog instance + public static final boolean NETWORK_ENABLE_PROXY_SUPPORT = false; // TODO: delete proxy at all after few releases, 2025-02-09 + // WARNING, do not change const values - it must be same for compatibility with user's saved settings public static final String KEY_SHOW_TOOLTIPS_DELAY = "showTooltipsDelay"; public static final String KEY_SHOW_CARD_NAMES = "showCardNames"; @@ -2795,7 +2797,7 @@ public class PreferencesDialog extends javax.swing.JDialog { tabsPanel.addTab("Sounds", tabSounds); - connection_Proxy.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Proxy for server connection and images download")); + connection_Proxy.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Proxy for server connection and images download (DO NOT SUPPORTED)")); cbProxyType.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -3317,6 +3319,11 @@ public class PreferencesDialog extends javax.swing.JDialog { return; } + if (!NETWORK_ENABLE_PROXY_SUPPORT) { + connection.setProxyType(ProxyType.NONE); + return; + } + connection.setProxyType(configProxyType); if (configProxyType != ProxyType.NONE) { String host = getCachedValue(KEY_PROXY_ADDRESS, ""); diff --git a/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java b/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java index b0046e18c54..d2bb68b4c70 100644 --- a/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java +++ b/Mage.Server.Console/src/main/java/mage/server/console/ConnectDialog.java @@ -365,12 +365,17 @@ public class ConnectDialog extends JDialog { connection.setPort(Integer.parseInt(this.txtPort.getText())); connection.setAdminPassword(new String(txtPassword.getPassword())); connection.setUsername(SessionImpl.ADMIN_NAME); - connection.setProxyType((ProxyType) this.cbProxyType.getSelectedItem()); - if (!this.cbProxyType.getSelectedItem().equals(ProxyType.NONE)) { - connection.setProxyHost(this.txtProxyServer.getText()); - connection.setProxyPort(Integer.parseInt(this.txtProxyPort.getText())); - connection.setProxyUsername(this.txtProxyUserName.getText()); - connection.setProxyPassword(new String(this.txtPasswordField.getPassword())); + + if (false) { // TODO: delete proxy at all after few releases, 2025-02-09 + connection.setProxyType((ProxyType) this.cbProxyType.getSelectedItem()); + if (!this.cbProxyType.getSelectedItem().equals(ProxyType.NONE)) { + connection.setProxyHost(this.txtProxyServer.getText()); + connection.setProxyPort(Integer.parseInt(this.txtProxyPort.getText())); + connection.setProxyUsername(this.txtProxyUserName.getText()); + connection.setProxyPassword(new String(this.txtPasswordField.getPassword())); + } + } else { + connection.setProxyType(ProxyType.NONE); } logger.debug("connecting: " + connection.getProxyType() + ' ' + connection.getProxyHost() + ' ' + connection.getProxyPort()); diff --git a/Mage.Server.Console/src/main/java/mage/server/console/ConsoleFrame.java b/Mage.Server.Console/src/main/java/mage/server/console/ConsoleFrame.java index 338b6761e25..3ad175c942a 100644 --- a/Mage.Server.Console/src/main/java/mage/server/console/ConsoleFrame.java +++ b/Mage.Server.Console/src/main/java/mage/server/console/ConsoleFrame.java @@ -101,13 +101,18 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient { newConnection.setPort(ConsoleFrame.getPreferences().getInt("serverPort", 17171)); newConnection.setUsername(SessionImpl.ADMIN_NAME); newConnection.setAdminPassword(ConsoleFrame.getPreferences().get("password", "")); - newConnection.setProxyType(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH))); - if (!newConnection.getProxyType().equals(Connection.ProxyType.NONE)) { - newConnection.setProxyHost(ConsoleFrame.getPreferences().get("proxyAddress", "")); - newConnection.setProxyPort(ConsoleFrame.getPreferences().getInt("proxyPort", 0)); - newConnection.setProxyUsername(ConsoleFrame.getPreferences().get("proxyUsername", "")); - newConnection.setProxyPassword(ConsoleFrame.getPreferences().get("proxyPassword", "")); + if (false) { // TODO: delete proxy at all after few releases, 2025-02-09 + newConnection.setProxyType(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH))); + if (!newConnection.getProxyType().equals(Connection.ProxyType.NONE)) { + newConnection.setProxyHost(ConsoleFrame.getPreferences().get("proxyAddress", "")); + newConnection.setProxyPort(ConsoleFrame.getPreferences().getInt("proxyPort", 0)); + newConnection.setProxyUsername(ConsoleFrame.getPreferences().get("proxyUsername", "")); + newConnection.setProxyPassword(ConsoleFrame.getPreferences().get("proxyPassword", "")); + } + } else { + newConnection.setProxyType(Connection.ProxyType.NONE); } + status = connect(newConnection); } return status;