Skip to content

Commit 7814157

Browse files
committed
Set event codes for address changes
1 parent 203dbdb commit 7814157

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/ErrorCodes.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
6011 - Ping error
77
6012 - Get public IP error
8+
6013 - Public IP address change (warning)
9+
6014 - Local IP address change (warning)
810

911
6021 - Update check failed
1012
6022 - Update failed

modNetwork.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static string GetLocalIPAddress()
8383
string oldLocalIP = modDatabase.GetConfig("Ping_LastKnownLocalIP");
8484
if (oldLocalIP != newLocalIP)
8585
{
86-
modLogging.LogEvent("Local IP address changed from " + oldLocalIP + " to " + newLocalIP, EventLogEntryType.Warning);
86+
modLogging.LogEvent("Local IP address changed from " + oldLocalIP + " to " + newLocalIP, EventLogEntryType.Warning, 6014);
8787
modDatabase.AddOrUpdateConfig(new modDatabase.Config { Key = "Ping_LastKnownLocalIP", Value = newLocalIP });
8888
}
8989

@@ -119,7 +119,7 @@ public static string GetPublicIPAddress()
119119
string oldPublicIP = modDatabase.GetConfig("Ping_LastKnownPublicIP");
120120
if (oldPublicIP != newPublicIP)
121121
{
122-
modLogging.LogEvent("Public IP address changed from " + oldPublicIP + " to " + newPublicIP, EventLogEntryType.Warning);
122+
modLogging.LogEvent("Public IP address changed from " + oldPublicIP + " to " + newPublicIP, EventLogEntryType.Warning, 6013);
123123
modDatabase.AddOrUpdateConfig(new modDatabase.Config { Key = "Ping_LastKnownPublicIP", Value = newPublicIP });
124124
}
125125

0 commit comments

Comments
 (0)