diff --git a/DiscordBotPlugin/DiscordBotPlugin.csproj b/DiscordBotPlugin/DiscordBotPlugin.csproj index a693418..baf5631 100644 --- a/DiscordBotPlugin/DiscordBotPlugin.csproj +++ b/DiscordBotPlugin/DiscordBotPlugin.csproj @@ -59,23 +59,23 @@ MinimumRecommendedRules.ruleset - - ..\packages\Discord.Net.Commands.3.12.0\lib\net461\Discord.Net.Commands.dll + + ..\packages\Discord.Net.Commands.3.14.1\lib\net461\Discord.Net.Commands.dll - - ..\packages\Discord.Net.Core.3.12.0\lib\net461\Discord.Net.Core.dll + + ..\packages\Discord.Net.Core.3.14.1\lib\net461\Discord.Net.Core.dll - - ..\packages\Discord.Net.Interactions.3.12.0\lib\net461\Discord.Net.Interactions.dll + + ..\packages\Discord.Net.Interactions.3.14.1\lib\net461\Discord.Net.Interactions.dll - - ..\packages\Discord.Net.Rest.3.12.0\lib\net461\Discord.Net.Rest.dll + + ..\packages\Discord.Net.Rest.3.14.1\lib\net461\Discord.Net.Rest.dll - - ..\packages\Discord.Net.Webhook.3.12.0\lib\netstandard2.0\Discord.Net.Webhook.dll + + ..\packages\Discord.Net.Webhook.3.14.1\lib\netstandard2.0\Discord.Net.Webhook.dll - - ..\packages\Discord.Net.WebSocket.3.12.0\lib\net461\Discord.Net.WebSocket.dll + + ..\packages\Discord.Net.WebSocket.3.14.1\lib\net461\Discord.Net.WebSocket.dll H:\AMPDatastore\Instances\Minecraft01\Plugins\LocalFileBackupPlugin\LocalFileBackupPlugin.dll diff --git a/DiscordBotPlugin/PluginMain.cs b/DiscordBotPlugin/PluginMain.cs index 7bee5d4..8c6769c 100644 --- a/DiscordBotPlugin/PluginMain.cs +++ b/DiscordBotPlugin/PluginMain.cs @@ -15,6 +15,7 @@ using LocalFileBackupPlugin; using System.Diagnostics; using System.Diagnostics.Tracing; +using System.Threading.Tasks.Sources; namespace DiscordBotPlugin { @@ -403,7 +404,8 @@ private async Task GetServerInfo(bool updateExisting, SocketSlashCommand msg, bo //if server is online, get the uptime info and set the field accordingly if (application.State == ApplicationState.Ready) { - TimeSpan uptime = DateTime.Now.Subtract(application.StartTime); + + TimeSpan uptime = DateTime.Now.Subtract(application.StartTime.ToLocalTime()); embed.AddField("Uptime", string.Format("{0:D2}:{1:D2}:{2:D2}:{3:D2}", uptime.Days, uptime.Hours, uptime.Minutes, uptime.Seconds), true); } @@ -695,7 +697,7 @@ private async Task UpdateWebPanel(string webPanelPath) //if server is online, get the uptime info and set the field accordingly if (application.State == ApplicationState.Ready) { - TimeSpan up = DateTime.Now.Subtract(application.StartTime); + TimeSpan up = DateTime.Now.Subtract(application.StartTime.ToLocalTime()); uptime = string.Format("{0:D2}:{1:D2}:{2:D2}:{3:D2}", up.Days, up.Hours, up.Minutes, up.Seconds); } else @@ -2213,7 +2215,8 @@ private string GetMemoryUsage() double totalAvailable = application.MaxRAMUsage; if (totalAvailable == 0) totalAvailable = platform.InstalledRAMMB; - double usage = application.GetRAMUsage(); + double usage = application.GetPhysicalRAMUsage(); + if(usage >= 1024 || (totalAvailable > 1024 && _settings.MainSettings.ShowMaximumRAM)) gb = true; diff --git a/DiscordBotPlugin/packages.config b/DiscordBotPlugin/packages.config index 8fe533f..cc68fb9 100644 --- a/DiscordBotPlugin/packages.config +++ b/DiscordBotPlugin/packages.config @@ -1,12 +1,12 @@  - - - - - - - + + + + + + +