Check tile thresholds and banned items every second instead of every update.
Increase tile threshold to accommodate for ^.
This commit is contained in:
parent
c4efc96303
commit
37d30cd49e
2 changed files with 31 additions and 22 deletions
|
|
@ -46,7 +46,7 @@ namespace TShockAPI
|
||||||
public bool RangeChecks = true;
|
public bool RangeChecks = true;
|
||||||
public bool SpamChecks = false;
|
public bool SpamChecks = false;
|
||||||
public bool DisableBuild = false;
|
public bool DisableBuild = false;
|
||||||
public int TileThreshold = 20;
|
public int TileThreshold = 60;
|
||||||
|
|
||||||
public float[] AdminChatRGB = { 255, 0, 0 };
|
public float[] AdminChatRGB = { 255, 0, 0 };
|
||||||
public string AdminChatPrefix = "(Admin) ";
|
public string AdminChatPrefix = "(Admin) ";
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,8 @@ namespace TShockAPI
|
||||||
public static Process TShockProcess;
|
public static Process TShockProcess;
|
||||||
public static bool OverridePort = false;
|
public static bool OverridePort = false;
|
||||||
|
|
||||||
|
public static double ElapsedTime;
|
||||||
|
|
||||||
public override Version Version
|
public override Version Version
|
||||||
{
|
{
|
||||||
get { return VersionNum; }
|
get { return VersionNum; }
|
||||||
|
|
@ -320,6 +322,12 @@ namespace TShockAPI
|
||||||
if (Backups.IsBackupTime)
|
if (Backups.IsBackupTime)
|
||||||
Backups.Backup();
|
Backups.Backup();
|
||||||
|
|
||||||
|
ElapsedTime += time.ElapsedGameTime.TotalMilliseconds;
|
||||||
|
|
||||||
|
//call these every second, not every update
|
||||||
|
if (ElapsedTime >= 1000)
|
||||||
|
{
|
||||||
|
ElapsedTime = 0;
|
||||||
foreach (TSPlayer player in TShock.Players)
|
foreach (TSPlayer player in TShock.Players)
|
||||||
{
|
{
|
||||||
if (player != null && player.Active)
|
if (player != null && player.Active)
|
||||||
|
|
@ -362,6 +370,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnJoin(int ply, HandledEventArgs handler)
|
private void OnJoin(int ply, HandledEventArgs handler)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue