diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index c6f8b888ae..ca0b7adc08 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -769,8 +769,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0; if (canEditObjectsChanged) friendClient.SendChangeUserRights(userID, friendID, rights); + } + // update local cache + //m_Friends[friendID].Friends = m_FriendsService.GetFriends(friendID); + foreach (FriendInfo finfo in m_Friends[friendID].Friends) + if (finfo.Friend == userID.ToString()) + finfo.TheirFlags = rights; + return true; } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 2ab46aa33f..b0555daa3a 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -131,6 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return ret; } + // DO NOT OVERRIDE THIS METHOD public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) { diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 3035d889e7..12b6aa0ba3 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -286,23 +286,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { // Deleting someone else's item // - - if (remoteClient == null || objectGroup.OwnerID != remoteClient.AgentId) { - // Folder skeleton may not be loaded and we - // have to wait for the inventory to find - // the destination folder - // + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); } else { - // Assume inventory skeleton was loaded during login - // and all folders can be found - // - folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); } } else if (action == DeRezAction.Return) @@ -332,7 +324,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (folder == null) // None of the above { - //folder = userInfo.RootFolder.FindFolder(folderID); folder = new InventoryFolderBase(folderID); if (folder == null) // Nowhere to put it diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index ae03cdf9f6..209cf0d3c2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" }; - ServerUtils.LoadPlugin("OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector", args); + ServerUtils.LoadPlugin("OpenSim.Server.Handlers.dll:XInventoryInConnector", args); } } diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 4d360f6be5..a1451ce705 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -134,8 +134,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver foreach (KeyValuePair kvp in m_uuids) { - if (kvp.Key != UUID.Zero) - m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); + m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); } m_requestCallbackTimer.Enabled = true; @@ -270,7 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } catch (Exception e) { - m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}{1}", e.Message, e.StackTrace); + m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e); } } @@ -286,8 +285,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver catch (Exception e) { m_log.ErrorFormat( - "[ARCHIVER]: Terminating archive creation since asset requester callback failed with {0}{1}", - e.Message, e.StackTrace); + "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e); } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e61132e41a..167e166b06 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1592,16 +1592,32 @@ namespace OpenSim.Region.Framework.Scenes // So that we know the database is upto date, // for when deleting the object from it ForceSceneObjectBackup(grp); - if (remoteClient != null) + + if (remoteClient == null) { - if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) + // Autoreturn has a null client. Nothing else does. So + // allow only returns + if (action != DeRezAction.Return) + return; + + permissionToTakeCopy = false; + } + else + { + if (action == DeRezAction.TakeCopy) + { + if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) + permissionToTakeCopy = false; + } + else + { permissionToTakeCopy = false; + } if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) permissionToTake = false; if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) permissionToDelete = false; - } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fb191e6a5e..d49bbb2d1c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9829,19 +9829,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llXorBase64StringsCorrect(string str1, string str2) { m_host.AddScriptLPS(1); - string ret = String.Empty; - string src1 = llBase64ToString(str1); - string src2 = llBase64ToString(str2); - int c = 0; - for (int i = 0; i < src1.Length; i++) - { - ret += (char) (src1[i] ^ src2[c]); - c++; - if (c >= src2.Length) - c = 0; + if (str1 == String.Empty) + return String.Empty; + if (str2 == String.Empty) + return str1; + + byte[] data1 = Convert.FromBase64String(str1); + byte[] data2 = Convert.FromBase64String(str2); + + byte[] d2 = new Byte[data1.Length]; + int pos = 0; + + if (data1.Length <= data2.Length) + { + Array.Copy(data2, 0, d2, 0, data1.Length); } - return llStringToBase64(ret); + else + { + while (pos < data1.Length) + { + int len = data1.Length - pos; + if (len > data2.Length) + len = data2.Length; + + Array.Copy(data2, 0, d2, pos, len); + pos += len; + } + } + + for (pos = 0 ; pos < data1.Length ; pos++ ) + data1[pos] ^= d2[pos]; + + return Convert.ToBase64String(data1); } public LSL_String llHTTPRequest(string url, LSL_List parameters, string body) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 30e127d19b..bbaf923858 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -556,6 +556,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (stateSource == (int)StateSource.ScriptedRez) { + lock (m_CompileDict) + { + m_CompileDict[itemID] = 0; + } + DoOnRezScript(parms); } else @@ -1356,9 +1361,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine string xml = instance.GetXMLState(); XmlDocument sdoc = new XmlDocument(); - sdoc.LoadXml(xml); - XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); - XmlNode rootNode = rootL[0]; + bool loadedState = true; + try + { + sdoc.LoadXml(xml); + } + catch (System.Xml.XmlException e) + { + loadedState = false; + } + + XmlNodeList rootL = null; + XmlNode rootNode = null; + if (loadedState) + { + rootL = sdoc.GetElementsByTagName("ScriptState"); + rootNode = rootL[0]; + } // Create XmlDocument doc = new XmlDocument(); @@ -1374,8 +1393,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine stateData.Attributes.Append(engineName); doc.AppendChild(stateData); + XmlNode xmlstate = null; + // Add ... - XmlNode xmlstate = doc.ImportNode(rootNode, true); + if (loadedState) + { + xmlstate = doc.ImportNode(rootNode, true); + } + else + { + xmlstate = doc.CreateElement("", "ScriptState", ""); + } + stateData.AppendChild(xmlstate); string assemName = instance.GetAssemblyName(); diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index a5bebb859f..dee31bdf58 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -230,6 +230,12 @@ namespace OpenSim.Server.Base "shutdown", "Quit the application", HandleQuit); + // Register a command to read other commands from a file + MainConsole.Instance.Commands.AddCommand("base", false, "command-script", + "command-script