From 68437f0a224580de572737d853addadc06cc5970 Mon Sep 17 00:00:00 2001 From: quake1337 Date: Mon, 14 Aug 2017 14:39:22 +0200 Subject: [PATCH] Add "less than 2gb ram" warning --- TShockAPI/StatTracker.cs | 2 +- TShockAPI/TShock.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TShockAPI/StatTracker.cs b/TShockAPI/StatTracker.cs index 47e5d2cc..61f42d14 100644 --- a/TShockAPI/StatTracker.cs +++ b/TShockAPI/StatTracker.cs @@ -177,7 +177,7 @@ namespace TShockAPI return plugins; } - private long GetTotalSystemRam(bool isMono) + public long GetTotalSystemRam(bool isMono) { if (totalMem != 0) { diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 022e70e5..8a109a08 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -329,6 +329,10 @@ namespace TShockAPI Log.ConsoleInfo("TShock {0} ({1}) now running.", Version, VersionCodename); + if (StatTracker.GetTotalSystemRam(ServerApi.RunningMono) < 2) + { + Log.ConsoleInfo("This machine has less than 2 gigabytes of RAM installed. Be advised that it might not be enough to run TShock."); + } ServerApi.Hooks.GamePostInitialize.Register(this, OnPostInit); ServerApi.Hooks.GameUpdate.Register(this, OnUpdate); ServerApi.Hooks.GameHardmodeTileUpdate.Register(this, OnHardUpdate);