fix(core): Adds Hashed & Hierarchical Timer Wheel (#655)
- Removes TimerPriority - Removes TimerThread - Adds a [Hashed & Hierarchical Timer Wheel](http://www.cs.columbia.edu/~nahum/w6998/papers/ton97-timing-wheels.pdf)
This commit is contained in:
parent
b99d520019
commit
fb915992dd
138 changed files with 468 additions and 802 deletions
|
|
@ -3022,8 +3022,6 @@ namespace Server.Mobiles
|
|||
m_Owner = owner;
|
||||
|
||||
m_Owner.m_NextDetectHidden = Core.TickCount;
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ namespace Server.Mobiles
|
|||
var rand = Utility.Random(527);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
500 527 No Hue Color 94.88% 0
|
||||
10 527 Green 1.90% 0x8295
|
||||
10 527 Green 1.90% 0x8163 (Very Close to Above Green) //this one is an approximation
|
||||
5 527 Dark Green 0.95% 0x87D4
|
||||
1 527 Valorite 0.19% 0x88AB
|
||||
1 527 Midnight Blue 0.19% 0x8258
|
||||
|
||||
|
||||
* */
|
||||
|
||||
if (rand <= 0)
|
||||
|
|
@ -264,7 +264,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -5599,7 +5599,6 @@ namespace Server.Mobiles
|
|||
public DeleteTimer(Mobile creature, TimeSpan delay) : base(delay)
|
||||
{
|
||||
m = creature;
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
@ -5618,7 +5617,6 @@ namespace Server.Mobiles
|
|||
public LoyaltyTimer() : base(InternalDelay, InternalDelay)
|
||||
{
|
||||
m_NextHourlyCheck = Core.Now + TimeSpan.FromHours(1.0);
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ namespace Server.Mobiles
|
|||
public UnhideTimer(ShadowFiend owner) : base(TimeSpan.FromSeconds(30.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ namespace Server.Mobiles
|
|||
public override void OnDeath( Container c )
|
||||
{
|
||||
base.OnDeath( c );
|
||||
|
||||
|
||||
if (Utility.RandomDouble() < 0.15)
|
||||
c.DropItem( new DisintegratingThesisNotes() );
|
||||
|
||||
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
c.DropItem( new ParrotItem() );
|
||||
}
|
||||
|
|
@ -120,7 +120,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -79,14 +79,13 @@ namespace Server.Mobiles
|
|||
private Mobile m_From;
|
||||
private Mobile m_Mobile;
|
||||
private int m_Count;
|
||||
|
||||
|
||||
public InternalTimer( Mobile from, Mobile m ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
m_Mobile = m;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace Server.Mobiles
|
|||
public override void OnDeath( Container c )
|
||||
{
|
||||
base.OnDeath( c );
|
||||
|
||||
|
||||
if (Utility.RandomDouble() < 0.025)
|
||||
{
|
||||
switch ( Utility.Random( 18 ) )
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Mobiles
|
|||
case 17: c.DropItem( new GreymistGloves() ); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
c.DropItem( new ParrotItem() );
|
||||
}
|
||||
|
|
@ -153,7 +153,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -242,7 +242,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -189,7 +189,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_From = from;
|
||||
m_Mobile = m;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ namespace Server.Mobiles
|
|||
m_Mobile = m;
|
||||
m_Mod = mod;
|
||||
m_Table = table;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -131,7 +131,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ namespace Server.Mobiles
|
|||
public ExpireTimer(Mobile m, TimeSpan delay) : base(delay)
|
||||
{
|
||||
m_Mobile = m;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -248,7 +248,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_Mods = mods;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ namespace Server.Mobiles
|
|||
{
|
||||
m_Mobile = m;
|
||||
m_From = from;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
public void DoExpire()
|
||||
|
|
|
|||
|
|
@ -236,8 +236,6 @@ namespace Server.Mobiles
|
|||
public ExpirePolymorphTimer(Mobile owner) : base(TimeSpan.FromMinutes(3.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ namespace Server.Mobiles
|
|||
public AutokillTimer(Dummy owner) : base(TimeSpan.FromMinutes(5.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -546,7 +546,6 @@ namespace Server.Mobiles
|
|||
|
||||
public TeleportTimer(Mobile owner) : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
|
@ -643,7 +642,6 @@ namespace Server.Mobiles
|
|||
|
||||
public GoodiesTimer(Map map, int x, int y) : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))
|
||||
{
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
|
||||
m_Map = map;
|
||||
m_X = x;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ namespace Server.Mobiles
|
|||
public DrainTimer(HarrowerTentacles owner) : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_Owner = owner;
|
||||
Priority = TimerPriority.TwoFiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ namespace Server.Mobiles
|
|||
public ParagonStamRegen(Mobile m)
|
||||
: base(FastRegenRate, FastRegenRate)
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
|
||||
m_Owner = m as BaseCreature;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -708,8 +708,6 @@ namespace Server.Mobiles
|
|||
: base(delay)
|
||||
{
|
||||
m_Mobile = m;
|
||||
|
||||
Priority = TimerPriority.OneSecond;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -1352,8 +1352,6 @@ namespace Server.Mobiles
|
|||
public PayTimer(PlayerVendor vendor, TimeSpan delay) : base(delay, GetInterval())
|
||||
{
|
||||
m_Vendor = vendor;
|
||||
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
public static TimeSpan GetInterval()
|
||||
|
|
@ -1706,8 +1704,6 @@ namespace Server.Mobiles
|
|||
public ExpireTimer(PlayerVendorPlaceholder placeholder) : base(TimeSpan.FromMinutes(2.0))
|
||||
{
|
||||
m_Placeholder = placeholder;
|
||||
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -365,8 +365,6 @@ namespace Server.Mobiles
|
|||
public RentalExpireTimer(RentedVendor vendor, TimeSpan delay) : base(delay, vendor.RentalDuration.Duration)
|
||||
{
|
||||
m_Vendor = vendor;
|
||||
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -108,8 +108,6 @@ namespace Server.Mobiles
|
|||
public ExpireTimer(VendorInventory inventory, TimeSpan delay) : base(delay)
|
||||
{
|
||||
m_Inventory = inventory;
|
||||
|
||||
Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue