29 using System.Collections.Generic;
31 using System.Reflection;
32 using System.Threading;
35 using pCampBot.Interfaces;
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 Random rng = Bot.Manager.Rng;
62 "[TELEPORT BEHAVIOUR]: Ignoring teleport action for {0} since no regions are known yet",
Bot.Name);
66 knownRegions = Bot.Manager.RegionsKnown.Values.ToArray();
69 Simulator sourceRegion = Bot.Client.Network.CurrentSim;
70 GridRegion destRegion = knownRegions[rng.Next(knownRegions.Length)];
71 Vector3 destPosition =
new Vector3(rng.Next(255), rng.Next(255), 50);
74 "[TELEPORT BEHAVIOUR]: Teleporting {0} from {1} {2} to {3} {4}",
75 Bot.Name, sourceRegion.Name, Bot.Client.Self.SimPosition, destRegion.Name, destPosition);
77 Bot.Client.Self.Teleport(destRegion.RegionHandle, destPosition);
79 Thread.Sleep(Bot.Random.Next(3000, 10000));
Teleport to a random region on the grid.
override void Action()
Action to take when this behaviour is invoked.
string AbbreviatedName
Abbreviated name of this behaviour.
BotManager Manager
Bot manager.
Dictionary< ulong, GridRegion > RegionsKnown
The regions that we know about.
OpenSim.Services.Interfaces.GridRegion GridRegion