diff options
author | Justin Clarke Casey | 2008-05-09 17:23:27 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-09 17:23:27 +0000 |
commit | d9dffc4a9a1e561921013aa076eee70faa9b7b92 (patch) | |
tree | 59b4babe8099169824417572fe007a2bcb96b691 | |
parent | * Patch from Jed (DeepThink) - More optimisations for BulletX renderer. Trime... (diff) | |
download | opensim-SC_OLD-d9dffc4a9a1e561921013aa076eee70faa9b7b92.zip opensim-SC_OLD-d9dffc4a9a1e561921013aa076eee70faa9b7b92.tar.gz opensim-SC_OLD-d9dffc4a9a1e561921013aa076eee70faa9b7b92.tar.bz2 opensim-SC_OLD-d9dffc4a9a1e561921013aa076eee70faa9b7b92.tar.xz |
From: Michael Osias <mosias@us.ibm.com>
Stop .net generating ambiguous operator errors when two integers are compared for equality in LSL
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index ad3d79d..d794db3 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -208,7 +208,15 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
208 | 208 | ||
209 | // FIXME: these all should probably go into the respective region | 209 | // FIXME: these all should probably go into the respective region |
210 | // modules | 210 | // modules |
211 | |||
212 | /// <summary> | ||
213 | /// Processes a fetch inventory request and sends the reply | ||
211 | 214 | ||
215 | /// </summary> | ||
216 | /// <param name="request"></param> | ||
217 | /// <param name="path"></param> | ||
218 | /// <param name="param"></param> | ||
219 | /// <returns></returns> | ||
212 | // Request is like: | 220 | // Request is like: |
213 | //<llsd> | 221 | //<llsd> |
214 | // <map><key>folders</key> | 222 | // <map><key>folders</key> |
@@ -255,8 +263,10 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
255 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); | 263 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); |
256 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); | 264 | inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", ""); |
257 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); | 265 | inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", ""); |
266 | |||
258 | response += inventoryitemstr; | 267 | response += inventoryitemstr; |
259 | } | 268 | } |
269 | |||
260 | if (response.Length == 0) | 270 | if (response.Length == 0) |
261 | { | 271 | { |
262 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. | 272 | // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. |
@@ -276,6 +286,11 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
276 | return response; | 286 | return response; |
277 | } | 287 | } |
278 | 288 | ||
289 | /// <summary> | ||
290 | /// Construct an LLSD reply packet to a CAPS inventory request | ||
291 | /// </summary> | ||
292 | /// <param name="invFetch"></param> | ||
293 | /// <returns></returns> | ||
279 | private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch) | 294 | private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch) |
280 | { | 295 | { |
281 | LLSDInventoryDescendents reply = new LLSDInventoryDescendents(); | 296 | LLSDInventoryDescendents reply = new LLSDInventoryDescendents(); |
@@ -333,6 +348,11 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
333 | return reply; | 348 | return reply; |
334 | } | 349 | } |
335 | 350 | ||
351 | /// <summary> | ||
352 | /// Convert an internal inventory item object into an LLSD object. | ||
353 | /// </summary> | ||
354 | /// <param name="invItem"></param> | ||
355 | /// <returns></returns> | ||
336 | private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) | 356 | private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) |
337 | { | 357 | { |
338 | LLSDInventoryItem llsdItem = new LLSDInventoryItem(); | 358 | LLSDInventoryItem llsdItem = new LLSDInventoryItem(); |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 09ab5d4..c904b1d 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -1249,6 +1249,18 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1249 | return new LSLInteger(d); | 1249 | return new LSLInteger(d); |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | static public bool operator ==(LSLInteger i1, LSLInteger i2) | ||
1253 | { | ||
1254 | bool ret = i1.value == i2.value; | ||
1255 | return ret; | ||
1256 | } | ||
1257 | |||
1258 | static public bool operator !=(LSLInteger i1, LSLInteger i2) | ||
1259 | { | ||
1260 | bool ret = i1.value != i2.value; | ||
1261 | return ret; | ||
1262 | } | ||
1263 | |||
1252 | static public LSLInteger operator &(LSLInteger i1, LSLInteger i2) | 1264 | static public LSLInteger operator &(LSLInteger i1, LSLInteger i2) |
1253 | { | 1265 | { |
1254 | int ret = i1.value & i2.value; | 1266 | int ret = i1.value & i2.value; |