PageRenderTime 61ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

/OpenMetaverse/Modules/AgentManager.cs

https://bitbucket.org/VirtualReality/3rdparty-addon-modules
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

  1. /*
  2. * Copyright (c) 2007-2009, openmetaverse.org
  3. * All rights reserved.
  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. *
  8. * - Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. * - Neither the name of the openmetaverse.org nor the names
  11. * of its contributors may be used to endorse or promote products derived from
  12. * this software without specific prior written permission.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  15. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  18. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  19. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  20. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  21. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  22. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  23. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  24. * POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. using System;
  27. using System.Net;
  28. using System.Text;
  29. using System.Text.RegularExpressions;
  30. using System.Threading;
  31. using System.Reflection;
  32. using System.Collections.Generic;
  33. using OpenMetaverse.StructuredData;
  34. using OpenMetaverse.Http;
  35. using OpenMetaverse.Assets;
  36. using OpenMetaverse.Packets;
  37. using OpenMetaverse.Interfaces;
  38. using OpenMetaverse.Messages.Linden;
  39. namespace OpenMetaverse
  40. {
  41. #region Enums
  42. /// <summary>
  43. /// Permission request flags, asked when a script wants to control an Avatar
  44. /// </summary>
  45. [Flags]
  46. public enum ScriptPermission : int
  47. {
  48. /// <summary>Placeholder for empty values, shouldn't ever see this</summary>
  49. None = 0,
  50. /// <summary>Script wants ability to take money from you</summary>
  51. Debit = 1 << 1,
  52. /// <summary>Script wants to take camera controls for you</summary>
  53. TakeControls = 1 << 2,
  54. /// <summary>Script wants to remap avatars controls</summary>
  55. RemapControls = 1 << 3,
  56. /// <summary>Script wants to trigger avatar animations</summary>
  57. /// <remarks>This function is not implemented on the grid</remarks>
  58. TriggerAnimation = 1 << 4,
  59. /// <summary>Script wants to attach or detach the prim or primset to your avatar</summary>
  60. Attach = 1 << 5,
  61. /// <summary>Script wants permission to release ownership</summary>
  62. /// <remarks>This function is not implemented on the grid
  63. /// The concept of "public" objects does not exist anymore.</remarks>
  64. ReleaseOwnership = 1 << 6,
  65. /// <summary>Script wants ability to link/delink with other prims</summary>
  66. ChangeLinks = 1 << 7,
  67. /// <summary>Script wants permission to change joints</summary>
  68. /// <remarks>This function is not implemented on the grid</remarks>
  69. ChangeJoints = 1 << 8,
  70. /// <summary>Script wants permissions to change permissions</summary>
  71. /// <remarks>This function is not implemented on the grid</remarks>
  72. ChangePermissions = 1 << 9,
  73. /// <summary>Script wants to track avatars camera position and rotation </summary>
  74. TrackCamera = 1 << 10,
  75. /// <summary>Script wants to control your camera</summary>
  76. ControlCamera = 1 << 11
  77. }
  78. /// <summary>
  79. /// Special commands used in Instant Messages
  80. /// </summary>
  81. public enum InstantMessageDialog : byte
  82. {
  83. /// <summary>Indicates a regular IM from another agent</summary>
  84. MessageFromAgent = 0,
  85. /// <summary>Simple notification box with an OK button</summary>
  86. MessageBox = 1,
  87. // <summary>Used to show a countdown notification with an OK
  88. // button, deprecated now</summary>
  89. //[Obsolete]
  90. //MessageBoxCountdown = 2,
  91. /// <summary>You've been invited to join a group.</summary>
  92. GroupInvitation = 3,
  93. /// <summary>Inventory offer</summary>
  94. InventoryOffered = 4,
  95. /// <summary>Accepted inventory offer</summary>
  96. InventoryAccepted = 5,
  97. /// <summary>Declined inventory offer</summary>
  98. InventoryDeclined = 6,
  99. /// <summary>Group vote</summary>
  100. GroupVote = 7,
  101. // <summary>A message to everyone in the agent's group, no longer
  102. // used</summary>
  103. //[Obsolete]
  104. //DeprecatedGroupMessage = 8,
  105. /// <summary>An object is offering its inventory</summary>
  106. TaskInventoryOffered = 9,
  107. /// <summary>Accept an inventory offer from an object</summary>
  108. TaskInventoryAccepted = 10,
  109. /// <summary>Decline an inventory offer from an object</summary>
  110. TaskInventoryDeclined = 11,
  111. /// <summary>Unknown</summary>
  112. NewUserDefault = 12,
  113. /// <summary>Start a session, or add users to a session</summary>
  114. SessionAdd = 13,
  115. /// <summary>Start a session, but don't prune offline users</summary>
  116. SessionOfflineAdd = 14,
  117. /// <summary>Start a session with your group</summary>
  118. SessionGroupStart = 15,
  119. /// <summary>Start a session without a calling card (finder or objects)</summary>
  120. SessionCardlessStart = 16,
  121. /// <summary>Send a message to a session</summary>
  122. SessionSend = 17,
  123. /// <summary>Leave a session</summary>
  124. SessionDrop = 18,
  125. /// <summary>Indicates that the IM is from an object</summary>
  126. MessageFromObject = 19,
  127. /// <summary>Sent an IM to a busy user, this is the auto response</summary>
  128. BusyAutoResponse = 20,
  129. /// <summary>Shows the message in the console and chat history</summary>
  130. ConsoleAndChatHistory = 21,
  131. /// <summary>Send a teleport lure</summary>
  132. RequestTeleport = 22,
  133. /// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
  134. AcceptTeleport = 23,
  135. /// <summary>Response sent to the agent which inititiated a teleport invitation</summary>
  136. DenyTeleport = 24,
  137. /// <summary>Only useful if you have Linden permissions</summary>
  138. GodLikeRequestTeleport = 25,
  139. /// <summary>A placeholder type for future expansion, currently not
  140. /// used</summary>
  141. CurrentlyUnused = 26,
  142. // <summary>Notification of a new group election, this is
  143. // deprecated</summary>
  144. //[Obsolete]
  145. //DeprecatedGroupElection = 27,
  146. /// <summary>IM to tell the user to go to an URL</summary>
  147. GotoUrl = 28,
  148. /// <summary>IM for help</summary>
  149. Session911Start = 29,
  150. /// <summary>IM sent automatically on call for help, sends a lure
  151. /// to each Helper reached</summary>
  152. Lure911 = 30,
  153. /// <summary>Like an IM but won't go to email</summary>
  154. FromTaskAsAlert = 31,
  155. /// <summary>IM from a group officer to all group members</summary>
  156. GroupNotice = 32,
  157. /// <summary>Unknown</summary>
  158. GroupNoticeInventoryAccepted = 33,
  159. /// <summary>Unknown</summary>
  160. GroupNoticeInventoryDeclined = 34,
  161. /// <summary>Accept a group invitation</summary>
  162. GroupInvitationAccept = 35,
  163. /// <summary>Decline a group invitation</summary>
  164. GroupInvitationDecline = 36,
  165. /// <summary>Unknown</summary>
  166. GroupNoticeRequested = 37,
  167. /// <summary>An avatar is offering you friendship</summary>
  168. FriendshipOffered = 38,
  169. /// <summary>An avatar has accepted your friendship offer</summary>
  170. FriendshipAccepted = 39,
  171. /// <summary>An avatar has declined your friendship offer</summary>
  172. FriendshipDeclined = 40,
  173. /// <summary>Indicates that a user has started typing</summary>
  174. StartTyping = 41,
  175. /// <summary>Indicates that a user has stopped typing</summary>
  176. StopTyping = 42
  177. }
  178. /// <summary>
  179. /// Flag in Instant Messages, whether the IM should be delivered to
  180. /// offline avatars as well
  181. /// </summary>
  182. public enum InstantMessageOnline
  183. {
  184. /// <summary>Only deliver to online avatars</summary>
  185. Online = 0,
  186. /// <summary>If the avatar is offline the message will be held until
  187. /// they login next, and possibly forwarded to their e-mail account</summary>
  188. Offline = 1
  189. }
  190. /// <summary>
  191. /// Conversion type to denote Chat Packet types in an easier-to-understand format
  192. /// </summary>
  193. public enum ChatType : byte
  194. {
  195. /// <summary>Whisper (5m radius)</summary>
  196. Whisper = 0,
  197. /// <summary>Normal chat (10/20m radius), what the official viewer typically sends</summary>
  198. Normal = 1,
  199. /// <summary>Shouting! (100m radius)</summary>
  200. Shout = 2,
  201. // <summary>Say chat (10/20m radius) - The official viewer will
  202. // print "[4:15] You say, hey" instead of "[4:15] You: hey"</summary>
  203. //[Obsolete]
  204. //Say = 3,
  205. /// <summary>Event message when an Avatar has begun to type</summary>
  206. StartTyping = 4,
  207. /// <summary>Event message when an Avatar has stopped typing</summary>
  208. StopTyping = 5,
  209. /// <summary>Send the message to the debug channel</summary>
  210. Debug = 6,
  211. /// <summary>Event message when an object uses llOwnerSay</summary>
  212. OwnerSay = 8,
  213. /// <summary>Special value to support llRegionSay, never sent to the client</summary>
  214. RegionSay = Byte.MaxValue,
  215. }
  216. /// <summary>
  217. /// Identifies the source of a chat message
  218. /// </summary>
  219. public enum ChatSourceType : byte
  220. {
  221. /// <summary>Chat from the grid or simulator</summary>
  222. System = 0,
  223. /// <summary>Chat from another avatar</summary>
  224. Agent = 1,
  225. /// <summary>Chat from an object</summary>
  226. Object = 2
  227. }
  228. /// <summary>
  229. ///
  230. /// </summary>
  231. public enum ChatAudibleLevel : sbyte
  232. {
  233. /// <summary></summary>
  234. Not = -1,
  235. /// <summary></summary>
  236. Barely = 0,
  237. /// <summary></summary>
  238. Fully = 1
  239. }
  240. /// <summary>
  241. /// Effect type used in ViewerEffect packets
  242. /// </summary>
  243. public enum EffectType : byte
  244. {
  245. /// <summary></summary>
  246. Text = 0,
  247. /// <summary></summary>
  248. Icon,
  249. /// <summary></summary>
  250. Connector,
  251. /// <summary></summary>
  252. FlexibleObject,
  253. /// <summary></summary>
  254. AnimalControls,
  255. /// <summary></summary>
  256. AnimationObject,
  257. /// <summary></summary>
  258. Cloth,
  259. /// <summary>Project a beam from a source to a destination, such as
  260. /// the one used when editing an object</summary>
  261. Beam,
  262. /// <summary></summary>
  263. Glow,
  264. /// <summary></summary>
  265. Point,
  266. /// <summary></summary>
  267. Trail,
  268. /// <summary>Create a swirl of particles around an object</summary>
  269. Sphere,
  270. /// <summary></summary>
  271. Spiral,
  272. /// <summary></summary>
  273. Edit,
  274. /// <summary>Cause an avatar to look at an object</summary>
  275. LookAt,
  276. /// <summary>Cause an avatar to point at an object</summary>
  277. PointAt
  278. }
  279. /// <summary>
  280. /// The action an avatar is doing when looking at something, used in
  281. /// ViewerEffect packets for the LookAt effect
  282. /// </summary>
  283. public enum LookAtType : byte
  284. {
  285. /// <summary></summary>
  286. None,
  287. /// <summary></summary>
  288. Idle,
  289. /// <summary></summary>
  290. AutoListen,
  291. /// <summary></summary>
  292. FreeLook,
  293. /// <summary></summary>
  294. Respond,
  295. /// <summary></summary>
  296. Hover,
  297. /// <summary>Deprecated</summary>
  298. [Obsolete]
  299. Conversation,
  300. /// <summary></summary>
  301. Select,
  302. /// <summary></summary>
  303. Focus,
  304. /// <summary></summary>
  305. Mouselook,
  306. /// <summary></summary>
  307. Clear
  308. }
  309. /// <summary>
  310. /// The action an avatar is doing when pointing at something, used in
  311. /// ViewerEffect packets for the PointAt effect
  312. /// </summary>
  313. public enum PointAtType : byte
  314. {
  315. /// <summary></summary>
  316. None,
  317. /// <summary></summary>
  318. Select,
  319. /// <summary></summary>
  320. Grab,
  321. /// <summary></summary>
  322. Clear
  323. }
  324. /// <summary>
  325. /// Money transaction types
  326. /// </summary>
  327. public enum MoneyTransactionType : int
  328. {
  329. /// <summary></summary>
  330. None = 0,
  331. /// <summary></summary>
  332. FailSimulatorTimeout = 1,
  333. /// <summary></summary>
  334. FailDataserverTimeout = 2,
  335. /// <summary></summary>
  336. ObjectClaim = 1000,
  337. /// <summary></summary>
  338. LandClaim = 1001,
  339. /// <summary></summary>
  340. GroupCreate = 1002,
  341. /// <summary></summary>
  342. ObjectPublicClaim = 1003,
  343. /// <summary></summary>
  344. GroupJoin = 1004,
  345. /// <summary></summary>
  346. TeleportCharge = 1100,
  347. /// <summary></summary>
  348. UploadCharge = 1101,
  349. /// <summary></summary>
  350. LandAuction = 1102,
  351. /// <summary></summary>
  352. ClassifiedCharge = 1103,
  353. /// <summary></summary>
  354. ObjectTax = 2000,
  355. /// <summary></summary>
  356. LandTax = 2001,
  357. /// <summary></summary>
  358. LightTax = 2002,
  359. /// <summary></summary>
  360. ParcelDirFee = 2003,
  361. /// <summary></summary>
  362. GroupTax = 2004,
  363. /// <summary></summary>
  364. ClassifiedRenew = 2005,
  365. /// <summary></summary>
  366. GiveInventory = 3000,
  367. /// <summary></summary>
  368. ObjectSale = 5000,
  369. /// <summary></summary>
  370. Gift = 5001,
  371. /// <summary></summary>
  372. LandSale = 5002,
  373. /// <summary></summary>
  374. ReferBonus = 5003,
  375. /// <summary></summary>
  376. InventorySale = 5004,
  377. /// <summary></summary>
  378. RefundPurchase = 5005,
  379. /// <summary></summary>
  380. LandPassSale = 5006,
  381. /// <summary></summary>
  382. DwellBonus = 5007,
  383. /// <summary></summary>
  384. PayObject = 5008,
  385. /// <summary></summary>
  386. ObjectPays = 5009,
  387. /// <summary></summary>
  388. GroupLandDeed = 6001,
  389. /// <summary></summary>
  390. GroupObjectDeed = 6002,
  391. /// <summary></summary>
  392. GroupLiability = 6003,
  393. /// <summary></summary>
  394. GroupDividend = 6004,
  395. /// <summary></summary>
  396. GroupMembershipDues = 6005,
  397. /// <summary></summary>
  398. ObjectRelease = 8000,
  399. /// <summary></summary>
  400. LandRelease = 8001,
  401. /// <summary></summary>
  402. ObjectDelete = 8002,
  403. /// <summary></summary>
  404. ObjectPublicDecay = 8003,
  405. /// <summary></summary>
  406. ObjectPublicDelete = 8004,
  407. /// <summary></summary>
  408. LindenAdjustment = 9000,
  409. /// <summary></summary>
  410. LindenGrant = 9001,
  411. /// <summary></summary>
  412. LindenPenalty = 9002,
  413. /// <summary></summary>
  414. EventFee = 9003,
  415. /// <summary></summary>
  416. EventPrize = 9004,
  417. /// <summary></summary>
  418. StipendBasic = 10000,
  419. /// <summary></summary>
  420. StipendDeveloper = 10001,
  421. /// <summary></summary>
  422. StipendAlways = 10002,
  423. /// <summary></summary>
  424. StipendDaily = 10003,
  425. /// <summary></summary>
  426. StipendRating = 10004,
  427. /// <summary></summary>
  428. StipendDelta = 10005
  429. }
  430. /// <summary>
  431. ///
  432. /// </summary>
  433. [Flags]
  434. public enum TransactionFlags : byte
  435. {
  436. /// <summary></summary>
  437. None = 0,
  438. /// <summary></summary>
  439. SourceGroup = 1,
  440. /// <summary></summary>
  441. DestGroup = 2,
  442. /// <summary></summary>
  443. OwnerGroup = 4,
  444. /// <summary></summary>
  445. SimultaneousContribution = 8,
  446. /// <summary></summary>
  447. ContributionRemoval = 16
  448. }
  449. /// <summary>
  450. ///
  451. /// </summary>
  452. public enum MeanCollisionType : byte
  453. {
  454. /// <summary></summary>
  455. None,
  456. /// <summary></summary>
  457. Bump,
  458. /// <summary></summary>
  459. LLPushObject,
  460. /// <summary></summary>
  461. SelectedObjectCollide,
  462. /// <summary></summary>
  463. ScriptedObjectCollide,
  464. /// <summary></summary>
  465. PhysicalObjectCollide
  466. }
  467. /// <summary>
  468. /// Flags sent when a script takes or releases a control
  469. /// </summary>
  470. /// <remarks>NOTE: (need to verify) These might be a subset of the ControlFlags enum in Movement,</remarks>
  471. [Flags]
  472. public enum ScriptControlChange : uint
  473. {
  474. /// <summary>No Flags set</summary>
  475. None = 0,
  476. /// <summary>Forward (W or up Arrow)</summary>
  477. Forward = 1,
  478. /// <summary>Back (S or down arrow)</summary>
  479. Back = 2,
  480. /// <summary>Move left (shift+A or left arrow)</summary>
  481. Left = 4,
  482. /// <summary>Move right (shift+D or right arrow)</summary>
  483. Right = 8,
  484. /// <summary>Up (E or PgUp)</summary>
  485. Up = 16,
  486. /// <summary>Down (C or PgDown)</summary>
  487. Down = 32,
  488. /// <summary>Rotate left (A or left arrow)</summary>
  489. RotateLeft = 256,
  490. /// <summary>Rotate right (D or right arrow)</summary>
  491. RotateRight = 512,
  492. /// <summary>Left Mouse Button</summary>
  493. LeftButton = 268435456,
  494. /// <summary>Left Mouse button in MouseLook</summary>
  495. MouseLookLeftButton = 1073741824
  496. }
  497. /// <summary>
  498. /// Currently only used to hide your group title
  499. /// </summary>
  500. [Flags]
  501. public enum AgentFlags : byte
  502. {
  503. /// <summary>No flags set</summary>
  504. None = 0,
  505. /// <summary>Hide your group title</summary>
  506. HideTitle = 0x01,
  507. }
  508. /// <summary>
  509. /// Action state of the avatar, which can currently be typing and
  510. /// editing
  511. /// </summary>
  512. [Flags]
  513. public enum AgentState : byte
  514. {
  515. /// <summary></summary>
  516. None = 0x00,
  517. /// <summary></summary>
  518. Typing = 0x04,
  519. /// <summary></summary>
  520. Editing = 0x10
  521. }
  522. /// <summary>
  523. /// Current teleport status
  524. /// </summary>
  525. public enum TeleportStatus
  526. {
  527. /// <summary>Unknown status</summary>
  528. None,
  529. /// <summary>Teleport initialized</summary>
  530. Start,
  531. /// <summary>Teleport in progress</summary>
  532. Progress,
  533. /// <summary>Teleport failed</summary>
  534. Failed,
  535. /// <summary>Teleport completed</summary>
  536. Finished,
  537. /// <summary>Teleport cancelled</summary>
  538. Cancelled
  539. }
  540. /// <summary>
  541. ///
  542. /// </summary>
  543. [Flags]
  544. public enum TeleportFlags : uint
  545. {
  546. /// <summary>No flags set, or teleport failed</summary>
  547. Default = 0,
  548. /// <summary>Set when newbie leaves help island for first time</summary>
  549. SetHomeToTarget = 1 << 0,
  550. /// <summary></summary>
  551. SetLastToTarget = 1 << 1,
  552. /// <summary>Via Lure</summary>
  553. ViaLure = 1 << 2,
  554. /// <summary>Via Landmark</summary>
  555. ViaLandmark = 1 << 3,
  556. /// <summary>Via Location</summary>
  557. ViaLocation = 1 << 4,
  558. /// <summary>Via Home</summary>
  559. ViaHome = 1 << 5,
  560. /// <summary>Via Telehub</summary>
  561. ViaTelehub = 1 << 6,
  562. /// <summary>Via Login</summary>
  563. ViaLogin = 1 << 7,
  564. /// <summary>Linden Summoned</summary>
  565. ViaGodlikeLure = 1 << 8,
  566. /// <summary>Linden Forced me</summary>
  567. Godlike = 1 << 9,
  568. /// <summary></summary>
  569. NineOneOne = 1 << 10,
  570. /// <summary>Agent Teleported Home via Script</summary>
  571. DisableCancel = 1 << 11,
  572. /// <summary></summary>
  573. ViaRegionID = 1 << 12,
  574. /// <summary></summary>
  575. IsFlying = 1 << 13,
  576. /// <summary></summary>
  577. ResetHome = 1 << 14,
  578. /// <summary>forced to new location for example when avatar is banned or ejected</summary>
  579. ForceRedirect = 1 << 15,
  580. /// <summary>Teleport Finished via a Lure</summary>
  581. FinishedViaLure = 1 << 26,
  582. /// <summary>Finished, Sim Changed</summary>
  583. FinishedViaNewSim = 1 << 28,
  584. /// <summary>Finished, Same Sim</summary>
  585. FinishedViaSameSim = 1 << 29
  586. }
  587. /// <summary>
  588. ///
  589. /// </summary>
  590. [Flags]
  591. public enum TeleportLureFlags
  592. {
  593. /// <summary></summary>
  594. NormalLure = 0,
  595. /// <summary></summary>
  596. GodlikeLure = 1,
  597. /// <summary></summary>
  598. GodlikePursuit = 2
  599. }
  600. /// <summary>
  601. ///
  602. /// </summary>
  603. [Flags]
  604. public enum ScriptSensorTypeFlags
  605. {
  606. /// <summary></summary>
  607. Agent = 1,
  608. /// <summary></summary>
  609. Active = 2,
  610. /// <summary></summary>
  611. Passive = 4,
  612. /// <summary></summary>
  613. Scripted = 8,
  614. }
  615. /// <summary>
  616. /// Type of mute entry
  617. /// </summary>
  618. public enum MuteType
  619. {
  620. /// <summary>Object muted by name</summary>
  621. ByName = 0,
  622. /// <summary>Muted residet</summary>
  623. Resident = 1,
  624. /// <summary>Object muted by UUID</summary>
  625. Object = 2,
  626. /// <summary>Muted group</summary>
  627. Group = 3,
  628. /// <summary>Muted external entry</summary>
  629. External = 4
  630. }
  631. /// <summary>
  632. /// Flags of mute entry
  633. /// </summary>
  634. [Flags]
  635. public enum MuteFlags : int
  636. {
  637. /// <summary>No exceptions</summary>
  638. Default = 0x0,
  639. /// <summary>Don't mute text chat</summary>
  640. TextChat = 0x1,
  641. /// <summary>Don't mute voice chat</summary>
  642. VoiceChat = 0x2,
  643. /// <summary>Don't mute particles</summary>
  644. Particles = 0x4,
  645. /// <summary>Don't mute sounds</summary>
  646. ObjectSounds = 0x8,
  647. /// <summary>Don't mute</summary>
  648. All = 0xf
  649. }
  650. #endregion Enums
  651. #region Structs
  652. /// <summary>
  653. /// Instant Message
  654. /// </summary>
  655. public struct InstantMessage
  656. {
  657. /// <summary>Key of sender</summary>
  658. public UUID FromAgentID;
  659. /// <summary>Name of sender</summary>
  660. public string FromAgentName;
  661. /// <summary>Key of destination avatar</summary>
  662. public UUID ToAgentID;
  663. /// <summary>ID of originating estate</summary>
  664. public uint ParentEstateID;
  665. /// <summary>Key of originating region</summary>
  666. public UUID RegionID;
  667. /// <summary>Coordinates in originating region</summary>
  668. public Vector3 Position;
  669. /// <summary>Instant message type</summary>
  670. public InstantMessageDialog Dialog;
  671. /// <summary>Group IM session toggle</summary>
  672. public bool GroupIM;
  673. /// <summary>Key of IM session, for Group Messages, the groups UUID</summary>
  674. public UUID IMSessionID;
  675. /// <summary>Timestamp of the instant message</summary>
  676. public DateTime Timestamp;
  677. /// <summary>Instant message text</summary>
  678. public string Message;
  679. /// <summary>Whether this message is held for offline avatars</summary>
  680. public InstantMessageOnline Offline;
  681. /// <summary>Context specific packed data</summary>
  682. public byte[] BinaryBucket;
  683. /// <summary>Print the struct data as a string</summary>
  684. /// <returns>A string containing the field name, and field value</returns>
  685. public override string ToString()
  686. {
  687. return Helpers.StructToString(this);
  688. }
  689. }
  690. /// <summary>Represents muted object or resident</summary>
  691. public class MuteEntry
  692. {
  693. /// <summary>Type of the mute entry</summary>
  694. public MuteType Type;
  695. /// <summary>UUID of the mute etnry</summary>
  696. public UUID ID;
  697. /// <summary>Mute entry name</summary>
  698. public string Name;
  699. /// <summary>Mute flags</summary>
  700. public MuteFlags Flags;
  701. }
  702. /// <summary>Transaction detail sent with MoneyBalanceReply message</summary>
  703. public class TransactionInfo
  704. {
  705. /// <summary>Type of the transaction</summary>
  706. public int TransactionType; // FIXME: this should be an enum
  707. /// <summary>UUID of the transaction source</summary>
  708. public UUID SourceID;
  709. /// <summary>Is the transaction source a group</summary>
  710. public bool IsSourceGroup;
  711. /// <summary>UUID of the transaction destination</summary>
  712. public UUID DestID;
  713. /// <summary>Is transaction destination a group</summary>
  714. public bool IsDestGroup;
  715. /// <summary>Transaction amount</summary>
  716. public int Amount;
  717. /// <summary>Transaction description</summary>
  718. public string ItemDescription;
  719. }
  720. #endregion Structs
  721. /// <summary>
  722. /// Manager class for our own avatar
  723. /// </summary>
  724. public partial class AgentManager
  725. {
  726. #region Delegates
  727. /// <summary>
  728. /// Called once attachment resource usage information has been collected
  729. /// </summary>
  730. /// <param name="success">Indicates if operation was successfull</param>
  731. /// <param name="info">Attachment resource usage information</param>
  732. public delegate void AttachmentResourcesCallback(bool success, AttachmentResourcesMessage info);
  733. #endregion Delegates
  734. #region Event Delegates
  735. /// <summary>The event subscribers. null if no subcribers</summary>
  736. private EventHandler<ChatEventArgs> m_Chat;
  737. /// <summary>Raises the ChatFromSimulator event</summary>
  738. /// <param name="e">A ChatEventArgs object containing the
  739. /// data returned from the data server</param>
  740. protected virtual void OnChat(ChatEventArgs e)
  741. {
  742. EventHandler<ChatEventArgs> handler = m_Chat;
  743. if (handler != null)
  744. handler(this, e);
  745. }
  746. /// <summary>Thread sync lock object</summary>
  747. private readonly object m_ChatLock = new object();
  748. /// <summary>Raised when a scripted object or agent within range sends a public message</summary>
  749. public event EventHandler<ChatEventArgs> ChatFromSimulator
  750. {
  751. add { lock (m_ChatLock) { m_Chat += value; } }
  752. remove { lock (m_ChatLock) { m_Chat -= value; } }
  753. }
  754. /// <summary>The event subscribers. null if no subcribers</summary>
  755. private EventHandler<ScriptDialogEventArgs> m_ScriptDialog;
  756. /// <summary>Raises the ScriptDialog event</summary>
  757. /// <param name="e">A SctriptDialogEventArgs object containing the
  758. /// data returned from the data server</param>
  759. protected virtual void OnScriptDialog(ScriptDialogEventArgs e)
  760. {
  761. EventHandler<ScriptDialogEventArgs> handler = m_ScriptDialog;
  762. if (handler != null)
  763. handler(this, e);
  764. }
  765. /// <summary>Thread sync lock object</summary>
  766. private readonly object m_ScriptDialogLock = new object();
  767. /// <summary>Raised when a scripted object sends a dialog box containing possible
  768. /// options an agent can respond to</summary>
  769. public event EventHandler<ScriptDialogEventArgs> ScriptDialog
  770. {
  771. add { lock (m_ScriptDialogLock) { m_ScriptDialog += value; } }
  772. remove { lock (m_ScriptDialogLock) { m_ScriptDialog -= value; } }
  773. }
  774. /// <summary>The event subscribers. null if no subcribers</summary>
  775. private EventHandler<ScriptQuestionEventArgs> m_ScriptQuestion;
  776. /// <summary>Raises the ScriptQuestion event</summary>
  777. /// <param name="e">A ScriptQuestionEventArgs object containing the
  778. /// data returned from the data server</param>
  779. protected virtual void OnScriptQuestion(ScriptQuestionEventArgs e)
  780. {
  781. EventHandler<ScriptQuestionEventArgs> handler = m_ScriptQuestion;
  782. if (handler != null)
  783. handler(this, e);
  784. }
  785. /// <summary>Thread sync lock object</summary>
  786. private readonly object m_ScriptQuestionLock = new object();
  787. /// <summary>Raised when an object requests a change in the permissions an agent has permitted</summary>
  788. public event EventHandler<ScriptQuestionEventArgs> ScriptQuestion
  789. {
  790. add { lock (m_ScriptQuestionLock) { m_ScriptQuestion += value; } }
  791. remove { lock (m_ScriptQuestionLock) { m_ScriptQuestion -= value; } }
  792. }
  793. /// <summary>The event subscribers. null if no subcribers</summary>
  794. private EventHandler<LoadUrlEventArgs> m_LoadURL;
  795. /// <summary>Raises the LoadURL event</summary>
  796. /// <param name="e">A LoadUrlEventArgs object containing the
  797. /// data returned from the data server</param>
  798. protected virtual void OnLoadURL(LoadUrlEventArgs e)
  799. {
  800. EventHandler<LoadUrlEventArgs> handler = m_LoadURL;
  801. if (handler != null)
  802. handler(this, e);
  803. }
  804. /// <summary>Thread sync lock object</summary>
  805. private readonly object m_LoadUrlLock = new object();
  806. /// <summary>Raised when a script requests an agent open the specified URL</summary>
  807. public event EventHandler<LoadUrlEventArgs> LoadURL
  808. {
  809. add { lock (m_LoadUrlLock) { m_LoadURL += value; } }
  810. remove { lock (m_LoadUrlLock) { m_LoadURL -= value; } }
  811. }
  812. /// <summary>The event subscribers. null if no subcribers</summary>
  813. private EventHandler<BalanceEventArgs> m_Balance;
  814. /// <summary>Raises the MoneyBalance event</summary>
  815. /// <param name="e">A BalanceEventArgs object containing the
  816. /// data returned from the data server</param>
  817. protected virtual void OnBalance(BalanceEventArgs e)
  818. {
  819. EventHandler<BalanceEventArgs> handler = m_Balance;
  820. if (handler != null)
  821. handler(this, e);
  822. }
  823. /// <summary>Thread sync lock object</summary>
  824. private readonly object m_BalanceLock = new object();
  825. /// <summary>Raised when an agents currency balance is updated</summary>
  826. public event EventHandler<BalanceEventArgs> MoneyBalance
  827. {
  828. add { lock (m_BalanceLock) { m_Balance += value; } }
  829. remove { lock (m_BalanceLock) { m_Balance -= value; } }
  830. }
  831. /// <summary>The event subscribers. null if no subcribers</summary>
  832. private EventHandler<MoneyBalanceReplyEventArgs> m_MoneyBalance;
  833. /// <summary>Raises the MoneyBalanceReply event</summary>
  834. /// <param name="e">A MoneyBalanceReplyEventArgs object containing the
  835. /// data returned from the data server</param>
  836. protected virtual void OnMoneyBalanceReply(MoneyBalanceReplyEventArgs e)
  837. {
  838. EventHandler<MoneyBalanceReplyEventArgs> handler = m_MoneyBalance;
  839. if (handler != null)
  840. handler(this, e);
  841. }
  842. /// <summary>Thread sync lock object</summary>
  843. private readonly object m_MoneyBalanceReplyLock = new object();
  844. /// <summary>Raised when a transaction occurs involving currency such as a land purchase</summary>
  845. public event EventHandler<MoneyBalanceReplyEventArgs> MoneyBalanceReply
  846. {
  847. add { lock (m_MoneyBalanceReplyLock) { m_MoneyBalance += value; } }
  848. remove { lock (m_MoneyBalanceReplyLock) { m_MoneyBalance -= value; } }
  849. }
  850. /// <summary>The event subscribers. null if no subcribers</summary>
  851. private EventHandler<InstantMessageEventArgs> m_InstantMessage;
  852. /// <summary>Raises the IM event</summary>
  853. /// <param name="e">A InstantMessageEventArgs object containing the
  854. /// data returned from the data server</param>
  855. protected virtual void OnInstantMessage(InstantMessageEventArgs e)
  856. {
  857. EventHandler<InstantMessageEventArgs> handler = m_InstantMessage;
  858. if (handler != null)
  859. handler(this, e);
  860. }
  861. /// <summary>Thread sync lock object</summary>
  862. private readonly object m_InstantMessageLock = new object();
  863. /// <summary>Raised when an ImprovedInstantMessage packet is recieved from the simulator, this is used for everything from
  864. /// private messaging to friendship offers. The Dialog field defines what type of message has arrived</summary>
  865. public event EventHandler<InstantMessageEventArgs> IM
  866. {
  867. add { lock (m_InstantMessageLock) { m_InstantMessage += value; } }
  868. remove { lock (m_InstantMessageLock) { m_InstantMessage -= value; } }
  869. }
  870. /// <summary>The event subscribers. null if no subcribers</summary>
  871. private EventHandler<TeleportEventArgs> m_Teleport;
  872. /// <summary>Raises the TeleportProgress event</summary>
  873. /// <param name="e">A TeleportEventArgs object containing the
  874. /// data returned from the data server</param>
  875. protected virtual void OnTeleport(TeleportEventArgs e)
  876. {
  877. EventHandler<TeleportEventArgs> handler = m_Teleport;
  878. if (handler != null)
  879. handler(this, e);
  880. }
  881. /// <summary>Thread sync lock object</summary>
  882. private readonly object m_TeleportLock = new object();
  883. /// <summary>Raised when an agent has requested a teleport to another location, or when responding to a lure. Raised multiple times
  884. /// for each teleport indicating the progress of the request</summary>
  885. public event EventHandler<TeleportEventArgs> TeleportProgress
  886. {
  887. add { lock (m_TeleportLock) { m_Teleport += value; } }
  888. remove { lock (m_TeleportLock) { m_Teleport += value; } }
  889. }
  890. /// <summary>The event subscribers. null if no subcribers</summary>
  891. private EventHandler<AgentDataReplyEventArgs> m_AgentData;
  892. /// <summary>Raises the AgentDataReply event</summary>
  893. /// <param name="e">A AgentDataReplyEventArgs object containing the
  894. /// data returned from the data server</param>
  895. protected virtual void OnAgentData(AgentDataReplyEventArgs e)
  896. {
  897. EventHandler<AgentDataReplyEventArgs> handler = m_AgentData;
  898. if (handler != null)
  899. handler(this, e);
  900. }
  901. /// <summary>Thread sync lock object</summary>
  902. private readonly object m_AgentDataLock = new object();
  903. /// <summary>Raised when a simulator sends agent specific information for our avatar.</summary>
  904. public event EventHandler<AgentDataReplyEventArgs> AgentDataReply
  905. {
  906. add { lock (m_AgentDataLock) { m_AgentData += value; } }
  907. remove { lock (m_AgentDataLock) { m_AgentData -= value; } }
  908. }
  909. /// <summary>The event subscribers. null if no subcribers</summary>
  910. private EventHandler<AnimationsChangedEventArgs> m_AnimationsChanged;
  911. /// <summary>Raises the AnimationsChanged event</summary>
  912. /// <param name="e">A AnimationsChangedEventArgs object containing the
  913. /// data returned from the data server</param>
  914. protected virtual void OnAnimationsChanged(AnimationsChangedEventArgs e)
  915. {
  916. EventHandler<AnimationsChangedEventArgs> handler = m_AnimationsChanged;
  917. if (handler != null)
  918. handler(this, e);
  919. }
  920. /// <summary>Thread sync lock object</summary>
  921. private readonly object m_AnimationsChangedLock = new object();
  922. /// <summary>Raised when our agents animation playlist changes</summary>
  923. public event EventHandler<AnimationsChangedEventArgs> AnimationsChanged
  924. {
  925. add { lock (m_AnimationsChangedLock) { m_AnimationsChanged += value; } }
  926. remove { lock (m_AnimationsChangedLock) { m_AnimationsChanged -= value; } }
  927. }
  928. /// <summary>The event subscribers. null if no subcribers</summary>
  929. private EventHandler<MeanCollisionEventArgs> m_MeanCollision;
  930. /// <summary>Raises the MeanCollision event</summary>
  931. /// <param name="e">A MeanCollisionEventArgs object containing the
  932. /// data returned from the data server</param>
  933. protected virtual void OnMeanCollision(MeanCollisionEventArgs e)
  934. {
  935. EventHandler<MeanCollisionEventArgs> handler = m_MeanCollision;
  936. if (handler != null)
  937. handler(this, e);
  938. }
  939. /// <summary>Thread sync lock object</summary>
  940. private readonly object m_MeanCollisionLock = new object();
  941. /// <summary>Raised when an object or avatar forcefully collides with our agent</summary>
  942. public event EventHandler<MeanCollisionEventArgs> MeanCollision
  943. {
  944. add { lock (m_MeanCollisionLock) { m_MeanCollision += value; } }
  945. remove { lock (m_MeanCollisionLock) { m_MeanCollision -= value; } }
  946. }
  947. /// <summary>The event subscribers. null if no subcribers</summary>
  948. private EventHandler<RegionCrossedEventArgs> m_RegionCrossed;
  949. /// <summary>Raises the RegionCrossed event</summary>
  950. /// <param name="e">A RegionCrossedEventArgs object containing the
  951. /// data returned from the data server</param>
  952. protected virtual void OnRegionCrossed(RegionCrossedEventArgs e)
  953. {
  954. EventHandler<RegionCrossedEventArgs> handler = m_RegionCrossed;
  955. if (handler != null)
  956. handler(this, e);
  957. }
  958. /// <summary>Thread sync lock object</summary>
  959. private readonly object m_RegionCrossedLock = new object();
  960. /// <summary>Raised when our agent crosses a region border into another region</summary>
  961. public event EventHandler<RegionCrossedEventArgs> RegionCrossed
  962. {
  963. add { lock (m_RegionCrossedLock) { m_RegionCrossed += value; } }
  964. remove { lock (m_RegionCrossedLock) { m_RegionCrossed -= value; } }
  965. }
  966. /// <summary>The event subscribers. null if no subcribers</summary>
  967. private EventHandler<GroupChatJoinedEventArgs> m_GroupChatJoined;
  968. /// <summary>Raises the GroupChatJoined event</summary>
  969. /// <param name="e">A GroupChatJoinedEventArgs object containing the
  970. /// data returned from the data server</param>
  971. protected virtual void OnGroupChatJoined(GroupChatJoinedEventArgs e)
  972. {
  973. EventHandler<GroupChatJoinedEventArgs> handler = m_GroupChatJoined;
  974. if (handler != null)
  975. handler(this, e);
  976. }
  977. /// <summary>Thread sync lock object</summary>
  978. private readonly object m_GroupChatJoinedLock = new object();
  979. /// <summary>Raised when our agent succeeds or fails to join a group chat session</summary>
  980. public event EventHandler<GroupChatJoinedEventArgs> GroupChatJoined
  981. {
  982. add { lock (m_GroupChatJoinedLock) { m_GroupChatJoined += value; } }
  983. remove { lock (m_GroupChatJoinedLock) { m_GroupChatJoined -= value; } }
  984. }
  985. /// <summary>The event subscribers. null if no subcribers</summary>
  986. private EventHandler<AlertMessageEventArgs> m_AlertMessage;
  987. /// <summary>Raises the AlertMessage event</summary>
  988. /// <param name="e">A AlertMessageEventArgs object containing the
  989. /// data returned from the data server</param>
  990. protected virtual void OnAlertMessage(AlertMessageEventArgs e)
  991. {
  992. EventHandler<AlertMessageEventArgs> handler = m_AlertMessage;
  993. if (handler != null)
  994. handler(this, e);
  995. }
  996. /// <summary>Thread sync lock object</summary>
  997. private readonly object m_AlertMessageLock = new object();
  998. /// <summary>Raised when a simulator sends an urgent message usually indication the recent failure of
  999. /// another action we have attempted to take such as an attempt to enter a parcel where we are denied access</summary>
  1000. public event EventHandler<AlertMessageEventArgs> AlertMessage
  1001. {
  1002. add { lock (m_AlertMessageLock) { m_AlertMessage += value; } }
  1003. remove { lock (m_AlertMessageLock) { m_AlertMessage -= value; } }
  1004. }
  1005. /// <summary>The event subscribers. null if no subcribers</summary>
  1006. private EventHandler<ScriptControlEventArgs> m_ScriptControl;
  1007. /// <summary>Raises the ScriptControlChange event</summary>
  1008. /// <param name="e">A ScriptControlEventArgs object containing the
  1009. /// data returned from the data server</param>
  1010. protected virtual void OnScriptControlChange(ScriptControlEventArgs e)
  1011. {
  1012. EventHandler<ScriptControlEventArgs> handler = m_ScriptControl;
  1013. if (handler != null)
  1014. handler(this, e);
  1015. }
  1016. /// <summary>Thread sync lock object</summary>
  1017. private readonly object m_ScriptControlLock = new object();
  1018. /// <summary>Raised when a script attempts to take or release specified controls for our agent</summary>
  1019. public event EventHandler<ScriptControlEventArgs> ScriptControlChange
  1020. {
  1021. add { lock (m_ScriptControlLock) { m_ScriptControl += value; } }
  1022. remove { lock (m_ScriptControlLock) { m_ScriptControl -= value; } }
  1023. }
  1024. /// <summary>The event subscribers. null if no subcribers</summary>
  1025. private EventHandler<CameraConstraintEventArgs> m_CameraConstraint;
  1026. /// <summary>Raises the CameraConstraint event</summary>
  1027. /// <param name="e">A CameraConstraintEventArgs object containing the
  1028. /// data returned from the data server</param>
  1029. protected virtual void OnCameraConstraint(CameraConstraintEventArgs e)
  1030. {
  1031. EventHandler<CameraConstraintEventArgs> handler = m_CameraConstraint;
  1032. if (handler != null)
  1033. handler(this, e);
  1034. }
  1035. /// <summary>Thread sync lock object</summary>
  1036. private readonly object m_CameraConstraintLock = new object();
  1037. /// <summary>Raised when the simulator detects our agent is trying to view something
  1038. /// beyond its limits</summary>
  1039. public event EventHandler<CameraConstraintEventArgs> CameraConstraint
  1040. {
  1041. add { lock (m_CameraConstraintLock) { m_CameraConstraint += value; } }
  1042. remove { lock (m_CameraConstraintLock) { m_CameraConstraint -= value; } }
  1043. }
  1044. /// <summary>The event subscribers. null if no subcribers</summary>
  1045. private EventHandler<ScriptSensorReplyEventArgs> m_ScriptSensorReply;
  1046. /// <summary>Raises the ScriptSensorReply event</summary>
  1047. /// <param name="e">A ScriptSensorReplyEventArgs object containing the
  1048. /// data returned from the data server</param>
  1049. protected virtual void OnScriptSensorReply(ScriptSensorReplyEventArgs e)
  1050. {
  1051. EventHandler<ScriptSensorReplyEventArgs> handler = m_ScriptSensorReply;
  1052. if (handler != null)
  1053. handler(this, e);
  1054. }
  1055. /// <summary>Thread sync lock object</summary>
  1056. private readonly object m_ScriptSensorReplyLock = new object();
  1057. /// <summary>Raised when a script sensor reply is received from a simulator</summary>
  1058. public event EventHandler<ScriptSensorReplyEventArgs> ScriptSensorReply
  1059. {
  1060. add { lock (m_ScriptSensorReplyLock) { m_ScriptSensorReply += value; } }
  1061. remove { lock (m_ScriptSensorReplyLock) { m_ScriptSensorReply -= value; } }
  1062. }
  1063. /// <summary>The event subscribers. null if no subcribers</summary>
  1064. private EventHandler<AvatarSitResponseEventArgs> m_AvatarSitResponse;
  1065. /// <summary>Raises the AvatarSitResponse event</summary>
  1066. /// <param name="e">A AvatarSitResponseEventArgs object containing the
  1067. /// data returned from the data server</param>
  1068. protected virtual void OnAvatarSitResponse(AvatarSitResponseEventArgs e)
  1069. {
  1070. EventHandler<AvatarSitResponseEventArgs> handler = m_AvatarSitResponse;
  1071. if (handler != null)
  1072. handler(this, e);
  1073. }
  1074. /// <summary>Thread sync lock object</summary>
  1075. private readonly object m_AvatarSitResponseLock = new object();
  1076. /// <summary>Raised in response to a <see cref="RequestSit"/> request</summary>
  1077. public event EventHandler<AvatarSitResponseEventArgs> AvatarSitResponse
  1078. {
  1079. add { lock (m_AvatarSitResponseLock) { m_AvatarSitResponse += value; } }
  1080. remove { lock (m_AvatarSitResponseLock) { m_AvatarSitResponse -= value; } }
  1081. }
  1082. /// <summary>The event subscribers. null if no subcribers</summary>
  1083. private EventHandler<ChatSessionMemberAddedEventArgs> m_ChatSessionMemberAdded;
  1084. /// <summary>Raises the ChatSessionMemberAdded event</summary>
  1085. /// <param name="e">A ChatSessionMemberAddedEventArgs object containing the
  1086. /// data returned from the data server</param>
  1087. protected virtual void OnChatSessionMemberAdded(ChatSessionMemberAddedEventArgs e)
  1088. {
  1089. EventHandler<ChatSessionMemberAddedEventArgs> handler = m_ChatSessionMemberAdded;
  1090. if (handler != null)
  1091. handler(this, e);
  1092. }
  1093. /// <summary>Thread sync lock object</summary>
  1094. private readonly object m_ChatSessionMemberAddedLock = new object();
  1095. /// <summary>Raised when an avatar enters a group chat session we are participating in</summary>
  1096. public event EventHandler<ChatSessionMemberAddedEventArgs> ChatSessionMemberAdded
  1097. {
  1098. add { lock (m_ChatSessionMemberAddedLock) { m_ChatSessionMemberAdded += value; } }
  1099. remove { lock (m_ChatSessionMemberAddedLock) { m_ChatSessionMemberAdded -= value; } }
  1100. }
  1101. /// <summary>The event subscribers. null if no subcribers</summary>
  1102. private EventHandler<ChatSessionMemberLeftEventArgs> m_ChatSessionMemberLeft;
  1103. /// <summary>Raises the ChatSessionMemberLeft event</summary>
  1104. /// <param name="e">A ChatSessionMemberLeftEventArgs object containing the
  1105. /// data returned from the data server</param>
  1106. protected virtual void OnChatSessionMemberLeft(ChatSessionMemberLeftEventArgs e)
  1107. {
  1108. EventHandler<ChatSessionMemberLeftEventArgs> handler = m_ChatSessionMemberLeft;
  1109. if (handler != null)
  1110. handler(this, e);
  1111. }
  1112. /// <summary>Thread sync lock object</summary>
  1113. private readonly object m_ChatSessionMemberLeftLock = new object();
  1114. /// <summary>Raised when an agent exits a group chat session we are participating in</summary>
  1115. public event EventHandler<ChatSessionMemberLeftEventArgs> ChatSessionMemberLeft
  1116. {
  1117. add { lock (m_ChatSessionMemberLeftLock) { m_ChatSessionMemberLeft += value; } }
  1118. remove { lock (m_ChatSessionMemberLeftLock) { m_ChatSessionMemberLeft -= value; } }
  1119. }
  1120. /// <summary>The event subscribers, null of no subscribers</summary>
  1121. private EventHandler<SetDisplayNameReplyEventArgs> m_SetDisplayNameReply;
  1122. ///<summary>Raises the SetDisplayNameReply Event</summary>
  1123. /// <param name="e">A SetDisplayNameReplyEventArgs object containing
  1124. /// the data sent from the simulator</param>
  1125. protected virtual void OnSetDisplayNameReply(SetDisplayNameReplyEventArgs e)
  1126. {
  1127. EventHandler<SetDisplayNameReplyEventArgs> handler = m_SetDisplayNameReply;
  1128. if (handler != null)
  1129. handler(this, e);
  1130. }
  1131. /// <summary>Thread sync lock object</summary>
  1132. private readonly object m_SetDisplayNameReplyLock = new object();
  1133. /// <summary>Raised when the simulator sends us data containing
  1134. /// the details of display name change</summary>
  1135. public event EventHandler<SetDisplayNameReplyEventArgs> SetDisplayNameReply
  1136. {
  1137. add { lock (m_SetDisplayNameReplyLock) { m_SetDisplayNameReply += value; } }
  1138. remove { lock (m_SetDisplayNameReplyLock) { m_SetDisplayNameReply -= value; } }
  1139. }
  1140. /// <summary>The event subscribers. null if no subcribers</summary>
  1141. private EventHandler<EventArgs> m_MuteListUpdated;
  1142. /// <summary>Raises the MuteListUpdated event</summary>
  1143. /// <param name="e">A EventArgs object containing the
  1144. /// data returned from the data server</param>
  1145. protected virtual void OnMuteListUpdated(EventArgs e)
  1146. {
  1147. EventHandler<EventArgs> handler = m_MuteListUpdated;
  1148. if (handler != null)
  1149. handler(this, e);
  1150. }
  1151. /// <summary>Thread sync lock object</summary>
  1152. private readonly object m_MuteListUpdatedLock = new object();
  1153. /// <summary>Raised when a scripted object or agent within range sends a public message</summary>
  1154. public event EventHandler<EventArgs> MuteListUpdated
  1155. {
  1156. add { lock (m_MuteListUpdatedLock) { m_MuteListUpdated += value; } }
  1157. remove { lock (m_MuteListUpdatedLock) { m_MuteListUpdated -= value; } }
  1158. }
  1159. #endregion Callbacks
  1160. /// <summary>Reference to the GridClient instance</summary>
  1161. private readonly GridClient Client;
  1162. /// <summary>Used for movement and camera tracking</summary>
  1163. public readonly AgentMovement Movement;
  1164. /// <summary>Currently p…

Large files files are truncated, but you can click here to view the full file