/OpenMetaverse/Modules/AgentManager.cs
C# | 5131 lines | 3037 code | 588 blank | 1506 comment | 275 complexity | edd424313b5ed3dee961639e508fda25 MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- /*
- * Copyright (c) 2007-2009, openmetaverse.org
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the openmetaverse.org nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
- using System;
- using System.Net;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Reflection;
- using System.Collections.Generic;
- using OpenMetaverse.StructuredData;
- using OpenMetaverse.Http;
- using OpenMetaverse.Assets;
- using OpenMetaverse.Packets;
- using OpenMetaverse.Interfaces;
- using OpenMetaverse.Messages.Linden;
- namespace OpenMetaverse
- {
- #region Enums
- /// <summary>
- /// Permission request flags, asked when a script wants to control an Avatar
- /// </summary>
- [Flags]
- public enum ScriptPermission : int
- {
- /// <summary>Placeholder for empty values, shouldn't ever see this</summary>
- None = 0,
- /// <summary>Script wants ability to take money from you</summary>
- Debit = 1 << 1,
- /// <summary>Script wants to take camera controls for you</summary>
- TakeControls = 1 << 2,
- /// <summary>Script wants to remap avatars controls</summary>
- RemapControls = 1 << 3,
- /// <summary>Script wants to trigger avatar animations</summary>
- /// <remarks>This function is not implemented on the grid</remarks>
- TriggerAnimation = 1 << 4,
- /// <summary>Script wants to attach or detach the prim or primset to your avatar</summary>
- Attach = 1 << 5,
- /// <summary>Script wants permission to release ownership</summary>
- /// <remarks>This function is not implemented on the grid
- /// The concept of "public" objects does not exist anymore.</remarks>
- ReleaseOwnership = 1 << 6,
- /// <summary>Script wants ability to link/delink with other prims</summary>
- ChangeLinks = 1 << 7,
- /// <summary>Script wants permission to change joints</summary>
- /// <remarks>This function is not implemented on the grid</remarks>
- ChangeJoints = 1 << 8,
- /// <summary>Script wants permissions to change permissions</summary>
- /// <remarks>This function is not implemented on the grid</remarks>
- ChangePermissions = 1 << 9,
- /// <summary>Script wants to track avatars camera position and rotation </summary>
- TrackCamera = 1 << 10,
- /// <summary>Script wants to control your camera</summary>
- ControlCamera = 1 << 11
- }
- /// <summary>
- /// Special commands used in Instant Messages
- /// </summary>
- public enum InstantMessageDialog : byte
- {
- /// <summary>Indicates a regular IM from another agent</summary>
- MessageFromAgent = 0,
- /// <summary>Simple notification box with an OK button</summary>
- MessageBox = 1,
- // <summary>Used to show a countdown notification with an OK
- // button, deprecated now</summary>
- //[Obsolete]
- //MessageBoxCountdown = 2,
- /// <summary>You've been invited to join a group.</summary>
- GroupInvitation = 3,
- /// <summary>Inventory offer</summary>
- InventoryOffered = 4,
- /// <summary>Accepted inventory offer</summary>
- InventoryAccepted = 5,
- /// <summary>Declined inventory offer</summary>
- InventoryDeclined = 6,
- /// <summary>Group vote</summary>
- GroupVote = 7,
- // <summary>A message to everyone in the agent's group, no longer
- // used</summary>
- //[Obsolete]
- //DeprecatedGroupMessage = 8,
- /// <summary>An object is offering its inventory</summary>
- TaskInventoryOffered = 9,
- /// <summary>Accept an inventory offer from an object</summary>
- TaskInventoryAccepted = 10,
- /// <summary>Decline an inventory offer from an object</summary>
- TaskInventoryDeclined = 11,
- /// <summary>Unknown</summary>
- NewUserDefault = 12,
- /// <summary>Start a session, or add users to a session</summary>
- SessionAdd = 13,
- /// <summary>Start a session, but don't prune offline users</summary>
- SessionOfflineAdd = 14,
- /// <summary>Start a session with your group</summary>
- SessionGroupStart = 15,
- /// <summary>Start a session without a calling card (finder or objects)</summary>
- SessionCardlessStart = 16,
- /// <summary>Send a message to a session</summary>
- SessionSend = 17,
- /// <summary>Leave a session</summary>
- SessionDrop = 18,
- /// <summary>Indicates that the IM is from an object</summary>
- MessageFromObject = 19,
- /// <summary>Sent an IM to a busy user, this is the auto response</summary>
- BusyAutoResponse = 20,
- /// <summary>Shows the message in the console and chat history</summary>
- ConsoleAndChatHistory = 21,
- /// <summary>Send a teleport lure</summary>
- RequestTeleport = 22,
- /// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
- AcceptTeleport = 23,
- /// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
- DenyTeleport = 24,
- /// <summary>Only useful if you have Linden permissions</summary>
- GodLikeRequestTeleport = 25,
- /// <summary>A placeholder type for future expansion, currently not
- /// used</summary>
- CurrentlyUnused = 26,
- // <summary>Notification of a new group election, this is
- // deprecated</summary>
- //[Obsolete]
- //DeprecatedGroupElection = 27,
- /// <summary>IM to tell the user to go to an URL</summary>
- GotoUrl = 28,
- /// <summary>IM for help</summary>
- Session911Start = 29,
- /// <summary>IM sent automatically on call for help, sends a lure
- /// to each Helper reached</summary>
- Lure911 = 30,
- /// <summary>Like an IM but won't go to email</summary>
- FromTaskAsAlert = 31,
- /// <summary>IM from a group officer to all group members</summary>
- GroupNotice = 32,
- /// <summary>Unknown</summary>
- GroupNoticeInventoryAccepted = 33,
- /// <summary>Unknown</summary>
- GroupNoticeInventoryDeclined = 34,
- /// <summary>Accept a group invitation</summary>
- GroupInvitationAccept = 35,
- /// <summary>Decline a group invitation</summary>
- GroupInvitationDecline = 36,
- /// <summary>Unknown</summary>
- GroupNoticeRequested = 37,
- /// <summary>An avatar is offering you friendship</summary>
- FriendshipOffered = 38,
- /// <summary>An avatar has accepted your friendship offer</summary>
- FriendshipAccepted = 39,
- /// <summary>An avatar has declined your friendship offer</summary>
- FriendshipDeclined = 40,
- /// <summary>Indicates that a user has started typing</summary>
- StartTyping = 41,
- /// <summary>Indicates that a user has stopped typing</summary>
- StopTyping = 42
- }
- /// <summary>
- /// Flag in Instant Messages, whether the IM should be delivered to
- /// offline avatars as well
- /// </summary>
- public enum InstantMessageOnline
- {
- /// <summary>Only deliver to online avatars</summary>
- Online = 0,
- /// <summary>If the avatar is offline the message will be held until
- /// they login next, and possibly forwarded to their e-mail account</summary>
- Offline = 1
- }
- /// <summary>
- /// Conversion type to denote Chat Packet types in an easier-to-understand format
- /// </summary>
- public enum ChatType : byte
- {
- /// <summary>Whisper (5m radius)</summary>
- Whisper = 0,
- /// <summary>Normal chat (10/20m radius), what the official viewer typically sends</summary>
- Normal = 1,
- /// <summary>Shouting! (100m radius)</summary>
- Shout = 2,
- // <summary>Say chat (10/20m radius) - The official viewer will
- // print "[4:15] You say, hey" instead of "[4:15] You: hey"</summary>
- //[Obsolete]
- //Say = 3,
- /// <summary>Event message when an Avatar has begun to type</summary>
- StartTyping = 4,
- /// <summary>Event message when an Avatar has stopped typing</summary>
- StopTyping = 5,
- /// <summary>Send the message to the debug channel</summary>
- Debug = 6,
- /// <summary>Event message when an object uses llOwnerSay</summary>
- OwnerSay = 8,
- /// <summary>Special value to support llRegionSay, never sent to the client</summary>
- RegionSay = Byte.MaxValue,
- }
- /// <summary>
- /// Identifies the source of a chat message
- /// </summary>
- public enum ChatSourceType : byte
- {
- /// <summary>Chat from the grid or simulator</summary>
- System = 0,
- /// <summary>Chat from another avatar</summary>
- Agent = 1,
- /// <summary>Chat from an object</summary>
- Object = 2
- }
- /// <summary>
- ///
- /// </summary>
- public enum ChatAudibleLevel : sbyte
- {
- /// <summary></summary>
- Not = -1,
- /// <summary></summary>
- Barely = 0,
- /// <summary></summary>
- Fully = 1
- }
- /// <summary>
- /// Effect type used in ViewerEffect packets
- /// </summary>
- public enum EffectType : byte
- {
- /// <summary></summary>
- Text = 0,
- /// <summary></summary>
- Icon,
- /// <summary></summary>
- Connector,
- /// <summary></summary>
- FlexibleObject,
- /// <summary></summary>
- AnimalControls,
- /// <summary></summary>
- AnimationObject,
- /// <summary></summary>
- Cloth,
- /// <summary>Project a beam from a source to a destination, such as
- /// the one used when editing an object</summary>
- Beam,
- /// <summary></summary>
- Glow,
- /// <summary></summary>
- Point,
- /// <summary></summary>
- Trail,
- /// <summary>Create a swirl of particles around an object</summary>
- Sphere,
- /// <summary></summary>
- Spiral,
- /// <summary></summary>
- Edit,
- /// <summary>Cause an avatar to look at an object</summary>
- LookAt,
- /// <summary>Cause an avatar to point at an object</summary>
- PointAt
- }
- /// <summary>
- /// The action an avatar is doing when looking at something, used in
- /// ViewerEffect packets for the LookAt effect
- /// </summary>
- public enum LookAtType : byte
- {
- /// <summary></summary>
- None,
- /// <summary></summary>
- Idle,
- /// <summary></summary>
- AutoListen,
- /// <summary></summary>
- FreeLook,
- /// <summary></summary>
- Respond,
- /// <summary></summary>
- Hover,
- /// <summary>Deprecated</summary>
- [Obsolete]
- Conversation,
- /// <summary></summary>
- Select,
- /// <summary></summary>
- Focus,
- /// <summary></summary>
- Mouselook,
- /// <summary></summary>
- Clear
- }
- /// <summary>
- /// The action an avatar is doing when pointing at something, used in
- /// ViewerEffect packets for the PointAt effect
- /// </summary>
- public enum PointAtType : byte
- {
- /// <summary></summary>
- None,
- /// <summary></summary>
- Select,
- /// <summary></summary>
- Grab,
- /// <summary></summary>
- Clear
- }
- /// <summary>
- /// Money transaction types
- /// </summary>
- public enum MoneyTransactionType : int
- {
- /// <summary></summary>
- None = 0,
- /// <summary></summary>
- FailSimulatorTimeout = 1,
- /// <summary></summary>
- FailDataserverTimeout = 2,
- /// <summary></summary>
- ObjectClaim = 1000,
- /// <summary></summary>
- LandClaim = 1001,
- /// <summary></summary>
- GroupCreate = 1002,
- /// <summary></summary>
- ObjectPublicClaim = 1003,
- /// <summary></summary>
- GroupJoin = 1004,
- /// <summary></summary>
- TeleportCharge = 1100,
- /// <summary></summary>
- UploadCharge = 1101,
- /// <summary></summary>
- LandAuction = 1102,
- /// <summary></summary>
- ClassifiedCharge = 1103,
- /// <summary></summary>
- ObjectTax = 2000,
- /// <summary></summary>
- LandTax = 2001,
- /// <summary></summary>
- LightTax = 2002,
- /// <summary></summary>
- ParcelDirFee = 2003,
- /// <summary></summary>
- GroupTax = 2004,
- /// <summary></summary>
- ClassifiedRenew = 2005,
- /// <summary></summary>
- GiveInventory = 3000,
- /// <summary></summary>
- ObjectSale = 5000,
- /// <summary></summary>
- Gift = 5001,
- /// <summary></summary>
- LandSale = 5002,
- /// <summary></summary>
- ReferBonus = 5003,
- /// <summary></summary>
- InventorySale = 5004,
- /// <summary></summary>
- RefundPurchase = 5005,
- /// <summary></summary>
- LandPassSale = 5006,
- /// <summary></summary>
- DwellBonus = 5007,
- /// <summary></summary>
- PayObject = 5008,
- /// <summary></summary>
- ObjectPays = 5009,
- /// <summary></summary>
- GroupLandDeed = 6001,
- /// <summary></summary>
- GroupObjectDeed = 6002,
- /// <summary></summary>
- GroupLiability = 6003,
- /// <summary></summary>
- GroupDividend = 6004,
- /// <summary></summary>
- GroupMembershipDues = 6005,
- /// <summary></summary>
- ObjectRelease = 8000,
- /// <summary></summary>
- LandRelease = 8001,
- /// <summary></summary>
- ObjectDelete = 8002,
- /// <summary></summary>
- ObjectPublicDecay = 8003,
- /// <summary></summary>
- ObjectPublicDelete = 8004,
- /// <summary></summary>
- LindenAdjustment = 9000,
- /// <summary></summary>
- LindenGrant = 9001,
- /// <summary></summary>
- LindenPenalty = 9002,
- /// <summary></summary>
- EventFee = 9003,
- /// <summary></summary>
- EventPrize = 9004,
- /// <summary></summary>
- StipendBasic = 10000,
- /// <summary></summary>
- StipendDeveloper = 10001,
- /// <summary></summary>
- StipendAlways = 10002,
- /// <summary></summary>
- StipendDaily = 10003,
- /// <summary></summary>
- StipendRating = 10004,
- /// <summary></summary>
- StipendDelta = 10005
- }
- /// <summary>
- ///
- /// </summary>
- [Flags]
- public enum TransactionFlags : byte
- {
- /// <summary></summary>
- None = 0,
- /// <summary></summary>
- SourceGroup = 1,
- /// <summary></summary>
- DestGroup = 2,
- /// <summary></summary>
- OwnerGroup = 4,
- /// <summary></summary>
- SimultaneousContribution = 8,
- /// <summary></summary>
- ContributionRemoval = 16
- }
- /// <summary>
- ///
- /// </summary>
- public enum MeanCollisionType : byte
- {
- /// <summary></summary>
- None,
- /// <summary></summary>
- Bump,
- /// <summary></summary>
- LLPushObject,
- /// <summary></summary>
- SelectedObjectCollide,
- /// <summary></summary>
- ScriptedObjectCollide,
- /// <summary></summary>
- PhysicalObjectCollide
- }
- /// <summary>
- /// Flags sent when a script takes or releases a control
- /// </summary>
- /// <remarks>NOTE: (need to verify) These might be a subset of the ControlFlags enum in Movement,</remarks>
- [Flags]
- public enum ScriptControlChange : uint
- {
- /// <summary>No Flags set</summary>
- None = 0,
- /// <summary>Forward (W or up Arrow)</summary>
- Forward = 1,
- /// <summary>Back (S or down arrow)</summary>
- Back = 2,
- /// <summary>Move left (shift+A or left arrow)</summary>
- Left = 4,
- /// <summary>Move right (shift+D or right arrow)</summary>
- Right = 8,
- /// <summary>Up (E or PgUp)</summary>
- Up = 16,
- /// <summary>Down (C or PgDown)</summary>
- Down = 32,
- /// <summary>Rotate left (A or left arrow)</summary>
- RotateLeft = 256,
- /// <summary>Rotate right (D or right arrow)</summary>
- RotateRight = 512,
- /// <summary>Left Mouse Button</summary>
- LeftButton = 268435456,
- /// <summary>Left Mouse button in MouseLook</summary>
- MouseLookLeftButton = 1073741824
- }
- /// <summary>
- /// Currently only used to hide your group title
- /// </summary>
- [Flags]
- public enum AgentFlags : byte
- {
- /// <summary>No flags set</summary>
- None = 0,
- /// <summary>Hide your group title</summary>
- HideTitle = 0x01,
- }
- /// <summary>
- /// Action state of the avatar, which can currently be typing and
- /// editing
- /// </summary>
- [Flags]
- public enum AgentState : byte
- {
- /// <summary></summary>
- None = 0x00,
- /// <summary></summary>
- Typing = 0x04,
- /// <summary></summary>
- Editing = 0x10
- }
- /// <summary>
- /// Current teleport status
- /// </summary>
- public enum TeleportStatus
- {
- /// <summary>Unknown status</summary>
- None,
- /// <summary>Teleport initialized</summary>
- Start,
- /// <summary>Teleport in progress</summary>
- Progress,
- /// <summary>Teleport failed</summary>
- Failed,
- /// <summary>Teleport completed</summary>
- Finished,
- /// <summary>Teleport cancelled</summary>
- Cancelled
- }
- /// <summary>
- ///
- /// </summary>
- [Flags]
- public enum TeleportFlags : uint
- {
- /// <summary>No flags set, or teleport failed</summary>
- Default = 0,
- /// <summary>Set when newbie leaves help island for first time</summary>
- SetHomeToTarget = 1 << 0,
- /// <summary></summary>
- SetLastToTarget = 1 << 1,
- /// <summary>Via Lure</summary>
- ViaLure = 1 << 2,
- /// <summary>Via Landmark</summary>
- ViaLandmark = 1 << 3,
- /// <summary>Via Location</summary>
- ViaLocation = 1 << 4,
- /// <summary>Via Home</summary>
- ViaHome = 1 << 5,
- /// <summary>Via Telehub</summary>
- ViaTelehub = 1 << 6,
- /// <summary>Via Login</summary>
- ViaLogin = 1 << 7,
- /// <summary>Linden Summoned</summary>
- ViaGodlikeLure = 1 << 8,
- /// <summary>Linden Forced me</summary>
- Godlike = 1 << 9,
- /// <summary></summary>
- NineOneOne = 1 << 10,
- /// <summary>Agent Teleported Home via Script</summary>
- DisableCancel = 1 << 11,
- /// <summary></summary>
- ViaRegionID = 1 << 12,
- /// <summary></summary>
- IsFlying = 1 << 13,
- /// <summary></summary>
- ResetHome = 1 << 14,
- /// <summary>forced to new location for example when avatar is banned or ejected</summary>
- ForceRedirect = 1 << 15,
- /// <summary>Teleport Finished via a Lure</summary>
- FinishedViaLure = 1 << 26,
- /// <summary>Finished, Sim Changed</summary>
- FinishedViaNewSim = 1 << 28,
- /// <summary>Finished, Same Sim</summary>
- FinishedViaSameSim = 1 << 29
- }
- /// <summary>
- ///
- /// </summary>
- [Flags]
- public enum TeleportLureFlags
- {
- /// <summary></summary>
- NormalLure = 0,
- /// <summary></summary>
- GodlikeLure = 1,
- /// <summary></summary>
- GodlikePursuit = 2
- }
- /// <summary>
- ///
- /// </summary>
- [Flags]
- public enum ScriptSensorTypeFlags
- {
- /// <summary></summary>
- Agent = 1,
- /// <summary></summary>
- Active = 2,
- /// <summary></summary>
- Passive = 4,
- /// <summary></summary>
- Scripted = 8,
- }
- /// <summary>
- /// Type of mute entry
- /// </summary>
- public enum MuteType
- {
- /// <summary>Object muted by name</summary>
- ByName = 0,
- /// <summary>Muted residet</summary>
- Resident = 1,
- /// <summary>Object muted by UUID</summary>
- Object = 2,
- /// <summary>Muted group</summary>
- Group = 3,
- /// <summary>Muted external entry</summary>
- External = 4
- }
- /// <summary>
- /// Flags of mute entry
- /// </summary>
- [Flags]
- public enum MuteFlags : int
- {
- /// <summary>No exceptions</summary>
- Default = 0x0,
- /// <summary>Don't mute text chat</summary>
- TextChat = 0x1,
- /// <summary>Don't mute voice chat</summary>
- VoiceChat = 0x2,
- /// <summary>Don't mute particles</summary>
- Particles = 0x4,
- /// <summary>Don't mute sounds</summary>
- ObjectSounds = 0x8,
- /// <summary>Don't mute</summary>
- All = 0xf
- }
- #endregion Enums
- #region Structs
- /// <summary>
- /// Instant Message
- /// </summary>
- public struct InstantMessage
- {
- /// <summary>Key of sender</summary>
- public UUID FromAgentID;
- /// <summary>Name of sender</summary>
- public string FromAgentName;
- /// <summary>Key of destination avatar</summary>
- public UUID ToAgentID;
- /// <summary>ID of originating estate</summary>
- public uint ParentEstateID;
- /// <summary>Key of originating region</summary>
- public UUID RegionID;
- /// <summary>Coordinates in originating region</summary>
- public Vector3 Position;
- /// <summary>Instant message type</summary>
- public InstantMessageDialog Dialog;
- /// <summary>Group IM session toggle</summary>
- public bool GroupIM;
- /// <summary>Key of IM session, for Group Messages, the groups UUID</summary>
- public UUID IMSessionID;
- /// <summary>Timestamp of the instant message</summary>
- public DateTime Timestamp;
- /// <summary>Instant message text</summary>
- public string Message;
- /// <summary>Whether this message is held for offline avatars</summary>
- public InstantMessageOnline Offline;
- /// <summary>Context specific packed data</summary>
- public byte[] BinaryBucket;
- /// <summary>Print the struct data as a string</summary>
- /// <returns>A string containing the field name, and field value</returns>
- public override string ToString()
- {
- return Helpers.StructToString(this);
- }
- }
- /// <summary>Represents muted object or resident</summary>
- public class MuteEntry
- {
- /// <summary>Type of the mute entry</summary>
- public MuteType Type;
- /// <summary>UUID of the mute etnry</summary>
- public UUID ID;
- /// <summary>Mute entry name</summary>
- public string Name;
- /// <summary>Mute flags</summary>
- public MuteFlags Flags;
- }
- /// <summary>Transaction detail sent with MoneyBalanceReply message</summary>
- public class TransactionInfo
- {
- /// <summary>Type of the transaction</summary>
- public int TransactionType; // FIXME: this should be an enum
- /// <summary>UUID of the transaction source</summary>
- public UUID SourceID;
- /// <summary>Is the transaction source a group</summary>
- public bool IsSourceGroup;
- /// <summary>UUID of the transaction destination</summary>
- public UUID DestID;
- /// <summary>Is transaction destination a group</summary>
- public bool IsDestGroup;
- /// <summary>Transaction amount</summary>
- public int Amount;
- /// <summary>Transaction description</summary>
- public string ItemDescription;
- }
- #endregion Structs
- /// <summary>
- /// Manager class for our own avatar
- /// </summary>
- public partial class AgentManager
- {
- #region Delegates
- /// <summary>
- /// Called once attachment resource usage information has been collected
- /// </summary>
- /// <param name="success">Indicates if operation was successfull</param>
- /// <param name="info">Attachment resource usage information</param>
- public delegate void AttachmentResourcesCallback(bool success, AttachmentResourcesMessage info);
- #endregion Delegates
- #region Event Delegates
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ChatEventArgs> m_Chat;
- /// <summary>Raises the ChatFromSimulator event</summary>
- /// <param name="e">A ChatEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnChat(ChatEventArgs e)
- {
- EventHandler<ChatEventArgs> handler = m_Chat;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ChatLock = new object();
- /// <summary>Raised when a scripted object or agent within range sends a public message</summary>
- public event EventHandler<ChatEventArgs> ChatFromSimulator
- {
- add { lock (m_ChatLock) { m_Chat += value; } }
- remove { lock (m_ChatLock) { m_Chat -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ScriptDialogEventArgs> m_ScriptDialog;
- /// <summary>Raises the ScriptDialog event</summary>
- /// <param name="e">A SctriptDialogEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnScriptDialog(ScriptDialogEventArgs e)
- {
- EventHandler<ScriptDialogEventArgs> handler = m_ScriptDialog;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ScriptDialogLock = new object();
- /// <summary>Raised when a scripted object sends a dialog box containing possible
- /// options an agent can respond to</summary>
- public event EventHandler<ScriptDialogEventArgs> ScriptDialog
- {
- add { lock (m_ScriptDialogLock) { m_ScriptDialog += value; } }
- remove { lock (m_ScriptDialogLock) { m_ScriptDialog -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ScriptQuestionEventArgs> m_ScriptQuestion;
- /// <summary>Raises the ScriptQuestion event</summary>
- /// <param name="e">A ScriptQuestionEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnScriptQuestion(ScriptQuestionEventArgs e)
- {
- EventHandler<ScriptQuestionEventArgs> handler = m_ScriptQuestion;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ScriptQuestionLock = new object();
- /// <summary>Raised when an object requests a change in the permissions an agent has permitted</summary>
- public event EventHandler<ScriptQuestionEventArgs> ScriptQuestion
- {
- add { lock (m_ScriptQuestionLock) { m_ScriptQuestion += value; } }
- remove { lock (m_ScriptQuestionLock) { m_ScriptQuestion -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<LoadUrlEventArgs> m_LoadURL;
- /// <summary>Raises the LoadURL event</summary>
- /// <param name="e">A LoadUrlEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnLoadURL(LoadUrlEventArgs e)
- {
- EventHandler<LoadUrlEventArgs> handler = m_LoadURL;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_LoadUrlLock = new object();
- /// <summary>Raised when a script requests an agent open the specified URL</summary>
- public event EventHandler<LoadUrlEventArgs> LoadURL
- {
- add { lock (m_LoadUrlLock) { m_LoadURL += value; } }
- remove { lock (m_LoadUrlLock) { m_LoadURL -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<BalanceEventArgs> m_Balance;
- /// <summary>Raises the MoneyBalance event</summary>
- /// <param name="e">A BalanceEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnBalance(BalanceEventArgs e)
- {
- EventHandler<BalanceEventArgs> handler = m_Balance;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_BalanceLock = new object();
- /// <summary>Raised when an agents currency balance is updated</summary>
- public event EventHandler<BalanceEventArgs> MoneyBalance
- {
- add { lock (m_BalanceLock) { m_Balance += value; } }
- remove { lock (m_BalanceLock) { m_Balance -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<MoneyBalanceReplyEventArgs> m_MoneyBalance;
- /// <summary>Raises the MoneyBalanceReply event</summary>
- /// <param name="e">A MoneyBalanceReplyEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnMoneyBalanceReply(MoneyBalanceReplyEventArgs e)
- {
- EventHandler<MoneyBalanceReplyEventArgs> handler = m_MoneyBalance;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_MoneyBalanceReplyLock = new object();
- /// <summary>Raised when a transaction occurs involving currency such as a land purchase</summary>
- public event EventHandler<MoneyBalanceReplyEventArgs> MoneyBalanceReply
- {
- add { lock (m_MoneyBalanceReplyLock) { m_MoneyBalance += value; } }
- remove { lock (m_MoneyBalanceReplyLock) { m_MoneyBalance -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<InstantMessageEventArgs> m_InstantMessage;
- /// <summary>Raises the IM event</summary>
- /// <param name="e">A InstantMessageEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnInstantMessage(InstantMessageEventArgs e)
- {
- EventHandler<InstantMessageEventArgs> handler = m_InstantMessage;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_InstantMessageLock = new object();
- /// <summary>Raised when an ImprovedInstantMessage packet is recieved from the simulator, this is used for everything from
- /// private messaging to friendship offers. The Dialog field defines what type of message has arrived</summary>
- public event EventHandler<InstantMessageEventArgs> IM
- {
- add { lock (m_InstantMessageLock) { m_InstantMessage += value; } }
- remove { lock (m_InstantMessageLock) { m_InstantMessage -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<TeleportEventArgs> m_Teleport;
- /// <summary>Raises the TeleportProgress event</summary>
- /// <param name="e">A TeleportEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnTeleport(TeleportEventArgs e)
- {
- EventHandler<TeleportEventArgs> handler = m_Teleport;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_TeleportLock = new object();
- /// <summary>Raised when an agent has requested a teleport to another location, or when responding to a lure. Raised multiple times
- /// for each teleport indicating the progress of the request</summary>
- public event EventHandler<TeleportEventArgs> TeleportProgress
- {
- add { lock (m_TeleportLock) { m_Teleport += value; } }
- remove { lock (m_TeleportLock) { m_Teleport += value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<AgentDataReplyEventArgs> m_AgentData;
- /// <summary>Raises the AgentDataReply event</summary>
- /// <param name="e">A AgentDataReplyEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnAgentData(AgentDataReplyEventArgs e)
- {
- EventHandler<AgentDataReplyEventArgs> handler = m_AgentData;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_AgentDataLock = new object();
- /// <summary>Raised when a simulator sends agent specific information for our avatar.</summary>
- public event EventHandler<AgentDataReplyEventArgs> AgentDataReply
- {
- add { lock (m_AgentDataLock) { m_AgentData += value; } }
- remove { lock (m_AgentDataLock) { m_AgentData -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<AnimationsChangedEventArgs> m_AnimationsChanged;
- /// <summary>Raises the AnimationsChanged event</summary>
- /// <param name="e">A AnimationsChangedEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnAnimationsChanged(AnimationsChangedEventArgs e)
- {
- EventHandler<AnimationsChangedEventArgs> handler = m_AnimationsChanged;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_AnimationsChangedLock = new object();
- /// <summary>Raised when our agents animation playlist changes</summary>
- public event EventHandler<AnimationsChangedEventArgs> AnimationsChanged
- {
- add { lock (m_AnimationsChangedLock) { m_AnimationsChanged += value; } }
- remove { lock (m_AnimationsChangedLock) { m_AnimationsChanged -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<MeanCollisionEventArgs> m_MeanCollision;
- /// <summary>Raises the MeanCollision event</summary>
- /// <param name="e">A MeanCollisionEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnMeanCollision(MeanCollisionEventArgs e)
- {
- EventHandler<MeanCollisionEventArgs> handler = m_MeanCollision;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_MeanCollisionLock = new object();
- /// <summary>Raised when an object or avatar forcefully collides with our agent</summary>
- public event EventHandler<MeanCollisionEventArgs> MeanCollision
- {
- add { lock (m_MeanCollisionLock) { m_MeanCollision += value; } }
- remove { lock (m_MeanCollisionLock) { m_MeanCollision -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<RegionCrossedEventArgs> m_RegionCrossed;
- /// <summary>Raises the RegionCrossed event</summary>
- /// <param name="e">A RegionCrossedEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnRegionCrossed(RegionCrossedEventArgs e)
- {
- EventHandler<RegionCrossedEventArgs> handler = m_RegionCrossed;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_RegionCrossedLock = new object();
- /// <summary>Raised when our agent crosses a region border into another region</summary>
- public event EventHandler<RegionCrossedEventArgs> RegionCrossed
- {
- add { lock (m_RegionCrossedLock) { m_RegionCrossed += value; } }
- remove { lock (m_RegionCrossedLock) { m_RegionCrossed -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<GroupChatJoinedEventArgs> m_GroupChatJoined;
- /// <summary>Raises the GroupChatJoined event</summary>
- /// <param name="e">A GroupChatJoinedEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnGroupChatJoined(GroupChatJoinedEventArgs e)
- {
- EventHandler<GroupChatJoinedEventArgs> handler = m_GroupChatJoined;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_GroupChatJoinedLock = new object();
- /// <summary>Raised when our agent succeeds or fails to join a group chat session</summary>
- public event EventHandler<GroupChatJoinedEventArgs> GroupChatJoined
- {
- add { lock (m_GroupChatJoinedLock) { m_GroupChatJoined += value; } }
- remove { lock (m_GroupChatJoinedLock) { m_GroupChatJoined -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<AlertMessageEventArgs> m_AlertMessage;
- /// <summary>Raises the AlertMessage event</summary>
- /// <param name="e">A AlertMessageEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnAlertMessage(AlertMessageEventArgs e)
- {
- EventHandler<AlertMessageEventArgs> handler = m_AlertMessage;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_AlertMessageLock = new object();
- /// <summary>Raised when a simulator sends an urgent message usually indication the recent failure of
- /// another action we have attempted to take such as an attempt to enter a parcel where we are denied access</summary>
- public event EventHandler<AlertMessageEventArgs> AlertMessage
- {
- add { lock (m_AlertMessageLock) { m_AlertMessage += value; } }
- remove { lock (m_AlertMessageLock) { m_AlertMessage -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ScriptControlEventArgs> m_ScriptControl;
- /// <summary>Raises the ScriptControlChange event</summary>
- /// <param name="e">A ScriptControlEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnScriptControlChange(ScriptControlEventArgs e)
- {
- EventHandler<ScriptControlEventArgs> handler = m_ScriptControl;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ScriptControlLock = new object();
- /// <summary>Raised when a script attempts to take or release specified controls for our agent</summary>
- public event EventHandler<ScriptControlEventArgs> ScriptControlChange
- {
- add { lock (m_ScriptControlLock) { m_ScriptControl += value; } }
- remove { lock (m_ScriptControlLock) { m_ScriptControl -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<CameraConstraintEventArgs> m_CameraConstraint;
- /// <summary>Raises the CameraConstraint event</summary>
- /// <param name="e">A CameraConstraintEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnCameraConstraint(CameraConstraintEventArgs e)
- {
- EventHandler<CameraConstraintEventArgs> handler = m_CameraConstraint;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_CameraConstraintLock = new object();
- /// <summary>Raised when the simulator detects our agent is trying to view something
- /// beyond its limits</summary>
- public event EventHandler<CameraConstraintEventArgs> CameraConstraint
- {
- add { lock (m_CameraConstraintLock) { m_CameraConstraint += value; } }
- remove { lock (m_CameraConstraintLock) { m_CameraConstraint -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ScriptSensorReplyEventArgs> m_ScriptSensorReply;
- /// <summary>Raises the ScriptSensorReply event</summary>
- /// <param name="e">A ScriptSensorReplyEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnScriptSensorReply(ScriptSensorReplyEventArgs e)
- {
- EventHandler<ScriptSensorReplyEventArgs> handler = m_ScriptSensorReply;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ScriptSensorReplyLock = new object();
- /// <summary>Raised when a script sensor reply is received from a simulator</summary>
- public event EventHandler<ScriptSensorReplyEventArgs> ScriptSensorReply
- {
- add { lock (m_ScriptSensorReplyLock) { m_ScriptSensorReply += value; } }
- remove { lock (m_ScriptSensorReplyLock) { m_ScriptSensorReply -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<AvatarSitResponseEventArgs> m_AvatarSitResponse;
- /// <summary>Raises the AvatarSitResponse event</summary>
- /// <param name="e">A AvatarSitResponseEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnAvatarSitResponse(AvatarSitResponseEventArgs e)
- {
- EventHandler<AvatarSitResponseEventArgs> handler = m_AvatarSitResponse;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_AvatarSitResponseLock = new object();
- /// <summary>Raised in response to a <see cref="RequestSit"/> request</summary>
- public event EventHandler<AvatarSitResponseEventArgs> AvatarSitResponse
- {
- add { lock (m_AvatarSitResponseLock) { m_AvatarSitResponse += value; } }
- remove { lock (m_AvatarSitResponseLock) { m_AvatarSitResponse -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ChatSessionMemberAddedEventArgs> m_ChatSessionMemberAdded;
- /// <summary>Raises the ChatSessionMemberAdded event</summary>
- /// <param name="e">A ChatSessionMemberAddedEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnChatSessionMemberAdded(ChatSessionMemberAddedEventArgs e)
- {
- EventHandler<ChatSessionMemberAddedEventArgs> handler = m_ChatSessionMemberAdded;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ChatSessionMemberAddedLock = new object();
- /// <summary>Raised when an avatar enters a group chat session we are participating in</summary>
- public event EventHandler<ChatSessionMemberAddedEventArgs> ChatSessionMemberAdded
- {
- add { lock (m_ChatSessionMemberAddedLock) { m_ChatSessionMemberAdded += value; } }
- remove { lock (m_ChatSessionMemberAddedLock) { m_ChatSessionMemberAdded -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<ChatSessionMemberLeftEventArgs> m_ChatSessionMemberLeft;
- /// <summary>Raises the ChatSessionMemberLeft event</summary>
- /// <param name="e">A ChatSessionMemberLeftEventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnChatSessionMemberLeft(ChatSessionMemberLeftEventArgs e)
- {
- EventHandler<ChatSessionMemberLeftEventArgs> handler = m_ChatSessionMemberLeft;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_ChatSessionMemberLeftLock = new object();
- /// <summary>Raised when an agent exits a group chat session we are participating in</summary>
- public event EventHandler<ChatSessionMemberLeftEventArgs> ChatSessionMemberLeft
- {
- add { lock (m_ChatSessionMemberLeftLock) { m_ChatSessionMemberLeft += value; } }
- remove { lock (m_ChatSessionMemberLeftLock) { m_ChatSessionMemberLeft -= value; } }
- }
- /// <summary>The event subscribers, null of no subscribers</summary>
- private EventHandler<SetDisplayNameReplyEventArgs> m_SetDisplayNameReply;
- ///<summary>Raises the SetDisplayNameReply Event</summary>
- /// <param name="e">A SetDisplayNameReplyEventArgs object containing
- /// the data sent from the simulator</param>
- protected virtual void OnSetDisplayNameReply(SetDisplayNameReplyEventArgs e)
- {
- EventHandler<SetDisplayNameReplyEventArgs> handler = m_SetDisplayNameReply;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_SetDisplayNameReplyLock = new object();
- /// <summary>Raised when the simulator sends us data containing
- /// the details of display name change</summary>
- public event EventHandler<SetDisplayNameReplyEventArgs> SetDisplayNameReply
- {
- add { lock (m_SetDisplayNameReplyLock) { m_SetDisplayNameReply += value; } }
- remove { lock (m_SetDisplayNameReplyLock) { m_SetDisplayNameReply -= value; } }
- }
- /// <summary>The event subscribers. null if no subcribers</summary>
- private EventHandler<EventArgs> m_MuteListUpdated;
- /// <summary>Raises the MuteListUpdated event</summary>
- /// <param name="e">A EventArgs object containing the
- /// data returned from the data server</param>
- protected virtual void OnMuteListUpdated(EventArgs e)
- {
- EventHandler<EventArgs> handler = m_MuteListUpdated;
- if (handler != null)
- handler(this, e);
- }
- /// <summary>Thread sync lock object</summary>
- private readonly object m_MuteListUpdatedLock = new object();
- /// <summary>Raised when a scripted object or agent within range sends a public message</summary>
- public event EventHandler<EventArgs> MuteListUpdated
- {
- add { lock (m_MuteListUpdatedLock) { m_MuteListUpdated += value; } }
- remove { lock (m_MuteListUpdatedLock) { m_MuteListUpdated -= value; } }
- }
- #endregion Callbacks
- /// <summary>Reference to the GridClient instance</summary>
- private readonly GridClient Client;
- /// <summary>Used for movement and camera tracking</summary>
- public readonly AgentMovement Movement;
- /// <summary>Currently p…
Large files files are truncated, but you can click here to view the full file