Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Knives.Utils;
|
||||
|
||||
namespace Knives.Chat3
|
||||
{
|
||||
public class TrackSpam
|
||||
{
|
||||
private static Hashtable s_Log = new Hashtable();
|
||||
|
||||
public static bool LogSpam( Mobile m, string type, TimeSpan limit )
|
||||
{
|
||||
if ( s_Log.Contains( m ) )
|
||||
{
|
||||
Hashtable table = (Hashtable)s_Log[m];
|
||||
|
||||
if ( table.Contains( type ) )
|
||||
{
|
||||
if ( (DateTime)table[type] > DateTime.Now-limit )
|
||||
return false;
|
||||
|
||||
table[type] = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Hashtable table = new Hashtable();
|
||||
table[type] = DateTime.Now;
|
||||
s_Log[m] = table;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static TimeSpan NextAllowedIn( Mobile m, string type, TimeSpan limit )
|
||||
{
|
||||
if ( s_Log[m] == null )
|
||||
return TimeSpan.FromSeconds( 1 );
|
||||
|
||||
Hashtable table = (Hashtable)s_Log[m];
|
||||
|
||||
if ( table[type] == null || (DateTime)table[type]+limit < DateTime.Now )
|
||||
return TimeSpan.FromSeconds( 1 );
|
||||
|
||||
return (DateTime)table[type]+limit-DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user