Consistently give responsibility for thread sleeping to behaviours rather than controlling from the main action loop
This is to avoid excessive and inconsistent delays between behaviours that currently need to embed sleeps in other actions (e.g. physics) and other behaviours. Might need a more sophisticated approach in the long term.varregion
parent
3dbe7313d1
commit
76bd2e2d72
|
@ -29,6 +29,7 @@ using OpenMetaverse;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using pCampBot.Interfaces;
|
||||
|
||||
namespace pCampBot
|
||||
|
@ -60,6 +61,8 @@ namespace pCampBot
|
|||
Bot.Client.Self.Grab(prim.LocalID);
|
||||
Bot.Client.Self.GrabUpdate(prim.ID, Vector3.Zero);
|
||||
Bot.Client.Self.DeGrab(prim.LocalID);
|
||||
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using pCampBot.Interfaces;
|
||||
|
@ -74,6 +75,8 @@ namespace pCampBot
|
|||
Bot.Name, sourceRegion.Name, Bot.Client.Self.SimPosition, destRegion.Name, destPosition);
|
||||
|
||||
Bot.Client.Self.Teleport(destRegion.RegionHandle, destPosition);
|
||||
|
||||
Thread.Sleep(Bot.Random.Next(3000, 10000));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -282,7 +282,7 @@ namespace pCampBot
|
|||
{
|
||||
foreach (IBehaviour behaviour in Behaviours.Values)
|
||||
{
|
||||
Thread.Sleep(Random.Next(3000, 10000));
|
||||
// Thread.Sleep(Random.Next(3000, 10000));
|
||||
|
||||
// m_log.DebugFormat("[pCAMPBOT]: For {0} performing action {1}", Name, b.GetType());
|
||||
behaviour.Action();
|
||||
|
|
Loading…
Reference in New Issue