Add "less than 2gb ram" warning
This commit is contained in:
parent
9dce68e6e2
commit
68437f0a22
2 changed files with 5 additions and 1 deletions
|
|
@ -177,7 +177,7 @@ namespace TShockAPI
|
||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long GetTotalSystemRam(bool isMono)
|
public long GetTotalSystemRam(bool isMono)
|
||||||
{
|
{
|
||||||
if (totalMem != 0)
|
if (totalMem != 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,10 @@ namespace TShockAPI
|
||||||
|
|
||||||
Log.ConsoleInfo("TShock {0} ({1}) now running.", Version, VersionCodename);
|
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.GamePostInitialize.Register(this, OnPostInit);
|
||||||
ServerApi.Hooks.GameUpdate.Register(this, OnUpdate);
|
ServerApi.Hooks.GameUpdate.Register(this, OnUpdate);
|
||||||
ServerApi.Hooks.GameHardmodeTileUpdate.Register(this, OnHardUpdate);
|
ServerApi.Hooks.GameHardmodeTileUpdate.Register(this, OnHardUpdate);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue