diff options
author | Diva Canto | 2013-07-09 14:13:51 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-09 14:13:51 -0700 |
commit | d0dfb744b206d3bd002ed72f415f177c6b04226b (patch) | |
tree | dba29f24667d254371abb726e2842700c189dfdf /OpenSim/Region/CoreModules | |
parent | Put guards on a bunch of exception-inducing code, as seen in logs from load t... (diff) | |
parent | BulletSim: add parameter to optionally disable vehicle linear deflection. (diff) | |
download | opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.zip opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.gz opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.bz2 opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 329 insertions, 72 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 08196f1..2116605 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
54 | m_FriendsModule = fmodule; | 54 | m_FriendsModule = fmodule; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle( | 57 | protected override byte[] ProcessRequest( |
58 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 58 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | StreamReader sr = new StreamReader(requestData); | 60 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index a542d62..0cd495c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -122,9 +122,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
122 | { | 122 | { |
123 | string uri = "/CAPS/" + UUID.Random(); | 123 | string uri = "/CAPS/" + UUID.Random(); |
124 | 124 | ||
125 | caps.RegisterHandler("UntrustedSimulatorMessage", | 125 | caps.RegisterHandler( |
126 | new RestStreamHandler("POST", uri, | 126 | "UntrustedSimulatorMessage", |
127 | HandleUntrustedSimulatorMessage)); | 127 | new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); |
128 | } | 128 | } |
129 | 129 | ||
130 | private string HandleUntrustedSimulatorMessage(string request, | 130 | private string HandleUntrustedSimulatorMessage(string request, |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 161f160..44edd7f 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -304,7 +304,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
304 | } | 304 | } |
305 | 305 | ||
306 | string serverURI = string.Empty; | 306 | string serverURI = string.Empty; |
307 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 307 | // bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
308 | UUID creatorId = UUID.Zero; | 308 | UUID creatorId = UUID.Zero; |
309 | 309 | ||
310 | OSDMap parameters= new OSDMap(); | 310 | OSDMap parameters= new OSDMap(); |
@@ -369,7 +369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
369 | } | 369 | } |
370 | 370 | ||
371 | string serverURI = string.Empty; | 371 | string serverURI = string.Empty; |
372 | bool foreign = GetUserProfileServerURI(target, out serverURI); | 372 | // bool foreign = GetUserProfileServerURI(target, out serverURI); |
373 | 373 | ||
374 | object Ad = (object)ad; | 374 | object Ad = (object)ad; |
375 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) | 375 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) |
@@ -438,10 +438,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
438 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; | 438 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; |
439 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); | 439 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); |
440 | ScenePresence p = FindPresence(remoteClient.AgentId); | 440 | ScenePresence p = FindPresence(remoteClient.AgentId); |
441 | Vector3 avaPos = p.AbsolutePosition; | ||
442 | 441 | ||
443 | string serverURI = string.Empty; | 442 | string serverURI = string.Empty; |
444 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 443 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
445 | 444 | ||
446 | if (land == null) | 445 | if (land == null) |
447 | { | 446 | { |
@@ -488,7 +487,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
488 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) | 487 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) |
489 | { | 488 | { |
490 | string serverURI = string.Empty; | 489 | string serverURI = string.Empty; |
491 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 490 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
492 | 491 | ||
493 | UUID classifiedId; | 492 | UUID classifiedId; |
494 | OSDMap parameters= new OSDMap(); | 493 | OSDMap parameters= new OSDMap(); |
@@ -538,7 +537,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
538 | } | 537 | } |
539 | 538 | ||
540 | string serverURI = string.Empty; | 539 | string serverURI = string.Empty; |
541 | bool foreign = GetUserProfileServerURI(targetId, out serverURI); | 540 | // bool foreign = GetUserProfileServerURI(targetId, out serverURI); |
542 | 541 | ||
543 | OSDMap parameters= new OSDMap(); | 542 | OSDMap parameters= new OSDMap(); |
544 | parameters.Add("creatorId", OSD.FromUUID(targetId)); | 543 | parameters.Add("creatorId", OSD.FromUUID(targetId)); |
@@ -589,7 +588,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
589 | UUID targetID; | 588 | UUID targetID; |
590 | UUID.TryParse(args[0], out targetID); | 589 | UUID.TryParse(args[0], out targetID); |
591 | string serverURI = string.Empty; | 590 | string serverURI = string.Empty; |
592 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 591 | // bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
593 | IClientAPI remoteClient = (IClientAPI)sender; | 592 | IClientAPI remoteClient = (IClientAPI)sender; |
594 | 593 | ||
595 | UserProfilePick pick = new UserProfilePick(); | 594 | UserProfilePick pick = new UserProfilePick(); |
@@ -657,7 +656,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
657 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); | 656 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); |
658 | UserProfilePick pick = new UserProfilePick(); | 657 | UserProfilePick pick = new UserProfilePick(); |
659 | string serverURI = string.Empty; | 658 | string serverURI = string.Empty; |
660 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 659 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
661 | ScenePresence p = FindPresence(remoteClient.AgentId); | 660 | ScenePresence p = FindPresence(remoteClient.AgentId); |
662 | 661 | ||
663 | Vector3 avaPos = p.AbsolutePosition; | 662 | Vector3 avaPos = p.AbsolutePosition; |
@@ -717,7 +716,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
717 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) | 716 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) |
718 | { | 717 | { |
719 | string serverURI = string.Empty; | 718 | string serverURI = string.Empty; |
720 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 719 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
721 | 720 | ||
722 | OSDMap parameters= new OSDMap(); | 721 | OSDMap parameters= new OSDMap(); |
723 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); | 722 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); |
@@ -752,7 +751,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
752 | 751 | ||
753 | IClientAPI remoteClient = (IClientAPI)sender; | 752 | IClientAPI remoteClient = (IClientAPI)sender; |
754 | string serverURI = string.Empty; | 753 | string serverURI = string.Empty; |
755 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 754 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
756 | note.TargetId = remoteClient.AgentId; | 755 | note.TargetId = remoteClient.AgentId; |
757 | UUID.TryParse(args[0], out note.UserId); | 756 | UUID.TryParse(args[0], out note.UserId); |
758 | 757 | ||
@@ -788,7 +787,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
788 | note.Notes = queryNotes; | 787 | note.Notes = queryNotes; |
789 | 788 | ||
790 | string serverURI = string.Empty; | 789 | string serverURI = string.Empty; |
791 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 790 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
792 | 791 | ||
793 | object Note = note; | 792 | object Note = note; |
794 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) | 793 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) |
@@ -833,7 +832,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
833 | prop.Language = languages; | 832 | prop.Language = languages; |
834 | 833 | ||
835 | string serverURI = string.Empty; | 834 | string serverURI = string.Empty; |
836 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 835 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
837 | 836 | ||
838 | object Param = prop; | 837 | object Param = prop; |
839 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) | 838 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) |
@@ -955,7 +954,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
955 | prop.FirstLifeText = newProfile.FirstLifeAboutText; | 954 | prop.FirstLifeText = newProfile.FirstLifeAboutText; |
956 | 955 | ||
957 | string serverURI = string.Empty; | 956 | string serverURI = string.Empty; |
958 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 957 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
959 | 958 | ||
960 | object Prop = prop; | 959 | object Prop = prop; |
961 | 960 | ||
@@ -994,7 +993,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
994 | } | 993 | } |
995 | 994 | ||
996 | string serverURI = string.Empty; | 995 | string serverURI = string.Empty; |
997 | bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI); | 996 | // bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI); |
998 | 997 | ||
999 | // This is checking a friend on the home grid | 998 | // This is checking a friend on the home grid |
1000 | // Not HG friend | 999 | // Not HG friend |
@@ -1247,7 +1246,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1247 | return false; | 1246 | return false; |
1248 | } | 1247 | } |
1249 | 1248 | ||
1250 | byte[] buf = new byte[8192]; | ||
1251 | Stream rstream = webResponse.GetResponseStream(); | 1249 | Stream rstream = webResponse.GetResponseStream(); |
1252 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); | 1250 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); |
1253 | 1251 | ||
@@ -1313,7 +1311,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1313 | return false; | 1311 | return false; |
1314 | } | 1312 | } |
1315 | 1313 | ||
1316 | byte[] buf = new byte[8192]; | ||
1317 | Stream rstream = webResponse.GetResponseStream(); | 1314 | Stream rstream = webResponse.GetResponseStream(); |
1318 | 1315 | ||
1319 | OSDMap response = new OSDMap(); | 1316 | OSDMap response = new OSDMap(); |
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 6ae9448..bd60611 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Linq; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using System.Text; | 33 | using System.Text; |
33 | using log4net; | 34 | using log4net; |
@@ -37,6 +38,7 @@ using OpenMetaverse; | |||
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
39 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
41 | using OpenSim.Framework.Servers.HttpServer; | ||
40 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
42 | using Caps=OpenSim.Framework.Capabilities.Caps; | 44 | using Caps=OpenSim.Framework.Capabilities.Caps; |
@@ -57,8 +59,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
57 | /// </summary> | 59 | /// </summary> |
58 | protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>(); | 60 | protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>(); |
59 | 61 | ||
60 | protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>(); | 62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); |
61 | protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds | 63 | |
64 | protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds | ||
62 | = new Dictionary<UUID, Dictionary<ulong, string>>(); | 65 | = new Dictionary<UUID, Dictionary<ulong, string>>(); |
63 | 66 | ||
64 | public void Initialise(IConfigSource source) | 67 | public void Initialise(IConfigSource source) |
@@ -70,9 +73,24 @@ namespace OpenSim.Region.CoreModules.Framework | |||
70 | m_scene = scene; | 73 | m_scene = scene; |
71 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); | 74 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); |
72 | 75 | ||
73 | MainConsole.Instance.Commands.AddCommand("Comms", false, "show caps", | 76 | MainConsole.Instance.Commands.AddCommand( |
74 | "show caps", | 77 | "Comms", false, "show caps list", |
75 | "Shows all registered capabilities for users", HandleShowCapsCommand); | 78 | "show caps list", |
79 | "Shows list of registered capabilities for users.", HandleShowCapsListCommand); | ||
80 | |||
81 | MainConsole.Instance.Commands.AddCommand( | ||
82 | "Comms", false, "show caps stats by user", | ||
83 | "show caps stats [<first-name> <last-name>]", | ||
84 | "Shows statistics on capabilities use by user.", | ||
85 | "If a user name is given, then prints a detailed breakdown of caps use ordered by number of requests received.", | ||
86 | HandleShowCapsStatsByUserCommand); | ||
87 | |||
88 | MainConsole.Instance.Commands.AddCommand( | ||
89 | "Comms", false, "show caps stats by cap", | ||
90 | "show caps stats by cap [<cap-name>]", | ||
91 | "Shows statistics on capabilities use by capability.", | ||
92 | "If a capability name is given, then prints a detailed breakdown of use by each user.", | ||
93 | HandleShowCapsStatsByCapCommand); | ||
76 | } | 94 | } |
77 | 95 | ||
78 | public void RegionLoaded(Scene scene) | 96 | public void RegionLoaded(Scene scene) |
@@ -105,35 +123,42 @@ namespace OpenSim.Region.CoreModules.Framework | |||
105 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) | 123 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) |
106 | return; | 124 | return; |
107 | 125 | ||
126 | Caps caps; | ||
108 | String capsObjectPath = GetCapsPath(agentId); | 127 | String capsObjectPath = GetCapsPath(agentId); |
109 | 128 | ||
110 | if (m_capsObjects.ContainsKey(agentId)) | 129 | lock (m_capsObjects) |
111 | { | 130 | { |
112 | Caps oldCaps = m_capsObjects[agentId]; | 131 | if (m_capsObjects.ContainsKey(agentId)) |
113 | 132 | { | |
114 | m_log.DebugFormat( | 133 | Caps oldCaps = m_capsObjects[agentId]; |
115 | "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ", | 134 | |
116 | agentId, oldCaps.CapsObjectPath, capsObjectPath); | 135 | m_log.DebugFormat( |
117 | // This should not happen. The caller code is confused. We need to fix that. | 136 | "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ", |
118 | // CAPs can never be reregistered, or the client will be confused. | 137 | agentId, oldCaps.CapsObjectPath, capsObjectPath); |
119 | // Hence this return here. | 138 | // This should not happen. The caller code is confused. We need to fix that. |
120 | //return; | 139 | // CAPs can never be reregistered, or the client will be confused. |
121 | } | 140 | // Hence this return here. |
141 | //return; | ||
142 | } | ||
122 | 143 | ||
123 | Caps caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, | 144 | caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, |
124 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, | 145 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, |
125 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); | 146 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); |
126 | 147 | ||
127 | m_capsObjects[agentId] = caps; | 148 | m_capsObjects[agentId] = caps; |
149 | } | ||
128 | 150 | ||
129 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); | 151 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); |
130 | } | 152 | } |
131 | 153 | ||
132 | public void RemoveCaps(UUID agentId) | 154 | public void RemoveCaps(UUID agentId) |
133 | { | 155 | { |
134 | if (childrenSeeds.ContainsKey(agentId)) | 156 | lock (m_childrenSeeds) |
135 | { | 157 | { |
136 | childrenSeeds.Remove(agentId); | 158 | if (m_childrenSeeds.ContainsKey(agentId)) |
159 | { | ||
160 | m_childrenSeeds.Remove(agentId); | ||
161 | } | ||
137 | } | 162 | } |
138 | 163 | ||
139 | lock (m_capsObjects) | 164 | lock (m_capsObjects) |
@@ -168,16 +193,22 @@ namespace OpenSim.Region.CoreModules.Framework | |||
168 | 193 | ||
169 | public void SetAgentCapsSeeds(AgentCircuitData agent) | 194 | public void SetAgentCapsSeeds(AgentCircuitData agent) |
170 | { | 195 | { |
171 | capsPaths[agent.AgentID] = agent.CapsPath; | 196 | lock (m_capsPaths) |
172 | childrenSeeds[agent.AgentID] | 197 | m_capsPaths[agent.AgentID] = agent.CapsPath; |
173 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); | 198 | |
199 | lock (m_childrenSeeds) | ||
200 | m_childrenSeeds[agent.AgentID] | ||
201 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); | ||
174 | } | 202 | } |
175 | 203 | ||
176 | public string GetCapsPath(UUID agentId) | 204 | public string GetCapsPath(UUID agentId) |
177 | { | 205 | { |
178 | if (capsPaths.ContainsKey(agentId)) | 206 | lock (m_capsPaths) |
179 | { | 207 | { |
180 | return capsPaths[agentId]; | 208 | if (m_capsPaths.ContainsKey(agentId)) |
209 | { | ||
210 | return m_capsPaths[agentId]; | ||
211 | } | ||
181 | } | 212 | } |
182 | 213 | ||
183 | return null; | 214 | return null; |
@@ -186,17 +217,24 @@ namespace OpenSim.Region.CoreModules.Framework | |||
186 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) | 217 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) |
187 | { | 218 | { |
188 | Dictionary<ulong, string> seeds = null; | 219 | Dictionary<ulong, string> seeds = null; |
189 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 220 | |
190 | return seeds; | 221 | lock (m_childrenSeeds) |
222 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) | ||
223 | return seeds; | ||
224 | |||
191 | return new Dictionary<ulong, string>(); | 225 | return new Dictionary<ulong, string>(); |
192 | } | 226 | } |
193 | 227 | ||
194 | public void DropChildSeed(UUID agentID, ulong handle) | 228 | public void DropChildSeed(UUID agentID, ulong handle) |
195 | { | 229 | { |
196 | Dictionary<ulong, string> seeds; | 230 | Dictionary<ulong, string> seeds; |
197 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 231 | |
232 | lock (m_childrenSeeds) | ||
198 | { | 233 | { |
199 | seeds.Remove(handle); | 234 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) |
235 | { | ||
236 | seeds.Remove(handle); | ||
237 | } | ||
200 | } | 238 | } |
201 | } | 239 | } |
202 | 240 | ||
@@ -204,53 +242,275 @@ namespace OpenSim.Region.CoreModules.Framework | |||
204 | { | 242 | { |
205 | Dictionary<ulong, string> seeds; | 243 | Dictionary<ulong, string> seeds; |
206 | string returnval; | 244 | string returnval; |
207 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 245 | |
246 | lock (m_childrenSeeds) | ||
208 | { | 247 | { |
209 | if (seeds.TryGetValue(handle, out returnval)) | 248 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) |
210 | return returnval; | 249 | { |
250 | if (seeds.TryGetValue(handle, out returnval)) | ||
251 | return returnval; | ||
252 | } | ||
211 | } | 253 | } |
254 | |||
212 | return null; | 255 | return null; |
213 | } | 256 | } |
214 | 257 | ||
215 | public void SetChildrenSeed(UUID agentID, Dictionary<ulong, string> seeds) | 258 | public void SetChildrenSeed(UUID agentID, Dictionary<ulong, string> seeds) |
216 | { | 259 | { |
217 | //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); | 260 | //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); |
218 | childrenSeeds[agentID] = seeds; | 261 | |
262 | lock (m_childrenSeeds) | ||
263 | m_childrenSeeds[agentID] = seeds; | ||
219 | } | 264 | } |
220 | 265 | ||
221 | public void DumpChildrenSeeds(UUID agentID) | 266 | public void DumpChildrenSeeds(UUID agentID) |
222 | { | 267 | { |
223 | m_log.Info("================ ChildrenSeed "+m_scene.RegionInfo.RegionName+" ================"); | 268 | m_log.Info("================ ChildrenSeed "+m_scene.RegionInfo.RegionName+" ================"); |
224 | foreach (KeyValuePair<ulong, string> kvp in childrenSeeds[agentID]) | 269 | |
270 | lock (m_childrenSeeds) | ||
225 | { | 271 | { |
226 | uint x, y; | 272 | foreach (KeyValuePair<ulong, string> kvp in m_childrenSeeds[agentID]) |
227 | Utils.LongToUInts(kvp.Key, out x, out y); | 273 | { |
228 | x = x / Constants.RegionSize; | 274 | uint x, y; |
229 | y = y / Constants.RegionSize; | 275 | Utils.LongToUInts(kvp.Key, out x, out y); |
230 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); | 276 | x = x / Constants.RegionSize; |
277 | y = y / Constants.RegionSize; | ||
278 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); | ||
279 | } | ||
231 | } | 280 | } |
232 | } | 281 | } |
233 | 282 | ||
234 | private void HandleShowCapsCommand(string module, string[] cmdparams) | 283 | private void HandleShowCapsListCommand(string module, string[] cmdParams) |
235 | { | 284 | { |
285 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
286 | return; | ||
287 | |||
236 | StringBuilder caps = new StringBuilder(); | 288 | StringBuilder caps = new StringBuilder(); |
237 | caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); | 289 | caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); |
238 | 290 | ||
239 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) | 291 | lock (m_capsObjects) |
240 | { | 292 | { |
241 | caps.AppendFormat("** User {0}:\n", kvp.Key); | 293 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) |
294 | { | ||
295 | caps.AppendFormat("** User {0}:\n", kvp.Key); | ||
296 | |||
297 | for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) | ||
298 | { | ||
299 | Uri uri = new Uri(kvp2.Value.ToString()); | ||
300 | caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); | ||
301 | } | ||
302 | |||
303 | foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers) | ||
304 | caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value); | ||
305 | } | ||
306 | } | ||
242 | 307 | ||
243 | for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) | 308 | MainConsole.Instance.Output(caps.ToString()); |
309 | } | ||
310 | |||
311 | private void HandleShowCapsStatsByCapCommand(string module, string[] cmdParams) | ||
312 | { | ||
313 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
314 | return; | ||
315 | |||
316 | if (cmdParams.Length != 5 && cmdParams.Length != 6) | ||
317 | { | ||
318 | MainConsole.Instance.Output("Usage: show caps stats by cap [<cap-name>]"); | ||
319 | return; | ||
320 | } | ||
321 | |||
322 | StringBuilder sb = new StringBuilder(); | ||
323 | sb.AppendFormat("Region {0}:\n", m_scene.Name); | ||
324 | |||
325 | if (cmdParams.Length == 5) | ||
326 | { | ||
327 | BuildSummaryStatsByCapReport(sb); | ||
328 | } | ||
329 | else if (cmdParams.Length == 6) | ||
330 | { | ||
331 | BuildDetailedStatsByCapReport(sb, cmdParams[5]); | ||
332 | } | ||
333 | |||
334 | MainConsole.Instance.Output(sb.ToString()); | ||
335 | } | ||
336 | |||
337 | private void BuildDetailedStatsByCapReport(StringBuilder sb, string capName) | ||
338 | { | ||
339 | sb.AppendFormat("Capability name {0}\n", capName); | ||
340 | |||
341 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
342 | cdt.AddColumn("User Name", 34); | ||
343 | cdt.AddColumn("Req Received", 12); | ||
344 | cdt.AddColumn("Req Handled", 12); | ||
345 | cdt.Indent = 2; | ||
346 | |||
347 | Dictionary<string, int> receivedStats = new Dictionary<string, int>(); | ||
348 | Dictionary<string, int> handledStats = new Dictionary<string, int>(); | ||
349 | |||
350 | m_scene.ForEachScenePresence( | ||
351 | sp => | ||
244 | { | 352 | { |
245 | Uri uri = new Uri(kvp2.Value.ToString()); | 353 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); |
246 | caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); | 354 | |
355 | if (caps == null) | ||
356 | return; | ||
357 | |||
358 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
359 | |||
360 | IRequestHandler reqHandler; | ||
361 | if (capsHandlers.TryGetValue(capName, out reqHandler)) | ||
362 | { | ||
363 | receivedStats[sp.Name] = reqHandler.RequestsReceived; | ||
364 | handledStats[sp.Name] = reqHandler.RequestsHandled; | ||
365 | } | ||
247 | } | 366 | } |
367 | ); | ||
248 | 368 | ||
249 | foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers) | 369 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) |
250 | caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value); | 370 | { |
371 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | ||
251 | } | 372 | } |
252 | 373 | ||
253 | MainConsole.Instance.Output(caps.ToString()); | 374 | sb.Append(cdt.ToString()); |
375 | } | ||
376 | |||
377 | private void BuildSummaryStatsByCapReport(StringBuilder sb) | ||
378 | { | ||
379 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
380 | cdt.AddColumn("Name", 34); | ||
381 | cdt.AddColumn("Req Received", 12); | ||
382 | cdt.AddColumn("Req Handled", 12); | ||
383 | cdt.Indent = 2; | ||
384 | |||
385 | Dictionary<string, int> receivedStats = new Dictionary<string, int>(); | ||
386 | Dictionary<string, int> handledStats = new Dictionary<string, int>(); | ||
387 | |||
388 | m_scene.ForEachScenePresence( | ||
389 | sp => | ||
390 | { | ||
391 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
392 | |||
393 | if (caps == null) | ||
394 | return; | ||
395 | |||
396 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
397 | |||
398 | foreach (IRequestHandler reqHandler in capsHandlers.Values) | ||
399 | { | ||
400 | string reqName = reqHandler.Name ?? ""; | ||
401 | |||
402 | if (!receivedStats.ContainsKey(reqName)) | ||
403 | { | ||
404 | receivedStats[reqName] = reqHandler.RequestsReceived; | ||
405 | handledStats[reqName] = reqHandler.RequestsHandled; | ||
406 | } | ||
407 | else | ||
408 | { | ||
409 | receivedStats[reqName] += reqHandler.RequestsReceived; | ||
410 | handledStats[reqName] += reqHandler.RequestsHandled; | ||
411 | } | ||
412 | } | ||
413 | } | ||
414 | ); | ||
415 | |||
416 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) | ||
417 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | ||
418 | |||
419 | sb.Append(cdt.ToString()); | ||
420 | } | ||
421 | |||
422 | private void HandleShowCapsStatsByUserCommand(string module, string[] cmdParams) | ||
423 | { | ||
424 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
425 | return; | ||
426 | |||
427 | if (cmdParams.Length != 5 && cmdParams.Length != 7) | ||
428 | { | ||
429 | MainConsole.Instance.Output("Usage: show caps stats by user [<first-name> <last-name>]"); | ||
430 | return; | ||
431 | } | ||
432 | |||
433 | StringBuilder sb = new StringBuilder(); | ||
434 | sb.AppendFormat("Region {0}:\n", m_scene.Name); | ||
435 | |||
436 | if (cmdParams.Length == 5) | ||
437 | { | ||
438 | BuildSummaryStatsByUserReport(sb); | ||
439 | } | ||
440 | else if (cmdParams.Length == 7) | ||
441 | { | ||
442 | string firstName = cmdParams[5]; | ||
443 | string lastName = cmdParams[6]; | ||
444 | |||
445 | ScenePresence sp = m_scene.GetScenePresence(firstName, lastName); | ||
446 | |||
447 | if (sp == null) | ||
448 | return; | ||
449 | |||
450 | BuildDetailedStatsByUserReport(sb, sp); | ||
451 | } | ||
452 | |||
453 | MainConsole.Instance.Output(sb.ToString()); | ||
454 | } | ||
455 | |||
456 | private void BuildDetailedStatsByUserReport(StringBuilder sb, ScenePresence sp) | ||
457 | { | ||
458 | sb.AppendFormat("Avatar name {0}, type {1}\n", sp.Name, sp.IsChildAgent ? "child" : "root"); | ||
459 | |||
460 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
461 | cdt.AddColumn("Cap Name", 34); | ||
462 | cdt.AddColumn("Req Received", 12); | ||
463 | cdt.AddColumn("Req Handled", 12); | ||
464 | cdt.Indent = 2; | ||
465 | |||
466 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
467 | |||
468 | if (caps == null) | ||
469 | return; | ||
470 | |||
471 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
472 | |||
473 | foreach (IRequestHandler reqHandler in capsHandlers.Values.OrderByDescending(rh => rh.RequestsReceived)) | ||
474 | { | ||
475 | cdt.AddRow(reqHandler.Name, reqHandler.RequestsReceived, reqHandler.RequestsHandled); | ||
476 | } | ||
477 | |||
478 | sb.Append(cdt.ToString()); | ||
479 | } | ||
480 | |||
481 | private void BuildSummaryStatsByUserReport(StringBuilder sb) | ||
482 | { | ||
483 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
484 | cdt.AddColumn("Name", 32); | ||
485 | cdt.AddColumn("Type", 5); | ||
486 | cdt.AddColumn("Req Received", 12); | ||
487 | cdt.AddColumn("Req Handled", 12); | ||
488 | cdt.Indent = 2; | ||
489 | |||
490 | m_scene.ForEachScenePresence( | ||
491 | sp => | ||
492 | { | ||
493 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
494 | |||
495 | if (caps == null) | ||
496 | return; | ||
497 | |||
498 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
499 | |||
500 | int totalRequestsReceived = 0; | ||
501 | int totalRequestsHandled = 0; | ||
502 | |||
503 | foreach (IRequestHandler reqHandler in capsHandlers.Values) | ||
504 | { | ||
505 | totalRequestsReceived += reqHandler.RequestsReceived; | ||
506 | totalRequestsHandled += reqHandler.RequestsHandled; | ||
507 | } | ||
508 | |||
509 | cdt.AddRow(sp.Name, sp.IsChildAgent ? "child" : "root", totalRequestsReceived, totalRequestsHandled); | ||
510 | } | ||
511 | ); | ||
512 | |||
513 | sb.Append(cdt.ToString()); | ||
254 | } | 514 | } |
255 | } | 515 | } |
256 | } | 516 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs index eb74cda..2366767 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
55 | m_EstateModule = fmodule; | 55 | m_EstateModule = fmodule; |
56 | } | 56 | } |
57 | 57 | ||
58 | public override byte[] Handle(string path, Stream requestData, | 58 | protected override byte[] ProcessRequest(string path, Stream requestData, |
59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | StreamReader sr = new StreamReader(requestData); | 61 | StreamReader sr = new StreamReader(requestData); |