UrlModule.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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.Threading;
  29. using System.Collections.Generic;
  30. using System.Collections;
  31. using System.Reflection;
  32. using log4net;
  33. using Mono.Addins;
  34. using Nini.Config;
  35. using OpenMetaverse;
  36. using OpenSim.Framework;
  37. using OpenSim.Framework.Servers;
  38. using OpenSim.Framework.Servers.HttpServer;
  39. using OpenSim.Region.Framework.Interfaces;
  40. using OpenSim.Region.Framework.Scenes;
  41. namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
  42. {
  43. /// <summary>
  44. /// Data describing an external URL set up by a script.
  45. /// </summary>
  46. public class UrlData
  47. {
  48. /// <summary>
  49. /// Scene object part hosting the script
  50. /// </summary>
  51. public UUID hostID;
  52. /// <summary>
  53. /// The item ID of the script that requested the URL.
  54. /// </summary>
  55. public UUID itemID;
  56. /// <summary>
  57. /// The script engine that runs the script.
  58. /// </summary>
  59. public IScriptModule engine;
  60. /// <summary>
  61. /// The generated URL.
  62. /// </summary>
  63. public string url;
  64. /// <summary>
  65. /// The random UUID component of the generated URL.
  66. /// </summary>
  67. public UUID urlcode;
  68. /// <summary>
  69. /// The external requests currently being processed or awaiting retrieval for this URL.
  70. /// </summary>
  71. public Dictionary<UUID, RequestData> requests;
  72. }
  73. public class RequestData
  74. {
  75. public UUID requestID;
  76. public Dictionary<string, string> headers;
  77. public string body;
  78. public int responseCode;
  79. public string responseBody;
  80. public string responseType = "text/plain";
  81. //public ManualResetEvent ev;
  82. public bool requestDone;
  83. public int startTime;
  84. public string uri;
  85. }
  86. /// <summary>
  87. /// This module provides external URLs for in-world scripts.
  88. /// </summary>
  89. [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UrlModule")]
  90. public class UrlModule : ISharedRegionModule, IUrlModule
  91. {
  92. private static readonly ILog m_log =
  93. LogManager.GetLogger(
  94. MethodBase.GetCurrentMethod().DeclaringType);
  95. /// <summary>
  96. /// Indexs the URL request metadata (which script requested it, outstanding requests, etc.) by the request ID
  97. /// randomly generated when a request is received for this URL.
  98. /// </summary>
  99. /// <remarks>
  100. /// Manipulation or retrieval from this dictionary must be locked on m_UrlMap to preserve consistency with
  101. /// m_UrlMap
  102. /// </remarks>
  103. private Dictionary<UUID, UrlData> m_RequestMap = new Dictionary<UUID, UrlData>();
  104. /// <summary>
  105. /// Indexs the URL request metadata (which script requested it, outstanding requests, etc.) by the full URL
  106. /// </summary>
  107. private Dictionary<string, UrlData> m_UrlMap = new Dictionary<string, UrlData>();
  108. private uint m_HttpsPort = 0;
  109. private IHttpServer m_HttpServer = null;
  110. private IHttpServer m_HttpsServer = null;
  111. public string ExternalHostNameForLSL { get; private set; }
  112. /// <summary>
  113. /// The default maximum number of urls
  114. /// </summary>
  115. public const int DefaultTotalUrls = 100;
  116. /// <summary>
  117. /// Maximum number of external urls that can be set up by this module.
  118. /// </summary>
  119. public int TotalUrls { get; set; }
  120. public Type ReplaceableInterface
  121. {
  122. get { return null; }
  123. }
  124. public string Name
  125. {
  126. get { return "UrlModule"; }
  127. }
  128. public void Initialise(IConfigSource config)
  129. {
  130. IConfig networkConfig = config.Configs["Network"];
  131. if (networkConfig != null)
  132. {
  133. ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", null);
  134. bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener", false);
  135. if (ssl_enabled)
  136. m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
  137. }
  138. if (ExternalHostNameForLSL == null)
  139. ExternalHostNameForLSL = System.Environment.MachineName;
  140. IConfig llFunctionsConfig = config.Configs["LL-Functions"];
  141. if (llFunctionsConfig != null)
  142. TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", DefaultTotalUrls);
  143. else
  144. TotalUrls = DefaultTotalUrls;
  145. }
  146. public void PostInitialise()
  147. {
  148. }
  149. public void AddRegion(Scene scene)
  150. {
  151. if (m_HttpServer == null)
  152. {
  153. // There can only be one
  154. //
  155. m_HttpServer = MainServer.Instance;
  156. //
  157. // We can use the https if it is enabled
  158. if (m_HttpsPort > 0)
  159. {
  160. m_HttpsServer = MainServer.GetHttpServer(m_HttpsPort);
  161. }
  162. }
  163. scene.RegisterModuleInterface<IUrlModule>(this);
  164. scene.EventManager.OnScriptReset += OnScriptReset;
  165. }
  166. public void RegionLoaded(Scene scene)
  167. {
  168. IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>();
  169. foreach (IScriptModule scriptModule in scriptModules)
  170. {
  171. scriptModule.OnScriptRemoved += ScriptRemoved;
  172. scriptModule.OnObjectRemoved += ObjectRemoved;
  173. }
  174. }
  175. public void RemoveRegion(Scene scene)
  176. {
  177. }
  178. public void Close()
  179. {
  180. }
  181. public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
  182. {
  183. UUID urlcode = UUID.Random();
  184. lock (m_UrlMap)
  185. {
  186. if (m_UrlMap.Count >= TotalUrls)
  187. {
  188. engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
  189. return urlcode;
  190. }
  191. string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
  192. UrlData urlData = new UrlData();
  193. urlData.hostID = host.UUID;
  194. urlData.itemID = itemID;
  195. urlData.engine = engine;
  196. urlData.url = url;
  197. urlData.urlcode = urlcode;
  198. urlData.requests = new Dictionary<UUID, RequestData>();
  199. m_UrlMap[url] = urlData;
  200. string uri = "/lslhttp/" + urlcode.ToString() + "/";
  201. PollServiceEventArgs args
  202. = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
  203. args.Type = PollServiceEventArgs.EventType.LslHttp;
  204. m_HttpServer.AddPollServiceHTTPHandler(uri, args);
  205. m_log.DebugFormat(
  206. "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}",
  207. uri, itemID, host.Name, host.LocalId);
  208. engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
  209. }
  210. return urlcode;
  211. }
  212. public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
  213. {
  214. UUID urlcode = UUID.Random();
  215. if (m_HttpsServer == null)
  216. {
  217. engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
  218. return urlcode;
  219. }
  220. lock (m_UrlMap)
  221. {
  222. if (m_UrlMap.Count >= TotalUrls)
  223. {
  224. engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
  225. return urlcode;
  226. }
  227. string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
  228. UrlData urlData = new UrlData();
  229. urlData.hostID = host.UUID;
  230. urlData.itemID = itemID;
  231. urlData.engine = engine;
  232. urlData.url = url;
  233. urlData.urlcode = urlcode;
  234. urlData.requests = new Dictionary<UUID, RequestData>();
  235. m_UrlMap[url] = urlData;
  236. string uri = "/lslhttps/" + urlcode.ToString() + "/";
  237. PollServiceEventArgs args
  238. = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
  239. args.Type = PollServiceEventArgs.EventType.LslHttp;
  240. m_HttpsServer.AddPollServiceHTTPHandler(uri, args);
  241. m_log.DebugFormat(
  242. "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
  243. uri, itemID, host.Name, host.LocalId);
  244. engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
  245. }
  246. return urlcode;
  247. }
  248. public void ReleaseURL(string url)
  249. {
  250. lock (m_UrlMap)
  251. {
  252. UrlData data;
  253. if (!m_UrlMap.TryGetValue(url, out data))
  254. {
  255. return;
  256. }
  257. foreach (UUID req in data.requests.Keys)
  258. m_RequestMap.Remove(req);
  259. m_log.DebugFormat(
  260. "[URL MODULE]: Releasing url {0} for {1} in {2}",
  261. url, data.itemID, data.hostID);
  262. RemoveUrl(data);
  263. m_UrlMap.Remove(url);
  264. }
  265. }
  266. public void HttpContentType(UUID request, string type)
  267. {
  268. lock (m_UrlMap)
  269. {
  270. if (m_RequestMap.ContainsKey(request))
  271. {
  272. UrlData urlData = m_RequestMap[request];
  273. urlData.requests[request].responseType = type;
  274. }
  275. else
  276. {
  277. m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
  278. }
  279. }
  280. }
  281. public void HttpResponse(UUID request, int status, string body)
  282. {
  283. lock (m_UrlMap)
  284. {
  285. if (m_RequestMap.ContainsKey(request))
  286. {
  287. UrlData urlData = m_RequestMap[request];
  288. string responseBody = body;
  289. if (urlData.requests[request].responseType.Equals("text/plain"))
  290. {
  291. string value;
  292. if (urlData.requests[request].headers.TryGetValue("user-agent", out value))
  293. {
  294. if (value != null && value.IndexOf("MSIE") >= 0)
  295. {
  296. // wrap the html escaped response if the target client is IE
  297. // It ignores "text/plain" if the body is html
  298. responseBody = "<html>" + System.Web.HttpUtility.HtmlEncode(body) + "</html>";
  299. }
  300. }
  301. }
  302. urlData.requests[request].responseCode = status;
  303. urlData.requests[request].responseBody = responseBody;
  304. //urlData.requests[request].ev.Set();
  305. urlData.requests[request].requestDone =true;
  306. }
  307. else
  308. {
  309. m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
  310. }
  311. }
  312. }
  313. public string GetHttpHeader(UUID requestId, string header)
  314. {
  315. lock (m_UrlMap)
  316. {
  317. if (m_RequestMap.ContainsKey(requestId))
  318. {
  319. UrlData urlData = m_RequestMap[requestId];
  320. string value;
  321. if (urlData.requests[requestId].headers.TryGetValue(header, out value))
  322. return value;
  323. }
  324. else
  325. {
  326. m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
  327. }
  328. }
  329. return String.Empty;
  330. }
  331. public int GetFreeUrls()
  332. {
  333. lock (m_UrlMap)
  334. return TotalUrls - m_UrlMap.Count;
  335. }
  336. public void ScriptRemoved(UUID itemID)
  337. {
  338. // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID);
  339. lock (m_UrlMap)
  340. {
  341. List<string> removeURLs = new List<string>();
  342. foreach (KeyValuePair<string, UrlData> url in m_UrlMap)
  343. {
  344. if (url.Value.itemID == itemID)
  345. {
  346. RemoveUrl(url.Value);
  347. removeURLs.Add(url.Key);
  348. foreach (UUID req in url.Value.requests.Keys)
  349. m_RequestMap.Remove(req);
  350. }
  351. }
  352. foreach (string urlname in removeURLs)
  353. m_UrlMap.Remove(urlname);
  354. }
  355. }
  356. public void ObjectRemoved(UUID objectID)
  357. {
  358. lock (m_UrlMap)
  359. {
  360. List<string> removeURLs = new List<string>();
  361. foreach (KeyValuePair<string, UrlData> url in m_UrlMap)
  362. {
  363. if (url.Value.hostID == objectID)
  364. {
  365. RemoveUrl(url.Value);
  366. removeURLs.Add(url.Key);
  367. foreach (UUID req in url.Value.requests.Keys)
  368. m_RequestMap.Remove(req);
  369. }
  370. }
  371. foreach (string urlname in removeURLs)
  372. m_UrlMap.Remove(urlname);
  373. }
  374. }
  375. private void RemoveUrl(UrlData data)
  376. {
  377. m_HttpServer.RemoveHTTPHandler("", "/lslhttp/" + data.urlcode.ToString() + "/");
  378. }
  379. private Hashtable NoEvents(UUID requestID, UUID sessionID)
  380. {
  381. Hashtable response = new Hashtable();
  382. UrlData urlData;
  383. lock (m_UrlMap)
  384. {
  385. // We need to return a 404 here in case the request URL was removed at exactly the same time that a
  386. // request was made. In this case, the request thread can outrace llRemoveURL() and still be polling
  387. // for the request ID.
  388. if (!m_RequestMap.ContainsKey(requestID))
  389. {
  390. response["int_response_code"] = 404;
  391. response["str_response_string"] = "";
  392. response["keepalive"] = false;
  393. response["reusecontext"] = false;
  394. return response;
  395. }
  396. urlData = m_RequestMap[requestID];
  397. if (System.Environment.TickCount - urlData.requests[requestID].startTime > 25000)
  398. {
  399. response["int_response_code"] = 500;
  400. response["str_response_string"] = "Script timeout";
  401. response["content_type"] = "text/plain";
  402. response["keepalive"] = false;
  403. response["reusecontext"] = false;
  404. //remove from map
  405. urlData.requests.Remove(requestID);
  406. m_RequestMap.Remove(requestID);
  407. return response;
  408. }
  409. }
  410. return response;
  411. }
  412. private bool HasEvents(UUID requestID, UUID sessionID)
  413. {
  414. lock (m_UrlMap)
  415. {
  416. // We return true here because an external URL request that happened at the same time as an llRemoveURL()
  417. // can still make it through to HttpRequestHandler(). That will return without setting up a request
  418. // when it detects that the URL has been removed. The poller, however, will continue to ask for
  419. // events for that request, so here we will signal that there are events and in GetEvents we will
  420. // return a 404.
  421. if (!m_RequestMap.ContainsKey(requestID))
  422. {
  423. return true;
  424. }
  425. UrlData urlData = m_RequestMap[requestID];
  426. if (!urlData.requests.ContainsKey(requestID))
  427. {
  428. return true;
  429. }
  430. // Trigger return of timeout response.
  431. if (System.Environment.TickCount - urlData.requests[requestID].startTime > 25000)
  432. {
  433. return true;
  434. }
  435. return urlData.requests[requestID].requestDone;
  436. }
  437. }
  438. private Hashtable GetEvents(UUID requestID, UUID sessionID)
  439. {
  440. Hashtable response;
  441. lock (m_UrlMap)
  442. {
  443. UrlData url = null;
  444. RequestData requestData = null;
  445. if (!m_RequestMap.ContainsKey(requestID))
  446. return NoEvents(requestID, sessionID);
  447. url = m_RequestMap[requestID];
  448. requestData = url.requests[requestID];
  449. if (!requestData.requestDone)
  450. return NoEvents(requestID, sessionID);
  451. response = new Hashtable();
  452. if (System.Environment.TickCount - requestData.startTime > 25000)
  453. {
  454. response["int_response_code"] = 500;
  455. response["str_response_string"] = "Script timeout";
  456. response["content_type"] = "text/plain";
  457. response["keepalive"] = false;
  458. response["reusecontext"] = false;
  459. return response;
  460. }
  461. //put response
  462. response["int_response_code"] = requestData.responseCode;
  463. response["str_response_string"] = requestData.responseBody;
  464. response["content_type"] = requestData.responseType;
  465. // response["content_type"] = "text/plain";
  466. response["keepalive"] = false;
  467. response["reusecontext"] = false;
  468. //remove from map
  469. url.requests.Remove(requestID);
  470. m_RequestMap.Remove(requestID);
  471. }
  472. return response;
  473. }
  474. public void HttpRequestHandler(UUID requestID, Hashtable request)
  475. {
  476. string uri = request["uri"].ToString();
  477. bool is_ssl = uri.Contains("lslhttps");
  478. try
  479. {
  480. Hashtable headers = (Hashtable)request["headers"];
  481. // string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
  482. int pos1 = uri.IndexOf("/");// /lslhttp
  483. int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
  484. int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
  485. string uri_tmp = uri.Substring(0, pos3 + 1);
  486. //HTTP server code doesn't provide us with QueryStrings
  487. string pathInfo;
  488. string queryString;
  489. queryString = "";
  490. pathInfo = uri.Substring(pos3);
  491. UrlData urlData = null;
  492. lock (m_UrlMap)
  493. {
  494. string url;
  495. if (is_ssl)
  496. url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
  497. else
  498. url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
  499. // Avoid a race - the request URL may have been released via llRequestUrl() whilst this
  500. // request was being processed.
  501. if (!m_UrlMap.TryGetValue(url, out urlData))
  502. return;
  503. //for llGetHttpHeader support we need to store original URI here
  504. //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
  505. //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader
  506. RequestData requestData = new RequestData();
  507. requestData.requestID = requestID;
  508. requestData.requestDone = false;
  509. requestData.startTime = System.Environment.TickCount;
  510. requestData.uri = uri;
  511. if (requestData.headers == null)
  512. requestData.headers = new Dictionary<string, string>();
  513. foreach (DictionaryEntry header in headers)
  514. {
  515. string key = (string)header.Key;
  516. string value = (string)header.Value;
  517. requestData.headers.Add(key, value);
  518. }
  519. foreach (DictionaryEntry de in request)
  520. {
  521. if (de.Key.ToString() == "querystringkeys")
  522. {
  523. System.String[] keys = (System.String[])de.Value;
  524. foreach (String key in keys)
  525. {
  526. if (request.ContainsKey(key))
  527. {
  528. string val = (String)request[key];
  529. queryString = queryString + key + "=" + val + "&";
  530. }
  531. }
  532. if (queryString.Length > 1)
  533. queryString = queryString.Substring(0, queryString.Length - 1);
  534. }
  535. }
  536. //if this machine is behind DNAT/port forwarding, currently this is being
  537. //set to address of port forwarding router
  538. requestData.headers["x-remote-ip"] = requestData.headers["remote_addr"];
  539. requestData.headers["x-path-info"] = pathInfo;
  540. requestData.headers["x-query-string"] = queryString;
  541. requestData.headers["x-script-url"] = urlData.url;
  542. urlData.requests.Add(requestID, requestData);
  543. m_RequestMap.Add(requestID, urlData);
  544. }
  545. urlData.engine.PostScriptEvent(
  546. urlData.itemID,
  547. "http_request",
  548. new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() });
  549. }
  550. catch (Exception we)
  551. {
  552. //Hashtable response = new Hashtable();
  553. m_log.Warn("[HttpRequestHandler]: http-in request failed");
  554. m_log.Warn(we.Message);
  555. m_log.Warn(we.StackTrace);
  556. }
  557. }
  558. private void OnScriptReset(uint localID, UUID itemID)
  559. {
  560. ScriptRemoved(itemID);
  561. }
  562. }
  563. }