diff options
Diffstat (limited to 'OpenSim')
46 files changed, 602 insertions, 754 deletions
diff --git a/OpenSim/Data/Tests/BasicEstateTest.cs b/OpenSim/Data/Tests/BasicEstateTest.cs index d8e1725..907bb38 100644 --- a/OpenSim/Data/Tests/BasicEstateTest.cs +++ b/OpenSim/Data/Tests/BasicEstateTest.cs | |||
@@ -154,13 +154,14 @@ namespace OpenSim.Data.Tests | |||
154 | ); | 154 | ); |
155 | } | 155 | } |
156 | 156 | ||
157 | //[Test] | 157 | [Test] |
158 | // Currently fails occasionally | ||
159 | public void T012_EstateSettingsRandomStorage() | 158 | public void T012_EstateSettingsRandomStorage() |
160 | { | 159 | { |
161 | // Letting estate store generate rows to database for us | 160 | // Letting estate store generate rows to database for us |
162 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID); | 161 | EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID); |
163 | new PropertyScrambler<EstateSettings>().Scramble(originalSettings); | 162 | new PropertyScrambler<EstateSettings>() |
163 | .DontScramble(x=>x.EstateID) | ||
164 | .Scramble(originalSettings); | ||
164 | 165 | ||
165 | // Saving settings. | 166 | // Saving settings. |
166 | db.StoreEstateSettings(originalSettings); | 167 | db.StoreEstateSettings(originalSettings); |
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs index 307c6bc..cd59c63 100644 --- a/OpenSim/Framework/IRegionCommsListener.cs +++ b/OpenSim/Framework/IRegionCommsListener.cs | |||
@@ -32,7 +32,6 @@ namespace OpenSim.Framework | |||
32 | { | 32 | { |
33 | public delegate void ExpectUserDelegate(AgentCircuitData agent); | 33 | public delegate void ExpectUserDelegate(AgentCircuitData agent); |
34 | 34 | ||
35 | public delegate bool ExpectPrimDelegate(UUID primID, string objData, int XMLMethod); | ||
36 | 35 | ||
37 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | 36 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); |
38 | 37 | ||
@@ -55,7 +54,6 @@ namespace OpenSim.Framework | |||
55 | public interface IRegionCommsListener | 54 | public interface IRegionCommsListener |
56 | { | 55 | { |
57 | event ExpectUserDelegate OnExpectUser; | 56 | event ExpectUserDelegate OnExpectUser; |
58 | event ExpectPrimDelegate OnExpectPrim; | ||
59 | event GenericCall2 OnExpectChildAgent; | 57 | event GenericCall2 OnExpectChildAgent; |
60 | event AgentCrossing OnAvatarCrossingIntoRegion; | 58 | event AgentCrossing OnAvatarCrossingIntoRegion; |
61 | event PrimCrossing OnPrimCrossingIntoRegion; | 59 | event PrimCrossing OnPrimCrossingIntoRegion; |
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs index 4fc3e01..5147901 100644 --- a/OpenSim/Framework/ISceneObject.cs +++ b/OpenSim/Framework/ISceneObject.cs | |||
@@ -38,6 +38,6 @@ namespace OpenSim.Framework | |||
38 | string ExtraToXmlString(); | 38 | string ExtraToXmlString(); |
39 | void ExtraFromXmlString(string xmlstr); | 39 | void ExtraFromXmlString(string xmlstr); |
40 | string GetStateSnapshot(); | 40 | string GetStateSnapshot(); |
41 | void SetState(string xmlstr, UUID regionID); | 41 | void SetState(string xmlstr, IScene s); |
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 90200d6..718a556 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs | |||
@@ -43,7 +43,6 @@ namespace OpenSim.Framework | |||
43 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; | 43 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; |
44 | private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; | 44 | private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; |
45 | private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent; | 45 | private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent; |
46 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | ||
47 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser | 46 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser |
48 | private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; | 47 | private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; |
49 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; | 48 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; |
@@ -53,7 +52,6 @@ namespace OpenSim.Framework | |||
53 | #region IRegionCommsListener Members | 52 | #region IRegionCommsListener Members |
54 | 53 | ||
55 | public event ExpectUserDelegate OnExpectUser; | 54 | public event ExpectUserDelegate OnExpectUser; |
56 | public event ExpectPrimDelegate OnExpectPrim; | ||
57 | public event GenericCall2 OnExpectChildAgent; | 55 | public event GenericCall2 OnExpectChildAgent; |
58 | public event AgentCrossing OnAvatarCrossingIntoRegion; | 56 | public event AgentCrossing OnAvatarCrossingIntoRegion; |
59 | public event PrimCrossing OnPrimCrossingIntoRegion; | 57 | public event PrimCrossing OnPrimCrossingIntoRegion; |
@@ -95,17 +93,6 @@ namespace OpenSim.Framework | |||
95 | 93 | ||
96 | } | 94 | } |
97 | 95 | ||
98 | public virtual bool TriggerExpectPrim(UUID primID, string objData, int XMLMethod) | ||
99 | { | ||
100 | handlerExpectPrim = OnExpectPrim; | ||
101 | if (handlerExpectPrim != null) | ||
102 | { | ||
103 | handlerExpectPrim(primID, objData, XMLMethod); | ||
104 | return true; | ||
105 | } | ||
106 | return false; | ||
107 | } | ||
108 | |||
109 | public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData) | 96 | public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData) |
110 | { | 97 | { |
111 | handlerChildAgentUpdate = OnChildAgentUpdate; | 98 | handlerChildAgentUpdate = OnChildAgentUpdate; |
@@ -128,18 +115,6 @@ namespace OpenSim.Framework | |||
128 | return false; | 115 | return false; |
129 | } | 116 | } |
130 | 117 | ||
131 | public virtual bool TriggerExpectPrimCrossing(UUID primID, Vector3 position, | ||
132 | bool isPhysical) | ||
133 | { | ||
134 | handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; | ||
135 | if (handlerPrimCrossingIntoRegion != null) | ||
136 | { | ||
137 | handlerPrimCrossingIntoRegion(primID, position, isPhysical); | ||
138 | return true; | ||
139 | } | ||
140 | return false; | ||
141 | } | ||
142 | |||
143 | public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID) | 118 | public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID) |
144 | { | 119 | { |
145 | handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed; | 120 | handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed; |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 0d93ff7..655df9d 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -442,7 +442,7 @@ namespace OpenSim.Framework.Servers | |||
442 | if (File.Exists(gitCommitFileName)) | 442 | if (File.Exists(gitCommitFileName)) |
443 | { | 443 | { |
444 | StreamReader CommitFile = File.OpenText(gitCommitFileName); | 444 | StreamReader CommitFile = File.OpenText(gitCommitFileName); |
445 | buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine(); | 445 | buildVersion = CommitFile.ReadLine(); |
446 | CommitFile.Close(); | 446 | CommitFile.Close(); |
447 | m_version += buildVersion ?? ""; | 447 | m_version += buildVersion ?? ""; |
448 | } | 448 | } |
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 9f98310..ec94b2d 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.8"; | 32 | private const string VERSION_NUMBER = "0.6.9"; |
33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; | 33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; |
34 | 34 | ||
35 | public enum Flavour | 35 | public enum Flavour |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 87ba5a8..a459f8d 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1389,6 +1389,30 @@ namespace OpenSim.Framework | |||
1389 | return null; | 1389 | return null; |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | #endregion FireAndForget Threading Pattern | 1392 | #endregion FireAndForget Threading Pattern |
1393 | /// <summary> | ||
1394 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
1395 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap | ||
1396 | /// for the callers. | ||
1397 | /// This trims it to a 12 day interval so don't let your frame time get too long. | ||
1398 | /// </summary> | ||
1399 | /// <returns></returns> | ||
1400 | public static Int32 EnvironmentTickCount() | ||
1401 | { | ||
1402 | return Environment.TickCount & EnvironmentTickCountMask; | ||
1403 | } | ||
1404 | const Int32 EnvironmentTickCountMask = 0x3fffffff; | ||
1405 | |||
1406 | /// <summary> | ||
1407 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
1408 | /// and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
1409 | /// 'EnvironmentTickCount()') and accounts for any wrapping. | ||
1410 | /// </summary> | ||
1411 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
1412 | public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) | ||
1413 | { | ||
1414 | Int32 diff = EnvironmentTickCount() - prevValue; | ||
1415 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); | ||
1416 | } | ||
1393 | } | 1417 | } |
1394 | } | 1418 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4221212..c2aa8e2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -13610,7 +13610,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
13610 | if (handlerGodKickUser != null) | 13610 | if (handlerGodKickUser != null) |
13611 | { | 13611 | { |
13612 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, | 13612 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, |
13613 | gkupack.UserInfo.AgentID, (uint)0, gkupack.UserInfo.Reason); | 13613 | gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); |
13614 | } | 13614 | } |
13615 | } | 13615 | } |
13616 | else | 13616 | else |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index 9856a1c..1e5f15a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Threading; | ||
31 | using log4net; | 32 | using log4net; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
@@ -429,7 +430,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
429 | // Send the packet | 430 | // Send the packet |
430 | m_udpServer.SendPacketFinal(nextPacket); | 431 | m_udpServer.SendPacketFinal(nextPacket); |
431 | m_nextPackets[i] = null; | 432 | m_nextPackets[i] = null; |
432 | packetSent = true; | 433 | packetSent = true; |
434 | this.PacketsSent++; | ||
433 | } | 435 | } |
434 | } | 436 | } |
435 | else | 437 | else |
@@ -446,6 +448,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
446 | // Send the packet | 448 | // Send the packet |
447 | m_udpServer.SendPacketFinal(packet); | 449 | m_udpServer.SendPacketFinal(packet); |
448 | packetSent = true; | 450 | packetSent = true; |
451 | this.PacketsSent++; | ||
449 | } | 452 | } |
450 | else | 453 | else |
451 | { | 454 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index c773c05..338f2bb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -138,6 +138,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
138 | /// whether or not to sleep</summary> | 138 | /// whether or not to sleep</summary> |
139 | private bool m_packetSent; | 139 | private bool m_packetSent; |
140 | 140 | ||
141 | /// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary> | ||
142 | private int m_elapsedMSSinceLastStatReport = 0; | ||
141 | /// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary> | 143 | /// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary> |
142 | private int m_tickLastOutgoingPacketHandler; | 144 | private int m_tickLastOutgoingPacketHandler; |
143 | /// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary> | 145 | /// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary> |
@@ -246,6 +248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
246 | // Start the packet processing threads | 248 | // Start the packet processing threads |
247 | Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); | 249 | Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); |
248 | Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); | 250 | Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); |
251 | m_elapsedMSSinceLastStatReport = Environment.TickCount; | ||
249 | } | 252 | } |
250 | 253 | ||
251 | public new void Stop() | 254 | public new void Stop() |
@@ -716,6 +719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
716 | // We don't need to do anything else with ping checks | 719 | // We don't need to do anything else with ping checks |
717 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; | 720 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; |
718 | CompletePing(udpClient, startPing.PingID.PingID); | 721 | CompletePing(udpClient, startPing.PingID.PingID); |
722 | |||
723 | if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000) | ||
724 | { | ||
725 | udpClient.SendPacketStats(); | ||
726 | m_elapsedMSSinceLastStatReport = Environment.TickCount; | ||
727 | } | ||
719 | return; | 728 | return; |
720 | } | 729 | } |
721 | else if (packet.Type == PacketType.CompletePingCheck) | 730 | else if (packet.Type == PacketType.CompletePingCheck) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 273c128..7e1bed5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
98 | /// <param name="godID">The person doing the kicking</param> | 98 | /// <param name="godID">The person doing the kicking</param> |
99 | /// <param name="sessionID">The session of the person doing the kicking</param> | 99 | /// <param name="sessionID">The session of the person doing the kicking</param> |
100 | /// <param name="agentID">the person that is being kicked</param> | 100 | /// <param name="agentID">the person that is being kicked</param> |
101 | /// <param name="kickflags">This isn't used apparently</param> | 101 | /// <param name="kickflags">Tells what to do to the user</param> |
102 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> | 102 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> |
103 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) | 103 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) |
104 | { | 104 | { |
@@ -110,39 +110,56 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
110 | { | 110 | { |
111 | if (m_scene.Permissions.IsGod(godID)) | 111 | if (m_scene.Permissions.IsGod(godID)) |
112 | { | 112 | { |
113 | if (agentID == kickUserID) | 113 | if (kickflags == 0) |
114 | { | 114 | { |
115 | string reasonStr = Utils.BytesToString(reason); | 115 | if (agentID == kickUserID) |
116 | { | ||
117 | string reasonStr = Utils.BytesToString(reason); | ||
116 | 118 | ||
117 | m_scene.ForEachClient( | 119 | m_scene.ForEachClient( |
118 | delegate(IClientAPI controller) | 120 | delegate(IClientAPI controller) |
119 | { | 121 | { |
120 | if (controller.AgentId != godID) | 122 | if (controller.AgentId != godID) |
121 | controller.Kick(reasonStr); | 123 | controller.Kick(reasonStr); |
122 | } | 124 | } |
123 | ); | 125 | ); |
124 | 126 | ||
125 | // This is a bit crude. It seems the client will be null before it actually stops the thread | 127 | // This is a bit crude. It seems the client will be null before it actually stops the thread |
126 | // The thread will kill itself eventually :/ | 128 | // The thread will kill itself eventually :/ |
127 | // Is there another way to make sure *all* clients get this 'inter region' message? | 129 | // Is there another way to make sure *all* clients get this 'inter region' message? |
128 | m_scene.ForEachScenePresence( | 130 | m_scene.ForEachScenePresence( |
129 | delegate(ScenePresence p) | 131 | delegate(ScenePresence p) |
130 | { | ||
131 | if (p.UUID != godID && !p.IsChildAgent) | ||
132 | { | 132 | { |
133 | // Possibly this should really be p.Close() though that method doesn't send a close | 133 | if (p.UUID != godID && !p.IsChildAgent) |
134 | // to the client | 134 | { |
135 | p.ControllingClient.Close(); | 135 | // Possibly this should really be p.Close() though that method doesn't send a close |
136 | // to the client | ||
137 | p.ControllingClient.Close(); | ||
138 | } | ||
136 | } | 139 | } |
137 | } | 140 | ); |
138 | ); | 141 | } |
142 | else | ||
143 | { | ||
144 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | ||
145 | |||
146 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | ||
147 | sp.ControllingClient.Close(); | ||
148 | } | ||
139 | } | 149 | } |
140 | else | 150 | |
151 | if (kickflags == 1) | ||
141 | { | 152 | { |
142 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | 153 | sp.AllowMovement = false; |
143 | 154 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | |
144 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | 155 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); |
145 | sp.ControllingClient.Close(); | 156 | } |
157 | |||
158 | if (kickflags == 2) | ||
159 | { | ||
160 | sp.AllowMovement = true; | ||
161 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
162 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
146 | } | 163 | } |
147 | } | 164 | } |
148 | else | 165 | else |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 8532d03..b778389 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -348,9 +348,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
348 | 348 | ||
349 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); | 349 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); |
350 | if (UUID.Zero != ospResolvedId) | 350 | if (UUID.Zero != ospResolvedId) |
351 | { | ||
351 | item.CreatorIdAsUuid = ospResolvedId; | 352 | item.CreatorIdAsUuid = ospResolvedId; |
353 | |||
354 | // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the | ||
355 | // database). Instead, replace with the UUID that we found. | ||
356 | item.CreatorId = ospResolvedId.ToString(); | ||
357 | } | ||
352 | else | 358 | else |
359 | { | ||
353 | item.CreatorIdAsUuid = m_userInfo.UserProfile.ID; | 360 | item.CreatorIdAsUuid = m_userInfo.UserProfile.ID; |
361 | } | ||
354 | 362 | ||
355 | item.Owner = m_userInfo.UserProfile.ID; | 363 | item.Owner = m_userInfo.UserProfile.ID; |
356 | 364 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 2c0d113..ecd60bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
280 | string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); | 280 | string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); |
281 | 281 | ||
282 | m_log.InfoFormat( | 282 | m_log.InfoFormat( |
283 | "[INVENTORY ARCHIVER]: Saving archive {0} from inventory path {1} for {2} {3}", | 283 | "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", |
284 | savePath, invPath, firstName, lastName); | 284 | savePath, invPath, firstName, lastName); |
285 | 285 | ||
286 | Guid id = Guid.NewGuid(); | 286 | Guid id = Guid.NewGuid(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 7927352..e4dad18 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -259,9 +259,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
259 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name); | 259 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name); |
260 | 260 | ||
261 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 261 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
262 | |||
263 | // We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the | ||
264 | // UUID, not the OSPA itself. | ||
265 | // Assert.That( | ||
266 | // foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), | ||
267 | // "Loaded item non-uuid creator doesn't match original"); | ||
262 | Assert.That( | 268 | Assert.That( |
263 | foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), | 269 | foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()), |
264 | "Loaded item non-uuid creator doesn't match original"); | 270 | "Loaded item non-uuid creator doesn't match original"); |
271 | |||
265 | Assert.That( | 272 | Assert.That( |
266 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), | 273 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), |
267 | "Loaded item uuid creator doesn't match original"); | 274 | "Loaded item uuid creator doesn't match original"); |
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index d4a28e2..60df2e7 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -602,9 +602,12 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
602 | ListenerInfo info = | 602 | ListenerInfo info = |
603 | ListenerInfo.FromData(localID, itemID, hostID, item); | 603 | ListenerInfo.FromData(localID, itemID, hostID, item); |
604 | 604 | ||
605 | if (!m_listeners.ContainsKey((int)item[2])) | 605 | lock (m_listeners) |
606 | m_listeners.Add((int)item[2], new List<ListenerInfo>()); | 606 | { |
607 | m_listeners[(int)item[2]].Add(info); | 607 | if (!m_listeners.ContainsKey((int)item[2])) |
608 | m_listeners.Add((int)item[2], new List<ListenerInfo>()); | ||
609 | m_listeners[(int)item[2]].Add(info); | ||
610 | } | ||
608 | 611 | ||
609 | idx+=6; | 612 | idx+=6; |
610 | } | 613 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index ee809bd..d9f6e33 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs | |||
@@ -263,8 +263,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
263 | { | 263 | { |
264 | // We need to make a local copy of the object | 264 | // We need to make a local copy of the object |
265 | ISceneObject sogClone = sog.CloneForNewScene(); | 265 | ISceneObject sogClone = sog.CloneForNewScene(); |
266 | sogClone.SetState(sog.GetStateSnapshot(), | 266 | sogClone.SetState(sog.GetStateSnapshot(), s); |
267 | s.RegionInfo.RegionID); | ||
268 | return s.IncomingCreateObject(sogClone); | 267 | return s.IncomingCreateObject(sogClone); |
269 | } | 268 | } |
270 | else | 269 | else |
@@ -294,15 +293,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
294 | 293 | ||
295 | #region Misc | 294 | #region Misc |
296 | 295 | ||
297 | public UUID GetRegionID(ulong regionhandle) | 296 | public Scene GetScene(ulong regionhandle) |
298 | { | 297 | { |
299 | foreach (Scene s in m_sceneList) | 298 | foreach (Scene s in m_sceneList) |
300 | { | 299 | { |
301 | if (s.RegionInfo.RegionHandle == regionhandle) | 300 | if (s.RegionInfo.RegionHandle == regionhandle) |
302 | return s.RegionInfo.RegionID; | 301 | return s; |
303 | } | 302 | } |
304 | // ? weird. should not happen | 303 | // ? weird. should not happen |
305 | return m_sceneList[0].RegionInfo.RegionID; | 304 | return m_sceneList[0]; |
306 | } | 305 | } |
307 | 306 | ||
308 | public bool IsLocalRegion(ulong regionhandle) | 307 | public bool IsLocalRegion(ulong regionhandle) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 696225c..710e3ca 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs | |||
@@ -641,7 +641,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
641 | if (args["extra"] != null) | 641 | if (args["extra"] != null) |
642 | extraStr = args["extra"].AsString(); | 642 | extraStr = args["extra"].AsString(); |
643 | 643 | ||
644 | UUID regionID = m_localBackend.GetRegionID(regionhandle); | 644 | IScene s = m_localBackend.GetScene(regionhandle); |
645 | SceneObjectGroup sog = null; | 645 | SceneObjectGroup sog = null; |
646 | try | 646 | try |
647 | { | 647 | { |
@@ -663,7 +663,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
663 | { | 663 | { |
664 | try | 664 | try |
665 | { | 665 | { |
666 | sog.SetState(stateXmlStr, regionID); | 666 | sog.SetState(stateXmlStr, s); |
667 | } | 667 | } |
668 | catch (Exception ex) | 668 | catch (Exception ex) |
669 | { | 669 | { |
@@ -695,8 +695,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
695 | if (args["itemid"] != null) | 695 | if (args["itemid"] != null) |
696 | itemID = args["itemid"].AsUUID(); | 696 | itemID = args["itemid"].AsUUID(); |
697 | 697 | ||
698 | //UUID regionID = m_localBackend.GetRegionID(regionhandle); | ||
699 | |||
700 | // This is the meaning of PUT object | 698 | // This is the meaning of PUT object |
701 | bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID); | 699 | bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID); |
702 | 700 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 34b81d8..af72968 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -454,6 +454,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
454 | /// <summary> | 454 | /// <summary> |
455 | /// Resolve path to a working FileStream | 455 | /// Resolve path to a working FileStream |
456 | /// </summary> | 456 | /// </summary> |
457 | /// <param name="path"></param> | ||
458 | /// <returns></returns> | ||
457 | private Stream GetStream(string path) | 459 | private Stream GetStream(string path) |
458 | { | 460 | { |
459 | if (File.Exists(path)) | 461 | if (File.Exists(path)) |
@@ -500,8 +502,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
500 | WebResponse response = request.GetResponse(); | 502 | WebResponse response = request.GetResponse(); |
501 | Stream file = response.GetResponseStream(); | 503 | Stream file = response.GetResponseStream(); |
502 | 504 | ||
503 | if (response.ContentType != "application/x-oar") | 505 | // justincc: gonna ignore the content type for now and just try anything |
504 | throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString())); | 506 | //if (response.ContentType != "application/x-oar") |
507 | // throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString())); | ||
505 | 508 | ||
506 | if (response.ContentLength == 0) | 509 | if (response.ContentLength == 0) |
507 | throw new Exception(String.Format("{0} returned an empty file", uri.ToString())); | 510 | throw new Exception(String.Format("{0} returned an empty file", uri.ToString())); |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 013a0ef..c9b3071 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -800,30 +800,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
800 | } | 800 | } |
801 | 801 | ||
802 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) | 802 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) |
803 | { | 803 | { |
804 | bool permission = false; | ||
805 | |||
806 | if (parcel.LandData.OwnerID == user) | 804 | if (parcel.LandData.OwnerID == user) |
807 | { | 805 | { |
808 | permission = true; | 806 | // Returning immediately so that group deeded objects on group deeded land don't trigger a NRE on |
807 | // the subsequent redundant checks when using lParcelMediaCommandList() | ||
808 | // See http://opensimulator.org/mantis/view.php?id=3999 for more details | ||
809 | return true; | ||
809 | } | 810 | } |
810 | 811 | ||
811 | if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) | 812 | if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) |
812 | { | 813 | { |
813 | permission = true; | 814 | return true; |
814 | } | 815 | } |
815 | 816 | ||
816 | if (IsEstateManager(user)) | 817 | if (IsEstateManager(user)) |
817 | { | 818 | { |
818 | permission = true; | 819 | return true; |
819 | } | 820 | } |
820 | 821 | ||
821 | if (IsAdministrator(user)) | 822 | if (IsAdministrator(user)) |
822 | { | 823 | { |
823 | permission = true; | 824 | return true; |
824 | } | 825 | } |
825 | 826 | ||
826 | return permission; | 827 | return false; |
827 | } | 828 | } |
828 | 829 | ||
829 | protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers) | 830 | protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers) |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 2c906a2..89a45da 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -185,19 +185,11 @@ namespace OpenSim.Region.Framework.Interfaces | |||
185 | List<UUID> GetInventoryList(); | 185 | List<UUID> GetInventoryList(); |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// Get the names of the assemblies associated with scripts in this inventory. | ||
189 | /// </summary> | ||
190 | /// <returns></returns> | ||
191 | string[] GetScriptAssemblies(); | ||
192 | |||
193 | /// <summary> | ||
194 | /// Get the xml representing the saved states of scripts in this inventory. | 188 | /// Get the xml representing the saved states of scripts in this inventory. |
195 | /// </summary> | 189 | /// </summary> |
196 | /// <returns> | 190 | /// <returns> |
197 | /// A <see cref="Dictionary`2"/> | 191 | /// A <see cref="Dictionary`2"/> |
198 | /// </returns> | 192 | /// </returns> |
199 | Dictionary<UUID, string> GetScriptStates(); | 193 | Dictionary<UUID, string> GetScriptStates(); |
200 | |||
201 | bool CanBeDeleted(); | ||
202 | } | 194 | } |
203 | } | 195 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 10835b9..f11e571 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -34,9 +34,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
34 | { | 34 | { |
35 | string ScriptEngineName { get; } | 35 | string ScriptEngineName { get; } |
36 | 36 | ||
37 | string GetAssemblyName(UUID itemID); | ||
38 | string GetXMLState(UUID itemID); | 37 | string GetXMLState(UUID itemID); |
39 | bool CanBeDeleted(UUID itemID); | 38 | void SetXMLState(UUID itemID, string xml); |
40 | 39 | ||
41 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | 40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); |
42 | bool PostObjectEvent(UUID itemID, string name, Object[] args); | 41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); |
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 5b571c7..9a7863b 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -131,11 +131,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
131 | if (left > 0) | 131 | if (left > 0) |
132 | { | 132 | { |
133 | x = m_inventoryDeletes.Dequeue(); | 133 | x = m_inventoryDeletes.Dequeue(); |
134 | if (!x.objectGroup.CanBeDeleted()) | ||
135 | { | ||
136 | m_inventoryDeletes.Enqueue(x); | ||
137 | return true; | ||
138 | } | ||
139 | 134 | ||
140 | m_log.DebugFormat( | 135 | m_log.DebugFormat( |
141 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); | 136 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f444e51..a3f3d8f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
310 | private Thread HeartbeatThread; | 310 | private Thread HeartbeatThread; |
311 | private volatile bool shuttingdown; | 311 | private volatile bool shuttingdown; |
312 | 312 | ||
313 | private int m_lastUpdate = Environment.TickCount; | 313 | private int m_lastUpdate; |
314 | private bool m_firstHeartbeat = true; | 314 | private bool m_firstHeartbeat = true; |
315 | 315 | ||
316 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; | 316 | private UpdatePrioritizationSchemes m_update_prioritization_scheme = UpdatePrioritizationSchemes.Time; |
@@ -387,6 +387,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
387 | { | 387 | { |
388 | get { return StatsReporter.getLastReportedSimFPS(); } | 388 | get { return StatsReporter.getLastReportedSimFPS(); } |
389 | } | 389 | } |
390 | |||
391 | public float[] SimulatorStats | ||
392 | { | ||
393 | get { return StatsReporter.getLastReportedSimStats(); } | ||
394 | } | ||
390 | 395 | ||
391 | public string DefaultScriptEngine | 396 | public string DefaultScriptEngine |
392 | { | 397 | { |
@@ -521,6 +526,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
521 | m_regionHandle = m_regInfo.RegionHandle; | 526 | m_regionHandle = m_regInfo.RegionHandle; |
522 | m_regionName = m_regInfo.RegionName; | 527 | m_regionName = m_regInfo.RegionName; |
523 | m_datastore = m_regInfo.DataStore; | 528 | m_datastore = m_regInfo.DataStore; |
529 | m_lastUpdate = Util.EnvironmentTickCount(); | ||
524 | 530 | ||
525 | m_physicalPrim = physicalPrim; | 531 | m_physicalPrim = physicalPrim; |
526 | m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor; | 532 | m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor; |
@@ -618,7 +624,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
618 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); | 624 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); |
619 | m_persistAfter *= 10000000; | 625 | m_persistAfter *= 10000000; |
620 | 626 | ||
621 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); | 627 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); |
622 | 628 | ||
623 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 629 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
624 | if (packetConfig != null) | 630 | if (packetConfig != null) |
@@ -730,6 +736,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
730 | 736 | ||
731 | m_regInfo = regInfo; | 737 | m_regInfo = regInfo; |
732 | m_eventManager = new EventManager(); | 738 | m_eventManager = new EventManager(); |
739 | |||
740 | m_lastUpdate = Util.EnvironmentTickCount(); | ||
733 | } | 741 | } |
734 | 742 | ||
735 | #endregion | 743 | #endregion |
@@ -1084,7 +1092,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1084 | HeartbeatThread.Abort(); | 1092 | HeartbeatThread.Abort(); |
1085 | HeartbeatThread = null; | 1093 | HeartbeatThread = null; |
1086 | } | 1094 | } |
1087 | m_lastUpdate = Environment.TickCount; | 1095 | m_lastUpdate = Util.EnvironmentTickCount(); |
1088 | 1096 | ||
1089 | HeartbeatThread = Watchdog.StartThread(Heartbeat, "Heartbeat for region " + RegionInfo.RegionName, ThreadPriority.Normal, false); | 1097 | HeartbeatThread = Watchdog.StartThread(Heartbeat, "Heartbeat for region " + RegionInfo.RegionName, ThreadPriority.Normal, false); |
1090 | } | 1098 | } |
@@ -1125,7 +1133,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1125 | { | 1133 | { |
1126 | Update(); | 1134 | Update(); |
1127 | 1135 | ||
1128 | m_lastUpdate = Environment.TickCount; | 1136 | m_lastUpdate = Util.EnvironmentTickCount(); |
1129 | m_firstHeartbeat = false; | 1137 | m_firstHeartbeat = false; |
1130 | } | 1138 | } |
1131 | catch (ThreadAbortException) | 1139 | catch (ThreadAbortException) |
@@ -1151,10 +1159,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1151 | while (!shuttingdown) | 1159 | while (!shuttingdown) |
1152 | { | 1160 | { |
1153 | TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate; | 1161 | TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate; |
1154 | physicsFPS = 0f; | 1162 | physicsFPS = 0f; |
1155 | 1163 | ||
1156 | maintc = otherMS = Environment.TickCount; | 1164 | maintc = Util.EnvironmentTickCount(); |
1157 | int tmpFrameMS = maintc; | 1165 | int tmpFrameMS = maintc; |
1166 | tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; | ||
1158 | 1167 | ||
1159 | // Increment the frame counter | 1168 | // Increment the frame counter |
1160 | ++m_frame; | 1169 | ++m_frame; |
@@ -1174,74 +1183,65 @@ namespace OpenSim.Region.Framework.Scenes | |||
1174 | if (m_frame % m_update_presences == 0) | 1183 | if (m_frame % m_update_presences == 0) |
1175 | m_sceneGraph.UpdatePresences(); | 1184 | m_sceneGraph.UpdatePresences(); |
1176 | 1185 | ||
1177 | int TempPhysicsMS2 = Environment.TickCount; | 1186 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); |
1178 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) | 1187 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) |
1179 | m_sceneGraph.UpdatePreparePhysics(); | 1188 | m_sceneGraph.UpdatePreparePhysics(); |
1180 | TempPhysicsMS2 = Environment.TickCount - TempPhysicsMS2; | 1189 | physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2); |
1181 | physicsMS2 = TempPhysicsMS2; | ||
1182 | 1190 | ||
1183 | if (m_frame % m_update_entitymovement == 0) | 1191 | if (m_frame % m_update_entitymovement == 0) |
1184 | m_sceneGraph.UpdateScenePresenceMovement(); | 1192 | m_sceneGraph.UpdateScenePresenceMovement(); |
1185 | 1193 | ||
1186 | int TempPhysicsMS = Environment.TickCount; | 1194 | int tmpPhysicsMS = Util.EnvironmentTickCount(); |
1187 | if (m_frame % m_update_physics == 0) | 1195 | if (m_frame % m_update_physics == 0) |
1188 | { | 1196 | { |
1189 | if (m_physics_enabled) | 1197 | if (m_physics_enabled) |
1190 | physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan)); | 1198 | physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan)); |
1191 | if (SynchronizeScene != null) | 1199 | if (SynchronizeScene != null) |
1192 | SynchronizeScene(this); | 1200 | SynchronizeScene(this); |
1193 | } | 1201 | } |
1194 | TempPhysicsMS = Environment.TickCount - TempPhysicsMS; | 1202 | physicsMS = Util.EnvironmentTickCountSubtract(tmpPhysicsMS); |
1195 | physicsMS = TempPhysicsMS; | ||
1196 | 1203 | ||
1197 | // Delete temp-on-rez stuff | 1204 | // Delete temp-on-rez stuff |
1198 | if (m_frame % m_update_backup == 0) | 1205 | if (m_frame % m_update_backup == 0) |
1199 | { | 1206 | { |
1200 | int tozMS = Environment.TickCount; | 1207 | int tmpTempOnRezMS = Util.EnvironmentTickCount(); |
1201 | CleanTempObjects(); | 1208 | CleanTempObjects(); |
1202 | tozMS -= Environment.TickCount; | 1209 | tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS); |
1203 | tempOnRezMS = tozMS; | ||
1204 | } | 1210 | } |
1205 | 1211 | ||
1206 | if (RegionStatus != RegionStatus.SlaveScene) | 1212 | if (RegionStatus != RegionStatus.SlaveScene) |
1207 | { | 1213 | { |
1208 | if (m_frame % m_update_events == 0) | 1214 | if (m_frame % m_update_events == 0) |
1209 | { | 1215 | { |
1210 | int evMS = Environment.TickCount; | 1216 | int evMS = Util.EnvironmentTickCount(); |
1211 | UpdateEvents(); | 1217 | UpdateEvents(); |
1212 | evMS -= Environment.TickCount; | 1218 | eventMS = Util.EnvironmentTickCountSubtract(evMS); ; |
1213 | eventMS = evMS; | ||
1214 | } | 1219 | } |
1215 | 1220 | ||
1216 | if (m_frame % m_update_backup == 0) | 1221 | if (m_frame % m_update_backup == 0) |
1217 | { | 1222 | { |
1218 | int backMS = Environment.TickCount; | 1223 | int backMS = Util.EnvironmentTickCount(); |
1219 | UpdateStorageBackup(); | 1224 | UpdateStorageBackup(); |
1220 | backMS -= Environment.TickCount; | 1225 | backupMS = Util.EnvironmentTickCountSubtract(backMS); |
1221 | backupMS = backMS; | ||
1222 | } | 1226 | } |
1223 | 1227 | ||
1224 | if (m_frame % m_update_terrain == 0) | 1228 | if (m_frame % m_update_terrain == 0) |
1225 | { | 1229 | { |
1226 | int terMS = Environment.TickCount; | 1230 | int terMS = Util.EnvironmentTickCount(); |
1227 | UpdateTerrain(); | 1231 | UpdateTerrain(); |
1228 | terMS -= Environment.TickCount; | 1232 | terrainMS = Util.EnvironmentTickCountSubtract(terMS); |
1229 | terrainMS = terMS; | ||
1230 | } | 1233 | } |
1231 | 1234 | ||
1232 | if (m_frame % m_update_land == 0) | 1235 | if (m_frame % m_update_land == 0) |
1233 | { | 1236 | { |
1234 | int ldMS = Environment.TickCount; | 1237 | int ldMS = Util.EnvironmentTickCount(); |
1235 | UpdateLand(); | 1238 | UpdateLand(); |
1236 | ldMS -= Environment.TickCount; | 1239 | landMS = Util.EnvironmentTickCountSubtract(ldMS); |
1237 | landMS = ldMS; | 1240 | } |
1238 | } | 1241 | |
1239 | 1242 | frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); | |
1240 | int tickCount = Environment.TickCount; | 1243 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; |
1241 | otherMS = tickCount - otherMS; | 1244 | lastCompletedFrame = Util.EnvironmentTickCount(); |
1242 | tmpFrameMS -= tickCount; | ||
1243 | frameMS = tmpFrameMS; | ||
1244 | lastCompletedFrame = tickCount; | ||
1245 | 1245 | ||
1246 | // if (m_frame%m_update_avatars == 0) | 1246 | // if (m_frame%m_update_avatars == 0) |
1247 | // UpdateInWorldTime(); | 1247 | // UpdateInWorldTime(); |
@@ -1293,9 +1293,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1293 | finally | 1293 | finally |
1294 | { | 1294 | { |
1295 | m_lastupdate = DateTime.UtcNow; | 1295 | m_lastupdate = DateTime.UtcNow; |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | maintc = Environment.TickCount - maintc; | 1298 | maintc = Util.EnvironmentTickCountSubtract(maintc); |
1299 | maintc = (int)(m_timespan * 1000) - maintc; | 1299 | maintc = (int)(m_timespan * 1000) - maintc; |
1300 | 1300 | ||
1301 | if ((maintc < (m_timespan * 1000)) && maintc > 0) | 1301 | if ((maintc < (m_timespan * 1000)) && maintc > 0) |
@@ -1306,6 +1306,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1306 | } | 1306 | } |
1307 | } | 1307 | } |
1308 | 1308 | ||
1309 | |||
1309 | 1310 | ||
1310 | public void AddGroupTarget(SceneObjectGroup grp) | 1311 | public void AddGroupTarget(SceneObjectGroup grp) |
1311 | { | 1312 | { |
@@ -2381,103 +2382,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2381 | return successYN; | 2382 | return successYN; |
2382 | } | 2383 | } |
2383 | 2384 | ||
2384 | /// <summary> | ||
2385 | /// Handle a scene object that is crossing into this region from another. | ||
2386 | /// NOTE: Unused as of 2009-02-09. Soon to be deleted. | ||
2387 | /// </summary> | ||
2388 | /// <param name="regionHandle"></param> | ||
2389 | /// <param name="primID"></param> | ||
2390 | /// <param name="objXMLData"></param> | ||
2391 | /// <param name="XMLMethod"></param> | ||
2392 | /// <returns></returns> | ||
2393 | public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod) | ||
2394 | { | ||
2395 | if (XMLMethod == 0) | ||
2396 | { | ||
2397 | m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID); | ||
2398 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | ||
2399 | if (sceneObject.IsAttachment) | ||
2400 | sceneObject.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; | ||
2401 | |||
2402 | return AddSceneObject(sceneObject); | ||
2403 | } | ||
2404 | else if ((XMLMethod == 100) && m_allowScriptCrossings) | ||
2405 | { | ||
2406 | m_log.Warn("[INTERREGION]: Prim state data arrived from a neighbor"); | ||
2407 | |||
2408 | XmlDocument doc = new XmlDocument(); | ||
2409 | doc.LoadXml(objXMLData); | ||
2410 | |||
2411 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); | ||
2412 | if (rootL.Count == 1) | ||
2413 | { | ||
2414 | XmlNode rootNode = rootL[0]; | ||
2415 | if (rootNode != null) | ||
2416 | { | ||
2417 | XmlNodeList partL = rootNode.ChildNodes; | ||
2418 | |||
2419 | foreach (XmlNode part in partL) | ||
2420 | { | ||
2421 | XmlNodeList nodeL = part.ChildNodes; | ||
2422 | |||
2423 | switch (part.Name) | ||
2424 | { | ||
2425 | case "Assemblies": | ||
2426 | foreach (XmlNode asm in nodeL) | ||
2427 | { | ||
2428 | string fn = asm.Attributes.GetNamedItem("Filename").Value; | ||
2429 | |||
2430 | Byte[] filedata = Convert.FromBase64String(asm.InnerText); | ||
2431 | string path = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString()); | ||
2432 | path = Path.Combine(path, fn); | ||
2433 | |||
2434 | if (!File.Exists(path)) | ||
2435 | { | ||
2436 | FileStream fs = File.Create(path); | ||
2437 | fs.Write(filedata, 0, filedata.Length); | ||
2438 | fs.Close(); | ||
2439 | } | ||
2440 | } | ||
2441 | break; | ||
2442 | case "ScriptStates": | ||
2443 | foreach (XmlNode st in nodeL) | ||
2444 | { | ||
2445 | string id = st.Attributes.GetNamedItem("UUID").Value; | ||
2446 | UUID uuid = new UUID(id); | ||
2447 | XmlNode state = st.ChildNodes[0]; | ||
2448 | |||
2449 | XmlDocument sdoc = new XmlDocument(); | ||
2450 | XmlNode sxmlnode = sdoc.CreateNode( | ||
2451 | XmlNodeType.XmlDeclaration, | ||
2452 | "", ""); | ||
2453 | sdoc.AppendChild(sxmlnode); | ||
2454 | |||
2455 | XmlNode newnode = sdoc.ImportNode(state, true); | ||
2456 | sdoc.AppendChild(newnode); | ||
2457 | |||
2458 | string spath = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString()); | ||
2459 | spath = Path.Combine(spath, uuid.ToString()); | ||
2460 | FileStream sfs = File.Create(spath + ".state"); | ||
2461 | ASCIIEncoding enc = new ASCIIEncoding(); | ||
2462 | Byte[] buf = enc.GetBytes(sdoc.InnerXml); | ||
2463 | sfs.Write(buf, 0, buf.Length); | ||
2464 | sfs.Close(); | ||
2465 | } | ||
2466 | break; | ||
2467 | } | ||
2468 | } | ||
2469 | } | ||
2470 | } | ||
2471 | |||
2472 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | ||
2473 | RootPrim.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); | ||
2474 | |||
2475 | return true; | ||
2476 | } | ||
2477 | |||
2478 | return true; | ||
2479 | } | ||
2480 | |||
2481 | public bool IncomingCreateObject(ISceneObject sog) | 2385 | public bool IncomingCreateObject(ISceneObject sog) |
2482 | { | 2386 | { |
2483 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2387 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
@@ -2677,9 +2581,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2677 | sp.IsChildAgent = false; | 2581 | sp.IsChildAgent = false; |
2678 | Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); | 2582 | Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); |
2679 | } | 2583 | } |
2680 | } | 2584 | } |
2681 | 2585 | ||
2682 | m_LastLogin = Environment.TickCount; | 2586 | m_LastLogin = Util.EnvironmentTickCount(); |
2683 | EventManager.TriggerOnNewClient(client); | 2587 | EventManager.TriggerOnNewClient(client); |
2684 | } | 2588 | } |
2685 | 2589 | ||
@@ -3350,7 +3254,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3350 | m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; | 3254 | m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; |
3351 | //m_eventManager.OnRegionUp += OtherRegionUp; | 3255 | //m_eventManager.OnRegionUp += OtherRegionUp; |
3352 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 3256 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
3353 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; | ||
3354 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 3257 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
3355 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 3258 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
3356 | m_sceneGridService.KiPrimitive += SendKillObject; | 3259 | m_sceneGridService.KiPrimitive += SendKillObject; |
@@ -3374,7 +3277,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3374 | m_sceneGridService.KiPrimitive -= SendKillObject; | 3277 | m_sceneGridService.KiPrimitive -= SendKillObject; |
3375 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; | 3278 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; |
3376 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; | 3279 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; |
3377 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; | ||
3378 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | 3280 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; |
3379 | //m_eventManager.OnRegionUp -= OtherRegionUp; | 3281 | //m_eventManager.OnRegionUp -= OtherRegionUp; |
3380 | m_sceneGridService.OnExpectUser -= HandleNewUserConnection; | 3282 | m_sceneGridService.OnExpectUser -= HandleNewUserConnection; |
@@ -4492,16 +4394,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4492 | 4394 | ||
4493 | #endregion | 4395 | #endregion |
4494 | 4396 | ||
4495 | #region Avatar Appearance Default | ||
4496 | |||
4497 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | ||
4498 | { | ||
4499 | visualParams = AvatarAppearance.GetDefaultVisualParams(); | ||
4500 | wearables = AvatarWearable.DefaultWearables; | ||
4501 | } | ||
4502 | |||
4503 | #endregion | ||
4504 | |||
4505 | public void RegionHandleRequest(IClientAPI client, UUID regionID) | 4397 | public void RegionHandleRequest(IClientAPI client, UUID regionID) |
4506 | { | 4398 | { |
4507 | ulong handle = 0; | 4399 | ulong handle = 0; |
@@ -4758,16 +4650,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
4758 | // 3 = We have seen a new user enter within the past 4 minutes | 4650 | // 3 = We have seen a new user enter within the past 4 minutes |
4759 | // which can be seen as positive confirmation of sim health | 4651 | // which can be seen as positive confirmation of sim health |
4760 | // | 4652 | // |
4761 | int health=1; // Start at 1, means we're up | 4653 | int health=1; // Start at 1, means we're up |
4762 | 4654 | ||
4763 | if ((Environment.TickCount - m_lastUpdate) < 1000) | 4655 | if ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000) |
4764 | health+=1; | 4656 | health+=1; |
4765 | else | 4657 | else |
4766 | return health; | 4658 | return health; |
4767 | 4659 | ||
4768 | // A login in the last 4 mins? We can't be doing too badly | 4660 | // A login in the last 4 mins? We can't be doing too badly |
4769 | // | 4661 | // |
4770 | if ((Environment.TickCount - m_LastLogin) < 240000) | 4662 | if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000) |
4771 | health++; | 4663 | health++; |
4772 | else | 4664 | else |
4773 | return health; | 4665 | return health; |
@@ -4963,9 +4855,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4963 | private void CheckHeartbeat() | 4855 | private void CheckHeartbeat() |
4964 | { | 4856 | { |
4965 | if (m_firstHeartbeat) | 4857 | if (m_firstHeartbeat) |
4966 | return; | 4858 | return; |
4967 | 4859 | ||
4968 | if (System.Environment.TickCount - m_lastUpdate > 2000) | 4860 | if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 2000) |
4969 | StartTimer(); | 4861 | StartTimer(); |
4970 | } | 4862 | } |
4971 | } | 4863 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 76c6cab..3892769 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -85,7 +85,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
85 | /// <summary> | 85 | /// <summary> |
86 | /// A Prim will arrive shortly | 86 | /// A Prim will arrive shortly |
87 | /// </summary> | 87 | /// </summary> |
88 | public event ExpectPrimDelegate OnExpectPrim; | ||
89 | public event CloseAgentConnection OnCloseAgentConnection; | 88 | public event CloseAgentConnection OnCloseAgentConnection; |
90 | 89 | ||
91 | /// <summary> | 90 | /// <summary> |
@@ -116,7 +115,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
116 | 115 | ||
117 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 116 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
118 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; | 117 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; |
119 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | ||
120 | private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; | 118 | private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; |
121 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; | 119 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; |
122 | //private RegionUp handlerRegionUp = null; // OnRegionUp; | 120 | //private RegionUp handlerRegionUp = null; // OnRegionUp; |
@@ -147,30 +145,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
147 | /// <exception cref="System.Exception">Thrown if region registration fails.</exception> | 145 | /// <exception cref="System.Exception">Thrown if region registration fails.</exception> |
148 | public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos) | 146 | public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos) |
149 | { | 147 | { |
150 | //m_interregionCommsOut = comms_out; | ||
151 | |||
152 | //m_regionInfo = regionInfos; | ||
153 | //m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName; | ||
154 | //regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo); | ||
155 | |||
156 | //if (regionCommsHost != null) | ||
157 | //{ | ||
158 | // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); | ||
159 | |||
160 | // regionCommsHost.debugRegionName = regionInfos.RegionName; | ||
161 | // regionCommsHost.OnExpectPrim += IncomingPrimCrossing; | ||
162 | // regionCommsHost.OnExpectUser += NewUserConnection; | ||
163 | // regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; | ||
164 | // regionCommsHost.OnCloseAgentConnection += CloseConnection; | ||
165 | // regionCommsHost.OnRegionUp += newRegionUp; | ||
166 | // regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; | ||
167 | // regionCommsHost.OnLogOffUser += GridLogOffUser; | ||
168 | // regionCommsHost.OnGetLandData += FetchLandData; | ||
169 | //} | ||
170 | //else | ||
171 | //{ | ||
172 | // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null"); | ||
173 | //} | ||
174 | } | 148 | } |
175 | 149 | ||
176 | /// <summary> | 150 | /// <summary> |
@@ -179,31 +153,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
179 | /// </summary> | 153 | /// </summary> |
180 | public void Close() | 154 | public void Close() |
181 | { | 155 | { |
182 | |||
183 | //if (regionCommsHost != null) | ||
184 | //{ | ||
185 | // regionCommsHost.OnLogOffUser -= GridLogOffUser; | ||
186 | // regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate; | ||
187 | // regionCommsHost.OnRegionUp -= newRegionUp; | ||
188 | // regionCommsHost.OnExpectUser -= NewUserConnection; | ||
189 | // regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; | ||
190 | // regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; | ||
191 | // regionCommsHost.OnCloseAgentConnection -= CloseConnection; | ||
192 | // regionCommsHost.OnGetLandData -= FetchLandData; | ||
193 | |||
194 | // try | ||
195 | // { | ||
196 | // m_commsProvider.GridService.DeregisterRegion(m_regionInfo); | ||
197 | // } | ||
198 | // catch (Exception e) | ||
199 | // { | ||
200 | // m_log.ErrorFormat( | ||
201 | // "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing", | ||
202 | // m_regionInfo.RegionName, e); | ||
203 | // } | ||
204 | |||
205 | // regionCommsHost = null; | ||
206 | //} | ||
207 | } | 156 | } |
208 | 157 | ||
209 | #region CommsManager Event handlers | 158 | #region CommsManager Event handlers |
@@ -263,27 +212,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
263 | } | 212 | } |
264 | } | 213 | } |
265 | 214 | ||
266 | /// <summary> | ||
267 | /// We have a new prim from a neighbor | ||
268 | /// </summary> | ||
269 | /// <param name="primID">unique ID for the primative</param> | ||
270 | /// <param name="objXMLData">XML2 encoded data of the primative</param> | ||
271 | /// <param name="XMLMethod">An Int that represents the version of the XMLMethod</param> | ||
272 | /// <returns>True if the prim was accepted, false if it was not</returns> | ||
273 | protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) | ||
274 | { | ||
275 | handlerExpectPrim = OnExpectPrim; | ||
276 | if (handlerExpectPrim != null) | ||
277 | { | ||
278 | return handlerExpectPrim(primID, objXMLData, XMLMethod); | ||
279 | } | ||
280 | else | ||
281 | { | ||
282 | return false; | ||
283 | } | ||
284 | |||
285 | } | ||
286 | |||
287 | protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical) | 215 | protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical) |
288 | { | 216 | { |
289 | handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; | 217 | handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 3cec77f..5a06bdb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -309,26 +309,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
309 | 309 | ||
310 | public string GetStateSnapshot() | 310 | public string GetStateSnapshot() |
311 | { | 311 | { |
312 | //m_log.Debug(" >>> GetStateSnapshot <<<"); | ||
313 | |||
314 | List<string> assemblies = new List<string>(); | ||
315 | Dictionary<UUID, string> states = new Dictionary<UUID, string>(); | 312 | Dictionary<UUID, string> states = new Dictionary<UUID, string>(); |
316 | 313 | ||
317 | foreach (SceneObjectPart part in m_parts.Values) | 314 | foreach (SceneObjectPart part in m_parts.Values) |
318 | { | 315 | { |
319 | foreach (string a in part.Inventory.GetScriptAssemblies()) | ||
320 | { | ||
321 | if (a != "" && !assemblies.Contains(a)) | ||
322 | assemblies.Add(a); | ||
323 | } | ||
324 | |||
325 | foreach (KeyValuePair<UUID, string> s in part.Inventory.GetScriptStates()) | 316 | foreach (KeyValuePair<UUID, string> s in part.Inventory.GetScriptStates()) |
326 | { | ||
327 | states[s.Key] = s.Value; | 317 | states[s.Key] = s.Value; |
328 | } | ||
329 | } | 318 | } |
330 | 319 | ||
331 | if (states.Count < 1 || assemblies.Count < 1) | 320 | if (states.Count < 1) |
332 | return ""; | 321 | return ""; |
333 | 322 | ||
334 | XmlDocument xmldoc = new XmlDocument(); | 323 | XmlDocument xmldoc = new XmlDocument(); |
@@ -342,104 +331,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
342 | 331 | ||
343 | xmldoc.AppendChild(rootElement); | 332 | xmldoc.AppendChild(rootElement); |
344 | 333 | ||
345 | XmlElement wrapper = xmldoc.CreateElement("", "Assemblies", | ||
346 | ""); | ||
347 | 334 | ||
348 | rootElement.AppendChild(wrapper); | 335 | XmlElement wrapper = xmldoc.CreateElement("", "ScriptStates", |
349 | |||
350 | foreach (string assembly in assemblies) | ||
351 | { | ||
352 | string fn = Path.GetFileName(assembly); | ||
353 | if (fn == String.Empty) | ||
354 | continue; | ||
355 | |||
356 | String filedata = String.Empty; | ||
357 | |||
358 | if (File.Exists(assembly+".text")) | ||
359 | { | ||
360 | FileInfo tfi = new FileInfo(assembly+".text"); | ||
361 | |||
362 | if (tfi == null) | ||
363 | continue; | ||
364 | |||
365 | Byte[] tdata = new Byte[tfi.Length]; | ||
366 | |||
367 | try | ||
368 | { | ||
369 | FileStream tfs = File.Open(assembly+".text", FileMode.Open, FileAccess.Read); | ||
370 | tfs.Read(tdata, 0, tdata.Length); | ||
371 | tfs.Close(); | ||
372 | } | ||
373 | catch (Exception e) | ||
374 | { | ||
375 | m_log.DebugFormat("[SOG]: Unable to open script textfile {0}, reason: {1}", assembly+".text", e.Message); | ||
376 | } | ||
377 | |||
378 | filedata = new System.Text.ASCIIEncoding().GetString(tdata); | ||
379 | } | ||
380 | else | ||
381 | { | ||
382 | FileInfo fi = new FileInfo(assembly); | ||
383 | |||
384 | if (fi == null) | ||
385 | continue; | ||
386 | |||
387 | Byte[] data = new Byte[fi.Length]; | ||
388 | |||
389 | try | ||
390 | { | ||
391 | FileStream fs = File.Open(assembly, FileMode.Open, FileAccess.Read); | ||
392 | fs.Read(data, 0, data.Length); | ||
393 | fs.Close(); | ||
394 | } | ||
395 | catch (Exception e) | ||
396 | { | ||
397 | m_log.DebugFormat("[SOG]: Unable to open script assembly {0}, reason: {1}", assembly, e.Message); | ||
398 | } | ||
399 | |||
400 | filedata = System.Convert.ToBase64String(data); | ||
401 | } | ||
402 | XmlElement assemblyData = xmldoc.CreateElement("", "Assembly", ""); | ||
403 | XmlAttribute assemblyName = xmldoc.CreateAttribute("", "Filename", ""); | ||
404 | assemblyName.Value = fn; | ||
405 | assemblyData.Attributes.Append(assemblyName); | ||
406 | |||
407 | assemblyData.InnerText = filedata; | ||
408 | |||
409 | wrapper.AppendChild(assemblyData); | ||
410 | } | ||
411 | |||
412 | wrapper = xmldoc.CreateElement("", "ScriptStates", | ||
413 | ""); | 336 | ""); |
414 | 337 | ||
415 | rootElement.AppendChild(wrapper); | 338 | rootElement.AppendChild(wrapper); |
416 | 339 | ||
417 | foreach (KeyValuePair<UUID, string> state in states) | 340 | foreach (KeyValuePair<UUID, string> state in states) |
418 | { | 341 | { |
419 | XmlElement stateData = xmldoc.CreateElement("", "State", ""); | ||
420 | |||
421 | XmlAttribute stateID = xmldoc.CreateAttribute("", "UUID", ""); | ||
422 | stateID.Value = state.Key.ToString(); | ||
423 | stateData.Attributes.Append(stateID); | ||
424 | |||
425 | XmlDocument sdoc = new XmlDocument(); | 342 | XmlDocument sdoc = new XmlDocument(); |
426 | sdoc.LoadXml(state.Value); | 343 | sdoc.LoadXml(state.Value); |
427 | XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); | 344 | XmlNodeList rootL = sdoc.GetElementsByTagName("State"); |
428 | XmlNode rootNode = rootL[0]; | 345 | XmlNode rootNode = rootL[0]; |
429 | 346 | ||
430 | XmlNode newNode = xmldoc.ImportNode(rootNode, true); | 347 | XmlNode newNode = xmldoc.ImportNode(rootNode, true); |
431 | stateData.AppendChild(newNode); | 348 | wrapper.AppendChild(newNode); |
432 | wrapper.AppendChild(stateData); | ||
433 | } | 349 | } |
434 | 350 | ||
435 | return xmldoc.InnerXml; | 351 | return xmldoc.InnerXml; |
436 | } | 352 | } |
437 | 353 | ||
438 | public void SetState(string objXMLData, UUID RegionID) | 354 | public void SetState(string objXMLData, IScene ins) |
439 | { | 355 | { |
356 | if (!(ins is Scene)) | ||
357 | return; | ||
358 | |||
359 | Scene s = (Scene)ins; | ||
360 | |||
440 | if (objXMLData == String.Empty) | 361 | if (objXMLData == String.Empty) |
441 | return; | 362 | return; |
442 | 363 | ||
364 | IScriptModule scriptModule = null; | ||
365 | |||
366 | foreach (IScriptModule sm in s.RequestModuleInterfaces<IScriptModule>()) | ||
367 | { | ||
368 | if (sm.ScriptEngineName == s.DefaultScriptEngine) | ||
369 | scriptModule = sm; | ||
370 | else if (scriptModule == null) | ||
371 | scriptModule = sm; | ||
372 | } | ||
373 | |||
374 | if (scriptModule == null) | ||
375 | return; | ||
376 | |||
443 | XmlDocument doc = new XmlDocument(); | 377 | XmlDocument doc = new XmlDocument(); |
444 | try | 378 | try |
445 | { | 379 | { |
@@ -457,69 +391,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
457 | } | 391 | } |
458 | 392 | ||
459 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); | 393 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); |
460 | if (rootL.Count == 1) | 394 | if (rootL.Count != 1) |
395 | return; | ||
396 | |||
397 | XmlElement rootE = (XmlElement)rootL[0]; | ||
398 | |||
399 | XmlNodeList dataL = rootE.GetElementsByTagName("ScriptStates"); | ||
400 | if (dataL.Count != 1) | ||
401 | return; | ||
402 | |||
403 | XmlElement dataE = (XmlElement)dataL[0]; | ||
404 | |||
405 | foreach (XmlNode n in dataE.ChildNodes) | ||
461 | { | 406 | { |
462 | XmlNode rootNode = rootL[0]; | 407 | XmlElement stateE = (XmlElement)n; |
463 | if (rootNode != null) | 408 | UUID itemID = new UUID(stateE.GetAttribute("UUID")); |
464 | { | 409 | |
465 | XmlNodeList partL = rootNode.ChildNodes; | 410 | scriptModule.SetXMLState(itemID, n.OuterXml); |
466 | |||
467 | foreach (XmlNode part in partL) | ||
468 | { | ||
469 | XmlNodeList nodeL = part.ChildNodes; | ||
470 | |||
471 | switch (part.Name) | ||
472 | { | ||
473 | case "Assemblies": | ||
474 | foreach (XmlNode asm in nodeL) | ||
475 | { | ||
476 | string fn = asm.Attributes.GetNamedItem("Filename").Value; | ||
477 | |||
478 | Byte[] filedata = Convert.FromBase64String(asm.InnerText); | ||
479 | string path = Path.Combine("ScriptEngines", RegionID.ToString()); | ||
480 | path = Path.Combine(path, fn); | ||
481 | |||
482 | if (!File.Exists(path)) | ||
483 | { | ||
484 | FileStream fs = File.Create(path); | ||
485 | fs.Write(filedata, 0, filedata.Length); | ||
486 | fs.Close(); | ||
487 | |||
488 | Byte[] textbytes = new System.Text.ASCIIEncoding().GetBytes(asm.InnerText); | ||
489 | fs = File.Create(path+".text"); | ||
490 | fs.Write(textbytes, 0, textbytes.Length); | ||
491 | fs.Close(); | ||
492 | } | ||
493 | } | ||
494 | break; | ||
495 | case "ScriptStates": | ||
496 | foreach (XmlNode st in nodeL) | ||
497 | { | ||
498 | string id = st.Attributes.GetNamedItem("UUID").Value; | ||
499 | UUID uuid = new UUID(id); | ||
500 | XmlNode state = st.ChildNodes[0]; | ||
501 | |||
502 | XmlDocument sdoc = new XmlDocument(); | ||
503 | XmlNode sxmlnode = sdoc.CreateNode( | ||
504 | XmlNodeType.XmlDeclaration, | ||
505 | "", ""); | ||
506 | sdoc.AppendChild(sxmlnode); | ||
507 | |||
508 | XmlNode newnode = sdoc.ImportNode(state, true); | ||
509 | sdoc.AppendChild(newnode); | ||
510 | |||
511 | string spath = Path.Combine("ScriptEngines", RegionID.ToString()); | ||
512 | spath = Path.Combine(spath, uuid.ToString()); | ||
513 | FileStream sfs = File.Create(spath + ".state"); | ||
514 | System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | ||
515 | Byte[] buf = enc.GetBytes(sdoc.InnerXml); | ||
516 | sfs.Write(buf, 0, buf.Length); | ||
517 | sfs.Close(); | ||
518 | } | ||
519 | break; | ||
520 | } | ||
521 | } | ||
522 | } | ||
523 | } | 411 | } |
524 | } | 412 | } |
525 | } | 413 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index bcc9b37..7359011 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1199,6 +1199,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1199 | 1199 | ||
1200 | if (!silent) | 1200 | if (!silent) |
1201 | { | 1201 | { |
1202 | part.UpdateFlag = 0; | ||
1202 | if (part == m_rootPart) | 1203 | if (part == m_rootPart) |
1203 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 1204 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
1204 | } | 1205 | } |
@@ -3341,17 +3342,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3341 | } | 3342 | } |
3342 | #endregion | 3343 | #endregion |
3343 | 3344 | ||
3344 | public bool CanBeDeleted() | ||
3345 | { | ||
3346 | foreach (SceneObjectPart part in Children.Values) | ||
3347 | { | ||
3348 | if (!part.CanBeDeleted()) | ||
3349 | return false; | ||
3350 | } | ||
3351 | |||
3352 | return true; | ||
3353 | } | ||
3354 | |||
3355 | public double GetUpdatePriority(IClientAPI client) | 3345 | public double GetUpdatePriority(IClientAPI client) |
3356 | { | 3346 | { |
3357 | switch (Scene.UpdatePrioritizationScheme) | 3347 | switch (Scene.UpdatePrioritizationScheme) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6f1b458..b6916f2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3797,10 +3797,5 @@ namespace OpenSim.Region.Framework.Scenes | |||
3797 | 3797 | ||
3798 | Inventory.ApplyNextOwnerPermissions(); | 3798 | Inventory.ApplyNextOwnerPermissions(); |
3799 | } | 3799 | } |
3800 | |||
3801 | public bool CanBeDeleted() | ||
3802 | { | ||
3803 | return Inventory.CanBeDeleted(); | ||
3804 | } | ||
3805 | } | 3800 | } |
3806 | } | 3801 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index f4ca877..7a0d7b7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -857,36 +857,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
857 | return ret; | 857 | return ret; |
858 | } | 858 | } |
859 | 859 | ||
860 | public string[] GetScriptAssemblies() | ||
861 | { | ||
862 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
863 | |||
864 | List<string> ret = new List<string>(); | ||
865 | if (engines == null) // No engine at all | ||
866 | return new string[0]; | ||
867 | |||
868 | foreach (TaskInventoryItem item in m_items.Values) | ||
869 | { | ||
870 | if (item.InvType == (int)InventoryType.LSL) | ||
871 | { | ||
872 | foreach (IScriptModule e in engines) | ||
873 | { | ||
874 | if (e != null) | ||
875 | { | ||
876 | string n = e.GetAssemblyName(item.ItemID); | ||
877 | if (n != String.Empty) | ||
878 | { | ||
879 | if (!ret.Contains(n)) | ||
880 | ret.Add(n); | ||
881 | break; | ||
882 | } | ||
883 | } | ||
884 | } | ||
885 | } | ||
886 | } | ||
887 | return ret.ToArray(); | ||
888 | } | ||
889 | |||
890 | public Dictionary<UUID, string> GetScriptStates() | 860 | public Dictionary<UUID, string> GetScriptStates() |
891 | { | 861 | { |
892 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | 862 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); |
@@ -916,30 +886,5 @@ namespace OpenSim.Region.Framework.Scenes | |||
916 | } | 886 | } |
917 | return ret; | 887 | return ret; |
918 | } | 888 | } |
919 | |||
920 | public bool CanBeDeleted() | ||
921 | { | ||
922 | if (!ContainsScripts()) | ||
923 | return true; | ||
924 | |||
925 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
926 | |||
927 | if (engines == null) // No engine at all | ||
928 | return true; | ||
929 | |||
930 | foreach (TaskInventoryItem item in m_items.Values) | ||
931 | { | ||
932 | if (item.InvType == (int)InventoryType.LSL) | ||
933 | { | ||
934 | foreach (IScriptModule e in engines) | ||
935 | { | ||
936 | if (!e.CanBeDeleted(item.ItemID)) | ||
937 | return false; | ||
938 | } | ||
939 | } | ||
940 | } | ||
941 | |||
942 | return true; | ||
943 | } | ||
944 | } | 889 | } |
945 | } | 890 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5604e3d..bcad335 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -755,13 +755,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
755 | /// </summary> | 755 | /// </summary> |
756 | public void SendPrimUpdates() | 756 | public void SendPrimUpdates() |
757 | { | 757 | { |
758 | m_perfMonMS = Environment.TickCount; | 758 | m_perfMonMS = EnvironmentTickCount(); |
759 | 759 | ||
760 | m_sceneViewer.SendPrimUpdates(); | 760 | m_sceneViewer.SendPrimUpdates(); |
761 | 761 | ||
762 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 762 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
763 | } | 763 | } |
764 | 764 | ||
765 | /// <summary> | ||
766 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
767 | /// and negative every 24.9 days. This trims down TickCount so it doesn't wrap | ||
768 | /// for the callers. | ||
769 | /// This trims it to a 12 day interval so don't let your frame time get too long. | ||
770 | /// </summary> | ||
771 | /// <returns></returns> | ||
772 | const Int32 EnvironmentTickCountMask = 0x3fffffff; | ||
773 | private static Int32 EnvironmentTickCount() { | ||
774 | return Environment.TickCount & EnvironmentTickCountMask; | ||
775 | } | ||
776 | |||
777 | /// <summary> | ||
778 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
779 | /// and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
780 | /// 'EnvironmentTickCount()') and accounts for any wrapping. | ||
781 | /// </summary> | ||
782 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
783 | private static Int32 EnvironmentTickCountSubtract(Int32 prevValue) { | ||
784 | Int32 diff = EnvironmentTickCount() - prevValue; | ||
785 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); | ||
786 | } | ||
787 | |||
788 | |||
765 | #region Status Methods | 789 | #region Status Methods |
766 | 790 | ||
767 | /// <summary> | 791 | /// <summary> |
@@ -1148,7 +1172,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1148 | // return; | 1172 | // return; |
1149 | //} | 1173 | //} |
1150 | 1174 | ||
1151 | m_perfMonMS = Environment.TickCount; | 1175 | m_perfMonMS = EnvironmentTickCount(); |
1152 | 1176 | ||
1153 | ++m_movementUpdateCount; | 1177 | ++m_movementUpdateCount; |
1154 | if (m_movementUpdateCount < 1) | 1178 | if (m_movementUpdateCount < 1) |
@@ -1464,7 +1488,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1464 | 1488 | ||
1465 | m_scene.EventManager.TriggerOnClientMovement(this); | 1489 | m_scene.EventManager.TriggerOnClientMovement(this); |
1466 | 1490 | ||
1467 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 1491 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
1468 | } | 1492 | } |
1469 | 1493 | ||
1470 | public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) | 1494 | public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) |
@@ -1924,7 +1948,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1924 | return; | 1948 | return; |
1925 | } | 1949 | } |
1926 | 1950 | ||
1927 | m_perfMonMS = Environment.TickCount; | 1951 | m_perfMonMS = EnvironmentTickCount(); |
1928 | 1952 | ||
1929 | Rotation = rotation; | 1953 | Rotation = rotation; |
1930 | Vector3 direc = vec * rotation; | 1954 | Vector3 direc = vec * rotation; |
@@ -1966,7 +1990,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1966 | // TODO: Add the force instead of only setting it to support multiple forces per frame? | 1990 | // TODO: Add the force instead of only setting it to support multiple forces per frame? |
1967 | m_forceToApply = direc; | 1991 | m_forceToApply = direc; |
1968 | 1992 | ||
1969 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 1993 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
1970 | } | 1994 | } |
1971 | 1995 | ||
1972 | #endregion | 1996 | #endregion |
@@ -2032,7 +2056,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2032 | // server. | 2056 | // server. |
2033 | if (remoteClient.IsActive) | 2057 | if (remoteClient.IsActive) |
2034 | { | 2058 | { |
2035 | m_perfMonMS = Environment.TickCount; | 2059 | m_perfMonMS = EnvironmentTickCount(); |
2036 | 2060 | ||
2037 | PhysicsActor actor = m_physicsActor; | 2061 | PhysicsActor actor = m_physicsActor; |
2038 | Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero; | 2062 | Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero; |
@@ -2045,7 +2069,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2045 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 2069 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
2046 | pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); | 2070 | pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); |
2047 | 2071 | ||
2048 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2072 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2049 | m_scene.StatsReporter.AddAgentUpdates(1); | 2073 | m_scene.StatsReporter.AddAgentUpdates(1); |
2050 | } | 2074 | } |
2051 | } | 2075 | } |
@@ -2055,11 +2079,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2055 | /// </summary> | 2079 | /// </summary> |
2056 | public void SendTerseUpdateToAllClients() | 2080 | public void SendTerseUpdateToAllClients() |
2057 | { | 2081 | { |
2058 | m_perfMonMS = Environment.TickCount; | 2082 | m_perfMonMS = EnvironmentTickCount(); |
2059 | 2083 | ||
2060 | m_scene.ForEachClient(SendTerseUpdateToClient); | 2084 | m_scene.ForEachClient(SendTerseUpdateToClient); |
2061 | 2085 | ||
2062 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2086 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2063 | } | 2087 | } |
2064 | 2088 | ||
2065 | public void SendCoarseLocations() | 2089 | public void SendCoarseLocations() |
@@ -2079,7 +2103,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2079 | 2103 | ||
2080 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) | 2104 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) |
2081 | { | 2105 | { |
2082 | m_perfMonMS = Environment.TickCount; | 2106 | m_perfMonMS = EnvironmentTickCount(); |
2083 | 2107 | ||
2084 | List<Vector3> CoarseLocations = new List<Vector3>(); | 2108 | List<Vector3> CoarseLocations = new List<Vector3>(); |
2085 | List<UUID> AvatarUUIDs = new List<UUID>(); | 2109 | List<UUID> AvatarUUIDs = new List<UUID>(); |
@@ -2115,7 +2139,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2115 | 2139 | ||
2116 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); | 2140 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); |
2117 | 2141 | ||
2118 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2142 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2119 | } | 2143 | } |
2120 | 2144 | ||
2121 | public void CoarseLocationChange() | 2145 | public void CoarseLocationChange() |
@@ -2152,7 +2176,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2152 | /// </summary> | 2176 | /// </summary> |
2153 | public void SendInitialFullUpdateToAllClients() | 2177 | public void SendInitialFullUpdateToAllClients() |
2154 | { | 2178 | { |
2155 | m_perfMonMS = Environment.TickCount; | 2179 | m_perfMonMS = EnvironmentTickCount(); |
2156 | 2180 | ||
2157 | ScenePresence[] avatars = m_scene.GetScenePresences(); | 2181 | ScenePresence[] avatars = m_scene.GetScenePresences(); |
2158 | 2182 | ||
@@ -2178,14 +2202,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2178 | } | 2202 | } |
2179 | 2203 | ||
2180 | m_scene.StatsReporter.AddAgentUpdates(avatars.Length); | 2204 | m_scene.StatsReporter.AddAgentUpdates(avatars.Length); |
2181 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2205 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2182 | 2206 | ||
2183 | //Animator.SendAnimPack(); | 2207 | //Animator.SendAnimPack(); |
2184 | } | 2208 | } |
2185 | 2209 | ||
2186 | public void SendFullUpdateToAllClients() | 2210 | public void SendFullUpdateToAllClients() |
2187 | { | 2211 | { |
2188 | m_perfMonMS = Environment.TickCount; | 2212 | m_perfMonMS = EnvironmentTickCount(); |
2189 | 2213 | ||
2190 | // only send update from root agents to other clients; children are only "listening posts" | 2214 | // only send update from root agents to other clients; children are only "listening posts" |
2191 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 2215 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
@@ -2195,7 +2219,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2195 | 2219 | ||
2196 | } | 2220 | } |
2197 | m_scene.StatsReporter.AddAgentUpdates(avatars.Count); | 2221 | m_scene.StatsReporter.AddAgentUpdates(avatars.Count); |
2198 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2222 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2199 | 2223 | ||
2200 | Animator.SendAnimPack(); | 2224 | Animator.SendAnimPack(); |
2201 | } | 2225 | } |
@@ -2237,7 +2261,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2237 | /// </summary> | 2261 | /// </summary> |
2238 | public void SendAppearanceToAllOtherAgents() | 2262 | public void SendAppearanceToAllOtherAgents() |
2239 | { | 2263 | { |
2240 | m_perfMonMS = Environment.TickCount; | 2264 | m_perfMonMS = EnvironmentTickCount(); |
2241 | 2265 | ||
2242 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2266 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2243 | { | 2267 | { |
@@ -2247,7 +2271,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2247 | } | 2271 | } |
2248 | }); | 2272 | }); |
2249 | 2273 | ||
2250 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2274 | m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); |
2251 | } | 2275 | } |
2252 | 2276 | ||
2253 | /// <summary> | 2277 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index ee288b3..f92f440 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -82,6 +82,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
82 | private int m_fps = 0; | 82 | private int m_fps = 0; |
83 | // saved last reported value so there is something available for llGetRegionFPS | 83 | // saved last reported value so there is something available for llGetRegionFPS |
84 | private float lastReportedSimFPS = 0; | 84 | private float lastReportedSimFPS = 0; |
85 | private float[] lastReportedSimStats = new float[21]; | ||
85 | private float m_pfps = 0; | 86 | private float m_pfps = 0; |
86 | private int m_agentUpdates = 0; | 87 | private int m_agentUpdates = 0; |
87 | 88 | ||
@@ -192,6 +193,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
192 | // / 10 divides the value by the number of times the sim heartbeat runs (10fps) | 193 | // / 10 divides the value by the number of times the sim heartbeat runs (10fps) |
193 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. | 194 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. |
194 | 195 | ||
196 | // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change | ||
197 | // values to X-per-second values. | ||
198 | |||
195 | for (int i = 0; i<21;i++) | 199 | for (int i = 0; i<21;i++) |
196 | { | 200 | { |
197 | sb[i] = new SimStatsPacket.StatBlock(); | 201 | sb[i] = new SimStatsPacket.StatBlock(); |
@@ -236,8 +240,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
236 | sb[12].StatID = (uint)Stats.OtherMS; | 240 | sb[12].StatID = (uint)Stats.OtherMS; |
237 | sb[12].StatValue = m_otherMS / statsUpdateFactor; | 241 | sb[12].StatValue = m_otherMS / statsUpdateFactor; |
238 | 242 | ||
239 | sb[13].StatID = (uint)Stats.InPacketsPerSecond; | 243 | sb[13].StatID = (uint)Stats.InPacketsPerSecond; |
240 | sb[13].StatValue = (m_inPacketsPerSecond); | 244 | sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor); |
241 | 245 | ||
242 | sb[14].StatID = (uint)Stats.OutPacketsPerSecond; | 246 | sb[14].StatID = (uint)Stats.OutPacketsPerSecond; |
243 | sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); | 247 | sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); |
@@ -259,6 +263,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
259 | 263 | ||
260 | sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; | 264 | sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; |
261 | sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; | 265 | sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; |
266 | |||
267 | for (int i = 0; i < 21; i++) | ||
268 | { | ||
269 | lastReportedSimStats[i] = sb[i].StatValue; | ||
270 | } | ||
262 | 271 | ||
263 | SimStats simStats | 272 | SimStats simStats |
264 | = new SimStats( | 273 | = new SimStats( |
@@ -279,8 +288,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
279 | m_fps = 0; | 288 | m_fps = 0; |
280 | m_pfps = 0; | 289 | m_pfps = 0; |
281 | m_agentUpdates = 0; | 290 | m_agentUpdates = 0; |
282 | m_inPacketsPerSecond = 0; | 291 | //m_inPacketsPerSecond = 0; |
283 | m_outPacketsPerSecond = 0; | 292 | //m_outPacketsPerSecond = 0; |
284 | m_unAckedBytes = 0; | 293 | m_unAckedBytes = 0; |
285 | m_scriptLinesPerSecond = 0; | 294 | m_scriptLinesPerSecond = 0; |
286 | 295 | ||
@@ -367,12 +376,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
367 | 376 | ||
368 | public void AddInPackets(int numPackets) | 377 | public void AddInPackets(int numPackets) |
369 | { | 378 | { |
370 | m_inPacketsPerSecond += numPackets; | 379 | m_inPacketsPerSecond = numPackets; |
371 | } | 380 | } |
372 | 381 | ||
373 | public void AddOutPackets(int numPackets) | 382 | public void AddOutPackets(int numPackets) |
374 | { | 383 | { |
375 | m_outPacketsPerSecond += numPackets; | 384 | m_outPacketsPerSecond = numPackets; |
376 | } | 385 | } |
377 | 386 | ||
378 | public void AddunAckedBytes(int numBytes) | 387 | public void AddunAckedBytes(int numBytes) |
@@ -438,6 +447,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
438 | { | 447 | { |
439 | return lastReportedSimFPS; | 448 | return lastReportedSimFPS; |
440 | } | 449 | } |
450 | |||
451 | public float[] getLastReportedSimStats() | ||
452 | { | ||
453 | return lastReportedSimStats; | ||
454 | } | ||
441 | 455 | ||
442 | public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) | 456 | public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) |
443 | { | 457 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs index 70e80bc..e664b44 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs | |||
@@ -69,13 +69,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
69 | m_config = config.Configs["IRC"]; | 69 | m_config = config.Configs["IRC"]; |
70 | if (m_config == null) | 70 | if (m_config == null) |
71 | { | 71 | { |
72 | m_log.InfoFormat("[IRC-Bridge] module not configured"); | 72 | // m_log.InfoFormat("[IRC-Bridge] module not configured"); |
73 | return; | 73 | return; |
74 | } | 74 | } |
75 | 75 | ||
76 | if (!m_config.GetBoolean("enabled", false)) | 76 | if (!m_config.GetBoolean("enabled", false)) |
77 | { | 77 | { |
78 | m_log.InfoFormat("[IRC-Bridge] module disabled in configuration"); | 78 | // m_log.InfoFormat("[IRC-Bridge] module disabled in configuration"); |
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | 81 | ||
@@ -85,6 +85,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
85 | } | 85 | } |
86 | 86 | ||
87 | m_pluginEnabled = true; | 87 | m_pluginEnabled = true; |
88 | m_log.InfoFormat("[IRC-Bridge]: Module enabled"); | ||
88 | } | 89 | } |
89 | 90 | ||
90 | public void AddRegion(Scene scene) | 91 | public void AddRegion(Scene scene) |
@@ -143,7 +144,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
143 | 144 | ||
144 | public static XmlRpcResponse XmlRpcAdminMethod(XmlRpcRequest request, IPEndPoint remoteClient) | 145 | public static XmlRpcResponse XmlRpcAdminMethod(XmlRpcRequest request, IPEndPoint remoteClient) |
145 | { | 146 | { |
146 | m_log.Info("[IRC-Bridge]: XML RPC Admin Entry"); | 147 | m_log.Debug("[IRC-Bridge]: XML RPC Admin Entry"); |
147 | 148 | ||
148 | XmlRpcResponse response = new XmlRpcResponse(); | 149 | XmlRpcResponse response = new XmlRpcResponse(); |
149 | Hashtable responseData = new Hashtable(); | 150 | Hashtable responseData = new Hashtable(); |
@@ -188,7 +189,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
188 | } | 189 | } |
189 | catch (Exception e) | 190 | catch (Exception e) |
190 | { | 191 | { |
191 | m_log.InfoFormat("[IRC-Bridge] XML RPC Admin request failed : {0}", e.Message); | 192 | m_log.ErrorFormat("[IRC-Bridge] XML RPC Admin request failed : {0}", e.Message); |
192 | 193 | ||
193 | responseData["success"] = "false"; | 194 | responseData["success"] = "false"; |
194 | responseData["error"] = e.Message; | 195 | responseData["error"] = e.Message; |
diff --git a/OpenSim/Region/OptionalModules/Python/PythonAPI/Console.cs b/OpenSim/Region/OptionalModules/Python/PythonAPI/Console.cs deleted file mode 100644 index a823ff9..0000000 --- a/OpenSim/Region/OptionalModules/Python/PythonAPI/Console.cs +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using log4net; | ||
31 | |||
32 | namespace OpenSim.Region.Modules.Python.PythonAPI | ||
33 | { | ||
34 | class Console | ||
35 | { | ||
36 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
37 | |||
38 | public void WriteLine(string txt) | ||
39 | { | ||
40 | m_log.Info(txt); | ||
41 | } | ||
42 | |||
43 | public void WriteLine(string txt, params Object[] e) | ||
44 | { | ||
45 | m_log.Info(String.Format(txt, e)); | ||
46 | } | ||
47 | } | ||
48 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Python/PythonModule.cs b/OpenSim/Region/OptionalModules/Python/PythonModule.cs deleted file mode 100644 index ce35363..0000000 --- a/OpenSim/Region/OptionalModules/Python/PythonModule.cs +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Security.Policy; | ||
32 | using System.Text; | ||
33 | using IronPython.Hosting; | ||
34 | using log4net; | ||
35 | using Nini.Config; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | |||
39 | namespace OpenSim.Region.Modules.Python | ||
40 | { | ||
41 | class PythonModule : IRegionModule | ||
42 | { | ||
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | private PythonEngine m_python; | ||
45 | |||
46 | public void Initialise(Scene scene, IConfigSource source) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | public void PostInitialise() | ||
51 | { | ||
52 | m_log.Info("[PYTHON] Initialising IronPython engine."); | ||
53 | m_python = new PythonEngine(); | ||
54 | m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); | ||
55 | } | ||
56 | |||
57 | public void Close() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | public string Name | ||
62 | { | ||
63 | get { return "PythonModule"; } | ||
64 | } | ||
65 | |||
66 | public bool IsSharedModule | ||
67 | { | ||
68 | get { return true; } | ||
69 | } | ||
70 | } | ||
71 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index 91c25a6..c653e98 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
62 | 62 | ||
63 | public void Initialise(IConfigSource config) | 63 | public void Initialise(IConfigSource config) |
64 | { | 64 | { |
65 | m_log.Info("[RegionReady] Initialising"); | 65 | //m_log.Info("[RegionReady] Initialising"); |
66 | 66 | ||
67 | m_config = config.Configs["RegionReady"]; | 67 | m_config = config.Configs["RegionReady"]; |
68 | if (m_config != null) | 68 | if (m_config != null) |
@@ -74,8 +74,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | if (!m_enabled) | 77 | // if (!m_enabled) |
78 | m_log.Info("[RegionReady] disabled."); | 78 | // m_log.Info("[RegionReady] disabled."); |
79 | } | 79 | } |
80 | 80 | ||
81 | public void AddRegion(Scene scene) | 81 | public void AddRegion(Scene scene) |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
92 | m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; | 92 | m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; |
93 | m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; | 93 | m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; |
94 | 94 | ||
95 | m_log.InfoFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); | 95 | m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); |
96 | } | 96 | } |
97 | 97 | ||
98 | public void RemoveRegion(Scene scene) | 98 | public void RemoveRegion(Scene scene) |
@@ -120,7 +120,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
120 | } | 120 | } |
121 | 121 | ||
122 | #endregion | 122 | #endregion |
123 | |||
124 | 123 | ||
125 | void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) | 124 | void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) |
126 | { | 125 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 17552d2..9e9c36f 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -2099,7 +2099,10 @@ Console.WriteLine(" JointCreateFixed"); | |||
2099 | // Re creates body on size. | 2099 | // Re creates body on size. |
2100 | // EnableBody also does setMass() | 2100 | // EnableBody also does setMass() |
2101 | enableBody(); | 2101 | enableBody(); |
2102 | d.BodyEnable(Body); | 2102 | if (Body != IntPtr.Zero) |
2103 | { | ||
2104 | d.BodyEnable(Body); | ||
2105 | } | ||
2103 | } | 2106 | } |
2104 | _parent_scene.geom_name_map[prim_geom] = oldname; | 2107 | _parent_scene.geom_name_map[prim_geom] = oldname; |
2105 | 2108 | ||
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index f49aea8..ae148a9 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -96,7 +96,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
96 | UUID GetDetectID(int idx); | 96 | UUID GetDetectID(int idx); |
97 | void SaveState(string assembly); | 97 | void SaveState(string assembly); |
98 | void DestroyScriptInstance(); | 98 | void DestroyScriptInstance(); |
99 | bool CanBeDeleted(); | ||
100 | 99 | ||
101 | IScriptApi GetApi(string name); | 100 | IScriptApi GetApi(string name); |
102 | 101 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 9d97cb2..ee32755 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -236,7 +236,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
236 | iHttpReq.StopHttpRequest(localID, itemID); | 236 | iHttpReq.StopHttpRequest(localID, itemID); |
237 | 237 | ||
238 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); | 238 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); |
239 | comms.DeleteListener(itemID); | 239 | if (comms != null) |
240 | comms.DeleteListener(itemID); | ||
240 | 241 | ||
241 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); | 242 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); |
242 | xmlrpc.DeleteChannels(itemID); | 243 | xmlrpc.DeleteChannels(itemID); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9c62775..d235bac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -734,7 +734,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
734 | ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); | 734 | ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); |
735 | 735 | ||
736 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 736 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
737 | wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); | 737 | if (wComm != null) |
738 | wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); | ||
738 | } | 739 | } |
739 | 740 | ||
740 | public void llSay(int channelID, string text) | 741 | public void llSay(int channelID, string text) |
@@ -754,7 +755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
754 | ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); | 755 | ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); |
755 | 756 | ||
756 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 757 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
757 | wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); | 758 | if (wComm != null) |
759 | wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); | ||
758 | } | 760 | } |
759 | } | 761 | } |
760 | 762 | ||
@@ -769,7 +771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
769 | ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); | 771 | ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); |
770 | 772 | ||
771 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 773 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
772 | wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); | 774 | if (wComm != null) |
775 | wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); | ||
773 | } | 776 | } |
774 | 777 | ||
775 | public void llRegionSay(int channelID, string text) | 778 | public void llRegionSay(int channelID, string text) |
@@ -786,7 +789,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
786 | m_host.AddScriptLPS(1); | 789 | m_host.AddScriptLPS(1); |
787 | 790 | ||
788 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 791 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
789 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | 792 | if (wComm != null) |
793 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | ||
790 | } | 794 | } |
791 | 795 | ||
792 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) | 796 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) |
@@ -795,21 +799,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
795 | UUID keyID; | 799 | UUID keyID; |
796 | UUID.TryParse(ID, out keyID); | 800 | UUID.TryParse(ID, out keyID); |
797 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 801 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
798 | return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); | 802 | if (wComm != null) |
803 | return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, keyID, msg); | ||
804 | else | ||
805 | return -1; | ||
799 | } | 806 | } |
800 | 807 | ||
801 | public void llListenControl(int number, int active) | 808 | public void llListenControl(int number, int active) |
802 | { | 809 | { |
803 | m_host.AddScriptLPS(1); | 810 | m_host.AddScriptLPS(1); |
804 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 811 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
805 | wComm.ListenControl(m_itemID, number, active); | 812 | if (wComm != null) |
813 | wComm.ListenControl(m_itemID, number, active); | ||
806 | } | 814 | } |
807 | 815 | ||
808 | public void llListenRemove(int number) | 816 | public void llListenRemove(int number) |
809 | { | 817 | { |
810 | m_host.AddScriptLPS(1); | 818 | m_host.AddScriptLPS(1); |
811 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 819 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
812 | wComm.ListenRemove(m_itemID, number); | 820 | if (wComm != null) |
821 | wComm.ListenRemove(m_itemID, number); | ||
813 | } | 822 | } |
814 | 823 | ||
815 | public void llSensor(string name, string id, int type, double range, double arc) | 824 | public void llSensor(string name, string id, int type, double range, double arc) |
@@ -1037,7 +1046,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1037 | return detectedParams.TouchUV; | 1046 | return detectedParams.TouchUV; |
1038 | } | 1047 | } |
1039 | 1048 | ||
1040 | public void llDie() | 1049 | public virtual void llDie() |
1041 | { | 1050 | { |
1042 | m_host.AddScriptLPS(1); | 1051 | m_host.AddScriptLPS(1); |
1043 | throw new SelfDeleteException(); | 1052 | throw new SelfDeleteException(); |
@@ -1987,6 +1996,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1987 | 1996 | ||
1988 | //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type | 1997 | //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type |
1989 | // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; | 1998 | // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; |
1999 | |||
2000 | // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line | ||
2001 | // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt | ||
2002 | // It's perfectly okay when the object is not an active physical body though. | ||
2003 | // So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against | ||
2004 | // but only if the object is not physial and active. This is important for rotating doors. | ||
2005 | // without the absoluteposition = absoluteposition happening, the doors do not move in the physics | ||
2006 | // scene | ||
2007 | if (part.PhysActor != null && !part.PhysActor.IsPhysical) | ||
2008 | { | ||
2009 | part.ParentGroup.ResetChildPrimPhysicsPositions(); | ||
2010 | } | ||
1990 | } | 2011 | } |
1991 | 2012 | ||
1992 | /// <summary> | 2013 | /// <summary> |
@@ -5772,6 +5793,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5772 | m_host.AddScriptLPS(1); | 5793 | m_host.AddScriptLPS(1); |
5773 | return World.SimulatorFPS; | 5794 | return World.SimulatorFPS; |
5774 | } | 5795 | } |
5796 | |||
5775 | 5797 | ||
5776 | /* particle system rules should be coming into this routine as doubles, that is | 5798 | /* particle system rules should be coming into this routine as doubles, that is |
5777 | rule[0] should be an integer from this list and rule[1] should be the arg | 5799 | rule[0] should be an integer from this list and rule[1] should be the arg |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e72fa70..5501679 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1948,5 +1948,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1948 | 1948 | ||
1949 | return key.ToString(); | 1949 | return key.ToString(); |
1950 | } | 1950 | } |
1951 | |||
1952 | /// <summary> | ||
1953 | /// Return information regarding various simulator statistics (sim fps, physics fps, time | ||
1954 | /// dilation, total number of prims, total number of active scripts, script lps, various | ||
1955 | /// timing data, packets in/out, etc. Basically much the information that's shown in the | ||
1956 | /// client's Statistics Bar (Ctrl-Shift-1) | ||
1957 | /// </summary> | ||
1958 | /// <returns>List of floats</returns> | ||
1959 | public LSL_List osGetRegionStats() | ||
1960 | { | ||
1961 | CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); | ||
1962 | m_host.AddScriptLPS(1); | ||
1963 | LSL_List ret = new LSL_List(); | ||
1964 | float[] stats = World.SimulatorStats; | ||
1965 | |||
1966 | for (int i = 0; i < 21; i++) | ||
1967 | { | ||
1968 | ret.Add(new LSL_Float( stats[i] )); | ||
1969 | } | ||
1970 | return ret; | ||
1971 | } | ||
1972 | |||
1951 | } | 1973 | } |
1952 | } | 1974 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs index 0716d45..eeb59d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs | |||
@@ -166,7 +166,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
166 | ts.next = DateTime.Now.Ticks + (long)data[idx+1]; | 166 | ts.next = DateTime.Now.Ticks + (long)data[idx+1]; |
167 | idx += 2; | 167 | idx += 2; |
168 | 168 | ||
169 | Timers.Add(MakeTimerKey(localID,itemID), ts); | 169 | lock (TimerListLock) |
170 | { | ||
171 | Timers.Add(MakeTimerKey(localID, itemID), ts); | ||
172 | } | ||
170 | } | 173 | } |
171 | } | 174 | } |
172 | } | 175 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 470946a..0b0dc00 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -162,5 +162,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
162 | 162 | ||
163 | key osGetMapTexture(); | 163 | key osGetMapTexture(); |
164 | key osGetRegionMapTexture(string regionName); | 164 | key osGetRegionMapTexture(string regionName); |
165 | LSL_List osGetRegionStats(); | ||
165 | } | 166 | } |
166 | } | 167 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 753ca55..acff8fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -515,6 +515,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
515 | public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f"; | 515 | public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f"; |
516 | public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; | 516 | public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; |
517 | public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; | 517 | public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; |
518 | |||
519 | // Constants for osGetRegionStats | ||
520 | public const int STATS_TIME_DILATION = 0; | ||
521 | public const int STATS_SIM_FPS = 1; | ||
522 | public const int STATS_PHYSICS_FPS = 2; | ||
523 | public const int STATS_AGENT_UPDATES = 3; | ||
524 | public const int STATS_ROOT_AGENTS = 4; | ||
525 | public const int STATS_CHILD_AGENTS = 5; | ||
526 | public const int STATS_TOTAL_PRIMS = 6; | ||
527 | public const int STATS_ACTIVE_PRIMS = 7; | ||
528 | public const int STATS_FRAME_MS = 8; | ||
529 | public const int STATS_NET_MS = 9; | ||
530 | public const int STATS_PHYSICS_MS = 10; | ||
531 | public const int STATS_IMAGE_MS = 11; | ||
532 | public const int STATS_OTHER_MS = 12; | ||
533 | public const int STATS_IN_PACKETS_PER_SECOND = 13; | ||
534 | public const int STATS_OUT_PACKETS_PER_SECOND = 14; | ||
535 | public const int STATS_UNACKED_BYTES = 15; | ||
536 | public const int STATS_AGENT_MS = 16; | ||
537 | public const int STATS_PENDING_DOWNLOADS = 17; | ||
538 | public const int STATS_PENDING_UPLOADS = 18; | ||
539 | public const int STATS_ACTIVE_SCRIPTS = 19; | ||
540 | public const int STATS_SCRIPT_LPS = 20; | ||
518 | 541 | ||
519 | } | 542 | } |
520 | } | 543 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 6b88834..519463e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -632,5 +632,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
632 | { | 632 | { |
633 | return m_OSSL_Functions.osGetRegionMapTexture(regionName); | 633 | return m_OSSL_Functions.osGetRegionMapTexture(regionName); |
634 | } | 634 | } |
635 | |||
636 | public LSL_List osGetRegionStats() | ||
637 | { | ||
638 | return m_OSSL_Functions.osGetRegionStats(); | ||
639 | } | ||
635 | } | 640 | } |
636 | } | 641 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 41b5d49..5c5d57e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -1011,10 +1011,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1011 | { | 1011 | { |
1012 | get { return m_RegionID; } | 1012 | get { return m_RegionID; } |
1013 | } | 1013 | } |
1014 | |||
1015 | public bool CanBeDeleted() | ||
1016 | { | ||
1017 | return true; | ||
1018 | } | ||
1019 | } | 1014 | } |
1020 | } | 1015 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a60c0ba..9030a5c 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1245,34 +1245,219 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1245 | } | 1245 | } |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | public string GetAssemblyName(UUID itemID) | ||
1249 | { | ||
1250 | IScriptInstance instance = GetInstance(itemID); | ||
1251 | if (instance == null) | ||
1252 | return ""; | ||
1253 | return instance.GetAssemblyName(); | ||
1254 | } | ||
1255 | |||
1256 | public string GetXMLState(UUID itemID) | 1248 | public string GetXMLState(UUID itemID) |
1257 | { | 1249 | { |
1258 | IScriptInstance instance = GetInstance(itemID); | 1250 | IScriptInstance instance = GetInstance(itemID); |
1259 | if (instance == null) | 1251 | if (instance == null) |
1260 | return ""; | 1252 | return ""; |
1261 | return instance.GetXMLState(); | 1253 | string xml = instance.GetXMLState(); |
1262 | } | ||
1263 | 1254 | ||
1264 | public bool CanBeDeleted(UUID itemID) | 1255 | XmlDocument sdoc = new XmlDocument(); |
1265 | { | 1256 | sdoc.LoadXml(xml); |
1266 | IScriptInstance instance = GetInstance(itemID); | 1257 | XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); |
1267 | if (instance == null) | 1258 | XmlNode rootNode = rootL[0]; |
1268 | return true; | 1259 | |
1260 | // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> | ||
1261 | XmlDocument doc = new XmlDocument(); | ||
1262 | XmlElement stateData = doc.CreateElement("", "State", ""); | ||
1263 | XmlAttribute stateID = doc.CreateAttribute("", "UUID", ""); | ||
1264 | stateID.Value = itemID.ToString(); | ||
1265 | stateData.Attributes.Append(stateID); | ||
1266 | XmlAttribute assetID = doc.CreateAttribute("", "Asset", ""); | ||
1267 | assetID.Value = instance.AssetID.ToString(); | ||
1268 | stateData.Attributes.Append(assetID); | ||
1269 | doc.AppendChild(stateData); | ||
1270 | |||
1271 | // Add <ScriptState>...</ScriptState> | ||
1272 | XmlNode xmlstate = doc.ImportNode(rootNode, true); | ||
1273 | stateData.AppendChild(xmlstate); | ||
1274 | |||
1275 | string assemName = instance.GetAssemblyName(); | ||
1276 | |||
1277 | string fn = Path.GetFileName(assemName); | ||
1278 | |||
1279 | string assem = String.Empty; | ||
1280 | |||
1281 | if (File.Exists(assemName + ".text")) | ||
1282 | { | ||
1283 | FileInfo tfi = new FileInfo(assemName + ".text"); | ||
1284 | |||
1285 | if (tfi != null) | ||
1286 | { | ||
1287 | Byte[] tdata = new Byte[tfi.Length]; | ||
1288 | |||
1289 | try | ||
1290 | { | ||
1291 | FileStream tfs = File.Open(assemName + ".text", | ||
1292 | FileMode.Open, FileAccess.Read); | ||
1293 | tfs.Read(tdata, 0, tdata.Length); | ||
1294 | tfs.Close(); | ||
1295 | |||
1296 | assem = new System.Text.ASCIIEncoding().GetString(tdata); | ||
1297 | } | ||
1298 | catch (Exception e) | ||
1299 | { | ||
1300 | m_log.DebugFormat("[XEngine]: Unable to open script textfile {0}, reason: {1}", assemName+".text", e.Message); | ||
1301 | } | ||
1302 | } | ||
1303 | } | ||
1304 | else | ||
1305 | { | ||
1306 | FileInfo fi = new FileInfo(assemName); | ||
1307 | |||
1308 | if (fi != null) | ||
1309 | { | ||
1310 | Byte[] data = new Byte[fi.Length]; | ||
1311 | |||
1312 | try | ||
1313 | { | ||
1314 | FileStream fs = File.Open(assemName, FileMode.Open, FileAccess.Read); | ||
1315 | fs.Read(data, 0, data.Length); | ||
1316 | fs.Close(); | ||
1317 | |||
1318 | assem = System.Convert.ToBase64String(data); | ||
1319 | } | ||
1320 | catch (Exception e) | ||
1321 | { | ||
1322 | m_log.DebugFormat("[XEngine]: Unable to open script assembly {0}, reason: {1}", assemName, e.Message); | ||
1323 | } | ||
1324 | |||
1325 | } | ||
1326 | } | ||
1327 | |||
1328 | string map = String.Empty; | ||
1329 | |||
1330 | if (File.Exists(fn + ".map")) | ||
1331 | { | ||
1332 | FileStream mfs = File.Open(fn + ".map", FileMode.Open, FileAccess.Read); | ||
1333 | StreamReader msr = new StreamReader(mfs); | ||
1334 | |||
1335 | map = msr.ReadToEnd(); | ||
1336 | |||
1337 | msr.Close(); | ||
1338 | mfs.Close(); | ||
1339 | } | ||
1340 | |||
1341 | XmlElement assemblyData = doc.CreateElement("", "Assembly", ""); | ||
1342 | XmlAttribute assemblyName = doc.CreateAttribute("", "Filename", ""); | ||
1343 | |||
1344 | assemblyName.Value = fn; | ||
1345 | assemblyData.Attributes.Append(assemblyName); | ||
1346 | |||
1347 | assemblyData.InnerText = assem; | ||
1348 | |||
1349 | stateData.AppendChild(assemblyData); | ||
1269 | 1350 | ||
1270 | return instance.CanBeDeleted(); | 1351 | XmlElement mapData = doc.CreateElement("", "LineMap", ""); |
1352 | XmlAttribute mapName = doc.CreateAttribute("", "Filename", ""); | ||
1353 | |||
1354 | mapName.Value = fn + ".map"; | ||
1355 | mapData.Attributes.Append(mapName); | ||
1356 | |||
1357 | mapData.InnerText = map; | ||
1358 | |||
1359 | stateData.AppendChild(mapData); | ||
1360 | return doc.InnerXml; | ||
1271 | } | 1361 | } |
1272 | 1362 | ||
1273 | private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) | 1363 | private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) |
1274 | { | 1364 | { |
1275 | return false; | 1365 | return false; |
1276 | } | 1366 | } |
1367 | |||
1368 | public void SetXMLState(UUID itemID, string xml) | ||
1369 | { | ||
1370 | if (xml == String.Empty) | ||
1371 | return; | ||
1372 | |||
1373 | XmlDocument doc = new XmlDocument(); | ||
1374 | |||
1375 | try | ||
1376 | { | ||
1377 | doc.LoadXml(xml); | ||
1378 | } | ||
1379 | catch (Exception) | ||
1380 | { | ||
1381 | m_log.Error("[XEngine]: Exception decoding XML data from region transfer"); | ||
1382 | return; | ||
1383 | } | ||
1384 | |||
1385 | XmlNodeList rootL = doc.GetElementsByTagName("State"); | ||
1386 | if (rootL.Count < 1) | ||
1387 | return; | ||
1388 | |||
1389 | XmlElement rootE = (XmlElement)rootL[0]; | ||
1390 | |||
1391 | if (rootE.GetAttribute("UUID") != itemID.ToString()) | ||
1392 | return; | ||
1393 | |||
1394 | // string assetID = rootE.GetAttribute("Asset"); | ||
1395 | |||
1396 | XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState"); | ||
1397 | |||
1398 | if (stateL.Count != 1) | ||
1399 | return; | ||
1400 | |||
1401 | XmlElement stateE = (XmlElement)stateL[0]; | ||
1402 | |||
1403 | if (World.m_trustBinaries) | ||
1404 | { | ||
1405 | XmlNodeList assemL = rootE.GetElementsByTagName("Assembly"); | ||
1406 | |||
1407 | if (assemL.Count != 1) | ||
1408 | return; | ||
1409 | |||
1410 | XmlElement assemE = (XmlElement)assemL[0]; | ||
1411 | |||
1412 | string fn = assemE.GetAttribute("Filename"); | ||
1413 | string base64 = assemE.InnerText; | ||
1414 | |||
1415 | string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | ||
1416 | path = Path.Combine(path, fn); | ||
1417 | |||
1418 | if (!File.Exists(path)) | ||
1419 | { | ||
1420 | Byte[] filedata = Convert.FromBase64String(base64); | ||
1421 | |||
1422 | FileStream fs = File.Create(path); | ||
1423 | fs.Write(filedata, 0, filedata.Length); | ||
1424 | fs.Close(); | ||
1425 | |||
1426 | fs = File.Create(path + ".text"); | ||
1427 | StreamWriter sw = new StreamWriter(fs); | ||
1428 | |||
1429 | sw.Write(base64); | ||
1430 | |||
1431 | sw.Close(); | ||
1432 | fs.Close(); | ||
1433 | } | ||
1434 | } | ||
1435 | |||
1436 | string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | ||
1437 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); | ||
1438 | |||
1439 | FileStream sfs = File.Create(statepath); | ||
1440 | StreamWriter ssw = new StreamWriter(sfs); | ||
1441 | |||
1442 | ssw.Write(stateE.OuterXml); | ||
1443 | |||
1444 | ssw.Close(); | ||
1445 | sfs.Close(); | ||
1446 | |||
1447 | XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); | ||
1448 | |||
1449 | XmlElement mapE = (XmlElement)mapL[0]; | ||
1450 | |||
1451 | string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | ||
1452 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); | ||
1453 | |||
1454 | FileStream mfs = File.Create(mappath); | ||
1455 | StreamWriter msw = new StreamWriter(mfs); | ||
1456 | |||
1457 | msw.Write(mapE.InnerText); | ||
1458 | |||
1459 | msw.Close(); | ||
1460 | mfs.Close(); | ||
1461 | } | ||
1277 | } | 1462 | } |
1278 | } | 1463 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index 20ea18f..cc1dfbf 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | |||
@@ -38,10 +38,10 @@ namespace OpenSim.Tests.Common.Mock | |||
38 | /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit | 38 | /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit |
39 | /// tests are single threaded. | 39 | /// tests are single threaded. |
40 | /// </summary> | 40 | /// </summary> |
41 | public class TestAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin | 41 | public class MockAssetDataPlugin : BaseAssetRepository, IAssetDataPlugin |
42 | { | 42 | { |
43 | public string Version { get { return "0"; } } | 43 | public string Version { get { return "0"; } } |
44 | public string Name { get { return "TestAssetDataPlugin"; } } | 44 | public string Name { get { return "MockAssetDataPlugin"; } } |
45 | 45 | ||
46 | public void Initialise() {} | 46 | public void Initialise() {} |
47 | public void Initialise(string connect) {} | 47 | public void Initialise(string connect) {} |