本文整理汇总了C#中Server.Misc.DeleteTimer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# DeleteTimer.Start方法的具体用法?C# DeleteTimer.Start怎么用?C# DeleteTimer.Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Misc.DeleteTimer
的用法示例。
在下文中一共展示了DeleteTimer.Start方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginDeleteTimer
public void BeginDeleteTimer()
{
if ( !(this is BaseEscortable) && !Summoned && !Deleted && !IsStabled )
{
StopDeleteTimer();
m_DeleteTimer = new DeleteTimer( this, TimeSpan.FromDays( 3.0 ) );
m_DeleteTimer.Start();
}
}
示例2: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch( version )
{
case 2:
{
alignment = (Alignment)reader.ReadInt();
goto case 1;
}
case 1:
{
TimeSpan deleteTime = TimeSpan.Zero;
if( version >= 1 )
deleteTime = reader.ReadTimeSpan();
if( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled )
{
if( deleteTime <= TimeSpan.Zero || deleteTime > TimeSpan.FromDays(3.0) )
deleteTime = TimeSpan.FromDays(3.0);
m_DeleteTimer = new DeleteTimer(this, deleteTime);
m_DeleteTimer.Start();
}
goto case 0;
}
case 0:
{
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iRangeHome = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if( m_iRangePerception == OldRangePerception )
m_iRangePerception = DefaultRangePerception;
m_pHome.X = reader.ReadInt();
m_pHome.Y = reader.ReadInt();
m_pHome.Z = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for( i = 0; i < iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if( type != null )
{
m_arSpellAttack.Add(type);
}
}
iCount = reader.ReadInt();
for( i = 0; i < iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if( type != null )
{
m_arSpellDefense.Add(type);
}
}
m_FightMode = (FightMode)reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType)reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if( m_bSummoned )
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer(m_ControlMaster, this, m_SummonEnd - DateTime.Now).Start();
}
m_iControlSlots = reader.ReadInt();
m_Loyalty = reader.ReadInt();
//.........这里部分代码省略.........
示例3: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if ( m_iRangePerception == OldRangePerception )
m_iRangePerception = DefaultRangePerception;
m_pHome.X = reader.ReadInt();
m_pHome.Y = reader.ReadInt();
m_pHome.Z = reader.ReadInt();
if ( version >= 1 )
{
m_iRangeHome = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for ( i=0; i< iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType( str );
if ( type != null )
{
m_arSpellAttack.Add( type );
}
}
iCount = reader.ReadInt();
for ( i=0; i< iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType( str );
if ( type != null )
{
m_arSpellDefense.Add( type );
}
}
}
else
{
m_iRangeHome = 0;
}
if ( version >= 2 )
{
m_FightMode = ( FightMode )reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType) reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if ( version < 9 )
reader.ReadDouble();
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if ( m_bSummoned )
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControlled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if ( version >= 3 )
m_Loyalty = reader.ReadInt();
else
m_Loyalty = MaxLoyalty; // Wonderfully Happy
//.........这里部分代码省略.........
示例4: Initialize
//----------------------------------------------------------------------
// Initialize; this is the engine entry point (called by the core);
//----------------------------------------------------------------------
public static void Initialize()
{
m_RegionHash = new Hashtable();
Console.Write( "Random Encounters: Initializing..." );
if( MaybeLoadXml() )
{
//if (m_Debug) DumpAll();
string intervals = "";
for( int i = 0; i < m_Intervals.Length; i++ )
{
if( i != 0 ) intervals += ":";
intervals += m_Intervals[i];
}
//Dungeon Wilderness Guarded House Jail
m_EncounterTimers = new EncounterTimer[m_Intervals.Length];
if( m_Intervals.Length >= 3 )
{
m_EncounterTimers[0] = new EncounterTimer( "Dungeon", m_Intervals[0] );
m_EncounterTimers[1] = new EncounterTimer( "Wilderness", m_Intervals[1] );
m_EncounterTimers[2] = new EncounterTimer( "Guarded", m_Intervals[2] );
}
if( m_Intervals.Length >= 4 )
{
//m_EncounterTimers[3] = new EncounterTimer( "House", m_Intervals[3] );
Console.WriteLine( "RandomEncounters: WARNING, House Spawning not implemented yet." );
}
if( m_Intervals.Length == 5 )
{
//m_EncounterTimers[4] = new EncounterTimer( "Jail", m_Intervals[4] );
Console.WriteLine( "RandomEncounters: WARNING, Jail Spawning not implemented yet." );
}
foreach( EncounterTimer timer in m_EncounterTimers ) timer.Start();
if( m_ReinitializeTimer == null )
{
m_ReinitializeTimer = new ReinitializeTimer();
m_ReinitializeTimer.Start();
}
// if (cleanupList.Count>0)
// {
// DeleteEncounterTimer deleter = new DeleteEncounterTimer( m_Cleanup, cleanupList );
// deleter.Start();
// }
m_DeleteTimer = new DeleteTimer( Cleanup, Cleanup );
m_DeleteTimer.Start();
Console.WriteLine( "done" );
}
else
{
Console.WriteLine( "failed!" );
}
}
示例5: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if ( m_iRangePerception == OldRangePerception )
m_iRangePerception = DefaultRangePerception;
m_Home.X = reader.ReadInt();
m_Home.Y = reader.ReadInt();
m_Home.Z = reader.ReadInt();
if ( version >= 1 )
{
m_iRangeHome = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for ( i=0; i< iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType( str );
if ( type != null )
{
m_arSpellAttack.Add( type );
}
}
iCount = reader.ReadInt();
for ( i=0; i< iCount; i++ )
{
string str = reader.ReadString();
Type type = Type.GetType( str );
if ( type != null )
{
m_arSpellDefense.Add( type );
}
}
}
else
{
m_iRangeHome = 0;
}
if ( version >= 2 )
{
m_FightMode = ( FightMode )reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType) reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if ( version < 9 )
reader.ReadDouble();
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if ( m_bSummoned )
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.UtcNow ).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControlled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if ( version >= 3 )
m_Loyalty = reader.ReadInt();
else
//.........这里部分代码省略.........
示例6: Initialize
//----------------------------------------------------------------------
// Initialize; this is the engine entry point (called by the core);
//----------------------------------------------------------------------
public static void Initialize()
{
m_RegionHash = new Hashtable();
if (MaybeLoadXml())
{
//if (m_Debug) DumpAll();
string intervals = "";
for( int i=0; i < m_Intervals.Length; i++ )
{
if( i!=0 ) intervals += ":";
intervals += m_Intervals[i];
}
Console.WriteLine(
"RE: **WE'RE LIVE, BABY***..."
);
Console.WriteLine(
" [picker={0} language={1} skiphidden={2} delay={3} intervals={4} cleanup={5} grace={6} debug={7} animateDebug={8}]",
m_Picker,
m_Language,
m_SkipHidden,
m_Delay,
intervals,
m_Cleanup,
m_CleanupGrace,
m_Debug,
m_DebugEffect
);
//Dungeon Wilderness Guarded House Jail
m_EncounterTimers = new EncounterTimer[m_Intervals.Length];
if( m_Intervals.Length >= 3 )
{
m_EncounterTimers[0] = new EncounterTimer( "Dungeon", m_Intervals[0] );
m_EncounterTimers[1] = new EncounterTimer( "Wilderness", m_Intervals[1] );
m_EncounterTimers[2] = new EncounterTimer( "Guarded", m_Intervals[2] );
}
if ( m_Intervals.Length >= 4 )
{
//m_EncounterTimers[3] = new EncounterTimer( "House", m_Intervals[3] );
Console.WriteLine("RE: WARNING, House Spawning not implemented yet.");
}
if ( m_Intervals.Length == 5 )
{
//m_EncounterTimers[4] = new EncounterTimer( "Jail", m_Intervals[4] );
Console.WriteLine("RE: WARNING, Jail Spawning not implemented yet.");
}
foreach( EncounterTimer timer in m_EncounterTimers ) timer.Start();
if( m_ReinitializeTimer==null )
{
m_ReinitializeTimer = new ReinitializeTimer();
m_ReinitializeTimer.Start();
}
// if (cleanupList.Count>0)
// {
// DeleteEncounterTimer deleter = new DeleteEncounterTimer( m_Cleanup, cleanupList );
// deleter.Start();
// }
m_DeleteTimer = new DeleteTimer( Cleanup, Cleanup );
m_DeleteTimer.Start();
}
else
{
Console.WriteLine("##### RE: ***FAILED INITIALIZATION***!");
}
}
示例7: OnDragDrop
public override bool OnDragDrop(Mobile m, Item t)
{
if (m_Done) return false;
Container pack = Backpack;
if (t is BaseClothing)
{
Emote("*Puts the clothing on*");
pack.DropItem(t);
AddItem(t);
return true;
}
if (t is Food)
{
Emote("*Eats the food*");
PlaySound(Utility.Random(0x3A, 3));
pack.DropItem(t);
AddItem(t);
return true;
}
if (t is Gold)
{
if (CheckTeachingMatch(m))
{
if (Teach(m_Teaching, m, t.Amount, true))
{
t.Delete();
return true;
}
}
pack.DropItem(t);
// Karma gain is 1% of gold with max gain of 25
int newKarma = (t.Amount > 2500) ? 25 : (t.Amount / 100);
Titles.AwardKarma(m, newKarma, true);
Direction = GetDirectionTo(m.Location);
Animate(32, 5, 1, true, false, 0); // Bow
if (t.Amount < 50)
Say("Thanks.");
else if ((t.Amount >= 50) && (t.Amount < 100))
Say("Thank you for the gold!");
else if ((t.Amount >= 100) && (t.Amount < 500))
Say("Thank you! The pockets are nice and heavy now!");
else if ((t.Amount >= 500) && (t.Amount < 1000))
Say("What a generous sum of gold! Thank you!");
else if ((t.Amount >= 1000) && (t.Amount < 5000))
Say("I owe you my life! Without this money I could not feed or clothe my children!");
else Say("I am no longer a pauper!"); // t.Amount >= 5000
if (TotalGold > 5000)
{
DeleteTimer d = new DeleteTimer(this, m);
d.Start();
}
return true;
}
Say("eh? Whats this for?");
return false;
}
示例8: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if (m_iRangePerception == OldRangePerception)
m_iRangePerception = DefaultRangePerception;
m_pHome.X = reader.ReadInt();
m_pHome.Y = reader.ReadInt();
m_pHome.Z = reader.ReadInt();
if (version >= 1)
{
m_iRangeHome = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellAttack.Add(type);
}
}
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellDefense.Add(type);
}
}
}
else
{
m_iRangeHome = 0;
}
if (version >= 2)
{
m_FightMode = (FightMode)reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType)reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if (version < 9)
reader.ReadDouble();
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if (m_bSummoned)
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer(m_ControlMaster, this, m_SummonEnd - DateTime.Now).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControlled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if (version >= 3)
m_Loyalty = reader.ReadInt();
else
m_Loyalty = MaxLoyalty; // Wonderfully Happy
//.........这里部分代码省略.........