aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorCasperW2009-12-21 13:29:48 +0100
committerCasperW2009-12-21 13:29:48 +0100
commitd8d6e8a30415197eb55c59172abfb890ec7a46bd (patch)
treedb937d6c6e3816932781e7be90c318408d117a78 /OpenSim
parentFixed a nasty crash in StandUp() that occurred when the part got killed with ... (diff)
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-d8d6e8a30415197eb55c59172abfb890ec7a46bd.zip
opensim-SC_OLD-d8d6e8a30415197eb55c59172abfb890ec7a46bd.tar.gz
opensim-SC_OLD-d8d6e8a30415197eb55c59172abfb890ec7a46bd.tar.bz2
opensim-SC_OLD-d8d6e8a30415197eb55c59172abfb890ec7a46bd.tar.xz
Merge branch 'master' into casper
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs148
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs13
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs55
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs47
-rw-r--r--OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs4
-rw-r--r--OpenSim/Tests/Clients/Grid/GridClient.cs6
13 files changed, 190 insertions, 134 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 75cdeb4..08f1bec 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -253,60 +253,66 @@ namespace OpenSim.Framework.Servers.HttpServer
253 253
254 private void OnRequest(object source, RequestEventArgs args) 254 private void OnRequest(object source, RequestEventArgs args)
255 { 255 {
256 IHttpClientContext context = (IHttpClientContext)source; 256 try
257 IHttpRequest request = args.Request;
258
259 PollServiceEventArgs psEvArgs;
260
261 if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs))
262 { 257 {
263 PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); 258 IHttpClientContext context = (IHttpClientContext)source;
264 259 IHttpRequest request = args.Request;
265 if (psEvArgs.Request != null) 260
261 PollServiceEventArgs psEvArgs;
262
263 if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs))
266 { 264 {
267 OSHttpRequest req = new OSHttpRequest(context, request); 265 PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request);
268 266
269 Stream requestStream = req.InputStream; 267 if (psEvArgs.Request != null)
270
271 Encoding encoding = Encoding.UTF8;
272 StreamReader reader = new StreamReader(requestStream, encoding);
273
274 string requestBody = reader.ReadToEnd();
275
276 Hashtable keysvals = new Hashtable();
277 Hashtable headervals = new Hashtable();
278
279 string[] querystringkeys = req.QueryString.AllKeys;
280 string[] rHeaders = req.Headers.AllKeys;
281
282 keysvals.Add("body", requestBody);
283 keysvals.Add("uri", req.RawUrl);
284 keysvals.Add("content-type", req.ContentType);
285 keysvals.Add("http-method", req.HttpMethod);
286
287 foreach (string queryname in querystringkeys)
288 {
289 keysvals.Add(queryname, req.QueryString[queryname]);
290 }
291
292 foreach (string headername in rHeaders)
293 { 268 {
294 headervals[headername] = req.Headers[headername]; 269 OSHttpRequest req = new OSHttpRequest(context, request);
270
271 Stream requestStream = req.InputStream;
272
273 Encoding encoding = Encoding.UTF8;
274 StreamReader reader = new StreamReader(requestStream, encoding);
275
276 string requestBody = reader.ReadToEnd();
277
278 Hashtable keysvals = new Hashtable();
279 Hashtable headervals = new Hashtable();
280
281 string[] querystringkeys = req.QueryString.AllKeys;
282 string[] rHeaders = req.Headers.AllKeys;
283
284 keysvals.Add("body", requestBody);
285 keysvals.Add("uri", req.RawUrl);
286 keysvals.Add("content-type", req.ContentType);
287 keysvals.Add("http-method", req.HttpMethod);
288
289 foreach (string queryname in querystringkeys)
290 {
291 keysvals.Add(queryname, req.QueryString[queryname]);
292 }
293
294 foreach (string headername in rHeaders)
295 {
296 headervals[headername] = req.Headers[headername];
297 }
298
299 keysvals.Add("headers",headervals);
300 keysvals.Add("querystringkeys", querystringkeys);
301
302 psEvArgs.Request(psreq.RequestID, keysvals);
295 } 303 }
296 304
297 keysvals.Add("headers",headervals); 305 m_PollServiceManager.Enqueue(psreq);
298 keysvals.Add("querystringkeys", querystringkeys); 306 }
299 307 else
300 psEvArgs.Request(psreq.RequestID, keysvals); 308 {
309 OnHandleRequestIOThread(context, request);
301 } 310 }
302
303 m_PollServiceManager.Enqueue(psreq);
304 } 311 }
305 else 312 catch (Exception e)
306 { 313 {
307 OnHandleRequestIOThread(context, request); 314 m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0} {1}", e.Message, e.StackTrace);
308 } 315 }
309
310 } 316 }
311 317
312 public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) 318 public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request)
@@ -465,11 +471,11 @@ namespace OpenSim.Framework.Servers.HttpServer
465 catch (SocketException e) 471 catch (SocketException e)
466 { 472 {
467 // This has to be here to prevent a Linux/Mono crash 473 // This has to be here to prevent a Linux/Mono crash
468 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); 474 m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
469 } 475 }
470 catch (IOException e) 476 catch (IOException e)
471 { 477 {
472 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); 478 m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
473 } 479 }
474 return; 480 return;
475 } 481 }
@@ -548,7 +554,7 @@ namespace OpenSim.Framework.Servers.HttpServer
548 } 554 }
549 catch (IOException e) 555 catch (IOException e)
550 { 556 {
551 m_log.ErrorFormat("[BASE HTTP SERVER] HandleRequest() threw ", e); 557 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
552 } 558 }
553 catch (InvalidOperationException e) 559 catch (InvalidOperationException e)
554 { 560 {
@@ -763,7 +769,7 @@ namespace OpenSim.Framework.Servers.HttpServer
763 byte[] buf = Encoding.UTF8.GetBytes("Not found"); 769 byte[] buf = Encoding.UTF8.GetBytes("Not found");
764 response.KeepAlive = false; 770 response.KeepAlive = false;
765 771
766 m_log.ErrorFormat("[BASE HTTP SERVER] Handler not found for http request {0}", request.RawUrl); 772 m_log.ErrorFormat("[BASE HTTP SERVER]: Handler not found for http request {0}", request.RawUrl);
767 773
768 response.SendChunked = false; 774 response.SendChunked = false;
769 response.ContentLength64 = buf.Length; 775 response.ContentLength64 = buf.Length;
@@ -775,7 +781,7 @@ namespace OpenSim.Framework.Servers.HttpServer
775 } 781 }
776 catch (Exception ex) 782 catch (Exception ex)
777 { 783 {
778 m_log.Warn("[HTTPD]: Error - " + ex.Message); 784 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
779 } 785 }
780 finally 786 finally
781 { 787 {
@@ -787,11 +793,11 @@ namespace OpenSim.Framework.Servers.HttpServer
787 catch (SocketException e) 793 catch (SocketException e)
788 { 794 {
789 // This has to be here to prevent a Linux/Mono crash 795 // This has to be here to prevent a Linux/Mono crash
790 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); 796 m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
791 } 797 }
792 catch (IOException e) 798 catch (IOException e)
793 { 799 {
794 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); 800 m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
795 } 801 }
796 } 802 }
797 return; 803 return;
@@ -812,7 +818,7 @@ namespace OpenSim.Framework.Servers.HttpServer
812 } 818 }
813 catch (Exception ex) 819 catch (Exception ex)
814 { 820 {
815 m_log.Warn("[HTTPD]: Error - " + ex.Message); 821 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
816 } 822 }
817 finally 823 finally
818 { 824 {
@@ -824,11 +830,11 @@ namespace OpenSim.Framework.Servers.HttpServer
824 catch (SocketException e) 830 catch (SocketException e)
825 { 831 {
826 // This has to be here to prevent a Linux/Mono crash 832 // This has to be here to prevent a Linux/Mono crash
827 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); 833 m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
828 } 834 }
829 catch (IOException e) 835 catch (IOException e)
830 { 836 {
831 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); 837 m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
832 } 838 }
833 } 839 }
834 } 840 }
@@ -864,7 +870,7 @@ namespace OpenSim.Framework.Servers.HttpServer
864 } 870 }
865 catch (Exception ex) 871 catch (Exception ex)
866 { 872 {
867 m_log.Warn("[HTTPD]: Error - " + ex.Message); 873 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
868 } 874 }
869 875
870 if (llsdRequest != null)// && m_defaultLlsdHandler != null) 876 if (llsdRequest != null)// && m_defaultLlsdHandler != null)
@@ -925,7 +931,7 @@ namespace OpenSim.Framework.Servers.HttpServer
925 } 931 }
926 catch (Exception ex) 932 catch (Exception ex)
927 { 933 {
928 m_log.Warn("[HTTPD]: Error - " + ex.Message); 934 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
929 } 935 }
930 finally 936 finally
931 { 937 {
@@ -939,12 +945,12 @@ namespace OpenSim.Framework.Servers.HttpServer
939 } 945 }
940 catch (IOException e) 946 catch (IOException e)
941 { 947 {
942 m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e); 948 m_log.DebugFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e);
943 } 949 }
944 catch (SocketException e) 950 catch (SocketException e)
945 { 951 {
946 // This has to be here to prevent a Linux/Mono crash 952 // This has to be here to prevent a Linux/Mono crash
947 m_log.WarnFormat("[BASE HTTP SERVER] LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); 953 m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e);
948 } 954 }
949 } 955 }
950 } 956 }
@@ -1482,11 +1488,11 @@ namespace OpenSim.Framework.Servers.HttpServer
1482 catch (SocketException e) 1488 catch (SocketException e)
1483 { 1489 {
1484 // This has to be here to prevent a Linux/Mono crash 1490 // This has to be here to prevent a Linux/Mono crash
1485 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); 1491 m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
1486 } 1492 }
1487 catch (IOException e) 1493 catch (IOException e)
1488 { 1494 {
1489 m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); 1495 m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
1490 } 1496 }
1491 } 1497 }
1492 } 1498 }
@@ -1510,7 +1516,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1510 } 1516 }
1511 catch (Exception ex) 1517 catch (Exception ex)
1512 { 1518 {
1513 m_log.Warn("[HTTPD]: Error - " + ex.Message); 1519 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
1514 } 1520 }
1515 finally 1521 finally
1516 { 1522 {
@@ -1523,7 +1529,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1523 catch (SocketException e) 1529 catch (SocketException e)
1524 { 1530 {
1525 // This has to be here to prevent a Linux/Mono crash 1531 // This has to be here to prevent a Linux/Mono crash
1526 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); 1532 m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
1527 } 1533 }
1528 } 1534 }
1529 } 1535 }
@@ -1546,7 +1552,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1546 } 1552 }
1547 catch (Exception ex) 1553 catch (Exception ex)
1548 { 1554 {
1549 m_log.Warn("[HTTPD]: Error - " + ex.Message); 1555 m_log.Warn("[BASE HTTP SERVER]: Error - " + ex.Message);
1550 } 1556 }
1551 finally 1557 finally
1552 { 1558 {
@@ -1566,7 +1572,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1566 1572
1567 public void Start() 1573 public void Start()
1568 { 1574 {
1569 m_log.Info("[HTTPD]: Starting up HTTP Server"); 1575 m_log.Info("[BASE HTTP SERVER]: Starting up HTTP Server");
1570 StartHTTP(); 1576 StartHTTP();
1571 } 1577 }
1572 1578
@@ -1574,7 +1580,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1574 { 1580 {
1575 try 1581 try
1576 { 1582 {
1577 m_log.Info("[HTTPD]: Spawned main thread OK"); 1583 m_log.Debug("[BASE HTTP SERVER]: Spawned main thread OK");
1578 //m_httpListener = new HttpListener(); 1584 //m_httpListener = new HttpListener();
1579 NotSocketErrors = 0; 1585 NotSocketErrors = 0;
1580 if (!m_ssl) 1586 if (!m_ssl)
@@ -1614,8 +1620,8 @@ namespace OpenSim.Framework.Servers.HttpServer
1614 } 1620 }
1615 catch (Exception e) 1621 catch (Exception e)
1616 { 1622 {
1617 m_log.Error("[HTTPD]: Error - " + e.Message); 1623 m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message);
1618 m_log.Error("[HTTPD]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?"); 1624 m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?");
1619 1625
1620 // We want this exception to halt the entire server since in current configurations we aren't too 1626 // We want this exception to halt the entire server since in current configurations we aren't too
1621 // useful without inbound HTTP. 1627 // useful without inbound HTTP.
@@ -1636,7 +1642,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1636 1642
1637 public void httpServerException(object source, Exception exception) 1643 public void httpServerException(object source, Exception exception)
1638 { 1644 {
1639 m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); 1645 m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
1640 /* 1646 /*
1641 if (HTTPDRunning)// && NotSocketErrors > 5) 1647 if (HTTPDRunning)// && NotSocketErrors > 5)
1642 { 1648 {
@@ -1662,7 +1668,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1662 } 1668 }
1663 catch (NullReferenceException) 1669 catch (NullReferenceException)
1664 { 1670 {
1665 m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer."); 1671 m_log.Warn("[BASE HTTP SERVER]: Null Reference when stopping HttpServer.");
1666 } 1672 }
1667 1673
1668 } 1674 }
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index d348c90..a7d34f5 100644
--- a/OpenSim/Framework/Servers/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -29,7 +29,7 @@ namespace OpenSim
29{ 29{
30 public class VersionInfo 30 public class VersionInfo
31 { 31 {
32 private const string VERSION_NUMBER = "0.6.9CM"; 32 private const string VERSION_NUMBER = "0.6.91CM";
33 private const Flavour VERSION_FLAVOUR = Flavour.Dev; 33 private const Flavour VERSION_FLAVOUR = Flavour.Dev;
34 public enum Flavour 34 public enum Flavour
35 { 35 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index 4d347cd..93cb60c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -405,6 +405,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
405 if (parts.Length >= 2) 405 if (parts.Length >= 2)
406 { 406 {
407 portstr = parts[1]; 407 portstr = parts[1];
408 //m_log.Debug("-- port = " + portstr);
408 if (!UInt32.TryParse(portstr, out port)) 409 if (!UInt32.TryParse(portstr, out port))
409 regionName = parts[1]; 410 regionName = parts[1];
410 } 411 }
@@ -620,8 +621,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
620 clonedRegion.RegionLocX = (int)x; 621 clonedRegion.RegionLocX = (int)x;
621 clonedRegion.RegionLocY = (int)y; 622 clonedRegion.RegionLocY = (int)y;
622 623
623 // Get the user's home region information 624 // Get the user's home region information and adapt the region handle
624 GridRegion home = m_aScene.GridService.GetRegionByUUID(m_aScene.RegionInfo.ScopeID, uinfo.UserProfile.HomeRegionID); 625 GridRegion home = GetRegionByUUID(m_aScene.RegionInfo.ScopeID, uinfo.UserProfile.HomeRegionID);
626 if (m_HyperlinkHandles.ContainsKey(uinfo.UserProfile.HomeRegionID))
627 {
628 ulong realHandle = m_HyperlinkHandles[uinfo.UserProfile.HomeRegionID];
629 Utils.LongToUInts(realHandle, out x, out y);
630 m_log.DebugFormat("[HGrid]: Foreign user is going elsewhere. Adjusting home handle from {0}-{1} to {2}-{3}", home.RegionLocX, home.RegionLocY, x, y);
631 home.RegionLocX = (int)x;
632 home.RegionLocY = (int)y;
633 }
625 634
626 // Get the user's service URLs 635 // Get the user's service URLs
627 string serverURI = ""; 636 string serverURI = "";
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
index d9f6e33..bdfe3b1 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
@@ -157,7 +157,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
157 } 157 }
158 158
159// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle); 159// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle);
160 reason = "Did not find region."; 160 uint x = 0, y = 0;
161 Utils.LongToUInts(regionHandle, out x, out y);
162 reason = "Did not find region " + x + "-" + y;
161 return false; 163 return false;
162 } 164 }
163 165
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index f11e571..98efcbe 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
35 string ScriptEngineName { get; } 35 string ScriptEngineName { get; }
36 36
37 string GetXMLState(UUID itemID); 37 string GetXMLState(UUID itemID);
38 void SetXMLState(UUID itemID, string xml); 38 bool SetXMLState(UUID itemID, string xml);
39 39
40 bool PostScriptEvent(UUID itemID, string name, Object[] args); 40 bool PostScriptEvent(UUID itemID, string name, Object[] args);
41 bool PostObjectEvent(UUID itemID, string name, Object[] args); 41 bool PostObjectEvent(UUID itemID, string name, Object[] args);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 20cae5d..265129c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Framework.Scenes
1328 maintc = Util.EnvironmentTickCountSubtract(maintc); 1328 maintc = Util.EnvironmentTickCountSubtract(maintc);
1329 maintc = (int)(m_timespan * 1000) - maintc; 1329 maintc = (int)(m_timespan * 1000) - maintc;
1330 1330
1331 if ((maintc < (m_timespan * 1000)) && maintc > 0) 1331 if (maintc > 0)
1332 Thread.Sleep(maintc); 1332 Thread.Sleep(maintc);
1333 1333
1334 // Tell the watchdog that this thread is still alive 1334 // Tell the watchdog that this thread is still alive
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4495eda..0eddbfd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -513,24 +513,11 @@ namespace OpenSim.Region.Framework.Scenes
513 { 513 {
514 // If this is a linkset, we don't want the physics engine mucking up our group position here. 514 // If this is a linkset, we don't want the physics engine mucking up our group position here.
515 PhysicsActor actor = PhysActor; 515 PhysicsActor actor = PhysActor;
516
517 if (actor != null && _parentID == 0) 516 if (actor != null && _parentID == 0)
518 { 517 {
519 m_groupPosition = actor.Position; 518 m_groupPosition = actor.Position;
520 }
521/*
522 if (actor != null)
523 {
524 if (_parentID == 0)
525 {
526 m_groupPosition = actor.Position;
527 }
528 else
529 {
530 m_groupPosition = ParentGroup.AbsolutePosition; // KF+Casper Update Child prims too!
531 }
532 } 519 }
533*/ 520
534 if (IsAttachment) 521 if (IsAttachment)
535 { 522 {
536 ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar); 523 ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar);
@@ -545,7 +532,6 @@ namespace OpenSim.Region.Framework.Scenes
545 StoreUndoState(); 532 StoreUndoState();
546 533
547 m_groupPosition = value; 534 m_groupPosition = value;
548
549 PhysicsActor actor = PhysActor; 535 PhysicsActor actor = PhysActor;
550 if (actor != null) 536 if (actor != null)
551 { 537 {
@@ -1755,16 +1741,17 @@ namespace OpenSim.Region.Framework.Scenes
1755 public Vector3 GetWorldPosition() 1741 public Vector3 GetWorldPosition()
1756 { 1742 {
1757 Quaternion parentRot = ParentGroup.RootPart.RotationOffset; 1743 Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
1758
1759 Vector3 axPos = OffsetPosition; 1744 Vector3 axPos = OffsetPosition;
1760 axPos *= parentRot; 1745 axPos *= parentRot;
1761 Vector3 translationOffsetPosition = axPos; 1746 Vector3 translationOffsetPosition = axPos;
1762 1747 if(_parentID == 0)
1763 int tx = (int)GroupPosition.X; 1748 {
1764 int ty = (int)GroupPosition.Y; 1749 return GroupPosition;
1765 int tz = (int)GroupPosition.Z; 1750 }
1766 1751 else
1767 return GroupPosition + translationOffsetPosition; 1752 {
1753 return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position
1754 }
1768 } 1755 }
1769 1756
1770 /// <summary> 1757 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index b57d912..0321c41 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Xml;
29using System.IO; 30using System.IO;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.Reflection; 32using System.Reflection;
@@ -295,15 +296,55 @@ namespace OpenSim.Region.Framework.Scenes
295 296
296 private void RestoreSavedScriptState(UUID oldID, UUID newID) 297 private void RestoreSavedScriptState(UUID oldID, UUID newID)
297 { 298 {
299 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
300 if (engines == null) // No engine at all
301 return;
302
298 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) 303 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
299 { 304 {
300 string fpath = Path.Combine("ScriptEngines/"+m_part.ParentGroup.Scene.RegionInfo.RegionID.ToString(), 305 XmlDocument doc = new XmlDocument();
301 newID.ToString()+".state"); 306
302 FileStream fs = File.Create(fpath); 307 doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]);
303 Byte[] buffer = enc.GetBytes(m_part.ParentGroup.m_savedScriptState[oldID]); 308
304 fs.Write(buffer,0,buffer.Length); 309 ////////// CRUFT WARNING ///////////////////////////////////
305 fs.Close(); 310 //
306 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 311 // Old objects will have <ScriptState><State> ...
312 // This format is XEngine ONLY
313 //
314 // New objects have <State Engine="...." ...><ScriptState>...
315 // This can be passed to any engine
316 //
317 XmlNode n = doc.SelectSingleNode("ScriptState");
318 if (n != null) // Old format data
319 {
320 XmlDocument newDoc = new XmlDocument();
321
322 XmlElement rootN = newDoc.CreateElement("", "State", "");
323 XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", "");
324 uuidA.Value = oldID.ToString();
325 rootN.Attributes.Append(uuidA);
326 XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", "");
327 engineA.Value = "XEngine";
328 rootN.Attributes.Append(engineA);
329
330 newDoc.AppendChild(rootN);
331
332 XmlNode stateN = newDoc.ImportNode(n, true);
333 rootN.AppendChild(stateN);
334
335 // This created document has only the minimun data
336 // necessary for XEngine to parse it successfully
337
338 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
339 }
340 foreach (IScriptModule e in engines)
341 {
342 if (e != null)
343 {
344 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
345 break;
346 }
347 }
307 } 348 }
308 } 349 }
309 350
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index abdd1a0..a3ad7ca 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Scenes
129 private Vector3? m_forceToApply; 129 private Vector3? m_forceToApply;
130 private uint m_requestedSitTargetID; 130 private uint m_requestedSitTargetID;
131 private UUID m_requestedSitTargetUUID; 131 private UUID m_requestedSitTargetUUID;
132 private Vector3 m_requestedSitOffset; 132
133 private SendCourseLocationsMethod m_sendCourseLocationsMethod; 133 private SendCourseLocationsMethod m_sendCourseLocationsMethod;
134 134
135 private bool m_startAnimationSet; 135 private bool m_startAnimationSet;
@@ -1926,7 +1926,7 @@ namespace OpenSim.Region.Framework.Scenes
1926 m_nextSitAnimation = part.SitAnimation; 1926 m_nextSitAnimation = part.SitAnimation;
1927 } 1927 }
1928 m_requestedSitTargetID = part.LocalId; 1928 m_requestedSitTargetID = part.LocalId;
1929 m_requestedSitOffset = offset; 1929 //m_requestedSitOffset = offset;
1930 m_requestedSitTargetUUID = targetID; 1930 m_requestedSitTargetUUID = targetID;
1931 1931
1932 m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); 1932 m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset);
@@ -2159,7 +2159,7 @@ namespace OpenSim.Region.Framework.Scenes
2159 if (part != null) 2159 if (part != null)
2160 { 2160 {
2161 m_requestedSitTargetID = part.LocalId; 2161 m_requestedSitTargetID = part.LocalId;
2162 m_requestedSitOffset = offset; 2162 //m_requestedSitOffset = offset;
2163 m_requestedSitTargetUUID = targetID; 2163 m_requestedSitTargetUUID = targetID;
2164 2164
2165 m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); 2165 m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e694f15..2da498a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4476,8 +4476,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4476 4476
4477 double x, y, z, s, t; 4477 double x, y, z, s, t;
4478 4478
4479 s = Math.Cos(angle / 2); 4479 s = Math.Cos(angle * 0.5);
4480 t = Math.Sin(angle / 2); // temp value to avoid 2 more sin() calcs 4480 t = Math.Sin(angle * 0.5); // temp value to avoid 2 more sin() calcs
4481 x = axis.x * t; 4481 x = axis.x * t;
4482 y = axis.y * t; 4482 y = axis.y * t;
4483 z = axis.z * t; 4483 z = axis.z * t;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 184af19..2a9a2db 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1348,6 +1348,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1348 XmlAttribute assetID = doc.CreateAttribute("", "Asset", ""); 1348 XmlAttribute assetID = doc.CreateAttribute("", "Asset", "");
1349 assetID.Value = instance.AssetID.ToString(); 1349 assetID.Value = instance.AssetID.ToString();
1350 stateData.Attributes.Append(assetID); 1350 stateData.Attributes.Append(assetID);
1351 XmlAttribute engineName = doc.CreateAttribute("", "Engine", "");
1352 engineName.Value = ScriptEngineName;
1353 stateData.Attributes.Append(engineName);
1351 doc.AppendChild(stateData); 1354 doc.AppendChild(stateData);
1352 1355
1353 // Add <ScriptState>...</ScriptState> 1356 // Add <ScriptState>...</ScriptState>
@@ -1447,10 +1450,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1447 return false; 1450 return false;
1448 } 1451 }
1449 1452
1450 public void SetXMLState(UUID itemID, string xml) 1453 public bool SetXMLState(UUID itemID, string xml)
1451 { 1454 {
1452 if (xml == String.Empty) 1455 if (xml == String.Empty)
1453 return; 1456 return false;
1454 1457
1455 XmlDocument doc = new XmlDocument(); 1458 XmlDocument doc = new XmlDocument();
1456 1459
@@ -1461,24 +1464,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1461 catch (Exception) 1464 catch (Exception)
1462 { 1465 {
1463 m_log.Error("[XEngine]: Exception decoding XML data from region transfer"); 1466 m_log.Error("[XEngine]: Exception decoding XML data from region transfer");
1464 return; 1467 return false;
1465 } 1468 }
1466 1469
1467 XmlNodeList rootL = doc.GetElementsByTagName("State"); 1470 XmlNodeList rootL = doc.GetElementsByTagName("State");
1468 if (rootL.Count < 1) 1471 if (rootL.Count < 1)
1469 return; 1472 return false;
1470 1473
1471 XmlElement rootE = (XmlElement)rootL[0]; 1474 XmlElement rootE = (XmlElement)rootL[0];
1472 1475
1473 if (rootE.GetAttribute("UUID") != itemID.ToString()) 1476 if (rootE.GetAttribute("Engine") != ScriptEngineName)
1474 return; 1477 return false;
1475 1478
1476// string assetID = rootE.GetAttribute("Asset"); 1479// On rez from inventory, that ID will have changed. It was only
1480// advisory anyway. So we don't check it anymore.
1481//
1482// if (rootE.GetAttribute("UUID") != itemID.ToString())
1483// return;
1477 1484
1478 XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState"); 1485 XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState");
1479 1486
1480 if (stateL.Count != 1) 1487 if (stateL.Count != 1)
1481 return; 1488 return false;
1482 1489
1483 XmlElement stateE = (XmlElement)stateL[0]; 1490 XmlElement stateE = (XmlElement)stateL[0];
1484 1491
@@ -1487,7 +1494,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1487 XmlNodeList assemL = rootE.GetElementsByTagName("Assembly"); 1494 XmlNodeList assemL = rootE.GetElementsByTagName("Assembly");
1488 1495
1489 if (assemL.Count != 1) 1496 if (assemL.Count != 1)
1490 return; 1497 return false;
1491 1498
1492 XmlElement assemE = (XmlElement)assemL[0]; 1499 XmlElement assemE = (XmlElement)assemL[0];
1493 1500
@@ -1527,19 +1534,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1527 sfs.Close(); 1534 sfs.Close();
1528 1535
1529 XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); 1536 XmlNodeList mapL = rootE.GetElementsByTagName("LineMap");
1530 1537 if (mapL.Count > 0)
1531 XmlElement mapE = (XmlElement)mapL[0]; 1538 {
1539 XmlElement mapE = (XmlElement)mapL[0];
1532 1540
1533 string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); 1541 string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
1534 mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); 1542 mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
1535 1543
1536 FileStream mfs = File.Create(mappath); 1544 FileStream mfs = File.Create(mappath);
1537 StreamWriter msw = new StreamWriter(mfs); 1545 StreamWriter msw = new StreamWriter(mfs);
1538 1546
1539 msw.Write(mapE.InnerText); 1547 msw.Write(mapE.InnerText);
1540 1548
1541 msw.Close(); 1549 msw.Close();
1542 mfs.Close(); 1550 mfs.Close();
1551 }
1552
1553 return true;
1543 } 1554 }
1544 } 1555 }
1545} 1556}
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
index 2f33bab..968a6d6 100644
--- a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
@@ -92,12 +92,12 @@ namespace OpenSim.Services.Connectors.Grid
92 try 92 try
93 { 93 {
94 UUID.TryParse((string)hash["uuid"], out uuid); 94 UUID.TryParse((string)hash["uuid"], out uuid);
95 m_log.Debug(">> HERE, uuid: " + uuid); 95 //m_log.Debug(">> HERE, uuid: " + uuid);
96 info.RegionID = uuid; 96 info.RegionID = uuid;
97 if ((string)hash["handle"] != null) 97 if ((string)hash["handle"] != null)
98 { 98 {
99 realHandle = Convert.ToUInt64((string)hash["handle"]); 99 realHandle = Convert.ToUInt64((string)hash["handle"]);
100 m_log.Debug(">> HERE, realHandle: " + realHandle); 100 //m_log.Debug(">> HERE, realHandle: " + realHandle);
101 } 101 }
102 //if (hash["region_image"] != null) 102 //if (hash["region_image"] != null)
103 //{ 103 //{
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs
index 8798c5e..972c0aa 100644
--- a/OpenSim/Tests/Clients/Grid/GridClient.cs
+++ b/OpenSim/Tests/Clients/Grid/GridClient.cs
@@ -44,9 +44,9 @@ namespace OpenSim.Tests.Clients.GridClient
44{ 44{
45 public class GridClient 45 public class GridClient
46 { 46 {
47 private static readonly ILog m_log = 47// private static readonly ILog m_log =
48 LogManager.GetLogger( 48// LogManager.GetLogger(
49 MethodBase.GetCurrentMethod().DeclaringType); 49// MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 public static void Main(string[] args) 51 public static void Main(string[] args)
52 { 52 {