EventQueueGetModule.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections;
  29. using System.Collections.Generic;
  30. using System.Net;
  31. using System.Reflection;
  32. using System.Threading;
  33. using log4net;
  34. using Nini.Config;
  35. using Mono.Addins;
  36. using OpenMetaverse;
  37. using OpenMetaverse.Messages.Linden;
  38. using OpenMetaverse.Packets;
  39. using OpenMetaverse.StructuredData;
  40. using OpenSim.Framework;
  41. using OpenSim.Framework.Console;
  42. using OpenSim.Framework.Servers;
  43. using OpenSim.Framework.Servers.HttpServer;
  44. using OpenSim.Region.Framework.Interfaces;
  45. using OpenSim.Region.Framework.Scenes;
  46. using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.OSD>;
  47. using Caps=OpenSim.Framework.Capabilities.Caps;
  48. namespace OpenSim.Region.ClientStack.Linden
  49. {
  50. public struct QueueItem
  51. {
  52. public int id;
  53. public OSDMap body;
  54. }
  55. [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EventQueueGetModule")]
  56. public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
  57. {
  58. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  59. private static string LogHeader = "[EVENT QUEUE GET MODULE]";
  60. /// <value>
  61. /// Debug level.
  62. /// </value>
  63. public int DebugLevel { get; set; }
  64. // Viewer post requests timeout in 60 secs
  65. // https://bitbucket.org/lindenlab/viewer-release/src/421c20423df93d650cc305dc115922bb30040999/indra/llmessage/llhttpclient.cpp?at=default#cl-44
  66. //
  67. private const int VIEWER_TIMEOUT = 60 * 1000;
  68. // Just to be safe, we work on a 10 sec shorter cycle
  69. private const int SERVER_EQ_TIME_NO_EVENTS = VIEWER_TIMEOUT - (10 * 1000);
  70. protected Scene m_scene;
  71. private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
  72. private Dictionary<UUID, Queue<OSD>> queues = new Dictionary<UUID, Queue<OSD>>();
  73. private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>();
  74. #region INonSharedRegionModule methods
  75. public virtual void Initialise(IConfigSource config)
  76. {
  77. }
  78. public void AddRegion(Scene scene)
  79. {
  80. m_scene = scene;
  81. scene.RegisterModuleInterface<IEventQueue>(this);
  82. scene.EventManager.OnClientClosed += ClientClosed;
  83. scene.EventManager.OnRegisterCaps += OnRegisterCaps;
  84. MainConsole.Instance.Commands.AddCommand(
  85. "Debug",
  86. false,
  87. "debug eq",
  88. "debug eq [0|1|2]",
  89. "Turn on event queue debugging\n"
  90. + " <= 0 - turns off all event queue logging\n"
  91. + " >= 1 - turns on event queue setup and outgoing event logging\n"
  92. + " >= 2 - turns on poll notification",
  93. HandleDebugEq);
  94. MainConsole.Instance.Commands.AddCommand(
  95. "Debug",
  96. false,
  97. "show eq",
  98. "show eq",
  99. "Show contents of event queues for logged in avatars. Used for debugging.",
  100. HandleShowEq);
  101. }
  102. public void RemoveRegion(Scene scene)
  103. {
  104. if (m_scene != scene)
  105. return;
  106. scene.EventManager.OnClientClosed -= ClientClosed;
  107. scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
  108. scene.UnregisterModuleInterface<IEventQueue>(this);
  109. m_scene = null;
  110. }
  111. public void RegionLoaded(Scene scene)
  112. {
  113. }
  114. public virtual void Close()
  115. {
  116. }
  117. public virtual string Name
  118. {
  119. get { return "EventQueueGetModule"; }
  120. }
  121. public Type ReplaceableInterface
  122. {
  123. get { return null; }
  124. }
  125. #endregion
  126. protected void HandleDebugEq(string module, string[] args)
  127. {
  128. int debugLevel;
  129. if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel)))
  130. {
  131. MainConsole.Instance.OutputFormat("Usage: debug eq [0|1|2]");
  132. }
  133. else
  134. {
  135. DebugLevel = debugLevel;
  136. MainConsole.Instance.OutputFormat(
  137. "Set event queue debug level to {0} in {1}", DebugLevel, m_scene.RegionInfo.RegionName);
  138. }
  139. }
  140. protected void HandleShowEq(string module, string[] args)
  141. {
  142. MainConsole.Instance.OutputFormat("For scene {0}", m_scene.Name);
  143. lock (queues)
  144. {
  145. foreach (KeyValuePair<UUID, Queue<OSD>> kvp in queues)
  146. {
  147. MainConsole.Instance.OutputFormat(
  148. "For agent {0} there are {1} messages queued for send.",
  149. kvp.Key, kvp.Value.Count);
  150. }
  151. }
  152. }
  153. /// <summary>
  154. /// Always returns a valid queue
  155. /// </summary>
  156. /// <param name="agentId"></param>
  157. /// <returns></returns>
  158. private Queue<OSD> TryGetQueue(UUID agentId)
  159. {
  160. lock (queues)
  161. {
  162. if (!queues.ContainsKey(agentId))
  163. {
  164. if (DebugLevel > 0)
  165. m_log.DebugFormat(
  166. "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}",
  167. agentId, m_scene.RegionInfo.RegionName);
  168. queues[agentId] = new Queue<OSD>();
  169. }
  170. return queues[agentId];
  171. }
  172. }
  173. /// <summary>
  174. /// May return a null queue
  175. /// </summary>
  176. /// <param name="agentId"></param>
  177. /// <returns></returns>
  178. private Queue<OSD> GetQueue(UUID agentId)
  179. {
  180. lock (queues)
  181. {
  182. if (queues.ContainsKey(agentId))
  183. {
  184. return queues[agentId];
  185. }
  186. else
  187. return null;
  188. }
  189. }
  190. #region IEventQueue Members
  191. public bool Enqueue(OSD ev, UUID avatarID)
  192. {
  193. //m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName);
  194. try
  195. {
  196. Queue<OSD> queue = GetQueue(avatarID);
  197. if (queue != null)
  198. {
  199. lock (queue)
  200. queue.Enqueue(ev);
  201. }
  202. else
  203. {
  204. OSDMap evMap = (OSDMap)ev;
  205. m_log.WarnFormat(
  206. "[EVENTQUEUE]: (Enqueue) No queue found for agent {0} when placing message {1} in region {2}",
  207. avatarID, evMap["message"], m_scene.Name);
  208. }
  209. }
  210. catch (NullReferenceException e)
  211. {
  212. m_log.Error("[EVENTQUEUE] Caught exception: " + e);
  213. return false;
  214. }
  215. return true;
  216. }
  217. #endregion
  218. private void ClientClosed(UUID agentID, Scene scene)
  219. {
  220. //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
  221. lock (queues)
  222. queues.Remove(agentID);
  223. lock (m_AvatarQueueUUIDMapping)
  224. m_AvatarQueueUUIDMapping.Remove(agentID);
  225. lock (m_ids)
  226. {
  227. if (!m_ids.ContainsKey(agentID))
  228. m_ids.Remove(agentID);
  229. }
  230. // m_log.DebugFormat("[EVENTQUEUE]: Deleted queues for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
  231. }
  232. /// <summary>
  233. /// Generate an Event Queue Get handler path for the given eqg uuid.
  234. /// </summary>
  235. /// <param name='eqgUuid'></param>
  236. private string GenerateEqgCapPath(UUID eqgUuid)
  237. {
  238. return string.Format("/CAPS/EQG/{0}/", eqgUuid);
  239. }
  240. public void OnRegisterCaps(UUID agentID, Caps caps)
  241. {
  242. // Register an event queue for the client
  243. if (DebugLevel > 0)
  244. m_log.DebugFormat(
  245. "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
  246. agentID, caps, m_scene.RegionInfo.RegionName);
  247. UUID eventQueueGetUUID;
  248. Queue<OSD> queue;
  249. Random rnd = new Random(Environment.TickCount);
  250. int nrnd = rnd.Next(30000000);
  251. if (nrnd < 0)
  252. nrnd = -nrnd;
  253. lock (queues)
  254. {
  255. if (queues.ContainsKey(agentID))
  256. queue = queues[agentID];
  257. else
  258. queue = null;
  259. if (queue == null)
  260. {
  261. queue = new Queue<OSD>();
  262. queues[agentID] = queue;
  263. // push markers to handle old responses still waiting
  264. // this will cost at most viewer getting two forced noevents
  265. // even being a new queue better be safe
  266. queue.Enqueue(null);
  267. queue.Enqueue(null); // one should be enough
  268. lock (m_AvatarQueueUUIDMapping)
  269. {
  270. eventQueueGetUUID = UUID.Random();
  271. if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
  272. {
  273. // oops this should not happen ?
  274. m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID without a queue");
  275. eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
  276. }
  277. m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
  278. }
  279. lock (m_ids)
  280. {
  281. if (!m_ids.ContainsKey(agentID))
  282. m_ids.Add(agentID, nrnd);
  283. else
  284. m_ids[agentID] = nrnd;
  285. }
  286. }
  287. else
  288. {
  289. // push markers to handle old responses still waiting
  290. // this will cost at most viewer getting two forced noevents
  291. // even being a new queue better be safe
  292. queue.Enqueue(null);
  293. queue.Enqueue(null); // one should be enough
  294. // reuse or not to reuse TODO FIX
  295. lock (m_AvatarQueueUUIDMapping)
  296. {
  297. // Reuse open queues. The client does!
  298. // Its reuse caps path not queues those are been reused already
  299. if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
  300. {
  301. m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
  302. eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
  303. }
  304. else
  305. {
  306. eventQueueGetUUID = UUID.Random();
  307. m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
  308. m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!");
  309. }
  310. }
  311. lock (m_ids)
  312. {
  313. // change to negative numbers so they are changed at end of sending first marker
  314. // old data on a queue may be sent on a response for a new caps
  315. // but at least will be sent with coerent IDs
  316. if (!m_ids.ContainsKey(agentID))
  317. m_ids.Add(agentID, -nrnd); // should not happen
  318. else
  319. m_ids[agentID] = -m_ids[agentID];
  320. }
  321. }
  322. }
  323. caps.RegisterPollHandler(
  324. "EventQueueGet",
  325. new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS));
  326. }
  327. public bool HasEvents(UUID requestID, UUID agentID)
  328. {
  329. Queue<OSD> queue = GetQueue(agentID);
  330. if (queue != null)
  331. lock (queue)
  332. {
  333. //m_log.WarnFormat("POLLED FOR EVENTS BY {0} in {1} -- {2}", agentID, m_scene.RegionInfo.RegionName, queue.Count);
  334. return queue.Count > 0;
  335. }
  336. //m_log.WarnFormat("POLLED FOR EVENTS BY {0} unknown agent", agentID);
  337. return true;
  338. }
  339. /// <summary>
  340. /// Logs a debug line for an outbound event queue message if appropriate.
  341. /// </summary>
  342. /// <param name='element'>Element containing message</param>
  343. private void LogOutboundDebugMessage(OSD element, UUID agentId)
  344. {
  345. if (element is OSDMap)
  346. {
  347. OSDMap ev = (OSDMap)element;
  348. m_log.DebugFormat(
  349. "Eq OUT {0,-30} to {1,-20} {2,-20}",
  350. ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.Name);
  351. }
  352. }
  353. public void Drop(UUID requestID, UUID pAgentId)
  354. {
  355. // do nothing for now, hope client close will do it
  356. }
  357. public Hashtable GetEvents(UUID requestID, UUID pAgentId)
  358. {
  359. if (DebugLevel >= 2)
  360. m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.Name);
  361. Queue<OSD> queue = GetQueue(pAgentId);
  362. if (queue == null)
  363. {
  364. return NoEvents(requestID, pAgentId);
  365. }
  366. OSD element = null;;
  367. OSDArray array = new OSDArray();
  368. int thisID = 0;
  369. bool negativeID = false;
  370. lock (queue)
  371. {
  372. if (queue.Count == 0)
  373. return NoEvents(requestID, pAgentId);
  374. lock (m_ids)
  375. thisID = m_ids[pAgentId];
  376. if (thisID < 0)
  377. {
  378. negativeID = true;
  379. thisID = -thisID;
  380. }
  381. while (queue.Count > 0)
  382. {
  383. element = queue.Dequeue();
  384. // add elements until a marker is found
  385. // so they get into a response
  386. if (element == null)
  387. break;
  388. if (DebugLevel > 0)
  389. LogOutboundDebugMessage(element, pAgentId);
  390. array.Add(element);
  391. thisID++;
  392. }
  393. }
  394. OSDMap events = null;
  395. if (array.Count > 0)
  396. {
  397. events = new OSDMap();
  398. events.Add("events", array);
  399. events.Add("id", new OSDInteger(thisID));
  400. }
  401. if (negativeID && element == null)
  402. {
  403. Random rnd = new Random(Environment.TickCount);
  404. thisID = rnd.Next(30000000);
  405. if (thisID < 0)
  406. thisID = -thisID;
  407. }
  408. lock (m_ids)
  409. {
  410. m_ids[pAgentId] = thisID + 1;
  411. }
  412. // if there where no elements before a marker send a NoEvents
  413. if (array.Count == 0)
  414. return NoEvents(requestID, pAgentId);
  415. Hashtable responsedata = new Hashtable();
  416. responsedata["int_response_code"] = 200;
  417. responsedata["content_type"] = "application/xml";
  418. responsedata["keepalive"] = false;
  419. responsedata["reusecontext"] = false;
  420. responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
  421. //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
  422. return responsedata;
  423. }
  424. public Hashtable NoEvents(UUID requestID, UUID agentID)
  425. {
  426. Hashtable responsedata = new Hashtable();
  427. responsedata["int_response_code"] = 502;
  428. responsedata["content_type"] = "text/plain";
  429. responsedata["keepalive"] = false;
  430. responsedata["reusecontext"] = false;
  431. responsedata["str_response_string"] = "<llsd></llsd>";
  432. responsedata["error_status_text"] = "<llsd></llsd>";
  433. responsedata["http_protocol_version"] = "HTTP/1.0";
  434. return responsedata;
  435. }
  436. /* this is not a event message
  437. public void DisableSimulator(ulong handle, UUID avatarID)
  438. {
  439. OSD item = EventQueueHelper.DisableSimulator(handle);
  440. Enqueue(item, avatarID);
  441. }
  442. */
  443. public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
  444. {
  445. if (DebugLevel > 0)
  446. m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}",
  447. LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY);
  448. OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY);
  449. Enqueue(item, avatarID);
  450. }
  451. public virtual void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath,
  452. ulong regionHandle, int regionSizeX, int regionSizeY)
  453. {
  454. if (DebugLevel > 0)
  455. m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, endPoint={2}, avatarID={3}",
  456. LogHeader, regionHandle, endPoint, avatarID, regionSizeX, regionSizeY);
  457. OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY);
  458. Enqueue(item, avatarID);
  459. }
  460. public virtual void TeleportFinishEvent(ulong regionHandle, byte simAccess,
  461. IPEndPoint regionExternalEndPoint,
  462. uint locationID, uint flags, string capsURL,
  463. UUID avatarID, int regionSizeX, int regionSizeY)
  464. {
  465. if (DebugLevel > 0)
  466. m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, endPoint={2}, avatarID={3}",
  467. LogHeader, regionHandle, regionExternalEndPoint, avatarID, regionSizeX, regionSizeY);
  468. OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint,
  469. locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY);
  470. Enqueue(item, avatarID);
  471. }
  472. public virtual void CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt,
  473. IPEndPoint newRegionExternalEndPoint,
  474. string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY)
  475. {
  476. if (DebugLevel > 0)
  477. m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>",
  478. LogHeader, handle, avatarID, regionSizeX, regionSizeY);
  479. OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint,
  480. capsURL, avatarID, sessionID, regionSizeX, regionSizeY);
  481. Enqueue(item, avatarID);
  482. }
  483. public void ChatterboxInvitation(UUID sessionID, string sessionName,
  484. UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog,
  485. uint timeStamp, bool offline, int parentEstateID, Vector3 position,
  486. uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket)
  487. {
  488. OSD item = EventQueueHelper.ChatterboxInvitation(sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog,
  489. timeStamp, offline, parentEstateID, position, ttl, transactionID,
  490. fromGroup, binaryBucket);
  491. Enqueue(item, toAgent);
  492. //m_log.InfoFormat("########### eq ChatterboxInvitation #############\n{0}", item);
  493. }
  494. public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat,
  495. bool isModerator, bool textMute, bool isEnterorLeave)
  496. {
  497. OSD item = EventQueueHelper.ChatterBoxSessionAgentListUpdates(sessionID, fromAgent, canVoiceChat,
  498. isModerator, textMute, isEnterorLeave);
  499. Enqueue(item, toAgent);
  500. //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
  501. }
  502. public void ChatterBoxForceClose(UUID toAgent, UUID sessionID, string reason)
  503. {
  504. OSD item = EventQueueHelper.ChatterBoxForceClose(sessionID, reason);
  505. Enqueue(item, toAgent);
  506. }
  507. public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
  508. {
  509. OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
  510. Enqueue(item, avatarID);
  511. }
  512. public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
  513. {
  514. OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data);
  515. Enqueue(item, receiverAgent);
  516. }
  517. public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID)
  518. {
  519. OSD item = EventQueueHelper.PlacesQuery(groupUpdate);
  520. Enqueue(item, avatarID);
  521. }
  522. public OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono)
  523. {
  524. return EventQueueHelper.ScriptRunningReplyEvent(objectID, itemID, running, mono);
  525. }
  526. public OSD BuildEvent(string eventName, OSD eventBody)
  527. {
  528. return EventQueueHelper.BuildEvent(eventName, eventBody);
  529. }
  530. public void partPhysicsProperties(uint localID, byte physhapetype,
  531. float density, float friction, float bounce, float gravmod,UUID avatarID)
  532. {
  533. OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype,
  534. density, friction, bounce, gravmod);
  535. Enqueue(item, avatarID);
  536. }
  537. }
  538. }