diff options
author | UbitUmarov | 2016-11-27 15:14:34 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-27 15:14:34 +0000 |
commit | 877d3092b45723a2fe8b3a5bbc224cd5d5e55e82 (patch) | |
tree | f11a5b2d85443fefc81e1958c82828a16fc656cc /OpenSim/Region | |
parent | fix pool parameters for httptests (diff) | |
parent | HG on links request build the URI in http format with a / at end, this should... (diff) | |
download | opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.zip opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.gz opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.bz2 opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to '')
25 files changed, 438 insertions, 276 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4ab48e3..cf2bf33 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -242,22 +242,22 @@ namespace OpenSim | |||
242 | ChangeSelectedRegion); | 242 | ChangeSelectedRegion); |
243 | 243 | ||
244 | m_console.Commands.AddCommand("Archiving", false, "save xml", | 244 | m_console.Commands.AddCommand("Archiving", false, "save xml", |
245 | "save xml", | 245 | "save xml [<file name>]", |
246 | "Save a region's data in XML format", | 246 | "Save a region's data in XML format", |
247 | SaveXml); | 247 | SaveXml); |
248 | 248 | ||
249 | m_console.Commands.AddCommand("Archiving", false, "save xml2", | 249 | m_console.Commands.AddCommand("Archiving", false, "save xml2", |
250 | "save xml2", | 250 | "save xml2 [<file name>]", |
251 | "Save a region's data in XML2 format", | 251 | "Save a region's data in XML2 format", |
252 | SaveXml2); | 252 | SaveXml2); |
253 | 253 | ||
254 | m_console.Commands.AddCommand("Archiving", false, "load xml", | 254 | m_console.Commands.AddCommand("Archiving", false, "load xml", |
255 | "load xml [-newIDs [<x> <y> <z>]]", | 255 | "load xml [<file name> [-newUID [<x> <y> <z>]]]", |
256 | "Load a region's data from XML format", | 256 | "Load a region's data from XML format", |
257 | LoadXml); | 257 | LoadXml); |
258 | 258 | ||
259 | m_console.Commands.AddCommand("Archiving", false, "load xml2", | 259 | m_console.Commands.AddCommand("Archiving", false, "load xml2", |
260 | "load xml2", | 260 | "load xml2 [<file name>]", |
261 | "Load a region's data from XML2 format", | 261 | "Load a region's data from XML2 format", |
262 | LoadXml2); | 262 | LoadXml2); |
263 | 263 | ||
@@ -1068,7 +1068,7 @@ namespace OpenSim | |||
1068 | /// <param name="cmdparams"></param> | 1068 | /// <param name="cmdparams"></param> |
1069 | protected void SavePrimsXml2(string module, string[] cmdparams) | 1069 | protected void SavePrimsXml2(string module, string[] cmdparams) |
1070 | { | 1070 | { |
1071 | if (cmdparams.Length > 5) | 1071 | if (cmdparams.Length > 4) |
1072 | { | 1072 | { |
1073 | SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]); | 1073 | SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]); |
1074 | } | 1074 | } |
@@ -1087,7 +1087,7 @@ namespace OpenSim | |||
1087 | { | 1087 | { |
1088 | MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | 1088 | MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); |
1089 | 1089 | ||
1090 | if (cmdparams.Length > 0) | 1090 | if (cmdparams.Length > 2) |
1091 | { | 1091 | { |
1092 | SceneManager.SaveCurrentSceneToXml(cmdparams[2]); | 1092 | SceneManager.SaveCurrentSceneToXml(cmdparams[2]); |
1093 | } | 1093 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 8ba26e8..6cdf6f6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -606,21 +606,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
606 | //m_scene.CloseAllAgents(CircuitCode); | 606 | //m_scene.CloseAllAgents(CircuitCode); |
607 | 607 | ||
608 | // Disable UDP handling for this client | 608 | // Disable UDP handling for this client |
609 | m_udpClient.Shutdown(); | ||
610 | |||
611 | m_udpClient.OnQueueEmpty -= HandleQueueEmpty; | 609 | m_udpClient.OnQueueEmpty -= HandleQueueEmpty; |
612 | m_udpClient.HasUpdates -= HandleHasUpdates; | 610 | m_udpClient.HasUpdates -= HandleHasUpdates; |
613 | m_udpClient.OnPacketStats -= PopulateStats; | 611 | m_udpClient.OnPacketStats -= PopulateStats; |
612 | m_udpClient.Shutdown(); | ||
614 | 613 | ||
615 | // Shutdown the image manager | 614 | // Shutdown the image manager |
616 | ImageManager.Close(); | 615 | ImageManager.Close(); |
617 | ImageManager = null; | 616 | ImageManager = null; |
618 | 617 | ||
619 | m_entityUpdates = null; | 618 | m_entityUpdates = new PriorityQueue(1); |
620 | m_entityProps = null; | 619 | m_entityProps = new PriorityQueue(1); |
621 | m_killRecord.Clear(); | 620 | m_killRecord.Clear(); |
622 | GroupsInView.Clear(); | 621 | GroupsInView.Clear(); |
623 | m_scene = null; | 622 | // m_scene = null; can't do this unless checks are added everywhere due to workitems already in pools |
623 | |||
624 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 624 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
625 | //GC.Collect(); | 625 | //GC.Collect(); |
626 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 626 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
@@ -3126,10 +3126,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3126 | reply.Data.ActualArea = land.Area; | 3126 | reply.Data.ActualArea = land.Area; |
3127 | reply.Data.BillableArea = land.Area; // TODO: what is this? | 3127 | reply.Data.BillableArea = land.Area; // TODO: what is this? |
3128 | 3128 | ||
3129 | // Bit 0: Mature, bit 7: on sale, other bits: no idea | 3129 | reply.Data.Flags = (byte)Util.ConvertAccessLevelToMaturity((byte)info.AccessLevel); |
3130 | reply.Data.Flags = (byte)( | 3130 | if((land.Flags & (uint)ParcelFlags.ForSale) != 0) |
3131 | (info.AccessLevel > 13 ? (1 << 0) : 0) + | 3131 | reply.Data.Flags |= (byte)((1 << 7)); |
3132 | ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); | ||
3133 | 3132 | ||
3134 | Vector3 pos = land.UserLocation; | 3133 | Vector3 pos = land.UserLocation; |
3135 | if (pos.Equals(Vector3.Zero)) | 3134 | if (pos.Equals(Vector3.Zero)) |
@@ -4371,7 +4370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4371 | 4370 | ||
4372 | ushort timeDilation; | 4371 | ushort timeDilation; |
4373 | 4372 | ||
4374 | if(m_scene == null) | 4373 | if(!IsActive) |
4375 | return; | 4374 | return; |
4376 | 4375 | ||
4377 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); | 4376 | timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
@@ -9614,61 +9613,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9614 | 9613 | ||
9615 | #region Parcel related packets | 9614 | #region Parcel related packets |
9616 | 9615 | ||
9617 | // acumulate several HandleRegionHandleRequest consecutive overlaping requests | ||
9618 | // to be done with minimal resources as possible | ||
9619 | // variables temporary here while in test | ||
9620 | |||
9621 | Queue<UUID> RegionHandleRequests = new Queue<UUID>(); | ||
9622 | bool RegionHandleRequestsInService = false; | ||
9623 | |||
9624 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) | 9616 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) |
9625 | { | 9617 | { |
9626 | UUID currentUUID; | ||
9627 | |||
9628 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; | 9618 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; |
9629 | 9619 | ||
9630 | if (handlerRegionHandleRequest == null) | 9620 | if (handlerRegionHandleRequest != null) |
9631 | return true; | ||
9632 | |||
9633 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
9634 | |||
9635 | lock (RegionHandleRequests) | ||
9636 | { | ||
9637 | if (RegionHandleRequestsInService) | ||
9638 | { | ||
9639 | // we are already busy doing a previus request | ||
9640 | // so enqueue it | ||
9641 | RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID); | ||
9642 | return true; | ||
9643 | } | ||
9644 | |||
9645 | // else do it | ||
9646 | currentUUID = rhrPack.RequestBlock.RegionID; | ||
9647 | RegionHandleRequestsInService = true; | ||
9648 | } | ||
9649 | |||
9650 | while (true) | ||
9651 | { | 9621 | { |
9652 | handlerRegionHandleRequest(this, currentUUID); | 9622 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; |
9653 | 9623 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | |
9654 | lock (RegionHandleRequests) | ||
9655 | { | ||
9656 | // exit condition, nothing to do or closed | ||
9657 | // current code seems to assume we may loose the handler at anytime, | ||
9658 | // so keep checking it | ||
9659 | handlerRegionHandleRequest = OnRegionHandleRequest; | ||
9660 | |||
9661 | if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null) | ||
9662 | { | ||
9663 | RegionHandleRequests.Clear(); | ||
9664 | RegionHandleRequestsInService = false; | ||
9665 | return true; | ||
9666 | } | ||
9667 | currentUUID = RegionHandleRequests.Dequeue(); | ||
9668 | } | ||
9669 | } | 9624 | } |
9670 | 9625 | ||
9671 | return true; // actually unreached | 9626 | return true; |
9672 | } | 9627 | } |
9673 | 9628 | ||
9674 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) | 9629 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) |
@@ -12945,9 +12900,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12945 | /// provide your own method.</param> | 12900 | /// provide your own method.</param> |
12946 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method) | 12901 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method) |
12947 | { | 12902 | { |
12903 | |||
12904 | /* this is causing packet loss for some reason | ||
12905 | if(!m_udpClient.IsConnected) | ||
12906 | { | ||
12907 | PacketPool.Instance.ReturnPacket(packet); | ||
12908 | return; | ||
12909 | } | ||
12910 | */ | ||
12948 | if (m_outPacketsToDrop != null) | 12911 | if (m_outPacketsToDrop != null) |
12912 | { | ||
12949 | if (m_outPacketsToDrop.Contains(packet.Type.ToString())) | 12913 | if (m_outPacketsToDrop.Contains(packet.Type.ToString())) |
12914 | { | ||
12915 | PacketPool.Instance.ReturnPacket(packet); | ||
12950 | return; | 12916 | return; |
12917 | } | ||
12918 | } | ||
12951 | 12919 | ||
12952 | if (DebugPacketLevel > 0) | 12920 | if (DebugPacketLevel > 0) |
12953 | { | 12921 | { |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index e85cee2..dc8ac3c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -288,21 +288,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
288 | for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) | 288 | for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) |
289 | { | 289 | { |
290 | m_packetOutboxes[i].Clear(); | 290 | m_packetOutboxes[i].Clear(); |
291 | m_throttleCategories[i] = null; | ||
292 | m_nextPackets[i] = null; | 291 | m_nextPackets[i] = null; |
293 | } | 292 | } |
294 | 293 | ||
295 | // pull the throttle out of the scene throttle | 294 | // pull the throttle out of the scene throttle |
296 | m_throttleClient.Parent.UnregisterRequest(m_throttleClient); | 295 | m_throttleClient.Parent.UnregisterRequest(m_throttleClient); |
297 | m_throttleClient = null; | ||
298 | OnPacketStats = null; | ||
299 | OnQueueEmpty = null; | ||
300 | PendingAcks.Clear(); | 296 | PendingAcks.Clear(); |
301 | NeedAcks.Clear(); | 297 | NeedAcks.Clear(); |
302 | NeedAcks = null; | ||
303 | PendingAcks = null; | ||
304 | m_nextPackets = null; | ||
305 | m_packetOutboxes = null; | ||
306 | } | 298 | } |
307 | 299 | ||
308 | /// <summary> | 300 | /// <summary> |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index af33d17..a868e3a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -521,7 +521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
521 | 521 | ||
522 | // if (usePools) | 522 | // if (usePools) |
523 | // EnablePools(); | 523 | // EnablePools(); |
524 | DisablePools(); | 524 | base.DisablePools(); |
525 | } | 525 | } |
526 | 526 | ||
527 | public void Start() | 527 | public void Start() |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 7171974..4d726b4 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | |||
@@ -179,6 +179,11 @@ namespace OpenMetaverse | |||
179 | // m_dropRandomGenerator = new Random(); | 179 | // m_dropRandomGenerator = new Random(); |
180 | } | 180 | } |
181 | 181 | ||
182 | ~OpenSimUDPBase() | ||
183 | { | ||
184 | if(m_udpSocket !=null) | ||
185 | try { m_udpSocket.Close(); } catch { } | ||
186 | } | ||
182 | /// <summary> | 187 | /// <summary> |
183 | /// Start inbound UDP packet handling. | 188 | /// Start inbound UDP packet handling. |
184 | /// </summary> | 189 | /// </summary> |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index d4603f8..cac57b2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | |||
@@ -97,7 +97,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
97 | /// </summary> | 97 | /// </summary> |
98 | protected float m_burst; | 98 | protected float m_burst; |
99 | 99 | ||
100 | public virtual float MaxDripRate { get; set; } | 100 | protected float m_maxDripRate = 0; |
101 | public virtual float MaxDripRate | ||
102 | { | ||
103 | get { return m_maxDripRate; } | ||
104 | set { m_maxDripRate = value; } | ||
105 | } | ||
101 | 106 | ||
102 | public float RequestedBurst | 107 | public float RequestedBurst |
103 | { | 108 | { |
@@ -134,7 +139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
134 | /// the system tick interval (typically around 15-22ms)</remarks> | 139 | /// the system tick interval (typically around 15-22ms)</remarks> |
135 | protected float m_dripRate; | 140 | protected float m_dripRate; |
136 | 141 | ||
137 | public virtual float RequestedDripRate | 142 | public float RequestedDripRate |
138 | { | 143 | { |
139 | get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); } | 144 | get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); } |
140 | set { | 145 | set { |
@@ -146,7 +151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
146 | } | 151 | } |
147 | } | 152 | } |
148 | 153 | ||
149 | public virtual float DripRate | 154 | public float DripRate |
150 | { | 155 | { |
151 | get { | 156 | get { |
152 | float rate = Math.Min(RequestedDripRate,TotalDripRequest); | 157 | float rate = Math.Min(RequestedDripRate,TotalDripRequest); |
@@ -344,7 +349,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
344 | // greater than this. | 349 | // greater than this. |
345 | // </summary> | 350 | // </summary> |
346 | 351 | ||
347 | protected float m_maxDripRate = 0; | ||
348 | public override float MaxDripRate | 352 | public override float MaxDripRate |
349 | { | 353 | { |
350 | get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } | 354 | get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } |
@@ -359,7 +363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
359 | // <summary> | 363 | // <summary> |
360 | // Adjust drip rate in response to network conditions. | 364 | // Adjust drip rate in response to network conditions. |
361 | // </summary> | 365 | // </summary> |
362 | public virtual float AdjustedDripRate | 366 | public float AdjustedDripRate |
363 | { | 367 | { |
364 | get { return m_dripRate; } | 368 | get { return m_dripRate; } |
365 | set | 369 | set |
@@ -380,12 +384,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
380 | { | 384 | { |
381 | m_enabled = enabled; | 385 | m_enabled = enabled; |
382 | 386 | ||
383 | MaxDripRate = maxDripRate; | 387 | m_maxDripRate = (maxDripRate == 0 ? m_totalDripRequest : Math.Max(maxDripRate, m_minimumFlow)); |
384 | 388 | ||
385 | if (enabled) | 389 | if (enabled) |
386 | AdjustedDripRate = m_maxDripRate * .5f; | 390 | m_dripRate = m_maxDripRate * .5f; |
387 | else | 391 | else |
388 | AdjustedDripRate = m_maxDripRate; | 392 | m_dripRate = m_maxDripRate; |
393 | if (m_parent != null) | ||
394 | m_parent.RegisterRequest(this, m_dripRate); | ||
389 | } | 395 | } |
390 | 396 | ||
391 | /// <summary> | 397 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index fe0a243..5164289 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -55,9 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
55 | protected List<string> FreezeCache = new List<string>(); | 55 | protected List<string> FreezeCache = new List<string>(); |
56 | protected string m_adminPrefix = ""; | 56 | protected string m_adminPrefix = ""; |
57 | protected object m_syncy = new object(); | 57 | protected object m_syncy = new object(); |
58 | |||
59 | protected IConfig m_config; | 58 | protected IConfig m_config; |
60 | |||
61 | #region ISharedRegionModule Members | 59 | #region ISharedRegionModule Members |
62 | public virtual void Initialise(IConfigSource config) | 60 | public virtual void Initialise(IConfigSource config) |
63 | { | 61 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 71a0e52..33aa7ad 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -455,6 +455,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
455 | position = emergencyPos; | 455 | position = emergencyPos; |
456 | } | 456 | } |
457 | 457 | ||
458 | // Check Default Location (Also See ScenePresence.CompleteMovement) | ||
459 | if (position.X == 128f && position.Y == 128f) | ||
460 | position = sp.Scene.RegionInfo.DefaultLandingPoint; | ||
461 | |||
458 | // TODO: Get proper AVG Height | 462 | // TODO: Get proper AVG Height |
459 | float localHalfAVHeight = 0.8f; | 463 | float localHalfAVHeight = 0.8f; |
460 | if (sp.Appearance != null) | 464 | if (sp.Appearance != null) |
@@ -594,12 +598,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
594 | uint x = 0, y = 0; | 598 | uint x = 0, y = 0; |
595 | Util.RegionHandleToWorldLoc(regionHandle, out x, out y); | 599 | Util.RegionHandleToWorldLoc(regionHandle, out x, out y); |
596 | 600 | ||
601 | GridRegion reg; | ||
602 | |||
603 | // handle legacy HG. linked regions are mapped into y = 0 and have no size information | ||
604 | // so we can only search by base handle | ||
605 | if( y == 0) | ||
606 | { | ||
607 | reg = gridService.GetRegionByPosition(scope, (int)x, (int)y); | ||
608 | return reg; | ||
609 | } | ||
610 | |||
597 | // Compute the world location we're teleporting to | 611 | // Compute the world location we're teleporting to |
598 | double worldX = (double)x + position.X; | 612 | double worldX = (double)x + position.X; |
599 | double worldY = (double)y + position.Y; | 613 | double worldY = (double)y + position.Y; |
600 | 614 | ||
601 | // Find the region that contains the position | 615 | // Find the region that contains the position |
602 | GridRegion reg = GetRegionContainingWorldLocation(gridService, scope, worldX, worldY); | 616 | reg = GetRegionContainingWorldLocation(gridService, scope, worldX, worldY); |
603 | 617 | ||
604 | if (reg != null) | 618 | if (reg != null) |
605 | { | 619 | { |
@@ -813,8 +827,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
813 | if (OutSideViewRange) | 827 | if (OutSideViewRange) |
814 | { | 828 | { |
815 | m_log.DebugFormat( | 829 | m_log.DebugFormat( |
816 | "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}", | 830 | "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} size {3},{4} needs new child agent for agent {5} from {6}", |
817 | finalDestination.RegionName, newRegionX, newRegionY, sp.Name, Scene.Name); | 831 | finalDestination.RegionName, newRegionX, newRegionY,newSizeX, newSizeY, sp.Name, Scene.Name); |
818 | 832 | ||
819 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); | 833 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); |
820 | #region IP Translation for NAT | 834 | #region IP Translation for NAT |
@@ -2180,8 +2194,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2180 | #endregion // NotFoundLocationCache class | 2194 | #endregion // NotFoundLocationCache class |
2181 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); | 2195 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); |
2182 | 2196 | ||
2183 | // needed for old grid code | ||
2184 | |||
2185 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) | 2197 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) |
2186 | { | 2198 | { |
2187 | // Since we don't know how big the regions could be, we have to search a very large area | 2199 | // Since we don't know how big the regions could be, we have to search a very large area |
@@ -2191,6 +2203,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2191 | 2203 | ||
2192 | // Given a world position, get the GridRegion info for | 2204 | // Given a world position, get the GridRegion info for |
2193 | // the region containing that point. | 2205 | // the region containing that point. |
2206 | // for compatibility with old grids it does a scan to find large regions | ||
2207 | // 0.9 grids to that | ||
2208 | |||
2194 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, | 2209 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, |
2195 | double px, double py, uint pSizeHint) | 2210 | double px, double py, uint pSizeHint) |
2196 | { | 2211 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs index 3abacbd..36fb57a 100644 --- a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs | |||
@@ -48,31 +48,16 @@ namespace OpenSim.Region.CoreModules.Framework | |||
48 | MethodBase.GetCurrentMethod().DeclaringType); | 48 | MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private readonly List<Scene> m_scenes = new List<Scene>(); | 50 | private readonly List<Scene> m_scenes = new List<Scene>(); |
51 | private System.Timers.Timer m_timer = new System.Timers.Timer(); | 51 | private JobEngine m_processorJobEngine; |
52 | 52 | ||
53 | private Queue<Action> m_RequestQueue = new Queue<Action>(); | ||
54 | private Dictionary<string, List<string>> m_Pending = new Dictionary<string, List<string>>(); | ||
55 | private int m_Interval; | ||
56 | |||
57 | #region ISharedRegionModule | 53 | #region ISharedRegionModule |
58 | 54 | ||
59 | public void Initialise(IConfigSource config) | 55 | public void Initialise(IConfigSource config) |
60 | { | 56 | { |
61 | m_Interval = Util.GetConfigVarFromSections<int>(config, "Interval", new string[] { "ServiceThrottle" }, 5000); | 57 | m_processorJobEngine = new JobEngine( |
62 | 58 | "ServiceThrottle","ServiceThrottle"); | |
63 | m_timer = new System.Timers.Timer(); | 59 | m_processorJobEngine.RequestProcessTimeoutOnStop = 31000; // many webrequests have 30s expire |
64 | m_timer.AutoReset = false; | 60 | m_processorJobEngine.Start(); |
65 | m_timer.Enabled = true; | ||
66 | m_timer.Interval = 15000; // 15 secs at first | ||
67 | m_timer.Elapsed += ProcessQueue; | ||
68 | m_timer.Start(); | ||
69 | |||
70 | //WorkManager.StartThread( | ||
71 | // ProcessQueue, | ||
72 | // "GridServiceRequestThread", | ||
73 | // ThreadPriority.BelowNormal, | ||
74 | // true, | ||
75 | // false); | ||
76 | } | 61 | } |
77 | 62 | ||
78 | public void AddRegion(Scene scene) | 63 | public void AddRegion(Scene scene) |
@@ -82,7 +67,6 @@ namespace OpenSim.Region.CoreModules.Framework | |||
82 | m_scenes.Add(scene); | 67 | m_scenes.Add(scene); |
83 | scene.RegisterModuleInterface<IServiceThrottleModule>(this); | 68 | scene.RegisterModuleInterface<IServiceThrottleModule>(this); |
84 | scene.EventManager.OnNewClient += OnNewClient; | 69 | scene.EventManager.OnNewClient += OnNewClient; |
85 | scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; | ||
86 | } | 70 | } |
87 | } | 71 | } |
88 | 72 | ||
@@ -105,6 +89,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
105 | 89 | ||
106 | public void Close() | 90 | public void Close() |
107 | { | 91 | { |
92 | m_processorJobEngine.Stop(); | ||
108 | } | 93 | } |
109 | 94 | ||
110 | public string Name | 95 | public string Name |
@@ -126,38 +111,24 @@ namespace OpenSim.Region.CoreModules.Framework | |||
126 | client.OnRegionHandleRequest += OnRegionHandleRequest; | 111 | client.OnRegionHandleRequest += OnRegionHandleRequest; |
127 | } | 112 | } |
128 | 113 | ||
129 | void OnMakeRootAgent(ScenePresence obj) | ||
130 | { | ||
131 | lock (m_timer) | ||
132 | { | ||
133 | if (!m_timer.Enabled) | ||
134 | { | ||
135 | m_timer.Interval = m_Interval; | ||
136 | m_timer.Enabled = true; | ||
137 | m_timer.Start(); | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | |||
142 | public void OnRegionHandleRequest(IClientAPI client, UUID regionID) | 114 | public void OnRegionHandleRequest(IClientAPI client, UUID regionID) |
143 | { | 115 | { |
144 | //m_log.DebugFormat("[SERVICE THROTTLE]: RegionHandleRequest {0}", regionID); | 116 | //m_log.DebugFormat("[SERVICE THROTTLE]: RegionHandleRequest {0}", regionID); |
145 | ulong handle = 0; | ||
146 | if (IsLocalRegionHandle(regionID, out handle)) | ||
147 | { | ||
148 | client.SendRegionHandle(regionID, handle); | ||
149 | return; | ||
150 | } | ||
151 | |||
152 | Action action = delegate | 117 | Action action = delegate |
153 | { | 118 | { |
119 | if(!client.IsActive) | ||
120 | return; | ||
121 | |||
154 | GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, regionID); | 122 | GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, regionID); |
155 | 123 | ||
124 | if(!client.IsActive) | ||
125 | return; | ||
126 | |||
156 | if (r != null && r.RegionHandle != 0) | 127 | if (r != null && r.RegionHandle != 0) |
157 | client.SendRegionHandle(regionID, r.RegionHandle); | 128 | client.SendRegionHandle(regionID, r.RegionHandle); |
158 | }; | 129 | }; |
159 | 130 | ||
160 | Enqueue("region", regionID.ToString(), action); | 131 | m_processorJobEngine.QueueJob("regionHandle", action, regionID.ToString()); |
161 | } | 132 | } |
162 | 133 | ||
163 | #endregion Events | 134 | #endregion Events |
@@ -166,91 +137,10 @@ namespace OpenSim.Region.CoreModules.Framework | |||
166 | 137 | ||
167 | public void Enqueue(string category, string itemid, Action continuation) | 138 | public void Enqueue(string category, string itemid, Action continuation) |
168 | { | 139 | { |
169 | lock (m_RequestQueue) | 140 | m_processorJobEngine.QueueJob(category, continuation, itemid); |
170 | { | ||
171 | if (m_Pending.ContainsKey(category)) | ||
172 | { | ||
173 | if (m_Pending[category].Contains(itemid)) | ||
174 | // Don't enqueue, it's already pending | ||
175 | return; | ||
176 | } | ||
177 | else | ||
178 | m_Pending.Add(category, new List<string>()); | ||
179 | |||
180 | m_Pending[category].Add(itemid); | ||
181 | |||
182 | m_RequestQueue.Enqueue(delegate | ||
183 | { | ||
184 | lock (m_RequestQueue) | ||
185 | m_Pending[category].Remove(itemid); | ||
186 | |||
187 | continuation(); | ||
188 | }); | ||
189 | } | ||
190 | } | 141 | } |
191 | 142 | ||
192 | #endregion IServiceThrottleModule | 143 | #endregion IServiceThrottleModule |
193 | |||
194 | #region Process Continuation Queue | ||
195 | |||
196 | private void ProcessQueue(object sender, System.Timers.ElapsedEventArgs e) | ||
197 | { | ||
198 | //m_log.DebugFormat("[YYY]: Process queue with {0} continuations", m_RequestQueue.Count); | ||
199 | |||
200 | while (m_RequestQueue.Count > 0) | ||
201 | { | ||
202 | Action continuation = null; | ||
203 | lock (m_RequestQueue) | ||
204 | continuation = m_RequestQueue.Dequeue(); | ||
205 | |||
206 | if (continuation != null) | ||
207 | continuation(); | ||
208 | } | ||
209 | |||
210 | if (AreThereRootAgents()) | ||
211 | { | ||
212 | lock (m_timer) | ||
213 | { | ||
214 | m_timer.Interval = 1000; // 1 sec | ||
215 | m_timer.Enabled = true; | ||
216 | m_timer.Start(); | ||
217 | } | ||
218 | } | ||
219 | else | ||
220 | lock (m_timer) | ||
221 | m_timer.Enabled = false; | ||
222 | |||
223 | } | ||
224 | |||
225 | #endregion Process Continuation Queue | ||
226 | |||
227 | #region Misc | ||
228 | |||
229 | private bool IsLocalRegionHandle(UUID regionID, out ulong regionHandle) | ||
230 | { | ||
231 | regionHandle = 0; | ||
232 | foreach (Scene s in m_scenes) | ||
233 | if (s.RegionInfo.RegionID == regionID) | ||
234 | { | ||
235 | regionHandle = s.RegionInfo.RegionHandle; | ||
236 | return true; | ||
237 | } | ||
238 | return false; | ||
239 | } | ||
240 | |||
241 | private bool AreThereRootAgents() | ||
242 | { | ||
243 | foreach (Scene s in m_scenes) | ||
244 | { | ||
245 | foreach (ScenePresence sp in s.GetScenePresences()) | ||
246 | if (!sp.IsChildAgent) | ||
247 | return true; | ||
248 | } | ||
249 | |||
250 | return false; | ||
251 | } | ||
252 | |||
253 | #endregion Misc | ||
254 | } | 144 | } |
255 | 145 | ||
256 | } | 146 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 72fff22..5507526 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
206 | } | 206 | } |
207 | 207 | ||
208 | // Not found in cache, queue continuation | 208 | // Not found in cache, queue continuation |
209 | m_ServiceThrottle.Enqueue("name", uuid.ToString(), delegate | 209 | m_ServiceThrottle.Enqueue("uuidname", uuid.ToString(), delegate |
210 | { | 210 | { |
211 | //m_log.DebugFormat("[YYY]: Name request {0}", uuid); | 211 | //m_log.DebugFormat("[YYY]: Name request {0}", uuid); |
212 | 212 | ||
@@ -216,9 +216,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
216 | // So to avoid clients | 216 | // So to avoid clients |
217 | // (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will | 217 | // (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will |
218 | // instead drop the request entirely. | 218 | // instead drop the request entirely. |
219 | if(!client.IsActive) | ||
220 | return; | ||
219 | if (GetUser(uuid, out user)) | 221 | if (GetUser(uuid, out user)) |
220 | { | 222 | { |
221 | client.SendNameReply(uuid, user.FirstName, user.LastName); | 223 | if(client.IsActive) |
224 | client.SendNameReply(uuid, user.FirstName, user.LastName); | ||
222 | } | 225 | } |
223 | // else | 226 | // else |
224 | // m_log.DebugFormat( | 227 | // m_log.DebugFormat( |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs index ad9544a..a827c4c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences | |||
61 | get { return "RemoteAgentPreferencesServicesConnector"; } | 61 | get { return "RemoteAgentPreferencesServicesConnector"; } |
62 | } | 62 | } |
63 | 63 | ||
64 | public override void Initialise(IConfigSource source) | 64 | public new void Initialise(IConfigSource source) |
65 | { | 65 | { |
66 | IConfig moduleConfig = source.Configs["Modules"]; | 66 | IConfig moduleConfig = source.Configs["Modules"]; |
67 | if (moduleConfig != null) | 67 | if (moduleConfig != null) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 11a6d9f..98f1f3b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1801,30 +1801,51 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1801 | { | 1801 | { |
1802 | Hashtable hash = new Hashtable(); | 1802 | Hashtable hash = new Hashtable(); |
1803 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | 1803 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); |
1804 | if (hash.ContainsKey("region_id") && hash.ContainsKey("location")) | 1804 | if (hash.ContainsKey("location")) |
1805 | { | 1805 | { |
1806 | UUID regionID = (UUID)hash["region_id"]; | 1806 | UUID scope = m_scene.RegionInfo.ScopeID; |
1807 | ArrayList list = (ArrayList)hash["location"]; | 1807 | ArrayList list = (ArrayList)hash["location"]; |
1808 | uint x = (uint)(double)list[0]; | 1808 | uint x = (uint)(double)list[0]; |
1809 | uint y = (uint)(double)list[1]; | 1809 | uint y = (uint)(double)list[1]; |
1810 | if (hash.ContainsKey("region_handle")) | 1810 | if(hash.ContainsKey("region_id")) |
1811 | { | ||
1812 | // if you do a "About Landmark" on a landmark a second time, the viewer sends the | ||
1813 | // region_handle it got earlier via RegionHandleRequest | ||
1814 | ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]); | ||
1815 | parcelID = Util.BuildFakeParcelID(regionHandle, x, y); | ||
1816 | } | ||
1817 | else if (regionID == m_scene.RegionInfo.RegionID) | ||
1818 | { | 1811 | { |
1812 | UUID regionID = (UUID)hash["region_id"]; | ||
1813 | if (regionID == m_scene.RegionInfo.RegionID) | ||
1814 | { | ||
1819 | // a parcel request for a local parcel => no need to query the grid | 1815 | // a parcel request for a local parcel => no need to query the grid |
1820 | parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); | 1816 | parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); |
1817 | } | ||
1818 | else | ||
1819 | { | ||
1820 | // a parcel request for a parcel in another region. Ask the grid about the region | ||
1821 | GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID); | ||
1822 | if (info != null) | ||
1823 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | ||
1824 | } | ||
1821 | } | 1825 | } |
1822 | else | 1826 | |
1827 | else if (hash.ContainsKey("region_handle")) | ||
1823 | { | 1828 | { |
1824 | // a parcel request for a parcel in another region. Ask the grid about the region | 1829 | // if you do a "About Landmark" on a landmark a second time, the viewer sends the |
1825 | GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, regionID); | 1830 | // region_handle it got earlier via RegionHandleRequest |
1826 | if (info != null) | 1831 | ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]); |
1827 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | 1832 | if(regionHandle == m_scene.RegionInfo.RegionHandle) |
1833 | parcelID = Util.BuildFakeParcelID(regionHandle, x, y); | ||
1834 | else | ||
1835 | { | ||
1836 | uint wx; | ||
1837 | uint wy; | ||
1838 | Util.RegionHandleToWorldLoc(regionHandle, out wx, out wy); | ||
1839 | wx += x; | ||
1840 | wy += y; | ||
1841 | GridRegion info = m_scene.GridService.GetRegionByPosition(scope, (int)wx, (int)wy); | ||
1842 | if(info != null) | ||
1843 | { | ||
1844 | wx -= (uint)info.RegionLocX; | ||
1845 | wy -= (uint)info.RegionLocY; | ||
1846 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, wx, wy); | ||
1847 | } | ||
1848 | } | ||
1828 | } | 1849 | } |
1829 | } | 1850 | } |
1830 | } | 1851 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c349369..09f0b19 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5454,6 +5454,7 @@ Label_GroupsDone: | |||
5454 | 5454 | ||
5455 | public void CleanTempObjects() | 5455 | public void CleanTempObjects() |
5456 | { | 5456 | { |
5457 | DateTime now = DateTime.UtcNow; | ||
5457 | EntityBase[] entities = GetEntities(); | 5458 | EntityBase[] entities = GetEntities(); |
5458 | foreach (EntityBase obj in entities) | 5459 | foreach (EntityBase obj in entities) |
5459 | { | 5460 | { |
@@ -5465,7 +5466,7 @@ Label_GroupsDone: | |||
5465 | { | 5466 | { |
5466 | if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) | 5467 | if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) |
5467 | { | 5468 | { |
5468 | if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= DateTime.Now) | 5469 | if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= now) |
5469 | DeleteSceneObject(grp, false); | 5470 | DeleteSceneObject(grp, false); |
5470 | } | 5471 | } |
5471 | } | 5472 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e643db7..6cdbac5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -153,9 +153,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
153 | { | 153 | { |
154 | m_scene.SceneGraph.FireChangeBackup(this); | 154 | m_scene.SceneGraph.FireChangeBackup(this); |
155 | } | 155 | } |
156 | timeLastChanged = DateTime.Now.Ticks; | 156 | timeLastChanged = DateTime.UtcNow.Ticks; |
157 | if (!m_hasGroupChanged) | 157 | if (!m_hasGroupChanged) |
158 | timeFirstChanged = DateTime.Now.Ticks; | 158 | timeFirstChanged = DateTime.UtcNow.Ticks; |
159 | if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null) | 159 | if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null) |
160 | { | 160 | { |
161 | /* | 161 | /* |
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
233 | m_minPersistTime = m_scene.m_dontPersistBefore; | 233 | m_minPersistTime = m_scene.m_dontPersistBefore; |
234 | } | 234 | } |
235 | 235 | ||
236 | long currentTime = DateTime.Now.Ticks; | 236 | long currentTime = DateTime.UtcNow.Ticks; |
237 | 237 | ||
238 | if (timeLastChanged == 0) timeLastChanged = currentTime; | 238 | if (timeLastChanged == 0) timeLastChanged = currentTime; |
239 | if (timeFirstChanged == 0) timeFirstChanged = currentTime; | 239 | if (timeFirstChanged == 0) timeFirstChanged = currentTime; |
@@ -4161,6 +4161,180 @@ namespace OpenSim.Region.Framework.Scenes | |||
4161 | 4161 | ||
4162 | } | 4162 | } |
4163 | 4163 | ||
4164 | public bool GroupResize(double fscale) | ||
4165 | { | ||
4166 | // m_log.DebugFormat( | ||
4167 | // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, fscale); | ||
4168 | |||
4169 | if (Scene == null || IsDeleted || inTransit || fscale < 0) | ||
4170 | return false; | ||
4171 | |||
4172 | // ignore lsl restrictions. let them be done a LSL | ||
4173 | PhysicsActor pa = m_rootPart.PhysActor; | ||
4174 | |||
4175 | if(RootPart.KeyframeMotion != null) | ||
4176 | RootPart.KeyframeMotion.Suspend(); | ||
4177 | |||
4178 | float minsize = Scene.m_minNonphys; | ||
4179 | float maxsize = Scene.m_maxNonphys; | ||
4180 | |||
4181 | // assuming physics is more restrictive | ||
4182 | if (pa != null && pa.IsPhysical) | ||
4183 | { | ||
4184 | minsize = Scene.m_minPhys; | ||
4185 | maxsize = Scene.m_maxPhys; | ||
4186 | } | ||
4187 | |||
4188 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
4189 | float tmp; | ||
4190 | // check scaling factor so parts don't violate dimensions | ||
4191 | for(int i = 0; i < parts.Length; i++) | ||
4192 | { | ||
4193 | SceneObjectPart obPart = parts[i]; | ||
4194 | Vector3 oldSize = new Vector3(obPart.Scale); | ||
4195 | tmp = (float)(oldSize.X * fscale); | ||
4196 | if(tmp > maxsize) | ||
4197 | return false; | ||
4198 | if(tmp < minsize) | ||
4199 | return false; | ||
4200 | |||
4201 | tmp = (float)(oldSize.Y * fscale); | ||
4202 | if(tmp > maxsize) | ||
4203 | return false; | ||
4204 | if(tmp < minsize) | ||
4205 | return false; | ||
4206 | |||
4207 | tmp = (float)(oldSize.Z * fscale); | ||
4208 | if(tmp > maxsize) | ||
4209 | return false; | ||
4210 | if(tmp < minsize) | ||
4211 | return false; | ||
4212 | } | ||
4213 | |||
4214 | Vector3 newSize = RootPart.Scale; | ||
4215 | newSize.X = (float)(newSize.X * fscale); | ||
4216 | newSize.Y = (float)(newSize.Y * fscale); | ||
4217 | newSize.Z = (float)(newSize.Z * fscale); | ||
4218 | |||
4219 | if(pa != null) | ||
4220 | pa.Building = true; | ||
4221 | |||
4222 | RootPart.Scale = newSize; | ||
4223 | |||
4224 | Vector3 currentpos; | ||
4225 | for (int i = 0; i < parts.Length; i++) | ||
4226 | { | ||
4227 | SceneObjectPart obPart = parts[i]; | ||
4228 | |||
4229 | if (obPart.UUID != m_rootPart.UUID) | ||
4230 | { | ||
4231 | currentpos = obPart.OffsetPosition; | ||
4232 | currentpos.X = (float)(currentpos.X * fscale); | ||
4233 | currentpos.Y = (float)(currentpos.Y * fscale); | ||
4234 | currentpos.Z = (float)(currentpos.Z * fscale); | ||
4235 | |||
4236 | newSize = obPart.Scale; | ||
4237 | newSize.X = (float)(newSize.X * fscale); | ||
4238 | newSize.Y = (float)(newSize.Y * fscale); | ||
4239 | newSize.Z = (float)(newSize.Z * fscale); | ||
4240 | |||
4241 | obPart.Scale = newSize; | ||
4242 | obPart.UpdateOffSet(currentpos); | ||
4243 | } | ||
4244 | } | ||
4245 | |||
4246 | if(pa != null) | ||
4247 | pa.Building = false; | ||
4248 | |||
4249 | InvalidBoundsRadius(); | ||
4250 | |||
4251 | HasGroupChanged = true; | ||
4252 | m_rootPart.TriggerScriptChangedEvent(Changed.SCALE); | ||
4253 | ScheduleGroupForFullUpdate(); | ||
4254 | |||
4255 | if(RootPart.KeyframeMotion != null) | ||
4256 | RootPart.KeyframeMotion.Resume(); | ||
4257 | |||
4258 | return true; | ||
4259 | } | ||
4260 | |||
4261 | public float GetMaxGroupResizeScale() | ||
4262 | { | ||
4263 | if (Scene == null || IsDeleted || inTransit) | ||
4264 | return 1.0f; | ||
4265 | |||
4266 | float maxsize = Scene.m_maxNonphys; | ||
4267 | PhysicsActor pa = m_rootPart.PhysActor; | ||
4268 | // assuming physics is more restrictive | ||
4269 | if (pa != null && pa.IsPhysical) | ||
4270 | maxsize = Scene.m_maxPhys; | ||
4271 | |||
4272 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
4273 | float larger = float.MinValue; | ||
4274 | |||
4275 | for(int i = 0; i < parts.Length; i++) | ||
4276 | { | ||
4277 | SceneObjectPart obPart = parts[i]; | ||
4278 | Vector3 oldSize = new Vector3(obPart.Scale); | ||
4279 | if(larger < oldSize.X) | ||
4280 | larger = oldSize.X; | ||
4281 | |||
4282 | if(larger < oldSize.Y) | ||
4283 | larger = oldSize.Y; | ||
4284 | |||
4285 | if(larger < oldSize.Z) | ||
4286 | larger = oldSize.Z; | ||
4287 | } | ||
4288 | |||
4289 | if(larger >= maxsize) | ||
4290 | return 1.0f; | ||
4291 | |||
4292 | larger += 1e-3f; | ||
4293 | float fscale = maxsize / larger; | ||
4294 | |||
4295 | return fscale; | ||
4296 | } | ||
4297 | |||
4298 | public float GetMinGroupResizeScale() | ||
4299 | { | ||
4300 | if (Scene == null || IsDeleted || inTransit) | ||
4301 | return 1.0f; | ||
4302 | |||
4303 | float minsize = Scene.m_minNonphys; | ||
4304 | PhysicsActor pa = m_rootPart.PhysActor; | ||
4305 | // assuming physics is more restrictive | ||
4306 | if (pa != null && pa.IsPhysical) | ||
4307 | minsize = Scene.m_minPhys; | ||
4308 | |||
4309 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
4310 | float smaller = float.MaxValue; | ||
4311 | |||
4312 | for(int i = 0; i < parts.Length; i++) | ||
4313 | { | ||
4314 | SceneObjectPart obPart = parts[i]; | ||
4315 | Vector3 oldSize = new Vector3(obPart.Scale); | ||
4316 | if(smaller > oldSize.X) | ||
4317 | smaller = oldSize.X; | ||
4318 | |||
4319 | if(smaller > oldSize.Y) | ||
4320 | smaller = oldSize.Y; | ||
4321 | |||
4322 | if(smaller > oldSize.Z) | ||
4323 | smaller = oldSize.Z; | ||
4324 | } | ||
4325 | |||
4326 | if(smaller <= minsize) | ||
4327 | return 1.0f; | ||
4328 | |||
4329 | if(smaller > 2e-3f) | ||
4330 | smaller -= 1e-3f; | ||
4331 | float fscale = minsize / smaller; | ||
4332 | if(fscale < 1e-8f) | ||
4333 | fscale = 1e-8f; | ||
4334 | |||
4335 | return fscale; | ||
4336 | } | ||
4337 | |||
4164 | #endregion | 4338 | #endregion |
4165 | 4339 | ||
4166 | #region Position | 4340 | #region Position |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9d1dca2..3a06e7d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -185,8 +185,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
185 | return | 185 | return |
186 | !(SitTargetPosition == Vector3.Zero | 186 | !(SitTargetPosition == Vector3.Zero |
187 | && (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion | 187 | && (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion |
188 | || SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 1f && SitTargetOrientation.W == 0f // W-Z Mapping was invalid at one point | 188 | || (SitTargetOrientation.W == 0f && SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f ))); // Invalid Quaternion |
189 | || SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f && SitTargetOrientation.W == 0f)); // Invalid Quaternion | ||
190 | } | 189 | } |
191 | } | 190 | } |
192 | 191 | ||
@@ -1909,7 +1908,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1909 | 1908 | ||
1910 | public void ResetExpire() | 1909 | public void ResetExpire() |
1911 | { | 1910 | { |
1912 | Expires = DateTime.Now + new TimeSpan(600000000); | 1911 | Expires = DateTime.UtcNow + new TimeSpan(600000000); |
1913 | } | 1912 | } |
1914 | 1913 | ||
1915 | public void AddFlag(PrimFlags flag) | 1914 | public void AddFlag(PrimFlags flag) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2cfdd94..2cf0e9d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2043,6 +2043,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2043 | look = new Vector3(0.99f, 0.042f, 0); | 2043 | look = new Vector3(0.99f, 0.042f, 0); |
2044 | } | 2044 | } |
2045 | 2045 | ||
2046 | // Check Default Location (Also See EntityTransferModule.TeleportAgentWithinRegion) | ||
2047 | if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f) | ||
2048 | AbsolutePosition = Scene.RegionInfo.DefaultLandingPoint; | ||
2049 | |||
2046 | if (!MakeRootAgent(AbsolutePosition, flying, ref look)) | 2050 | if (!MakeRootAgent(AbsolutePosition, flying, ref look)) |
2047 | { | 2051 | { |
2048 | m_log.DebugFormat( | 2052 | m_log.DebugFormat( |
@@ -2071,14 +2075,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2071 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2075 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2072 | } | 2076 | } |
2073 | 2077 | ||
2074 | if(!gotCrossUpdate) | ||
2075 | RotateToLookAt(look); | ||
2076 | 2078 | ||
2077 | // Tell the client that we're totally ready | 2079 | // Tell the client that we're totally ready |
2078 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 2080 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
2079 | 2081 | ||
2080 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2082 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2081 | 2083 | ||
2084 | |||
2082 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2085 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2083 | { | 2086 | { |
2084 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2087 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
@@ -2107,12 +2110,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2107 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | 2110 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); |
2108 | // } | 2111 | // } |
2109 | 2112 | ||
2113 | |||
2110 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2114 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2111 | 2115 | ||
2116 | |||
2117 | if(m_teleportFlags > 0) //sanity check | ||
2118 | gotCrossUpdate = false; | ||
2119 | |||
2120 | if(!gotCrossUpdate) | ||
2121 | RotateToLookAt(look); | ||
2122 | |||
2123 | |||
2112 | // start sending terrain patchs | 2124 | // start sending terrain patchs |
2113 | if (!gotCrossUpdate && !isNPC) | 2125 | if (!gotCrossUpdate && !isNPC) |
2114 | Scene.SendLayerData(ControllingClient); | 2126 | Scene.SendLayerData(ControllingClient); |
2115 | 2127 | ||
2128 | // HG delay | ||
2129 | if((m_teleportFlags & TeleportFlags.ViaHGLogin) != 0) | ||
2130 | { | ||
2131 | Thread.Sleep(500); | ||
2132 | m_log.DebugFormat("[CompleteMovement] HG delay: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2133 | } | ||
2134 | |||
2116 | m_previusParcelHide = false; | 2135 | m_previusParcelHide = false; |
2117 | m_previusParcelUUID = UUID.Zero; | 2136 | m_previusParcelUUID = UUID.Zero; |
2118 | m_currentParcelHide = false; | 2137 | m_currentParcelHide = false; |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index 3c03130..01bc491 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -265,6 +265,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
265 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 265 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
266 | { | 266 | { |
267 | SceneObjectGroup obj = DeserializeGroupFromXml2(aPrimNode.OuterXml); | 267 | SceneObjectGroup obj = DeserializeGroupFromXml2(aPrimNode.OuterXml); |
268 | scene.AddNewSceneObject(obj, true); | ||
268 | if (startScripts) | 269 | if (startScripts) |
269 | sceneObjects.Add(obj); | 270 | sceneObjects.Add(obj); |
270 | } | 271 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index c48e585..6c147f4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | |||
@@ -53,15 +53,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
53 | { | 53 | { |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private const int DEBUG_CHANNEL = 2147483647; | 56 | // private const int DEBUG_CHANNEL = 2147483647; use base value |
57 | 57 | ||
58 | private List<IScene> m_scenes = new List<IScene>(); | 58 | private new List<IScene> m_scenes = new List<IScene>(); |
59 | private List<IScene> m_conciergedScenes = new List<IScene>(); | 59 | private List<IScene> m_conciergedScenes = new List<IScene>(); |
60 | 60 | ||
61 | private bool m_replacingChatModule = false; | 61 | private bool m_replacingChatModule = false; |
62 | 62 | ||
63 | private IConfig m_config; | ||
64 | |||
65 | private string m_whoami = "conferencier"; | 63 | private string m_whoami = "conferencier"; |
66 | private Regex m_regions = null; | 64 | private Regex m_regions = null; |
67 | private string m_welcomes = null; | 65 | private string m_welcomes = null; |
@@ -72,29 +70,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
72 | private string m_brokerURI = String.Empty; | 70 | private string m_brokerURI = String.Empty; |
73 | private int m_brokerUpdateTimeout = 300; | 71 | private int m_brokerUpdateTimeout = 300; |
74 | 72 | ||
75 | internal object m_syncy = new object(); | 73 | internal new object m_syncy = new object(); |
76 | 74 | ||
77 | internal bool m_enabled = false; | 75 | internal new bool m_enabled = false; |
78 | 76 | ||
79 | #region ISharedRegionModule Members | 77 | #region ISharedRegionModule Members |
80 | public override void Initialise(IConfigSource config) | 78 | public override void Initialise(IConfigSource configSource) |
81 | { | 79 | { |
82 | m_config = config.Configs["Concierge"]; | 80 | IConfig config = configSource.Configs["Concierge"]; |
83 | 81 | ||
84 | if (null == m_config) | 82 | if (config == null) |
85 | return; | 83 | return; |
86 | 84 | ||
87 | if (!m_config.GetBoolean("enabled", false)) | 85 | if (!config.GetBoolean("enabled", false)) |
88 | return; | 86 | return; |
89 | 87 | ||
90 | m_enabled = true; | 88 | m_enabled = true; |
91 | 89 | ||
92 | |||
93 | // check whether ChatModule has been disabled: if yes, | 90 | // check whether ChatModule has been disabled: if yes, |
94 | // then we'll "stand in" | 91 | // then we'll "stand in" |
95 | try | 92 | try |
96 | { | 93 | { |
97 | if (config.Configs["Chat"] == null) | 94 | if (configSource.Configs["Chat"] == null) |
98 | { | 95 | { |
99 | // if Chat module has not been configured it's | 96 | // if Chat module has not been configured it's |
100 | // enabled by default, so we are not going to | 97 | // enabled by default, so we are not going to |
@@ -103,7 +100,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
103 | } | 100 | } |
104 | else | 101 | else |
105 | { | 102 | { |
106 | m_replacingChatModule = !config.Configs["Chat"].GetBoolean("enabled", true); | 103 | m_replacingChatModule = !configSource.Configs["Chat"].GetBoolean("enabled", true); |
107 | } | 104 | } |
108 | } | 105 | } |
109 | catch (Exception) | 106 | catch (Exception) |
@@ -114,21 +111,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
114 | m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing"); | 111 | m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing"); |
115 | 112 | ||
116 | // take note of concierge channel and of identity | 113 | // take note of concierge channel and of identity |
117 | m_conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel); | 114 | m_conciergeChannel = configSource.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel); |
118 | m_whoami = m_config.GetString("whoami", "conferencier"); | 115 | m_whoami = config.GetString("whoami", "conferencier"); |
119 | m_welcomes = m_config.GetString("welcomes", m_welcomes); | 116 | m_welcomes = config.GetString("welcomes", m_welcomes); |
120 | m_announceEntering = m_config.GetString("announce_entering", m_announceEntering); | 117 | m_announceEntering = config.GetString("announce_entering", m_announceEntering); |
121 | m_announceLeaving = m_config.GetString("announce_leaving", m_announceLeaving); | 118 | m_announceLeaving = config.GetString("announce_leaving", m_announceLeaving); |
122 | m_xmlRpcPassword = m_config.GetString("password", m_xmlRpcPassword); | 119 | m_xmlRpcPassword = config.GetString("password", m_xmlRpcPassword); |
123 | m_brokerURI = m_config.GetString("broker", m_brokerURI); | 120 | m_brokerURI = config.GetString("broker", m_brokerURI); |
124 | m_brokerUpdateTimeout = m_config.GetInt("broker_timeout", m_brokerUpdateTimeout); | 121 | m_brokerUpdateTimeout = config.GetInt("broker_timeout", m_brokerUpdateTimeout); |
125 | 122 | ||
126 | m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami); | 123 | m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami); |
127 | 124 | ||
128 | // calculate regions Regex | 125 | // calculate regions Regex |
129 | if (m_regions == null) | 126 | if (m_regions == null) |
130 | { | 127 | { |
131 | string regions = m_config.GetString("regions", String.Empty); | 128 | string regions = config.GetString("regions", String.Empty); |
132 | if (!String.IsNullOrEmpty(regions)) | 129 | if (!String.IsNullOrEmpty(regions)) |
133 | { | 130 | { |
134 | m_regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase); | 131 | m_regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase); |
@@ -136,7 +133,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
136 | } | 133 | } |
137 | } | 134 | } |
138 | 135 | ||
139 | |||
140 | public override void AddRegion(Scene scene) | 136 | public override void AddRegion(Scene scene) |
141 | { | 137 | { |
142 | if (!m_enabled) return; | 138 | if (!m_enabled) return; |
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 006b730..7312bc3 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | |||
@@ -532,7 +532,7 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
532 | 532 | ||
533 | lock(m_Materials) | 533 | lock(m_Materials) |
534 | { | 534 | { |
535 | if(oldid != UUID.Zero) | 535 | if(oldid != UUID.Zero && m_MaterialsRefCount.ContainsKey(oldid)) |
536 | { | 536 | { |
537 | m_MaterialsRefCount[oldid]--; | 537 | m_MaterialsRefCount[oldid]--; |
538 | if(m_MaterialsRefCount[oldid] <= 0) | 538 | if(m_MaterialsRefCount[oldid] <= 0) |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index 60b24ec..a50905b 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |||
@@ -2969,6 +2969,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2969 | 2969 | ||
2970 | private void changePhysRepData(ODEPhysRepData repData) | 2970 | private void changePhysRepData(ODEPhysRepData repData) |
2971 | { | 2971 | { |
2972 | if(_size == repData.size && | ||
2973 | _pbs == repData.pbs && | ||
2974 | m_shapetype == repData.shapetype && | ||
2975 | m_mesh == repData.mesh && | ||
2976 | primVolume == repData.volume) | ||
2977 | return; | ||
2978 | |||
2972 | CheckDelaySelect(); | 2979 | CheckDelaySelect(); |
2973 | 2980 | ||
2974 | OdePrim parent = (OdePrim)_parent; | 2981 | OdePrim parent = (OdePrim)_parent; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index af04951..849d02d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1803,6 +1803,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1803 | return 0; | 1803 | return 0; |
1804 | } | 1804 | } |
1805 | 1805 | ||
1806 | public LSL_Integer llScaleByFactor(double scaling_factor) | ||
1807 | { | ||
1808 | m_host.AddScriptLPS(1); | ||
1809 | SceneObjectGroup group = m_host.ParentGroup; | ||
1810 | |||
1811 | if(scaling_factor < 1e-6) | ||
1812 | return ScriptBaseClass.FALSE; | ||
1813 | if(scaling_factor > 1e6) | ||
1814 | return ScriptBaseClass.FALSE; | ||
1815 | |||
1816 | if (group == null || group.IsDeleted || group.inTransit) | ||
1817 | return ScriptBaseClass.FALSE; | ||
1818 | |||
1819 | if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical) | ||
1820 | return ScriptBaseClass.FALSE; | ||
1821 | |||
1822 | if (group.RootPart.KeyframeMotion != null) | ||
1823 | return ScriptBaseClass.FALSE; | ||
1824 | |||
1825 | if(group.GroupResize(scaling_factor)) | ||
1826 | return ScriptBaseClass.TRUE; | ||
1827 | else | ||
1828 | return ScriptBaseClass.FALSE; | ||
1829 | } | ||
1830 | |||
1831 | public LSL_Float llGetMaxScaleFactor() | ||
1832 | { | ||
1833 | m_host.AddScriptLPS(1); | ||
1834 | SceneObjectGroup group = m_host.ParentGroup; | ||
1835 | |||
1836 | if (group == null || group.IsDeleted || group.inTransit) | ||
1837 | return 1.0f; | ||
1838 | |||
1839 | return (LSL_Float)group.GetMaxGroupResizeScale(); | ||
1840 | } | ||
1841 | |||
1842 | public LSL_Float llGetMinScaleFactor() | ||
1843 | { | ||
1844 | m_host.AddScriptLPS(1); | ||
1845 | SceneObjectGroup group = m_host.ParentGroup; | ||
1846 | |||
1847 | if (group == null || group.IsDeleted || group.inTransit) | ||
1848 | return 1.0f; | ||
1849 | |||
1850 | return (LSL_Float)group.GetMinGroupResizeScale(); | ||
1851 | } | ||
1852 | |||
1806 | public void llSetScale(LSL_Vector scale) | 1853 | public void llSetScale(LSL_Vector scale) |
1807 | { | 1854 | { |
1808 | m_host.AddScriptLPS(1); | 1855 | m_host.AddScriptLPS(1); |
@@ -3049,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3049 | { | 3096 | { |
3050 | m_host.AddScriptLPS(1); | 3097 | m_host.AddScriptLPS(1); |
3051 | double ScriptTime = Util.GetTimeStampMS() - m_timer; | 3098 | double ScriptTime = Util.GetTimeStampMS() - m_timer; |
3052 | return (ScriptTime / 1000.0); | 3099 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3053 | } | 3100 | } |
3054 | 3101 | ||
3055 | public void llResetTime() | 3102 | public void llResetTime() |
@@ -3064,7 +3111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3064 | double now = Util.GetTimeStampMS(); | 3111 | double now = Util.GetTimeStampMS(); |
3065 | double ScriptTime = now - m_timer; | 3112 | double ScriptTime = now - m_timer; |
3066 | m_timer = now; | 3113 | m_timer = now; |
3067 | return (ScriptTime / 1000.0); | 3114 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3068 | } | 3115 | } |
3069 | 3116 | ||
3070 | public void llSound(string sound, double volume, int queue, int loop) | 3117 | public void llSound(string sound, double volume, int queue, int loop) |
@@ -3482,13 +3529,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3482 | 3529 | ||
3483 | if (item == null) | 3530 | if (item == null) |
3484 | { | 3531 | { |
3485 | Error("llRezAtRoot", "Can't find object '" + inventory + "'"); | 3532 | Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); |
3486 | return; | 3533 | return; |
3487 | } | 3534 | } |
3488 | 3535 | ||
3489 | if (item.InvType != (int)InventoryType.Object) | 3536 | if (item.InvType != (int)InventoryType.Object) |
3490 | { | 3537 | { |
3491 | Error("llRezAtRoot", "Can't create requested object; object is missing from database"); | 3538 | Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); |
3492 | return; | 3539 | return; |
3493 | } | 3540 | } |
3494 | 3541 | ||
@@ -3532,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3532 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | 3579 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) |
3533 | } | 3580 | } |
3534 | 3581 | ||
3535 | }, null, "LSL_Api.llRezAtRoot"); | 3582 | }, null, "LSL_Api.doObjectRez"); |
3536 | 3583 | ||
3537 | //ScriptSleep((int)((groupmass * velmag) / 10)); | 3584 | //ScriptSleep((int)((groupmass * velmag) / 10)); |
3538 | ScriptSleep(m_sleepMsOnRezAtRoot); | 3585 | ScriptSleep(m_sleepMsOnRezAtRoot); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 57bff6e..a21a0ca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1938,8 +1938,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1938 | taskItem.ResetIDs(m_host.UUID); | 1938 | taskItem.ResetIDs(m_host.UUID); |
1939 | taskItem.ParentID = m_host.UUID; | 1939 | taskItem.ParentID = m_host.UUID; |
1940 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); | 1940 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); |
1941 | taskItem.Name = asset.Name; | 1941 | taskItem.Name = name; |
1942 | taskItem.Description = asset.Description; | 1942 | taskItem.Description = description; |
1943 | taskItem.Type = (int)AssetType.Notecard; | 1943 | taskItem.Type = (int)AssetType.Notecard; |
1944 | taskItem.InvType = (int)InventoryType.Notecard; | 1944 | taskItem.InvType = (int)InventoryType.Notecard; |
1945 | taskItem.OwnerID = m_host.OwnerID; | 1945 | taskItem.OwnerID = m_host.OwnerID; |
@@ -3354,8 +3354,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3354 | m_host.AddScriptLPS(1); | 3354 | m_host.AddScriptLPS(1); |
3355 | 3355 | ||
3356 | Scene scene = m_ScriptEngine.World; | 3356 | Scene scene = m_ScriptEngine.World; |
3357 | GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID); | 3357 | RegionInfo reg = World.RegionInfo; |
3358 | return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight); | 3358 | // GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID); |
3359 | // return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight); | ||
3360 | return new LSL_Vector((float)reg.RegionSizeX, (float)reg.RegionSizeY, 0.0f); | ||
3359 | } | 3361 | } |
3360 | 3362 | ||
3361 | public int osGetSimulatorMemory() | 3363 | public int osGetSimulatorMemory() |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 3d1482d..cc52403 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -326,6 +326,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
326 | LSL_Integer llRound(double f); | 326 | LSL_Integer llRound(double f); |
327 | LSL_Integer llSameGroup(string agent); | 327 | LSL_Integer llSameGroup(string agent); |
328 | void llSay(int channelID, string text); | 328 | void llSay(int channelID, string text); |
329 | LSL_Integer llScaleByFactor(double scaling_factor); | ||
330 | LSL_Float llGetMaxScaleFactor(); | ||
331 | LSL_Float llGetMinScaleFactor(); | ||
329 | void llScaleTexture(double u, double v, int face); | 332 | void llScaleTexture(double u, double v, int face); |
330 | LSL_Integer llScriptDanger(LSL_Vector pos); | 333 | LSL_Integer llScriptDanger(LSL_Vector pos); |
331 | void llScriptProfiler(LSL_Integer flag); | 334 | void llScriptProfiler(LSL_Integer flag); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 2769712..9d36341 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1465,6 +1465,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1465 | m_LSL_Functions.llSay(channelID, text); | 1465 | m_LSL_Functions.llSay(channelID, text); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | public LSL_Integer llScaleByFactor(double scaling_factor) | ||
1469 | { | ||
1470 | return m_LSL_Functions.llScaleByFactor(scaling_factor); | ||
1471 | } | ||
1472 | |||
1473 | public LSL_Float llGetMaxScaleFactor() | ||
1474 | { | ||
1475 | return m_LSL_Functions.llGetMaxScaleFactor(); | ||
1476 | } | ||
1477 | |||
1478 | public LSL_Float llGetMinScaleFactor() | ||
1479 | { | ||
1480 | return m_LSL_Functions.llGetMinScaleFactor(); | ||
1481 | } | ||
1482 | |||
1468 | public void llScaleTexture(double u, double v, int face) | 1483 | public void llScaleTexture(double u, double v, int face) |
1469 | { | 1484 | { |
1470 | m_LSL_Functions.llScaleTexture(u, v, face); | 1485 | m_LSL_Functions.llScaleTexture(u, v, face); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index d725907..7129c8a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
880 | try | 880 | try |
881 | { | 881 | { |
882 | m_CurrentEvent = data.EventName; | 882 | m_CurrentEvent = data.EventName; |
883 | m_EventStart = DateTime.Now; | 883 | m_EventStart = DateTime.UtcNow; |
884 | m_InEvent = true; | 884 | m_InEvent = true; |
885 | 885 | ||
886 | try | 886 | try |
@@ -1033,7 +1033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1033 | if (!m_InEvent) | 1033 | if (!m_InEvent) |
1034 | return 0; | 1034 | return 0; |
1035 | 1035 | ||
1036 | return (DateTime.Now - m_EventStart).Seconds; | 1036 | return (DateTime.UtcNow - m_EventStart).Seconds; |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | public void ResetScript(int timeout) | 1039 | public void ResetScript(int timeout) |