diff options
author | Melanie | 2012-03-18 20:44:56 +0000 |
---|---|---|
committer | Melanie | 2012-03-18 20:44:56 +0000 |
commit | c7e302864a2eef7f9587ed22286c96a6074ac5b3 (patch) | |
tree | 8f0df2f66811309fd790966770434fa3ff68bfdf /OpenSim/Region/CoreModules/World | |
parent | Merge branch 'ubitwork' (diff) | |
parent | Amend to previous commit: normalize strings ToLower. (diff) | |
download | opensim-SC_OLD-c7e302864a2eef7f9587ed22286c96a6074ac5b3.zip opensim-SC_OLD-c7e302864a2eef7f9587ed22286c96a6074ac5b3.tar.gz opensim-SC_OLD-c7e302864a2eef7f9587ed22286c96a6074ac5b3.tar.bz2 opensim-SC_OLD-c7e302864a2eef7f9587ed22286c96a6074ac5b3.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
4 files changed, 93 insertions, 77 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 35f47d2..b95bda5 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -26,8 +26,10 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | ||
31 | using System.Reflection; | 33 | using System.Reflection; |
32 | using System.Security; | 34 | using System.Security; |
33 | using System.Timers; | 35 | using System.Timers; |
@@ -46,8 +48,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
46 | { | 48 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 50 | ||
49 | private delegate void LookupUUIDS(List<UUID> uuidLst); | ||
50 | |||
51 | private Timer m_regionChangeTimer = new Timer(); | 51 | private Timer m_regionChangeTimer = new Timer(); |
52 | public Scene Scene { get; private set; } | 52 | public Scene Scene { get; private set; } |
53 | public IUserManagement UserManager { get; private set; } | 53 | public IUserManagement UserManager { get; private set; } |
@@ -907,98 +907,77 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
907 | if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) | 907 | if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) |
908 | return; | 908 | return; |
909 | 909 | ||
910 | Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); | 910 | Dictionary<uint, float> sceneData = null; |
911 | List<UUID> uuidNameLookupList = new List<UUID>(); | 911 | List<UUID> uuidNameLookupList = new List<UUID>(); |
912 | 912 | ||
913 | if (reportType == 1) | 913 | if (reportType == 1) |
914 | { | 914 | { |
915 | SceneData = Scene.PhysicsScene.GetTopColliders(); | 915 | sceneData = Scene.PhysicsScene.GetTopColliders(); |
916 | } | 916 | } |
917 | else if (reportType == 0) | 917 | else if (reportType == 0) |
918 | { | 918 | { |
919 | SceneData = Scene.SceneGraph.GetTopScripts(); | 919 | IScriptModule scriptModule = Scene.RequestModuleInterface<IScriptModule>(); |
920 | |||
921 | if (scriptModule != null) | ||
922 | sceneData = scriptModule.GetObjectScriptsExecutionTimes(); | ||
920 | } | 923 | } |
921 | 924 | ||
922 | List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); | 925 | List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); |
923 | lock (SceneData) | 926 | if (sceneData != null) |
924 | { | 927 | { |
925 | foreach (uint obj in SceneData.Keys) | 928 | var sortedSceneData |
929 | = sceneData.Select( | ||
930 | item => new { Measurement = item.Value, Part = Scene.GetSceneObjectPart(item.Key) }); | ||
931 | |||
932 | sortedSceneData.OrderBy(item => item.Measurement); | ||
933 | |||
934 | int items = 0; | ||
935 | |||
936 | foreach (var entry in sortedSceneData) | ||
926 | { | 937 | { |
927 | SceneObjectPart prt = Scene.GetSceneObjectPart(obj); | 938 | // The object may have been deleted since we received the data. |
928 | if (prt != null) | 939 | if (entry.Part == null) |
940 | continue; | ||
941 | |||
942 | // Don't show scripts that haven't executed or where execution time is below one microsecond in | ||
943 | // order to produce a more readable report. | ||
944 | if (entry.Measurement < 0.001) | ||
945 | continue; | ||
946 | |||
947 | items++; | ||
948 | SceneObjectGroup so = entry.Part.ParentGroup; | ||
949 | |||
950 | LandStatReportItem lsri = new LandStatReportItem(); | ||
951 | lsri.LocationX = so.AbsolutePosition.X; | ||
952 | lsri.LocationY = so.AbsolutePosition.Y; | ||
953 | lsri.LocationZ = so.AbsolutePosition.Z; | ||
954 | lsri.Score = entry.Measurement; | ||
955 | lsri.TaskID = so.UUID; | ||
956 | lsri.TaskLocalID = so.LocalId; | ||
957 | lsri.TaskName = entry.Part.Name; | ||
958 | lsri.OwnerName = UserManager.GetUserName(so.OwnerID); | ||
959 | |||
960 | if (filter.Length != 0) | ||
929 | { | 961 | { |
930 | SceneObjectGroup sog = prt.ParentGroup; | 962 | if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter))) |
931 | LandStatReportItem lsri = new LandStatReportItem(); | ||
932 | lsri.LocationX = sog.AbsolutePosition.X; | ||
933 | lsri.LocationY = sog.AbsolutePosition.Y; | ||
934 | lsri.LocationZ = sog.AbsolutePosition.Z; | ||
935 | lsri.Score = SceneData[obj]; | ||
936 | lsri.TaskID = sog.UUID; | ||
937 | lsri.TaskLocalID = sog.LocalId; | ||
938 | lsri.TaskName = sog.GetPartName(obj); | ||
939 | lsri.OwnerName = "waiting"; | ||
940 | lock (uuidNameLookupList) | ||
941 | uuidNameLookupList.Add(sog.OwnerID); | ||
942 | |||
943 | if (filter.Length != 0) | ||
944 | { | 963 | { |
945 | if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter))) | ||
946 | { | ||
947 | } | ||
948 | else | ||
949 | { | ||
950 | continue; | ||
951 | } | ||
952 | } | 964 | } |
953 | 965 | else | |
954 | SceneReport.Add(lsri); | 966 | { |
967 | continue; | ||
968 | } | ||
955 | } | 969 | } |
970 | |||
971 | SceneReport.Add(lsri); | ||
972 | |||
973 | if (items >= 100) | ||
974 | break; | ||
956 | } | 975 | } |
957 | } | 976 | } |
958 | 977 | ||
959 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); | 978 | remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); |
960 | |||
961 | if (uuidNameLookupList.Count > 0) | ||
962 | LookupUUID(uuidNameLookupList); | ||
963 | } | 979 | } |
964 | 980 | ||
965 | private static void LookupUUIDSCompleted(IAsyncResult iar) | ||
966 | { | ||
967 | LookupUUIDS icon = (LookupUUIDS)iar.AsyncState; | ||
968 | icon.EndInvoke(iar); | ||
969 | } | ||
970 | |||
971 | private void LookupUUID(List<UUID> uuidLst) | ||
972 | { | ||
973 | LookupUUIDS d = LookupUUIDsAsync; | ||
974 | |||
975 | d.BeginInvoke(uuidLst, | ||
976 | LookupUUIDSCompleted, | ||
977 | d); | ||
978 | } | ||
979 | |||
980 | private void LookupUUIDsAsync(List<UUID> uuidLst) | ||
981 | { | ||
982 | UUID[] uuidarr; | ||
983 | |||
984 | lock (uuidLst) | ||
985 | { | ||
986 | uuidarr = uuidLst.ToArray(); | ||
987 | } | ||
988 | |||
989 | for (int i = 0; i < uuidarr.Length; i++) | ||
990 | { | ||
991 | // string lookupname = Scene.CommsManager.UUIDNameRequestString(uuidarr[i]); | ||
992 | |||
993 | IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>(); | ||
994 | if (userManager != null) | ||
995 | userManager.GetUserName(uuidarr[i]); | ||
996 | |||
997 | // we drop it. It gets cached though... so we're ready for the next request. | ||
998 | // diva commnent 11/21/2010: uh?!? wft? | ||
999 | // justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume. | ||
1000 | } | ||
1001 | } | ||
1002 | #endregion | 981 | #endregion |
1003 | 982 | ||
1004 | #region Outgoing Packets | 983 | #region Outgoing Packets |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 0f83d82..02ac091 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1664,7 +1664,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1664 | { | 1664 | { |
1665 | if (e.OwnerID == targetID) | 1665 | if (e.OwnerID == targetID) |
1666 | { | 1666 | { |
1667 | if (e.scriptScore >= 0.01) | 1667 | if (e.ContainsScripts()) |
1668 | { | 1668 | { |
1669 | returns.Add(e); | 1669 | returns.Add(e); |
1670 | } | 1670 | } |
@@ -1681,7 +1681,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1681 | ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y); | 1681 | ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y); |
1682 | if (landobject.LandData.OwnerID != e.OwnerID) | 1682 | if (landobject.LandData.OwnerID != e.OwnerID) |
1683 | { | 1683 | { |
1684 | if (e.scriptScore >= 0.01) | 1684 | if (e.ContainsScripts()) |
1685 | { | 1685 | { |
1686 | returns.Add(e); | 1686 | returns.Add(e); |
1687 | } | 1687 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 4805ccb..c51e140 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -86,6 +86,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
86 | private volatile bool m_tainted; | 86 | private volatile bool m_tainted; |
87 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); | 87 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); |
88 | 88 | ||
89 | private String m_InitialTerrain = "pinhead-island"; | ||
90 | |||
89 | /// <summary> | 91 | /// <summary> |
90 | /// Human readable list of terrain file extensions that are supported. | 92 | /// Human readable list of terrain file extensions that are supported. |
91 | /// </summary> | 93 | /// </summary> |
@@ -109,6 +111,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
109 | /// <param name="config">Config for the region</param> | 111 | /// <param name="config">Config for the region</param> |
110 | public void Initialise(IConfigSource config) | 112 | public void Initialise(IConfigSource config) |
111 | { | 113 | { |
114 | IConfig terrainConfig = config.Configs["Terrain"]; | ||
115 | if (terrainConfig != null) | ||
116 | m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain); | ||
112 | } | 117 | } |
113 | 118 | ||
114 | public void AddRegion(Scene scene) | 119 | public void AddRegion(Scene scene) |
@@ -120,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
120 | { | 125 | { |
121 | if (m_scene.Heightmap == null) | 126 | if (m_scene.Heightmap == null) |
122 | { | 127 | { |
123 | m_channel = new TerrainChannel(); | 128 | m_channel = new TerrainChannel(m_InitialTerrain); |
124 | m_scene.Heightmap = m_channel; | 129 | m_scene.Heightmap = m_channel; |
125 | m_revert = new TerrainChannel(); | 130 | m_revert = new TerrainChannel(); |
126 | UpdateRevertMap(); | 131 | UpdateRevertMap(); |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index f9384e9..3efb7dd 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -92,7 +92,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | 94 | ||
95 | //m_log.DebugFormat("MAP NAME=({0})", mapName); | 95 | //m_log.DebugFormat("MAP NAME=({0})", mapName); |
96 | |||
97 | // Hack to get around the fact that ll V3 now drops the port from the | ||
98 | // map name. See https://jira.secondlife.com/browse/VWR-28570 | ||
99 | // | ||
100 | // Caller, use this magic form instead: | ||
101 | // secondlife://http|!!mygrid.com|8002|Region+Name/128/128 | ||
102 | // or url encode if possible. | ||
103 | // the hacks we do with this viewer... | ||
104 | // | ||
105 | string mapNameOrig = mapName; | ||
106 | if (mapName.Contains("|")) | ||
107 | mapName = mapName.Replace('|', ':'); | ||
108 | if (mapName.Contains("+")) | ||
109 | mapName = mapName.Replace('+', ' '); | ||
110 | if (mapName.Contains("!")) | ||
111 | mapName = mapName.Replace('!', '/'); | ||
96 | 112 | ||
97 | // try to fetch from GridServer | 113 | // try to fetch from GridServer |
98 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); | 114 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); |
@@ -114,7 +130,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
114 | data.MapImageId = UUID.Zero; | 130 | data.MapImageId = UUID.Zero; |
115 | else | 131 | else |
116 | data.MapImageId = info.TerrainImage; | 132 | data.MapImageId = info.TerrainImage; |
117 | data.Name = info.RegionName; | 133 | // ugh! V2-3 is very sensitive about the result being |
134 | // exactly the same as the requested name | ||
135 | if (regionInfos.Count == 1) | ||
136 | data.Name = mapNameOrig; | ||
137 | else | ||
138 | data.Name = info.RegionName; | ||
118 | data.RegionFlags = 0; // TODO not used? | 139 | data.RegionFlags = 0; // TODO not used? |
119 | data.WaterHeight = 0; // not used | 140 | data.WaterHeight = 0; // not used |
120 | data.X = (ushort)(info.RegionLocX / Constants.RegionSize); | 141 | data.X = (ushort)(info.RegionLocX / Constants.RegionSize); |
@@ -138,6 +159,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
138 | // flags are agent flags sent from the viewer. | 159 | // flags are agent flags sent from the viewer. |
139 | // they have different values depending on different viewers, apparently | 160 | // they have different values depending on different viewers, apparently |
140 | remoteClient.SendMapBlock(blocks, flags); | 161 | remoteClient.SendMapBlock(blocks, flags); |
162 | |||
163 | // send extra user messages for V3 | ||
164 | // because the UI is very confusing | ||
165 | // while we don't fix the hard-coded urls | ||
166 | if (flags == 2) | ||
167 | { | ||
168 | if (regionInfos.Count == 0) | ||
169 | remoteClient.SendAgentAlertMessage("No regions found with that name.", true); | ||
170 | else if (regionInfos.Count == 1) | ||
171 | remoteClient.SendAgentAlertMessage("Region found!", false); | ||
172 | } | ||
141 | } | 173 | } |
142 | 174 | ||
143 | // private Scene GetClientScene(IClientAPI client) | 175 | // private Scene GetClientScene(IClientAPI client) |