diff options
author | Adam Frisby | 2008-05-11 04:32:43 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-11 04:32:43 +0000 |
commit | ee352ebc7971fbb62319da53c520304bda5a15a2 (patch) | |
tree | c7f6fba9087846bb203e1f3812c4e3445c8650e1 /OpenSim/Region | |
parent | * Refactored two more OutPackets. ObjectPropertiesFamily, and Object Propert... (diff) | |
download | opensim-SC_OLD-ee352ebc7971fbb62319da53c520304bda5a15a2.zip opensim-SC_OLD-ee352ebc7971fbb62319da53c520304bda5a15a2.tar.gz opensim-SC_OLD-ee352ebc7971fbb62319da53c520304bda5a15a2.tar.bz2 opensim-SC_OLD-ee352ebc7971fbb62319da53c520304bda5a15a2.tar.xz |
* Added NPCModule and NPCAvatar classes for NPCs. Primitive, but we can grow them out.
* Fix for Scene.Inventory.cs - It assumes every entity at startup is a SceneObjectGroup. (Actually, this shouldn't have compiled[!] without a warning.)
* Fix for LandManager at startup - it assumes there's a land channel when perhaps there isnt. (Bug that needs another refactor to fix. [Mike - I've assigned a ticket to you about this])
Diffstat (limited to 'OpenSim/Region')
6 files changed, 781 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs new file mode 100644 index 0000000..0e13b3d --- /dev/null +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -0,0 +1,716 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using libsecondlife; | ||
32 | using libsecondlife.Packets; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Environment.Scenes; | ||
35 | |||
36 | namespace OpenSim.Region.Environment.Modules.World.NPC | ||
37 | { | ||
38 | public class NPCAvatar : IClientAPI | ||
39 | { | ||
40 | private readonly string m_firstname; | ||
41 | private readonly string m_lastname; | ||
42 | private readonly LLVector3 m_startPos; | ||
43 | private readonly LLUUID m_uuid = LLUUID.Random(); | ||
44 | private readonly Scene m_scene; | ||
45 | |||
46 | public NPCAvatar(string firstname, string lastname, LLVector3 position, Scene scene) | ||
47 | { | ||
48 | m_firstname = firstname; | ||
49 | m_lastname = lastname; | ||
50 | m_startPos = position; | ||
51 | m_scene = scene; | ||
52 | } | ||
53 | |||
54 | public void Say(string message) | ||
55 | { | ||
56 | SendOnChatFromViewer(message, ChatTypeEnum.Say); | ||
57 | } | ||
58 | |||
59 | public void Shout(string message) | ||
60 | { | ||
61 | SendOnChatFromViewer(message, ChatTypeEnum.Shout); | ||
62 | } | ||
63 | |||
64 | public void Whisper(string message) | ||
65 | { | ||
66 | SendOnChatFromViewer(message, ChatTypeEnum.Whisper); | ||
67 | } | ||
68 | |||
69 | public void Broadcast(string message) | ||
70 | { | ||
71 | SendOnChatFromViewer(message, ChatTypeEnum.Broadcast); | ||
72 | } | ||
73 | |||
74 | public void GiveMoney(LLUUID target, int amount) | ||
75 | { | ||
76 | OnMoneyTransferRequest(m_uuid, target, amount, 1, "Payment"); | ||
77 | } | ||
78 | |||
79 | public void InstantMessage(LLUUID target, string message) | ||
80 | { | ||
81 | OnInstantMessage(this, m_uuid, SessionId, target, LLUUID.Combine(m_uuid, target), | ||
82 | (uint) Util.UnixTimeSinceEpoch(), Name, message, 0, false, 0, 0, | ||
83 | Position, m_scene.RegionInfo.RegionID, new byte[0]); | ||
84 | } | ||
85 | |||
86 | public LLVector3 Position | ||
87 | { | ||
88 | get { return m_scene.Entities[m_uuid].AbsolutePosition; } | ||
89 | set { m_scene.Entities[m_uuid].AbsolutePosition = value; } | ||
90 | } | ||
91 | |||
92 | #region Internal Functions | ||
93 | |||
94 | private void SendOnChatFromViewer(string message, ChatTypeEnum chatType) | ||
95 | { | ||
96 | ChatFromViewerArgs chatFromViewer = new ChatFromViewerArgs(); | ||
97 | chatFromViewer.Channel = 0; | ||
98 | chatFromViewer.From = Name; | ||
99 | chatFromViewer.Message = message; | ||
100 | chatFromViewer.Position = StartPos; | ||
101 | chatFromViewer.Scene = m_scene; | ||
102 | chatFromViewer.Sender = this; | ||
103 | chatFromViewer.SenderUUID = AgentId; | ||
104 | chatFromViewer.Type = chatType; | ||
105 | |||
106 | OnChatFromViewer(this, chatFromViewer); | ||
107 | } | ||
108 | |||
109 | #endregion | ||
110 | |||
111 | #region Event Definitions IGNORE | ||
112 | #pragma warning disable 67 | ||
113 | |||
114 | public event Action<IClientAPI> OnLogout; | ||
115 | public event ObjectPermissions OnObjectPermissions; | ||
116 | |||
117 | public event MoneyTransferRequest OnMoneyTransferRequest; | ||
118 | public event ParcelBuy OnParcelBuy; | ||
119 | public event Action<IClientAPI> OnConnectionClosed; | ||
120 | |||
121 | public event ImprovedInstantMessage OnInstantMessage; | ||
122 | public event ChatFromViewer OnChatFromViewer; | ||
123 | public event TextureRequest OnRequestTexture; | ||
124 | public event RezObject OnRezObject; | ||
125 | public event ModifyTerrain OnModifyTerrain; | ||
126 | public event SetAppearance OnSetAppearance; | ||
127 | public event AvatarNowWearing OnAvatarNowWearing; | ||
128 | public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; | ||
129 | public event UUIDNameRequest OnDetachAttachmentIntoInv; | ||
130 | public event ObjectAttach OnObjectAttach; | ||
131 | public event ObjectDeselect OnObjectDetach; | ||
132 | public event StartAnim OnStartAnim; | ||
133 | public event StopAnim OnStopAnim; | ||
134 | public event LinkObjects OnLinkObjects; | ||
135 | public event DelinkObjects OnDelinkObjects; | ||
136 | public event RequestMapBlocks OnRequestMapBlocks; | ||
137 | public event RequestMapName OnMapNameRequest; | ||
138 | public event TeleportLocationRequest OnTeleportLocationRequest; | ||
139 | public event TeleportLandmarkRequest OnTeleportLandmarkRequest; | ||
140 | public event DisconnectUser OnDisconnectUser; | ||
141 | public event RequestAvatarProperties OnRequestAvatarProperties; | ||
142 | public event SetAlwaysRun OnSetAlwaysRun; | ||
143 | |||
144 | public event GenericCall4 OnDeRezObject; | ||
145 | public event Action<IClientAPI> OnRegionHandShakeReply; | ||
146 | public event GenericCall2 OnRequestWearables; | ||
147 | public event GenericCall2 OnCompleteMovementToRegion; | ||
148 | public event UpdateAgent OnAgentUpdate; | ||
149 | public event AgentRequestSit OnAgentRequestSit; | ||
150 | public event AgentSit OnAgentSit; | ||
151 | public event AvatarPickerRequest OnAvatarPickerRequest; | ||
152 | public event Action<IClientAPI> OnRequestAvatarsData; | ||
153 | public event AddNewPrim OnAddPrim; | ||
154 | public event RequestGodlikePowers OnRequestGodlikePowers; | ||
155 | public event GodKickUser OnGodKickUser; | ||
156 | public event ObjectDuplicate OnObjectDuplicate; | ||
157 | public event UpdateVector OnGrabObject; | ||
158 | public event ObjectSelect OnDeGrabObject; | ||
159 | public event MoveObject OnGrabUpdate; | ||
160 | public event ViewerEffectEventHandler OnViewerEffect; | ||
161 | |||
162 | public event FetchInventory OnAgentDataUpdateRequest; | ||
163 | public event FetchInventory OnUserInfoRequest; | ||
164 | public event TeleportLocationRequest OnSetStartLocationRequest; | ||
165 | |||
166 | public event UpdateShape OnUpdatePrimShape; | ||
167 | public event ObjectExtraParams OnUpdateExtraParams; | ||
168 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | ||
169 | public event ObjectSelect OnObjectSelect; | ||
170 | public event GenericCall7 OnObjectDescription; | ||
171 | public event GenericCall7 OnObjectName; | ||
172 | public event UpdatePrimFlags OnUpdatePrimFlags; | ||
173 | public event UpdatePrimTexture OnUpdatePrimTexture; | ||
174 | public event UpdateVector OnUpdatePrimGroupPosition; | ||
175 | public event UpdateVector OnUpdatePrimSinglePosition; | ||
176 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | ||
177 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | ||
178 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | ||
179 | public event UpdateVector OnUpdatePrimScale; | ||
180 | public event UpdateVector OnUpdatePrimGroupScale; | ||
181 | public event StatusChange OnChildAgentStatus; | ||
182 | public event GenericCall2 OnStopMovement; | ||
183 | public event Action<LLUUID> OnRemoveAvatar; | ||
184 | |||
185 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | ||
186 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | ||
187 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | ||
188 | public event MoveInventoryFolder OnMoveInventoryFolder; | ||
189 | public event RemoveInventoryFolder OnRemoveInventoryFolder; | ||
190 | public event RemoveInventoryItem OnRemoveInventoryItem; | ||
191 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | ||
192 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | ||
193 | public event FetchInventory OnFetchInventory; | ||
194 | public event RequestTaskInventory OnRequestTaskInventory; | ||
195 | public event UpdateInventoryItem OnUpdateInventoryItem; | ||
196 | public event CopyInventoryItem OnCopyInventoryItem; | ||
197 | public event MoveInventoryItem OnMoveInventoryItem; | ||
198 | public event UDPAssetUploadRequest OnAssetUploadRequest; | ||
199 | public event XferReceive OnXferReceive; | ||
200 | public event RequestXfer OnRequestXfer; | ||
201 | public event ConfirmXfer OnConfirmXfer; | ||
202 | public event RezScript OnRezScript; | ||
203 | public event UpdateTaskInventory OnUpdateTaskInventory; | ||
204 | public event MoveTaskInventory OnMoveTaskItem; | ||
205 | public event RemoveTaskInventory OnRemoveTaskItem; | ||
206 | public event RequestAsset OnRequestAsset; | ||
207 | |||
208 | public event UUIDNameRequest OnNameFromUUIDRequest; | ||
209 | |||
210 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | ||
211 | public event ParcelDivideRequest OnParcelDivideRequest; | ||
212 | public event ParcelJoinRequest OnParcelJoinRequest; | ||
213 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | ||
214 | |||
215 | public event ParcelAccessListRequest OnParcelAccessListRequest; | ||
216 | public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; | ||
217 | public event ParcelSelectObjects OnParcelSelectObjects; | ||
218 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | ||
219 | public event ObjectDeselect OnObjectDeselect; | ||
220 | public event RegionInfoRequest OnRegionInfoRequest; | ||
221 | public event EstateCovenantRequest OnEstateCovenantRequest; | ||
222 | |||
223 | public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; | ||
224 | |||
225 | public event FriendActionDelegate OnApproveFriendRequest; | ||
226 | public event FriendActionDelegate OnDenyFriendRequest; | ||
227 | public event FriendshipTermination OnTerminateFriendship; | ||
228 | public event PacketStats OnPacketStats; | ||
229 | |||
230 | public event EconomyDataRequest OnEconomyDataRequest; | ||
231 | public event MoneyBalanceRequest OnMoneyBalanceRequest; | ||
232 | public event UpdateAvatarProperties OnUpdateAvatarProperties; | ||
233 | |||
234 | public event ObjectIncludeInSearch OnObjectIncludeInSearch; | ||
235 | public event UUIDNameRequest OnTeleportHomeRequest; | ||
236 | |||
237 | public event ScriptAnswer OnScriptAnswer; | ||
238 | public event RequestPayPrice OnRequestPayPrice; | ||
239 | public event AgentSit OnUndo; | ||
240 | |||
241 | public event ForceReleaseControls OnForceReleaseControls; | ||
242 | |||
243 | public event DetailedEstateDataRequest OnDetailedEstateDataRequest; | ||
244 | public event SetEstateFlagsRequest OnSetEstateFlagsRequest; | ||
245 | public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; | ||
246 | public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture; | ||
247 | public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights; | ||
248 | public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest; | ||
249 | public event SetRegionTerrainSettings OnSetRegionTerrainSettings; | ||
250 | public event EstateRestartSimRequest OnEstateRestartSimRequest; | ||
251 | public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; | ||
252 | public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; | ||
253 | public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest; | ||
254 | public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; | ||
255 | public event EstateDebugRegionRequest OnEstateDebugRegionRequest; | ||
256 | public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; | ||
257 | #pragma warning restore 67 | ||
258 | #endregion | ||
259 | |||
260 | #region Overrriden Methods IGNORE | ||
261 | |||
262 | public virtual LLVector3 StartPos | ||
263 | { | ||
264 | get { return m_startPos; } | ||
265 | set { } | ||
266 | } | ||
267 | |||
268 | public virtual LLUUID AgentId | ||
269 | { | ||
270 | get { return m_uuid; } | ||
271 | } | ||
272 | |||
273 | public LLUUID SessionId | ||
274 | { | ||
275 | get { return LLUUID.Zero; } | ||
276 | } | ||
277 | |||
278 | public LLUUID SecureSessionId | ||
279 | { | ||
280 | get { return LLUUID.Zero; } | ||
281 | } | ||
282 | |||
283 | public virtual string FirstName | ||
284 | { | ||
285 | get { return m_firstname; } | ||
286 | } | ||
287 | |||
288 | public virtual string LastName | ||
289 | { | ||
290 | get { return m_lastname; } | ||
291 | } | ||
292 | |||
293 | public virtual String Name | ||
294 | { | ||
295 | get { return FirstName + " " + LastName; } | ||
296 | } | ||
297 | |||
298 | public bool IsActive | ||
299 | { | ||
300 | get { return true; } | ||
301 | set { } | ||
302 | } | ||
303 | |||
304 | public virtual int NextAnimationSequenceNumber | ||
305 | { | ||
306 | get { return 1; } | ||
307 | } | ||
308 | |||
309 | public virtual void OutPacket(Packet newPack, ThrottleOutPacketType packType) | ||
310 | { | ||
311 | } | ||
312 | |||
313 | public virtual void SendWearables(AvatarWearable[] wearables, int serial) | ||
314 | { | ||
315 | } | ||
316 | |||
317 | public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) | ||
318 | { | ||
319 | } | ||
320 | |||
321 | public virtual void Kick(string message) | ||
322 | { | ||
323 | } | ||
324 | |||
325 | public virtual void SendStartPingCheck(byte seq) | ||
326 | { | ||
327 | } | ||
328 | |||
329 | public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List<AvatarPickerReplyDataArgs> Data) | ||
330 | { | ||
331 | } | ||
332 | |||
333 | public virtual void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | ||
334 | { | ||
335 | |||
336 | } | ||
337 | |||
338 | public virtual void SendKillObject(ulong regionHandle, uint localID) | ||
339 | { | ||
340 | } | ||
341 | |||
342 | public virtual void SetChildAgentThrottle(byte[] throttle) | ||
343 | { | ||
344 | } | ||
345 | public byte[] GetThrottlesPacked(float multiplier) | ||
346 | { | ||
347 | return new byte[0]; | ||
348 | } | ||
349 | |||
350 | |||
351 | public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) | ||
352 | { | ||
353 | } | ||
354 | |||
355 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, | ||
356 | LLUUID fromAgentID, byte source, byte audible) | ||
357 | { | ||
358 | } | ||
359 | |||
360 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, | ||
361 | LLUUID fromAgentID, byte source, byte audible) | ||
362 | { | ||
363 | } | ||
364 | |||
365 | public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | ||
366 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) | ||
367 | { | ||
368 | } | ||
369 | |||
370 | public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | ||
371 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, | ||
372 | byte[] binaryBucket) | ||
373 | { | ||
374 | } | ||
375 | |||
376 | public virtual void SendLayerData(float[] map) | ||
377 | { | ||
378 | } | ||
379 | |||
380 | public virtual void SendLayerData(int px, int py, float[] map) | ||
381 | { | ||
382 | } | ||
383 | |||
384 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) | ||
385 | { | ||
386 | } | ||
387 | |||
388 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) | ||
389 | { | ||
390 | } | ||
391 | |||
392 | public virtual AgentCircuitData RequestClientInfo() | ||
393 | { | ||
394 | return new AgentCircuitData(); | ||
395 | } | ||
396 | |||
397 | public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, | ||
398 | IPEndPoint newRegionExternalEndPoint, string capsURL) | ||
399 | { | ||
400 | } | ||
401 | |||
402 | public virtual void SendMapBlock(List<MapBlockData> mapBlocks) | ||
403 | { | ||
404 | } | ||
405 | |||
406 | public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) | ||
407 | { | ||
408 | } | ||
409 | |||
410 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | ||
411 | uint locationID, uint flags, string capsURL) | ||
412 | { | ||
413 | } | ||
414 | |||
415 | public virtual void SendTeleportFailed(string reason) | ||
416 | { | ||
417 | } | ||
418 | |||
419 | public virtual void SendTeleportLocationStart() | ||
420 | { | ||
421 | } | ||
422 | |||
423 | public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) | ||
424 | { | ||
425 | } | ||
426 | |||
427 | public virtual void SendPayPrice(LLUUID objectID, int[] payPrice) | ||
428 | { | ||
429 | } | ||
430 | |||
431 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, | ||
432 | uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) | ||
433 | { | ||
434 | } | ||
435 | |||
436 | public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | ||
437 | LLVector3 position, LLVector3 velocity, LLQuaternion rotation) | ||
438 | { | ||
439 | } | ||
440 | |||
441 | public virtual void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations) | ||
442 | { | ||
443 | } | ||
444 | |||
445 | public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) | ||
446 | { | ||
447 | } | ||
448 | |||
449 | public virtual void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels) | ||
450 | { | ||
451 | } | ||
452 | |||
453 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | ||
454 | PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, | ||
455 | LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, | ||
456 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, | ||
457 | uint parentID, | ||
458 | byte[] particleSystem, byte clickAction) | ||
459 | { | ||
460 | } | ||
461 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | ||
462 | PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, | ||
463 | LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, | ||
464 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, | ||
465 | uint parentID, | ||
466 | byte[] particleSystem, byte clickAction, byte[] textureanimation, | ||
467 | bool attachment, uint AttachmentPoint, LLUUID AssetId) | ||
468 | { | ||
469 | } | ||
470 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | ||
471 | LLVector3 position, LLQuaternion rotation, LLVector3 velocity, | ||
472 | LLVector3 rotationalvelocity, byte state, LLUUID AssetId) | ||
473 | { | ||
474 | } | ||
475 | |||
476 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | ||
477 | LLVector3 position, LLQuaternion rotation, LLVector3 velocity, | ||
478 | LLVector3 rotationalvelocity) | ||
479 | { | ||
480 | } | ||
481 | |||
482 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, | ||
483 | List<InventoryItemBase> items, | ||
484 | List<InventoryFolderBase> folders, | ||
485 | bool fetchFolders, | ||
486 | bool fetchItems) | ||
487 | { | ||
488 | } | ||
489 | |||
490 | public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) | ||
491 | { | ||
492 | } | ||
493 | |||
494 | public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) | ||
495 | { | ||
496 | } | ||
497 | |||
498 | public virtual void SendRemoveInventoryItem(LLUUID itemID) | ||
499 | { | ||
500 | } | ||
501 | |||
502 | /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> | ||
503 | public virtual void SendBulkUpdateInventory(InventoryItemBase item) | ||
504 | { | ||
505 | } | ||
506 | |||
507 | public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) | ||
508 | { | ||
509 | } | ||
510 | |||
511 | public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) | ||
512 | { | ||
513 | } | ||
514 | |||
515 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) | ||
516 | { | ||
517 | } | ||
518 | |||
519 | public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, | ||
520 | int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, | ||
521 | int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, | ||
522 | int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent) | ||
523 | { | ||
524 | |||
525 | } | ||
526 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) | ||
527 | { | ||
528 | } | ||
529 | |||
530 | public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) | ||
531 | { | ||
532 | } | ||
533 | |||
534 | public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, | ||
535 | byte flags) | ||
536 | { | ||
537 | } | ||
538 | |||
539 | public void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain) | ||
540 | { | ||
541 | } | ||
542 | |||
543 | public void SendAttachedSoundGainChange(LLUUID objectID, float gain) | ||
544 | { | ||
545 | |||
546 | } | ||
547 | |||
548 | public void SendAlertMessage(string message) | ||
549 | { | ||
550 | } | ||
551 | |||
552 | public void SendAgentAlertMessage(string message, bool modal) | ||
553 | { | ||
554 | } | ||
555 | |||
556 | public void SendSystemAlertMessage(string message) | ||
557 | { | ||
558 | } | ||
559 | |||
560 | public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, | ||
561 | string url) | ||
562 | { | ||
563 | } | ||
564 | |||
565 | public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) | ||
566 | { | ||
567 | if (OnRegionHandShakeReply != null) | ||
568 | { | ||
569 | OnRegionHandShakeReply(this); | ||
570 | } | ||
571 | |||
572 | if (OnCompleteMovementToRegion != null) | ||
573 | { | ||
574 | OnCompleteMovementToRegion(); | ||
575 | } | ||
576 | } | ||
577 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID) | ||
578 | { | ||
579 | } | ||
580 | |||
581 | public void SendConfirmXfer(ulong xferID, uint PacketID) | ||
582 | { | ||
583 | } | ||
584 | |||
585 | public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName) | ||
586 | { | ||
587 | } | ||
588 | |||
589 | public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) | ||
590 | { | ||
591 | } | ||
592 | |||
593 | public void SendShutdownConnectionNotice() | ||
594 | { | ||
595 | } | ||
596 | |||
597 | public void SendSimStats(Packet pack) | ||
598 | { | ||
599 | } | ||
600 | |||
601 | public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID, | ||
602 | uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, | ||
603 | uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category, | ||
604 | LLUUID LastOwnerID, string ObjectName, string Description) | ||
605 | { | ||
606 | } | ||
607 | |||
608 | public void SendObjectPropertiesReply(LLUUID ItemID, ulong CreationDate, LLUUID CreatorUUID, LLUUID FolderUUID, LLUUID FromTaskUUID, | ||
609 | LLUUID GroupUUID, short InventorySerial, LLUUID LastOwnerUUID, LLUUID ObjectUUID, | ||
610 | LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, | ||
611 | string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, | ||
612 | uint BaseMask) | ||
613 | { | ||
614 | } | ||
615 | |||
616 | public bool AddMoney(int debit) | ||
617 | { | ||
618 | return false; | ||
619 | } | ||
620 | |||
621 | public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel, ulong time, uint dlen, uint ylen, float phase) | ||
622 | { | ||
623 | } | ||
624 | |||
625 | public void SendViewerTime(int phase) | ||
626 | { | ||
627 | } | ||
628 | |||
629 | public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, | ||
630 | string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, | ||
631 | LLUUID partnerID) | ||
632 | { | ||
633 | } | ||
634 | |||
635 | public void SetDebug(int newDebug) | ||
636 | { | ||
637 | } | ||
638 | |||
639 | public void InPacket(Packet NewPack) | ||
640 | { | ||
641 | } | ||
642 | |||
643 | public void Close(bool ShutdownCircuit) | ||
644 | { | ||
645 | } | ||
646 | |||
647 | public void Stop() | ||
648 | { | ||
649 | } | ||
650 | |||
651 | private uint m_circuitCode; | ||
652 | |||
653 | public uint CircuitCode | ||
654 | { | ||
655 | get { return m_circuitCode; } | ||
656 | set { m_circuitCode = value; } | ||
657 | } | ||
658 | public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) | ||
659 | { | ||
660 | |||
661 | } | ||
662 | public void SendLogoutPacket() | ||
663 | { | ||
664 | } | ||
665 | |||
666 | public void Terminate() | ||
667 | { | ||
668 | } | ||
669 | |||
670 | public ClientInfo GetClientInfo() | ||
671 | { | ||
672 | return null; | ||
673 | } | ||
674 | |||
675 | public void SetClientInfo(ClientInfo info) | ||
676 | { | ||
677 | } | ||
678 | |||
679 | public void SendScriptQuestion(LLUUID objectID, string taskName, string ownerName, LLUUID itemID, int question) | ||
680 | { | ||
681 | } | ||
682 | public void SendHealth(float health) | ||
683 | { | ||
684 | } | ||
685 | |||
686 | public void sendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID) | ||
687 | { | ||
688 | } | ||
689 | public void sendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) | ||
690 | { | ||
691 | } | ||
692 | public void sendEstateCovenantInformation() | ||
693 | { | ||
694 | } | ||
695 | public void sendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) | ||
696 | { | ||
697 | } | ||
698 | |||
699 | public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags) | ||
700 | { | ||
701 | } | ||
702 | public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID) | ||
703 | { | ||
704 | } | ||
705 | public void sendForceClientSelectObjects(List<uint> objectIDs) | ||
706 | { | ||
707 | } | ||
708 | public void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount) | ||
709 | { | ||
710 | } | ||
711 | public void sendLandParcelOverlay(byte[] data, int sequence_id) | ||
712 | { | ||
713 | } | ||
714 | #endregion | ||
715 | } | ||
716 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs new file mode 100644 index 0000000..7aeff57 --- /dev/null +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs | |||
@@ -0,0 +1,43 @@ | |||
1 | using libsecondlife; | ||
2 | using Nini.Config; | ||
3 | using OpenSim.Region.Environment.Interfaces; | ||
4 | using OpenSim.Region.Environment.Scenes; | ||
5 | |||
6 | namespace OpenSim.Region.Environment.Modules.World.NPC | ||
7 | { | ||
8 | public class NPCModule : IRegionModule | ||
9 | { | ||
10 | private const bool m_enabled = false; | ||
11 | |||
12 | public void Initialise(Scene scene, IConfigSource source) | ||
13 | { | ||
14 | if (m_enabled) | ||
15 | { | ||
16 | NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene); | ||
17 | NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene); | ||
18 | scene.AddNewClient(testAvatar, false); | ||
19 | scene.AddNewClient(testAvatar2, false); | ||
20 | } | ||
21 | } | ||
22 | |||
23 | public void PostInitialise() | ||
24 | { | ||
25 | |||
26 | } | ||
27 | |||
28 | public void Close() | ||
29 | { | ||
30 | |||
31 | } | ||
32 | |||
33 | public string Name | ||
34 | { | ||
35 | get { return "NPCModule"; } | ||
36 | } | ||
37 | |||
38 | public bool IsSharedModule | ||
39 | { | ||
40 | get { return true; } | ||
41 | } | ||
42 | } | ||
43 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index e78ad2b..29bcf0b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -50,9 +50,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
50 | { | 50 | { |
51 | m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); | 51 | m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); |
52 | 52 | ||
53 | foreach (SceneObjectGroup group in Entities.Values) | 53 | foreach (EntityBase group in Entities.Values) |
54 | { | 54 | { |
55 | group.StartScripts(); | 55 | if (group is SceneObjectGroup) |
56 | { | ||
57 | ((SceneObjectGroup) group).StartScripts(); | ||
58 | } | ||
56 | } | 59 | } |
57 | } | 60 | } |
58 | 61 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2e1116b..e8a6c45 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1524,7 +1524,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1524 | 1524 | ||
1525 | CreateAndAddScenePresence(client, child); | 1525 | CreateAndAddScenePresence(client, child); |
1526 | 1526 | ||
1527 | LandChannel.SendParcelOverlay(client); | 1527 | try |
1528 | { | ||
1529 | LandChannel.SendParcelOverlay(client); | ||
1530 | } //BUG: Mike - please fix this. | ||
1531 | catch (KeyNotFoundException) | ||
1532 | { | ||
1533 | m_log.Warn("[LAND]: Bug #2 triggered with NPC. LandModule needs a refactor to fix this."); | ||
1534 | } | ||
1535 | |||
1528 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 1536 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
1529 | } | 1537 | } |
1530 | } | 1538 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 043d337..466b20a 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -410,7 +410,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
410 | RegisterToEvents(); | 410 | RegisterToEvents(); |
411 | SetDirectionVectors(); | 411 | SetDirectionVectors(); |
412 | 412 | ||
413 | m_scene.LandChannel.SendLandUpdate(this, true); | 413 | try |
414 | { | ||
415 | m_scene.LandChannel.SendLandUpdate(this, true); | ||
416 | } //BUG: Mike - please fix this. | ||
417 | catch (KeyNotFoundException) | ||
418 | { | ||
419 | m_log.Warn("[LAND]: Bug triggered with NPC. LandModule needs a refactor to fix this."); | ||
420 | } | ||
414 | } | 421 | } |
415 | 422 | ||
416 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, | 423 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, |
diff --git a/OpenSim/Region/Modules/Python/PythonModule.cs b/OpenSim/Region/Modules/Python/PythonModule.cs index 48e0a59..77c5125 100644 --- a/OpenSim/Region/Modules/Python/PythonModule.cs +++ b/OpenSim/Region/Modules/Python/PythonModule.cs | |||
@@ -23,11 +23,9 @@ namespace OpenSim.Region.Modules.Python | |||
23 | 23 | ||
24 | public void PostInitialise() | 24 | public void PostInitialise() |
25 | { | 25 | { |
26 | /* | ||
27 | m_log.Info("[PYTHON] Initialising IronPython engine."); | 26 | m_log.Info("[PYTHON] Initialising IronPython engine."); |
28 | m_python = new PythonEngine(); | 27 | m_python = new PythonEngine(); |
29 | m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); | 28 | m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); |
30 | */ | ||
31 | } | 29 | } |
32 | 30 | ||
33 | public void Close() | 31 | public void Close() |