Add @ijwu's changes + add /proc/meminfo trick for linux
This commit is contained in:
parent
68437f0a22
commit
e6ec63a90e
2 changed files with 39 additions and 5 deletions
|
|
@ -329,10 +329,12 @@ namespace TShockAPI
|
|||
|
||||
Log.ConsoleInfo("TShock {0} ({1}) now running.", Version, VersionCodename);
|
||||
|
||||
if (StatTracker.GetTotalSystemRam(ServerApi.RunningMono) < 2)
|
||||
var systemRam = StatTracker.GetFreeSystemRam(ServerApi.RunningMono);
|
||||
if (systemRam > -1 && systemRam < 2048)
|
||||
{
|
||||
Log.ConsoleInfo("This machine has less than 2 gigabytes of RAM installed. Be advised that it might not be enough to run TShock.");
|
||||
Log.ConsoleError("This machine has less than 2 gigabytes of RAM free. 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue