diff options
author | Melanie | 2010-11-22 23:31:29 +0100 |
---|---|---|
committer | Melanie | 2010-11-22 23:31:29 +0100 |
commit | 571becefb652869fa844188cadf8aca1fea774ab (patch) | |
tree | 1768fee146ca42ba24b7576fb4db134ca2185e38 /OpenSim/Region | |
parent | Make an invalud key string in llTextBox and llDialog non fatal to avoid (diff) | |
download | opensim-SC-571becefb652869fa844188cadf8aca1fea774ab.zip opensim-SC-571becefb652869fa844188cadf8aca1fea774ab.tar.gz opensim-SC-571becefb652869fa844188cadf8aca1fea774ab.tar.bz2 opensim-SC-571becefb652869fa844188cadf8aca1fea774ab.tar.xz |
Fix some crashes caused by the addition of the CreatorData column
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 2e3db48..22da665 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -436,9 +436,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
436 | item = new InventoryItemBase(); | 436 | item = new InventoryItemBase(); |
437 | // Can't know creator is the same, so null it in inventory | 437 | // Can't know creator is the same, so null it in inventory |
438 | if (objlist.Count > 1) | 438 | if (objlist.Count > 1) |
439 | { | ||
439 | item.CreatorId = UUID.Zero.ToString(); | 440 | item.CreatorId = UUID.Zero.ToString(); |
441 | item.CreatorData = String.Empty; | ||
442 | } | ||
440 | else | 443 | else |
444 | { | ||
441 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); | 445 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); |
446 | item.CreatorData = objlist[0].RootPart.CreatorData; | ||
447 | } | ||
442 | item.ID = UUID.Random(); | 448 | item.ID = UUID.Random(); |
443 | item.InvType = (int)InventoryType.Object; | 449 | item.InvType = (int)InventoryType.Object; |
444 | item.Folder = folder.ID; | 450 | item.Folder = folder.ID; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1ba28dc..7e9224d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10177,6 +10177,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10177 | if (str2 == String.Empty) | 10177 | if (str2 == String.Empty) |
10178 | return str1; | 10178 | return str1; |
10179 | 10179 | ||
10180 | int len = str2.Length; | ||
10181 | if ((len % 4) != 0) // LL is EVIL!!!! | ||
10182 | { | ||
10183 | while (str2.EndsWith("=")) | ||
10184 | str2 = str2.Substring(0, str2.Length - 1); | ||
10185 | |||
10186 | len = str2.Length; | ||
10187 | int mod = len % 4; | ||
10188 | |||
10189 | if (mod == 1) | ||
10190 | str2 = str2.Substring(0, str2.Length - 1); | ||
10191 | else if (mod == 2) | ||
10192 | str2 += "=="; | ||
10193 | else if (mod == 3) | ||
10194 | str2 += "="; | ||
10195 | } | ||
10196 | |||
10180 | byte[] data1; | 10197 | byte[] data1; |
10181 | byte[] data2; | 10198 | byte[] data2; |
10182 | try | 10199 | try |
@@ -10200,7 +10217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10200 | { | 10217 | { |
10201 | while (pos < data1.Length) | 10218 | while (pos < data1.Length) |
10202 | { | 10219 | { |
10203 | int len = data1.Length - pos; | 10220 | len = data1.Length - pos; |
10204 | if (len > data2.Length) | 10221 | if (len > data2.Length) |
10205 | len = data2.Length; | 10222 | len = data2.Length; |
10206 | 10223 | ||