Skip to content

Commit

Permalink
Minor mac address related fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Filigrani committed Mar 12, 2024
1 parent 8a2153e commit 39ff91e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions SkyCoopDedicatedServer/MyMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class BuildInfo
public const string Description = "Multiplayer mod";
public const string Author = "Filigrani & REDcat";
public const string Company = null;
public const string Version = "0.12.1";
public const string Version = "0.12.2";
public const string DownloadLink = null;
public const int RandomGenVersion = 5;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ public static void Initialize()
DiscordManager.Init();

Logger.Log("Server running on version "+ BuildInfo.Version);
Logger.Log("Build Mark 12");
Logger.Log("Build Mark 13");
}

public static string ExecuteCommand(string CMD, int _fromClient = -1)
Expand Down
15 changes: 9 additions & 6 deletions SkyCoopDedicatedServer/Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2910,12 +2910,15 @@ public static long GetDeterministicId(string m)
}
public static string GetMacAddress()
{
string macAddr =
(
from nic in NetworkInterface.GetAllNetworkInterfaces()
where nic.OperationalStatus == OperationalStatus.Up
select nic.GetPhysicalAddress().ToString()
).FirstOrDefault();
string macAddr = string.Empty;
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
if (nic.OperationalStatus == OperationalStatus.Up && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback && nic.GetPhysicalAddress().ToString().Length > 4)
{
macAddr = nic.GetPhysicalAddress().ToString();
break;
}
}
return macAddr;
}

Expand Down

0 comments on commit 39ff91e

Please sign in to comment.