diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/Bot.cs | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index 7f941a4..7a73e3f 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs | |||
@@ -49,8 +49,15 @@ namespace pCampBot | |||
49 | 49 | ||
50 | public delegate void AnEvent(Bot callbot, EventType someevent); // event delegate for bot events | 50 | public delegate void AnEvent(Bot callbot, EventType someevent); // event delegate for bot events |
51 | 51 | ||
52 | public BotManager BotManager { get; private set; } | 52 | /// <summary> |
53 | private IConfig startupConfig; // bot config, passed from BotManager | 53 | /// Bot manager. |
54 | /// </summary> | ||
55 | public BotManager Manager { get; private set; } | ||
56 | |||
57 | /// <summary> | ||
58 | /// Bot config, passed from BotManager. | ||
59 | /// </summary> | ||
60 | private IConfig startupConfig; | ||
54 | 61 | ||
55 | /// <summary> | 62 | /// <summary> |
56 | /// Behaviours implemented by this bot. | 63 | /// Behaviours implemented by this bot. |
@@ -132,7 +139,7 @@ namespace pCampBot | |||
132 | Password = password; | 139 | Password = password; |
133 | LoginUri = loginUri; | 140 | LoginUri = loginUri; |
134 | 141 | ||
135 | BotManager = bm; | 142 | Manager = bm; |
136 | startupConfig = bm.Config; | 143 | startupConfig = bm.Config; |
137 | readconfig(); | 144 | readconfig(); |
138 | 145 | ||
@@ -218,7 +225,19 @@ namespace pCampBot | |||
218 | { | 225 | { |
219 | MakeDefaultAppearance(wear); | 226 | MakeDefaultAppearance(wear); |
220 | } | 227 | } |
228 | |||
221 | Client.Self.Jump(true); | 229 | Client.Self.Jump(true); |
230 | |||
231 | // Extract nearby region information. | ||
232 | Client.Grid.GridRegion += Manager.Grid_GridRegion; | ||
233 | uint xUint, yUint; | ||
234 | Utils.LongToUInts(Client.Network.CurrentSim.Handle, out xUint, out yUint); | ||
235 | ushort minX, minY, maxX, maxY; | ||
236 | minX = (ushort)Math.Min(0, xUint - 5); | ||
237 | minY = (ushort)Math.Min(0, yUint - 5); | ||
238 | maxX = (ushort)(xUint + 5); | ||
239 | maxY = (ushort)(yUint + 5); | ||
240 | Client.Grid.RequestMapBlocks(GridLayerType.Terrain, minX, minY, maxX, maxY, false); | ||
222 | } | 241 | } |
223 | else | 242 | else |
224 | { | 243 | { |
@@ -472,13 +491,13 @@ namespace pCampBot | |||
472 | 491 | ||
473 | private void GetTexture(UUID textureID) | 492 | private void GetTexture(UUID textureID) |
474 | { | 493 | { |
475 | lock (BotManager.AssetsReceived) | 494 | lock (Manager.AssetsReceived) |
476 | { | 495 | { |
477 | // Don't request assets more than once. | 496 | // Don't request assets more than once. |
478 | if (BotManager.AssetsReceived.ContainsKey(textureID)) | 497 | if (Manager.AssetsReceived.ContainsKey(textureID)) |
479 | return; | 498 | return; |
480 | 499 | ||
481 | BotManager.AssetsReceived[textureID] = false; | 500 | Manager.AssetsReceived[textureID] = false; |
482 | Client.Assets.RequestImage(textureID, ImageType.Normal, Asset_TextureCallback_Texture); | 501 | Client.Assets.RequestImage(textureID, ImageType.Normal, Asset_TextureCallback_Texture); |
483 | } | 502 | } |
484 | } | 503 | } |
@@ -490,8 +509,8 @@ namespace pCampBot | |||
490 | 509 | ||
491 | public void Asset_ReceivedCallback(AssetDownload transfer, Asset asset) | 510 | public void Asset_ReceivedCallback(AssetDownload transfer, Asset asset) |
492 | { | 511 | { |
493 | lock (BotManager.AssetsReceived) | 512 | lock (Manager.AssetsReceived) |
494 | BotManager.AssetsReceived[asset.AssetID] = true; | 513 | Manager.AssetsReceived[asset.AssetID] = true; |
495 | 514 | ||
496 | // if (wear == "save") | 515 | // if (wear == "save") |
497 | // { | 516 | // { |