clockwerk-opensim-stable – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 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 OpenSimulator 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 OpenMetaverse;
32 using OpenMetaverse.Packets;
33 using OpenSim.Framework;
34 using OpenSim.Region.Framework.Interfaces;
35 using OpenSim.Region.Framework.Scenes;
36 using OpenSim.Region.CoreModules.World.Estate;
37 using log4net;
38 using System.Reflection;
39 using System.Xml;
40  
41 namespace OpenSim.Region.OptionalModules.World.NPC
42 {
43 public class NPCAvatar : IClientAPI, INPC
44 {
45 public bool SenseAsAgent { get; set; }
46  
47 public delegate void ChatToNPC(
48 string message, byte type, Vector3 fromPos, string fromName,
49 UUID fromAgentID, UUID ownerID, byte source, byte audible);
50  
51 /// <summary>
52 /// Fired when the NPC receives a chat message.
53 /// </summary>
54 public event ChatToNPC OnChatToNPC;
55  
56 /// <summary>
57 /// Fired when the NPC receives an instant message.
58 /// </summary>
59 public event Action<GridInstantMessage> OnInstantMessageToNPC;
60  
61 private readonly string m_firstname;
62 private readonly string m_lastname;
63 private readonly Vector3 m_startPos;
64 private readonly UUID m_uuid = UUID.Random();
65 private readonly Scene m_scene;
66 private readonly UUID m_ownerID;
67  
68 public NPCAvatar(
69 string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene)
70 {
71 m_firstname = firstname;
72 m_lastname = lastname;
73 m_startPos = position;
74 m_scene = scene;
75 m_ownerID = ownerID;
76 SenseAsAgent = senseAsAgent;
77 }
78  
79 public IScene Scene
80 {
81 get { return m_scene; }
82 }
83  
84 public UUID OwnerID
85 {
86 get { return m_ownerID; }
87 }
88  
89 public ISceneAgent SceneAgent { get; set; }
90  
91 public void Say(string message)
92 {
93 SendOnChatFromClient(0, message, ChatTypeEnum.Say);
94 }
95  
96 public void Say(int channel, string message)
97 {
98 SendOnChatFromClient(channel, message, ChatTypeEnum.Say);
99 }
100  
101 public void Shout(int channel, string message)
102 {
103 SendOnChatFromClient(channel, message, ChatTypeEnum.Shout);
104 }
105  
106 public void Whisper(int channel, string message)
107 {
108 SendOnChatFromClient(channel, message, ChatTypeEnum.Whisper);
109 }
110  
111 public void Broadcast(string message)
112 {
113 SendOnChatFromClient(0, message, ChatTypeEnum.Broadcast);
114 }
115  
116 public void GiveMoney(UUID target, int amount)
117 {
118 OnMoneyTransferRequest(m_uuid, target, amount, 1, "Payment");
119 }
120  
121 public bool Touch(UUID target)
122 {
123 SceneObjectPart part = m_scene.GetSceneObjectPart(target);
124 if (part == null)
125 return false;
126 bool objectTouchable = hasTouchEvents(part); // Only touch an object that is scripted to respond
127 if (!objectTouchable && !part.IsRoot)
128 objectTouchable = hasTouchEvents(part.ParentGroup.RootPart);
129 if (!objectTouchable)
130 return false;
131 // Set up the surface args as if the touch is from a client that does not support this
132 SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
133 surfaceArgs.FaceIndex = -1; // TOUCH_INVALID_FACE
134 surfaceArgs.Binormal = Vector3.Zero; // TOUCH_INVALID_VECTOR
135 surfaceArgs.Normal = Vector3.Zero; // TOUCH_INVALID_VECTOR
136 surfaceArgs.STCoord = new Vector3(-1.0f, -1.0f, 0.0f); // TOUCH_INVALID_TEXCOORD
137 surfaceArgs.UVCoord = surfaceArgs.STCoord; // TOUCH_INVALID_TEXCOORD
138 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
139 touchArgs.Add(surfaceArgs);
140 Vector3 offset = part.OffsetPosition * -1.0f;
141 if (OnGrabObject == null)
142 return false;
143 OnGrabObject(part.LocalId, offset, this, touchArgs);
144 if (OnGrabUpdate != null)
145 OnGrabUpdate(part.UUID, offset, part.ParentGroup.RootPart.GroupPosition, this, touchArgs);
146 if (OnDeGrabObject != null)
147 OnDeGrabObject(part.LocalId, this, touchArgs);
148 return true;
149 }
150  
151 private bool hasTouchEvents(SceneObjectPart part)
152 {
153 if ((part.ScriptEvents & scriptEvents.touch) != 0 ||
154 (part.ScriptEvents & scriptEvents.touch_start) != 0 ||
155 (part.ScriptEvents & scriptEvents.touch_end) != 0)
156 return true;
157 return false;
158 }
159  
160 public void InstantMessage(UUID target, string message)
161 {
162 OnInstantMessage(this, new GridInstantMessage(m_scene,
163 m_uuid, m_firstname + " " + m_lastname,
164 target, 0, false, message,
165 UUID.Zero, false, Position, new byte[0], true));
166 }
167  
168 public void SendAgentOffline(UUID[] agentIDs)
169 {
170  
171 }
172  
173 public void SendAgentOnline(UUID[] agentIDs)
174 {
175  
176 }
177  
178 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
179 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
180 {
181  
182 }
183  
184 public void SendAdminResponse(UUID Token, uint AdminLevel)
185 {
186  
187 }
188  
189 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
190 {
191  
192 }
193  
194 public Vector3 Position
195 {
196 get { return m_scene.Entities[m_uuid].AbsolutePosition; }
197 set { m_scene.Entities[m_uuid].AbsolutePosition = value; }
198 }
199  
200 public bool SendLogoutPacketWhenClosing
201 {
202 set { }
203 }
204  
205 #region Internal Functions
206  
207 private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
208 {
209 if (channel == 0)
210 {
211 message = message.Trim();
212 if (string.IsNullOrEmpty(message))
213 {
214 return;
215 }
216 }
217 OSChatMessage chatFromClient = new OSChatMessage();
218 chatFromClient.Channel = channel;
219 chatFromClient.From = Name;
220 chatFromClient.Message = message;
221 chatFromClient.Position = StartPos;
222 chatFromClient.Scene = m_scene;
223 chatFromClient.Sender = this;
224 chatFromClient.SenderUUID = AgentId;
225 chatFromClient.Type = chatType;
226  
227 OnChatFromClient(this, chatFromClient);
228 }
229  
230 #endregion
231  
232 #region Event Definitions IGNORE
233  
234 // disable warning: public events constituting public API
235 #pragma warning disable 67
236 public event Action<IClientAPI> OnLogout;
237 public event ObjectPermissions OnObjectPermissions;
238  
239 public event MoneyTransferRequest OnMoneyTransferRequest;
240 public event ParcelBuy OnParcelBuy;
241 public event Action<IClientAPI> OnConnectionClosed;
242 public event GenericMessage OnGenericMessage;
243 public event ImprovedInstantMessage OnInstantMessage;
244 public event ChatMessage OnChatFromClient;
245 public event TextureRequest OnRequestTexture;
246 public event RezObject OnRezObject;
247 public event ModifyTerrain OnModifyTerrain;
248 public event SetAppearance OnSetAppearance;
249 public event AvatarNowWearing OnAvatarNowWearing;
250 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
251 public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv;
252 public event UUIDNameRequest OnDetachAttachmentIntoInv;
253 public event ObjectAttach OnObjectAttach;
254 public event ObjectDeselect OnObjectDetach;
255 public event ObjectDrop OnObjectDrop;
256 public event StartAnim OnStartAnim;
257 public event StopAnim OnStopAnim;
258 public event LinkObjects OnLinkObjects;
259 public event DelinkObjects OnDelinkObjects;
260 public event RequestMapBlocks OnRequestMapBlocks;
261 public event RequestMapName OnMapNameRequest;
262 public event TeleportLocationRequest OnTeleportLocationRequest;
263 public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
264 public event TeleportCancel OnTeleportCancel;
265 public event DisconnectUser OnDisconnectUser;
266 public event RequestAvatarProperties OnRequestAvatarProperties;
267 public event SetAlwaysRun OnSetAlwaysRun;
268  
269 public event DeRezObject OnDeRezObject;
270 public event Action<IClientAPI> OnRegionHandShakeReply;
271 public event GenericCall1 OnRequestWearables;
272 public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
273 public event UpdateAgent OnPreAgentUpdate;
274 public event UpdateAgent OnAgentUpdate;
275 public event UpdateAgent OnAgentCameraUpdate;
276 public event AgentRequestSit OnAgentRequestSit;
277 public event AgentSit OnAgentSit;
278 public event AvatarPickerRequest OnAvatarPickerRequest;
279 public event Action<IClientAPI> OnRequestAvatarsData;
280 public event AddNewPrim OnAddPrim;
281 public event RequestGodlikePowers OnRequestGodlikePowers;
282 public event GodKickUser OnGodKickUser;
283 public event ObjectDuplicate OnObjectDuplicate;
284 public event GrabObject OnGrabObject;
285 public event DeGrabObject OnDeGrabObject;
286 public event MoveObject OnGrabUpdate;
287 public event SpinStart OnSpinStart;
288 public event SpinObject OnSpinUpdate;
289 public event SpinStop OnSpinStop;
290 public event ViewerEffectEventHandler OnViewerEffect;
291  
292 public event FetchInventory OnAgentDataUpdateRequest;
293 public event TeleportLocationRequest OnSetStartLocationRequest;
294  
295 public event UpdateShape OnUpdatePrimShape;
296 public event ObjectExtraParams OnUpdateExtraParams;
297 public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
298 public event ObjectRequest OnObjectRequest;
299 public event ObjectSelect OnObjectSelect;
300 public event GenericCall7 OnObjectDescription;
301 public event GenericCall7 OnObjectName;
302 public event GenericCall7 OnObjectClickAction;
303 public event GenericCall7 OnObjectMaterial;
304 public event UpdatePrimFlags OnUpdatePrimFlags;
305 public event UpdatePrimTexture OnUpdatePrimTexture;
306 public event UpdateVector OnUpdatePrimGroupPosition;
307 public event UpdateVector OnUpdatePrimSinglePosition;
308 public event UpdatePrimRotation OnUpdatePrimGroupRotation;
309 public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition;
310 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
311 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
312 public event UpdateVector OnUpdatePrimScale;
313 public event UpdateVector OnUpdatePrimGroupScale;
314 public event StatusChange OnChildAgentStatus;
315 public event GenericCall2 OnStopMovement;
316 public event Action<UUID> OnRemoveAvatar;
317  
318 public event CreateNewInventoryItem OnCreateNewInventoryItem;
319 public event LinkInventoryItem OnLinkInventoryItem;
320 public event CreateInventoryFolder OnCreateNewInventoryFolder;
321 public event UpdateInventoryFolder OnUpdateInventoryFolder;
322 public event MoveInventoryFolder OnMoveInventoryFolder;
323 public event RemoveInventoryFolder OnRemoveInventoryFolder;
324 public event RemoveInventoryItem OnRemoveInventoryItem;
325 public event FetchInventoryDescendents OnFetchInventoryDescendents;
326 public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
327 public event FetchInventory OnFetchInventory;
328 public event RequestTaskInventory OnRequestTaskInventory;
329 public event UpdateInventoryItem OnUpdateInventoryItem;
330 public event CopyInventoryItem OnCopyInventoryItem;
331 public event MoveInventoryItem OnMoveInventoryItem;
332 public event UDPAssetUploadRequest OnAssetUploadRequest;
333 public event XferReceive OnXferReceive;
334 public event RequestXfer OnRequestXfer;
335 public event AbortXfer OnAbortXfer;
336 public event ConfirmXfer OnConfirmXfer;
337 public event RezScript OnRezScript;
338 public event UpdateTaskInventory OnUpdateTaskInventory;
339 public event MoveTaskInventory OnMoveTaskItem;
340 public event RemoveTaskInventory OnRemoveTaskItem;
341 public event RequestAsset OnRequestAsset;
342  
343 public event UUIDNameRequest OnNameFromUUIDRequest;
344 public event UUIDNameRequest OnUUIDGroupNameRequest;
345  
346 public event ParcelPropertiesRequest OnParcelPropertiesRequest;
347 public event ParcelDivideRequest OnParcelDivideRequest;
348 public event ParcelJoinRequest OnParcelJoinRequest;
349 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
350 public event ParcelAbandonRequest OnParcelAbandonRequest;
351 public event ParcelGodForceOwner OnParcelGodForceOwner;
352 public event ParcelReclaim OnParcelReclaim;
353 public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
354 public event ParcelAccessListRequest OnParcelAccessListRequest;
355 public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
356 public event ParcelSelectObjects OnParcelSelectObjects;
357 public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
358 public event ParcelDeedToGroup OnParcelDeedToGroup;
359 public event ObjectDeselect OnObjectDeselect;
360 public event RegionInfoRequest OnRegionInfoRequest;
361 public event EstateCovenantRequest OnEstateCovenantRequest;
362 public event RequestTerrain OnRequestTerrain;
363 public event RequestTerrain OnUploadTerrain;
364 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
365  
366 public event FriendActionDelegate OnApproveFriendRequest;
367 public event FriendActionDelegate OnDenyFriendRequest;
368 public event FriendshipTermination OnTerminateFriendship;
369 public event GrantUserFriendRights OnGrantUserRights;
370  
371 public event EconomyDataRequest OnEconomyDataRequest;
372 public event MoneyBalanceRequest OnMoneyBalanceRequest;
373 public event UpdateAvatarProperties OnUpdateAvatarProperties;
374  
375 public event ObjectIncludeInSearch OnObjectIncludeInSearch;
376 public event UUIDNameRequest OnTeleportHomeRequest;
377  
378 public event ScriptAnswer OnScriptAnswer;
379 public event RequestPayPrice OnRequestPayPrice;
380 public event ObjectSaleInfo OnObjectSaleInfo;
381 public event ObjectBuy OnObjectBuy;
382 public event BuyObjectInventory OnBuyObjectInventory;
383 public event AgentSit OnUndo;
384 public event AgentSit OnRedo;
385 public event LandUndo OnLandUndo;
386  
387 public event ForceReleaseControls OnForceReleaseControls;
388 public event GodLandStatRequest OnLandStatRequest;
389 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
390  
391 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
392 public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
393 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
394 public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture;
395 public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights;
396 public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
397 public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
398 public event BakeTerrain OnBakeTerrain;
399 public event EstateRestartSimRequest OnEstateRestartSimRequest;
400 public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
401 public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
402 public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest;
403 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
404 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
405 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
406 public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest;
407 public event EstateChangeInfo OnEstateChangeInfo;
408 public event EstateManageTelehub OnEstateManageTelehub;
409 public event CachedTextureRequest OnCachedTextureRequest;
410 public event ScriptReset OnScriptReset;
411 public event GetScriptRunning OnGetScriptRunning;
412 public event SetScriptRunning OnSetScriptRunning;
413 public event Action<Vector3, bool, bool> OnAutoPilotGo;
414  
415 public event TerrainUnacked OnUnackedTerrain;
416  
417 public event RegionHandleRequest OnRegionHandleRequest;
418 public event ParcelInfoRequest OnParcelInfoRequest;
419  
420 public event ActivateGesture OnActivateGesture;
421 public event DeactivateGesture OnDeactivateGesture;
422 public event ObjectOwner OnObjectOwner;
423  
424 public event DirPlacesQuery OnDirPlacesQuery;
425 public event DirFindQuery OnDirFindQuery;
426 public event DirLandQuery OnDirLandQuery;
427 public event DirPopularQuery OnDirPopularQuery;
428 public event DirClassifiedQuery OnDirClassifiedQuery;
429 public event EventInfoRequest OnEventInfoRequest;
430 public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
431  
432 public event MapItemRequest OnMapItemRequest;
433  
434 public event OfferCallingCard OnOfferCallingCard;
435 public event AcceptCallingCard OnAcceptCallingCard;
436 public event DeclineCallingCard OnDeclineCallingCard;
437 public event SoundTrigger OnSoundTrigger;
438  
439 public event StartLure OnStartLure;
440 public event TeleportLureRequest OnTeleportLureRequest;
441 public event NetworkStats OnNetworkStatsUpdate;
442  
443 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
444 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
445 public event ClassifiedDelete OnClassifiedDelete;
446 public event ClassifiedDelete OnClassifiedGodDelete;
447  
448 public event EventNotificationAddRequest OnEventNotificationAddRequest;
449 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
450 public event EventGodDelete OnEventGodDelete;
451  
452 public event ParcelDwellRequest OnParcelDwellRequest;
453  
454 public event UserInfoRequest OnUserInfoRequest;
455 public event UpdateUserInfo OnUpdateUserInfo;
456  
457 public event RetrieveInstantMessages OnRetrieveInstantMessages;
458  
459 public event PickDelete OnPickDelete;
460 public event PickGodDelete OnPickGodDelete;
461 public event PickInfoUpdate OnPickInfoUpdate;
462 public event AvatarNotesUpdate OnAvatarNotesUpdate;
463  
464 public event MuteListRequest OnMuteListRequest;
465  
466 public event AvatarInterestUpdate OnAvatarInterestUpdate;
467  
468 public event PlacesQuery OnPlacesQuery;
469  
470 public event FindAgentUpdate OnFindAgent;
471 public event TrackAgentUpdate OnTrackAgent;
472 public event NewUserReport OnUserReport;
473 public event SaveStateHandler OnSaveState;
474 public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
475 public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
476 public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
477 public event FreezeUserUpdate OnParcelFreezeUser;
478 public event EjectUserUpdate OnParcelEjectUser;
479 public event ParcelBuyPass OnParcelBuyPass;
480 public event ParcelGodMark OnParcelGodMark;
481 public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
482 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
483 public event SimWideDeletesDelegate OnSimWideDeletes;
484 public event SendPostcard OnSendPostcard;
485 public event MuteListEntryUpdate OnUpdateMuteListEntry;
486 public event MuteListEntryRemove OnRemoveMuteListEntry;
487 public event GodlikeMessage onGodlikeMessage;
488 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
489  
490 #pragma warning restore 67
491  
492 #endregion
493  
494 public void ActivateGesture(UUID assetId, UUID gestureId)
495 {
496 }
497 public void DeactivateGesture(UUID assetId, UUID gestureId)
498 {
499 }
500  
501 #region Overrriden Methods IGNORE
502  
503 public virtual Vector3 StartPos
504 {
505 get { return m_startPos; }
506 set { }
507 }
508  
509 public virtual UUID AgentId
510 {
511 get { return m_uuid; }
512 }
513  
514 public UUID SessionId
515 {
516 get { return UUID.Zero; }
517 }
518  
519 public UUID SecureSessionId
520 {
521 get { return UUID.Zero; }
522 }
523  
524 public virtual string FirstName
525 {
526 get { return m_firstname; }
527 }
528  
529 public virtual string LastName
530 {
531 get { return m_lastname; }
532 }
533  
534 public virtual String Name
535 {
536 get { return FirstName + " " + LastName; }
537 }
538  
539 public bool IsActive
540 {
541 get { return true; }
542 set { }
543 }
544  
545 public bool IsLoggingOut
546 {
547 get { return false; }
548 set { }
549 }
550 public UUID ActiveGroupId
551 {
552 get { return UUID.Zero; }
553 }
554  
555 public string ActiveGroupName
556 {
557 get { return String.Empty; }
558 }
559  
560 public ulong ActiveGroupPowers
561 {
562 get { return 0; }
563 }
564  
565 public bool IsGroupMember(UUID groupID)
566 {
567 return false;
568 }
569  
570 public ulong GetGroupPowers(UUID groupID)
571 {
572 return 0;
573 }
574  
575 public virtual int NextAnimationSequenceNumber
576 {
577 get { return 1; }
578 }
579  
580 public virtual void SendWearables(AvatarWearable[] wearables, int serial)
581 {
582 }
583  
584 public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry)
585 {
586 }
587  
588 public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
589 {
590  
591 }
592  
593 public virtual void Kick(string message)
594 {
595 }
596  
597 public virtual void SendStartPingCheck(byte seq)
598 {
599 }
600  
601 public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List<AvatarPickerReplyDataArgs> Data)
602 {
603 }
604  
605 public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle)
606 {
607  
608 }
609  
610 public virtual void SendKillObject(List<uint> localID)
611 {
612 }
613  
614 public virtual void SetChildAgentThrottle(byte[] throttle)
615 {
616 }
617 public byte[] GetThrottlesPacked(float multiplier)
618 {
619 return new byte[0];
620 }
621  
622  
623 public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
624 {
625 }
626  
627 public virtual void SendChatMessage(
628 string message, byte type, Vector3 fromPos, string fromName,
629 UUID fromAgentID, UUID ownerID, byte source, byte audible)
630 {
631 ChatToNPC ctn = OnChatToNPC;
632  
633 if (ctn != null)
634 ctn(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible);
635 }
636  
637 public void SendInstantMessage(GridInstantMessage im)
638 {
639 Action<GridInstantMessage> oimtn = OnInstantMessageToNPC;
640  
641 if (oimtn != null)
642 oimtn(im);
643 }
644  
645 public void SendGenericMessage(string method, UUID invoice, List<string> message)
646 {
647  
648 }
649  
650 public void SendGenericMessage(string method, UUID invoice, List<byte[]> message)
651 {
652  
653 }
654  
655 public virtual void SendLayerData(float[] map)
656 {
657 }
658  
659 public virtual void SendLayerData(int px, int py, float[] map)
660 {
661 }
662 public virtual void SendLayerData(int px, int py, float[] map, bool track)
663 {
664 }
665  
666 public virtual void SendWindData(Vector2[] windSpeeds) { }
667  
668 public virtual void SendCloudData(float[] cloudCover) { }
669  
670 public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
671 {
672 }
673  
674 public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
675 {
676 }
677  
678 public virtual AgentCircuitData RequestClientInfo()
679 {
680 return new AgentCircuitData();
681 }
682  
683 public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt,
684 IPEndPoint newRegionExternalEndPoint, string capsURL)
685 {
686 }
687  
688 public virtual void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
689 {
690 }
691  
692 public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags)
693 {
694 }
695  
696 public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
697 uint locationID, uint flags, string capsURL)
698 {
699 }
700  
701 public virtual void SendTeleportFailed(string reason)
702 {
703 }
704  
705 public virtual void SendTeleportStart(uint flags)
706 {
707 }
708  
709 public virtual void SendTeleportProgress(uint flags, string message)
710 {
711 }
712  
713 public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item)
714 {
715 }
716  
717 public virtual void SendPayPrice(UUID objectID, int[] payPrice)
718 {
719 }
720  
721 public virtual void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
722 {
723 }
724  
725 public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
726 {
727 }
728  
729 public void SendAvatarDataImmediate(ISceneEntity avatar)
730 {
731 }
732  
733 public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
734 {
735 }
736  
737 public void ReprioritizeUpdates()
738 {
739 }
740  
741 public void FlushPrimUpdates()
742 {
743 }
744  
745 public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID,
746 List<InventoryItemBase> items,
747 List<InventoryFolderBase> folders,
748 int version,
749 bool fetchFolders,
750 bool fetchItems)
751 {
752 }
753  
754 public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
755 {
756 }
757  
758 public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID)
759 {
760 }
761  
762 public virtual void SendRemoveInventoryItem(UUID itemID)
763 {
764 }
765  
766 public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
767 {
768 }
769  
770 public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
771 {
772 }
773  
774 public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName)
775 {
776 }
777  
778 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
779 {
780 }
781 public virtual void SendAbortXferPacket(ulong xferID)
782 {
783  
784 }
785  
786 public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
787 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
788 int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
789 int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
790 {
791  
792 }
793 public virtual void SendNameReply(UUID profileId, string firstname, string lastname)
794 {
795 }
796  
797 public virtual void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID)
798 {
799 }
800  
801 public virtual void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain,
802 byte flags)
803 {
804 }
805  
806 public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
807 {
808 }
809  
810 public void SendAttachedSoundGainChange(UUID objectID, float gain)
811 {
812  
813 }
814  
815 public void SendAlertMessage(string message)
816 {
817 }
818  
819 public void SendAgentAlertMessage(string message, bool modal)
820 {
821 }
822  
823 public void SendSystemAlertMessage(string message)
824 {
825 }
826  
827 public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message,
828 string url)
829 {
830 }
831  
832 public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args)
833 {
834 if (OnRegionHandShakeReply != null)
835 {
836 OnRegionHandShakeReply(this);
837 }
838 }
839  
840 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
841 {
842 }
843  
844 public void SendConfirmXfer(ulong xferID, uint PacketID)
845 {
846 }
847  
848 public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
849 {
850 }
851  
852 public void SendInitiateDownload(string simFileName, string clientFileName)
853 {
854 }
855  
856 public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
857 {
858 }
859  
860 public void SendImageNotFound(UUID imageid)
861 {
862 }
863  
864 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
865 {
866 }
867  
868 public void SendShutdownConnectionNotice()
869 {
870 }
871  
872 public void SendSimStats(SimStats stats)
873 {
874 }
875  
876 public void SendObjectPropertiesFamilyData(ISceneEntity Entity, uint RequestFlags)
877 {
878  
879 }
880  
881 public void SendObjectPropertiesReply(ISceneEntity entity)
882 {
883 }
884  
885 public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase)
886 {
887 }
888  
889 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
890 {
891 }
892  
893 public void SendViewerTime(int phase)
894 {
895 }
896  
897 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
898 string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
899 UUID partnerID)
900 {
901 }
902  
903 public void SendAsset(AssetRequestToClient req)
904 {
905 }
906  
907 public void SendTexture(AssetBase TextureAsset)
908 {
909 }
910  
911 public int DebugPacketLevel { get; set; }
912  
913 public void InPacket(object NewPack)
914 {
915 }
916  
917 public void ProcessInPacket(Packet NewPack)
918 {
919 }
920  
921 public void Close()
922 {
923 Close(false);
924 }
925  
926 public void Close(bool force)
927 {
928 // Remove ourselves from the scene
929 m_scene.RemoveClient(AgentId, false);
930 }
931  
932 public void Start()
933 {
934 // We never start the client, so always fail.
935 throw new NotImplementedException();
936 }
937  
938 public void Stop()
939 {
940 }
941  
942 private uint m_circuitCode;
943 private IPEndPoint m_remoteEndPoint;
944  
945 public uint CircuitCode
946 {
947 get { return m_circuitCode; }
948 set
949 {
950 m_circuitCode = value;
951 m_remoteEndPoint = new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode);
952 }
953 }
954  
955 public IPEndPoint RemoteEndPoint
956 {
957 get { return m_remoteEndPoint; }
958 }
959  
960 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
961 {
962  
963 }
964 public void SendLogoutPacket()
965 {
966 }
967  
968 public void Terminate()
969 {
970 }
971  
972 public ClientInfo GetClientInfo()
973 {
974 return null;
975 }
976  
977 public void SetClientInfo(ClientInfo info)
978 {
979 }
980  
981 public void SendScriptQuestion(UUID objectID, string taskName, string ownerName, UUID itemID, int question)
982 {
983 }
984 public void SendHealth(float health)
985 {
986 }
987  
988 public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID)
989 {
990 }
991  
992 public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
993 {
994 }
995  
996 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
997 {
998 }
999 public void SendEstateCovenantInformation(UUID covenant)
1000 {
1001 }
1002 public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint)
1003 {
1004 }
1005 public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner)
1006 {
1007 }
1008  
1009 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
1010 {
1011 }
1012 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
1013 {
1014 }
1015 public void SendForceClientSelectObjects(List<uint> objectIDs)
1016 {
1017 }
1018 public void SendCameraConstraint(Vector4 ConstraintPlane)
1019 {
1020 }
1021 public void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount)
1022 {
1023 }
1024 public void SendLandParcelOverlay(byte[] data, int sequence_id)
1025 {
1026 }
1027  
1028 public void SendGroupNameReply(UUID groupLLUID, string GroupName)
1029 {
1030 }
1031  
1032 public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
1033 {
1034 }
1035  
1036 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
1037 {
1038 }
1039 #endregion
1040  
1041  
1042 public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
1043 {
1044 }
1045  
1046 public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID,
1047 byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight,
1048 byte mediaLoop)
1049 {
1050 }
1051  
1052 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
1053 {
1054 }
1055  
1056 public void SendClearFollowCamProperties (UUID objectID)
1057 {
1058 }
1059  
1060 public void SendRegionHandle (UUID regoinID, ulong handle)
1061 {
1062 }
1063  
1064 public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
1065 {
1066 }
1067  
1068 public void SetClientOption(string option, string value)
1069 {
1070 }
1071  
1072 public string GetClientOption(string option)
1073 {
1074 return string.Empty;
1075 }
1076  
1077 public void SendScriptTeleportRequest (string objName, string simName, Vector3 pos, Vector3 lookAt)
1078 {
1079 }
1080  
1081 public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
1082 {
1083 }
1084  
1085 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
1086 {
1087 }
1088  
1089 public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
1090 {
1091 }
1092  
1093 public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
1094 {
1095 }
1096  
1097 public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
1098 {
1099 }
1100  
1101 public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
1102 {
1103 }
1104  
1105 public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
1106 {
1107 }
1108  
1109 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
1110 {
1111 }
1112  
1113 public void SendEventInfoReply (EventData info)
1114 {
1115 }
1116  
1117 public void SendOfferCallingCard (UUID destID, UUID transactionID)
1118 {
1119 }
1120  
1121 public void SendAcceptCallingCard (UUID transactionID)
1122 {
1123 }
1124  
1125 public void SendDeclineCallingCard (UUID transactionID)
1126 {
1127 }
1128  
1129 public void SendJoinGroupReply(UUID groupID, bool success)
1130 {
1131 }
1132  
1133 public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
1134 {
1135 }
1136  
1137 public void SendLeaveGroupReply(UUID groupID, bool success)
1138 {
1139 }
1140  
1141 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
1142 {
1143 }
1144  
1145 public void SendTerminateFriend(UUID exFriendID)
1146 {
1147 }
1148  
1149 #region IClientAPI Members
1150  
1151  
1152 public bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
1153 {
1154 //throw new NotImplementedException();
1155 return false;
1156 }
1157  
1158 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
1159 {
1160 }
1161  
1162 public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
1163 {
1164 }
1165  
1166 public void SendAgentDropGroup(UUID groupID)
1167 {
1168 }
1169  
1170 public void SendAvatarNotesReply(UUID targetID, string text)
1171 {
1172 }
1173  
1174 public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
1175 {
1176 }
1177  
1178 public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
1179 {
1180 }
1181  
1182 public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
1183 {
1184 }
1185  
1186 public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
1187 {
1188 }
1189  
1190 public void SendCreateGroupReply(UUID groupID, bool success, string message)
1191 {
1192 }
1193  
1194 public void RefreshGroupMembership()
1195 {
1196 }
1197  
1198 public void SendUseCachedMuteList()
1199 {
1200 }
1201  
1202 public void SendMuteListUpdate(string filename)
1203 {
1204 }
1205  
1206 public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
1207 {
1208 }
1209 #endregion
1210  
1211 public void SendRebakeAvatarTextures(UUID textureID)
1212 {
1213 }
1214  
1215 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
1216 {
1217 }
1218  
1219 public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
1220 {
1221 }
1222  
1223 public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
1224 {
1225 }
1226  
1227 public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
1228 {
1229 }
1230  
1231 public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
1232 {
1233 }
1234  
1235 public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
1236 {
1237 }
1238  
1239 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
1240 {
1241 }
1242  
1243 public void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId)
1244 {
1245 }
1246  
1247 public void SendAgentTerseUpdate(ISceneEntity presence)
1248 {
1249 }
1250  
1251 public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data)
1252 {
1253 }
1254  
1255 public void SendPartPhysicsProprieties(ISceneEntity entity)
1256 {
1257 }
1258  
1259 }
1260 }