mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
parent
1a9c5fa469
commit
b4a60555fc
2 changed files with 1 additions and 25 deletions
|
@ -45,7 +45,6 @@ import java.io.InputStreamReader;
|
|||
import java.io.Writer;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
|
@ -392,12 +391,7 @@ public class ConnectDialog extends MageDialog {
|
|||
connection.setUsername(this.txtUserName.getText().trim());
|
||||
connection.setPassword(this.txtPassword.getText().trim());
|
||||
connection.setForceDBComparison(this.chkForceUpdateDB.isSelected());
|
||||
String allMAC = "";
|
||||
try {
|
||||
allMAC = connection.getMAC();
|
||||
} catch (SocketException ex) {
|
||||
}
|
||||
connection.setUserIdStr(System.getProperty("user.name") + ":" + System.getProperty("os.name") + ":" + MagePreferences.getUserNames() + ":" + allMAC);
|
||||
connection.setUserIdStr(System.getProperty("user.name") + ':' + MagePreferences.getUserNames());
|
||||
MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem());
|
||||
PreferencesDialog.setProxyInformation(connection);
|
||||
|
||||
|
|
|
@ -258,24 +258,6 @@ public class Connection {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static String getMAC() throws SocketException {
|
||||
StringBuilder allMACs = new StringBuilder();
|
||||
for (Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements();) {
|
||||
NetworkInterface iface = interfaces.nextElement();
|
||||
byte[] mac = iface.getHardwareAddress();
|
||||
|
||||
if (mac != null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < mac.length; i++) {
|
||||
sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
|
||||
}
|
||||
sb.append(';');
|
||||
allMACs.append(sb.toString());
|
||||
}
|
||||
}
|
||||
return allMACs.toString();
|
||||
}
|
||||
|
||||
public void setUserData(UserData userData) {
|
||||
this.userData = userData;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue