diff --git a/moonlight-common/src/com/limelight/nvstream/NvConnection.java b/moonlight-common/src/com/limelight/nvstream/NvConnection.java index 375de1a9..d8e8e262 100644 --- a/moonlight-common/src/com/limelight/nvstream/NvConnection.java +++ b/moonlight-common/src/com/limelight/nvstream/NvConnection.java @@ -2,11 +2,8 @@ package com.limelight.nvstream; import java.io.IOException; import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; import java.net.UnknownHostException; import java.security.NoSuchAlgorithmException; -import java.util.Enumeration; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -82,65 +79,6 @@ public class NvConnection { return keyGen.generateKey(); } - public static String getMacAddressString() throws SocketException { - Enumeration ifaceList; - NetworkInterface selectedIface = null; - - // First look for a WLAN interface (since those generally aren't removable) - ifaceList = NetworkInterface.getNetworkInterfaces(); - while (selectedIface == null && ifaceList.hasMoreElements()) { - NetworkInterface iface = ifaceList.nextElement(); - - if (iface.getName().startsWith("wlan") && - iface.getHardwareAddress() != null && - iface.getHardwareAddress().length > 0) { - selectedIface = iface; - } - } - - // If we didn't find that, look for an Ethernet interface - ifaceList = NetworkInterface.getNetworkInterfaces(); - while (selectedIface == null && ifaceList.hasMoreElements()) { - NetworkInterface iface = ifaceList.nextElement(); - - if (iface.getName().startsWith("eth") && - iface.getHardwareAddress() != null && - iface.getHardwareAddress().length > 0) { - selectedIface = iface; - } - } - - // Now just find something with a MAC address - ifaceList = NetworkInterface.getNetworkInterfaces(); - while (selectedIface == null && ifaceList.hasMoreElements()) { - NetworkInterface iface = ifaceList.nextElement(); - - if (iface.getHardwareAddress() != null && - iface.getHardwareAddress().length > 0) { - selectedIface = iface; - break; - } - } - - if (selectedIface == null) { - return null; - } - - byte[] macAddress = selectedIface.getHardwareAddress(); - if (macAddress != null) { - StringBuilder addrStr = new StringBuilder(); - for (int i = 0; i < macAddress.length; i++) { - addrStr.append(String.format("%02x", macAddress[i])); - if (i != macAddress.length - 1) { - addrStr.append(':'); - } - } - return addrStr.toString(); - } - - return null; - } - public void stop() { threadPool.shutdownNow();