diff options
author | Justin Clark-Casey (justincc) | 2012-02-29 00:03:55 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-29 00:03:55 +0000 |
commit | 670c7842a4d0bf6dc3bfa38938628688571f9c05 (patch) | |
tree | c7fafae52fdeb48179deca90abffc9c35aaf4489 | |
parent | Call Dispose() via using() on SqliteCommands in WebStatsModule after use. (diff) | |
parent | Fixed two typos. White space cleanups. (diff) | |
download | opensim-SC_OLD-670c7842a4d0bf6dc3bfa38938628688571f9c05.zip opensim-SC_OLD-670c7842a4d0bf6dc3bfa38938628688571f9c05.tar.gz opensim-SC_OLD-670c7842a4d0bf6dc3bfa38938628688571f9c05.tar.bz2 opensim-SC_OLD-670c7842a4d0bf6dc3bfa38938628688571f9c05.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
5 files changed, 32 insertions, 92 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index b761dfe..af25da9 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -63,77 +63,7 @@ namespace OpenSim.Framework | |||
63 | // a "long" call for warning & debugging purposes | 63 | // a "long" call for warning & debugging purposes |
64 | public const int LongCallTime = 500; | 64 | public const int LongCallTime = 500; |
65 | 65 | ||
66 | // /// <summary> | 66 | #region JSONRequest |
67 | // /// Send LLSD to an HTTP client in application/llsd+json form | ||
68 | // /// </summary> | ||
69 | // /// <param name="response">HTTP response to send the data in</param> | ||
70 | // /// <param name="body">LLSD to send to the client</param> | ||
71 | // public static void SendJSONResponse(OSHttpResponse response, OSDMap body) | ||
72 | // { | ||
73 | // byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body)); | ||
74 | // | ||
75 | // response.ContentEncoding = Encoding.UTF8; | ||
76 | // response.ContentLength = responseData.Length; | ||
77 | // response.ContentType = "application/llsd+json"; | ||
78 | // response.Body.Write(responseData, 0, responseData.Length); | ||
79 | // } | ||
80 | // | ||
81 | // /// <summary> | ||
82 | // /// Send LLSD to an HTTP client in application/llsd+xml form | ||
83 | // /// </summary> | ||
84 | // /// <param name="response">HTTP response to send the data in</param> | ||
85 | // /// <param name="body">LLSD to send to the client</param> | ||
86 | // public static void SendXMLResponse(OSHttpResponse response, OSDMap body) | ||
87 | // { | ||
88 | // byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body); | ||
89 | // | ||
90 | // response.ContentEncoding = Encoding.UTF8; | ||
91 | // response.ContentLength = responseData.Length; | ||
92 | // response.ContentType = "application/llsd+xml"; | ||
93 | // response.Body.Write(responseData, 0, responseData.Length); | ||
94 | // } | ||
95 | |||
96 | /// <summary> | ||
97 | /// Make a GET or GET-like request to a web service that returns LLSD | ||
98 | /// or JSON data | ||
99 | /// </summary> | ||
100 | public static OSDMap ServiceRequest(string url, string httpVerb) | ||
101 | { | ||
102 | string errorMessage; | ||
103 | |||
104 | try | ||
105 | { | ||
106 | HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); | ||
107 | request.Method = httpVerb; | ||
108 | |||
109 | using (WebResponse response = request.GetResponse()) | ||
110 | { | ||
111 | using (Stream responseStream = response.GetResponseStream()) | ||
112 | { | ||
113 | try | ||
114 | { | ||
115 | string responseStr = responseStream.GetStreamString(); | ||
116 | OSD responseOSD = OSDParser.Deserialize(responseStr); | ||
117 | if (responseOSD.Type == OSDType.Map) | ||
118 | return (OSDMap)responseOSD; | ||
119 | else | ||
120 | errorMessage = "Response format was invalid."; | ||
121 | } | ||
122 | catch | ||
123 | { | ||
124 | errorMessage = "Failed to parse the response."; | ||
125 | } | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | catch (Exception ex) | ||
130 | { | ||
131 | m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message); | ||
132 | errorMessage = ex.Message; | ||
133 | } | ||
134 | |||
135 | return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } }; | ||
136 | } | ||
137 | 67 | ||
138 | /// <summary> | 68 | /// <summary> |
139 | /// PUT JSON-encoded data to a web service that returns LLSD or | 69 | /// PUT JSON-encoded data to a web service that returns LLSD or |
@@ -303,6 +233,10 @@ namespace OpenSim.Framework | |||
303 | return result; | 233 | return result; |
304 | } | 234 | } |
305 | 235 | ||
236 | #endregion JSONRequest | ||
237 | |||
238 | #region FormRequest | ||
239 | |||
306 | /// <summary> | 240 | /// <summary> |
307 | /// POST URL-encoded form data to a web service that returns LLSD or | 241 | /// POST URL-encoded form data to a web service that returns LLSD or |
308 | /// JSON data | 242 | /// JSON data |
@@ -397,6 +331,8 @@ namespace OpenSim.Framework | |||
397 | result["Message"] = OSD.FromString("Service request failed: " + msg); | 331 | result["Message"] = OSD.FromString("Service request failed: " + msg); |
398 | return result; | 332 | return result; |
399 | } | 333 | } |
334 | |||
335 | #endregion FormRequest | ||
400 | 336 | ||
401 | #region Uri | 337 | #region Uri |
402 | 338 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 0c4ff7f..d2fe388 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
117 | string userAssetServer = string.Empty; | 117 | string userAssetServer = string.Empty; |
118 | if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission) | 118 | if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission) |
119 | { | 119 | { |
120 | Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); }); | 120 | m_assMapper.Post(assetID, avatarID, userAssetServer); |
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 74b047b..fd122da 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
132 | { | 132 | { |
133 | } | 133 | } |
134 | 134 | ||
135 | public Type ReplaceableInterface | 135 | public Type ReplaceableInterface |
136 | { | 136 | { |
137 | get { return null; } | 137 | get { return null; } |
138 | } | 138 | } |
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
220 | // There is a major hack going on in this method. The viewer doesn't request | 220 | // There is a major hack going on in this method. The viewer doesn't request |
221 | // map blocks (RequestMapBlocks) above 2048. That means that if we don't hack, | 221 | // map blocks (RequestMapBlocks) above 2048. That means that if we don't hack, |
222 | // grids above that cell don't have a map at all. So, here's the hack: we wait | 222 | // grids above that cell don't have a map at all. So, here's the hack: we wait |
223 | // for this CAP request to come, and we inject the map blocks at this point. | 223 | // for this CAP request to come, and we inject the map blocks at this point. |
224 | // In a normal scenario, this request simply sends back the MapLayer (the blue color). | 224 | // In a normal scenario, this request simply sends back the MapLayer (the blue color). |
225 | // In the hacked scenario, it also sends the map blocks via UDP. | 225 | // In the hacked scenario, it also sends the map blocks via UDP. |
226 | // | 226 | // |
@@ -751,7 +751,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
751 | { | 751 | { |
752 | uint x = 0, y = 0; | 752 | uint x = 0, y = 0; |
753 | Utils.LongToUInts(regionhandle, out x, out y); | 753 | Utils.LongToUInts(regionhandle, out x, out y); |
754 | GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); | 754 | GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); |
755 | 755 | ||
756 | if (mreg != null) | 756 | if (mreg != null) |
757 | { | 757 | { |
@@ -857,7 +857,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
857 | finally | 857 | finally |
858 | { | 858 | { |
859 | if (os != null) | 859 | if (os != null) |
860 | os.Close(); | 860 | os.Close(); |
861 | } | 861 | } |
862 | 862 | ||
863 | string response_mapItems_reply = null; | 863 | string response_mapItems_reply = null; |
@@ -960,16 +960,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
960 | // on an unloaded square. | 960 | // on an unloaded square. |
961 | // But make sure: Look whether the one we requested is in there | 961 | // But make sure: Look whether the one we requested is in there |
962 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 962 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
963 | minX * (int)Constants.RegionSize, | 963 | minX * (int)Constants.RegionSize, |
964 | maxX * (int)Constants.RegionSize, | 964 | maxX * (int)Constants.RegionSize, |
965 | minY * (int)Constants.RegionSize, | 965 | minY * (int)Constants.RegionSize, |
966 | maxY * (int)Constants.RegionSize); | 966 | maxY * (int)Constants.RegionSize); |
967 | 967 | ||
968 | if (regions != null) | 968 | if (regions != null) |
969 | { | 969 | { |
970 | foreach (GridRegion r in regions) | 970 | foreach (GridRegion r in regions) |
971 | { | 971 | { |
972 | if ((r.RegionLocX == minX * (int)Constants.RegionSize) && | 972 | if ((r.RegionLocX == minX * (int)Constants.RegionSize) && |
973 | (r.RegionLocY == minY * (int)Constants.RegionSize)) | 973 | (r.RegionLocY == minY * (int)Constants.RegionSize)) |
974 | { | 974 | { |
975 | // found it => add it to response | 975 | // found it => add it to response |
@@ -1004,7 +1004,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1004 | { | 1004 | { |
1005 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); | 1005 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
1006 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, | 1006 | List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, |
1007 | (minX - 4) * (int)Constants.RegionSize, | 1007 | (minX - 4) * (int)Constants.RegionSize, |
1008 | (maxX + 4) * (int)Constants.RegionSize, | 1008 | (maxX + 4) * (int)Constants.RegionSize, |
1009 | (minY - 4) * (int)Constants.RegionSize, | 1009 | (minY - 4) * (int)Constants.RegionSize, |
1010 | (maxY + 4) * (int)Constants.RegionSize); | 1010 | (maxY + 4) * (int)Constants.RegionSize); |
@@ -1336,7 +1336,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1336 | // Cannot create a map for a nonexistant heightmap | 1336 | // Cannot create a map for a nonexistant heightmap |
1337 | if (m_scene.Heightmap == null) | 1337 | if (m_scene.Heightmap == null) |
1338 | return; | 1338 | return; |
1339 | 1339 | ||
1340 | //create a texture asset of the terrain | 1340 | //create a texture asset of the terrain |
1341 | IMapImageGenerator terrain = m_scene.RequestModuleInterface<IMapImageGenerator>(); | 1341 | IMapImageGenerator terrain = m_scene.RequestModuleInterface<IMapImageGenerator>(); |
1342 | if (terrain == null) | 1342 | if (terrain == null) |
@@ -1345,7 +1345,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1345 | byte[] data = terrain.WriteJpeg2000Image(); | 1345 | byte[] data = terrain.WriteJpeg2000Image(); |
1346 | if (data == null) | 1346 | if (data == null) |
1347 | return; | 1347 | return; |
1348 | 1348 | ||
1349 | byte[] overlay = GenerateOverlay(); | 1349 | byte[] overlay = GenerateOverlay(); |
1350 | 1350 | ||
1351 | m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); | 1351 | m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); |
@@ -1366,7 +1366,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1366 | // Store the new one | 1366 | // Store the new one |
1367 | m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); | 1367 | m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); |
1368 | m_scene.AssetService.Store(asset); | 1368 | m_scene.AssetService.Store(asset); |
1369 | 1369 | ||
1370 | if (overlay != null) | 1370 | if (overlay != null) |
1371 | { | 1371 | { |
1372 | parcelImageID = UUID.Random(); | 1372 | parcelImageID = UUID.Random(); |
@@ -1390,7 +1390,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1390 | m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID; | 1390 | m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID; |
1391 | m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID; | 1391 | m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID; |
1392 | m_scene.RegionInfo.RegionSettings.Save(); | 1392 | m_scene.RegionInfo.RegionSettings.Save(); |
1393 | 1393 | ||
1394 | // Delete the old one | 1394 | // Delete the old one |
1395 | // m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID); | 1395 | // m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID); |
1396 | m_scene.AssetService.Delete(lastTerrainImageID.ToString()); | 1396 | m_scene.AssetService.Delete(lastTerrainImageID.ToString()); |
@@ -1469,18 +1469,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1469 | if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0) | 1469 | if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0) |
1470 | { | 1470 | { |
1471 | landForSale = true; | 1471 | landForSale = true; |
1472 | 1472 | ||
1473 | saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap()); | 1473 | saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap()); |
1474 | } | 1474 | } |
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | if (!landForSale) | 1477 | if (!landForSale) |
1478 | { | 1478 | { |
1479 | m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not geenrating overlay", m_scene.RegionInfo.RegionName); | 1479 | m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName); |
1480 | return null; | 1480 | return null; |
1481 | } | 1481 | } |
1482 | 1482 | ||
1483 | m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName); | 1483 | m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName); |
1484 | 1484 | ||
1485 | for (int x = 0 ; x < 64 ; x++) | 1485 | for (int x = 0 ; x < 64 ; x++) |
1486 | { | 1486 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 525c3c3..c5392b5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7069,10 +7069,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7069 | shapeBlock.PathScaleX = 100; | 7069 | shapeBlock.PathScaleX = 100; |
7070 | shapeBlock.PathScaleY = 150; | 7070 | shapeBlock.PathScaleY = 150; |
7071 | 7071 | ||
7072 | if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && | 7072 | int flag = type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR); |
7073 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && | 7073 | |
7074 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && | 7074 | if (type != (ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER | flag) && |
7075 | type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS) | 7075 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE | flag) && |
7076 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE | flag) && | ||
7077 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS | flag)) | ||
7076 | { | 7078 | { |
7077 | // default | 7079 | // default |
7078 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; | 7080 | type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index bb498b5..5a53e15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -378,6 +378,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
378 | public const int PRIM_SCULPT_TYPE_TORUS = 2; | 378 | public const int PRIM_SCULPT_TYPE_TORUS = 2; |
379 | public const int PRIM_SCULPT_TYPE_PLANE = 3; | 379 | public const int PRIM_SCULPT_TYPE_PLANE = 3; |
380 | public const int PRIM_SCULPT_TYPE_CYLINDER = 4; | 380 | public const int PRIM_SCULPT_TYPE_CYLINDER = 4; |
381 | public const int PRIM_SCULPT_FLAG_INVERT = 64; | ||
382 | public const int PRIM_SCULPT_FLAG_MIRROR = 128; | ||
381 | 383 | ||
382 | public const int MASK_BASE = 0; | 384 | public const int MASK_BASE = 0; |
383 | public const int MASK_OWNER = 1; | 385 | public const int MASK_OWNER = 1; |