diff options
author | Teravus Ovares | 2008-04-27 20:10:28 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-27 20:10:28 +0000 |
commit | 911e63765c7cea748b5ae2227f5c1d6ff131d329 (patch) | |
tree | f95eeffb4974a9b3f6ded4a46bdc240278a336b0 /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |
parent | Minor svn, formatting cleanup. (diff) | |
download | opensim-SC-911e63765c7cea748b5ae2227f5c1d6ff131d329.zip opensim-SC-911e63765c7cea748b5ae2227f5c1d6ff131d329.tar.gz opensim-SC-911e63765c7cea748b5ae2227f5c1d6ff131d329.tar.bz2 opensim-SC-911e63765c7cea748b5ae2227f5c1d6ff131d329.tar.xz |
* Single Attachments now work from inventory. You can attach from inventory and detach from inventory.
* Detaching from right clicking in world, detaches to your inventory.
* If you go up to a prim and attach it from in world, it appears in your inventory.
* Attachment placement is saved when you detach them.
* Choosing wear remembers your last attachment point from inventory.
* Wrote a method to update an inventory item's asset and sends the updated inventory item to the Client
* Wrote a recursive method to find the folder of a known existing inventory item.
* Removed a block on physics object position on creation. This might crash a region or two, let us know via Mantis if your region crashes because of a physics out of bounds error.
* Drop doesn't work. The menu item doesn't even come up. Don't know why :P.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 99 |
1 files changed, 98 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index a3e26b4..b5e2c40 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -1002,6 +1002,93 @@ namespace OpenSim.Region.Environment.Scenes | |||
1002 | } | 1002 | } |
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) | ||
1006 | { | ||
1007 | SceneObjectGroup objectGroup = grp; | ||
1008 | if (objectGroup != null) | ||
1009 | { | ||
1010 | string sceneObjectXml = objectGroup.ToXmlString(); | ||
1011 | |||
1012 | CachedUserInfo userInfo = | ||
1013 | CommsManager.UserProfileCacheService.GetUserDetails(agentID); | ||
1014 | if (userInfo != null) | ||
1015 | { | ||
1016 | Queue<InventoryFolderImpl> searchfolders = new Queue<InventoryFolderImpl>(); | ||
1017 | searchfolders.Enqueue(userInfo.RootFolder); | ||
1018 | |||
1019 | LLUUID foundFolder = userInfo.RootFolder.ID; | ||
1020 | |||
1021 | // search through folders to find the asset. | ||
1022 | while (searchfolders.Count > 0) | ||
1023 | { | ||
1024 | |||
1025 | InventoryFolderImpl fld = searchfolders.Dequeue(); | ||
1026 | lock (fld) | ||
1027 | { | ||
1028 | if (fld != null) | ||
1029 | { | ||
1030 | if (fld.Items.ContainsKey(assetID)) | ||
1031 | { | ||
1032 | foundFolder = fld.ID; | ||
1033 | searchfolders.Clear(); | ||
1034 | break; | ||
1035 | } | ||
1036 | else | ||
1037 | { | ||
1038 | foreach (InventoryFolderImpl subfld in fld.SubFolders.Values) | ||
1039 | { | ||
1040 | searchfolders.Enqueue(subfld); | ||
1041 | } | ||
1042 | } | ||
1043 | } | ||
1044 | } | ||
1045 | } | ||
1046 | AssetBase asset = CreateAsset( | ||
1047 | objectGroup.GetPartName(objectGroup.LocalId), | ||
1048 | objectGroup.GetPartDescription(objectGroup.LocalId), | ||
1049 | (sbyte)InventoryType.Object, | ||
1050 | (sbyte)AssetType.Object, | ||
1051 | Helpers.StringToField(sceneObjectXml)); | ||
1052 | AssetCache.AddAsset(asset); | ||
1053 | |||
1054 | InventoryItemBase item = new InventoryItemBase(); | ||
1055 | item.Creator = objectGroup.RootPart.CreatorID; | ||
1056 | item.Owner = agentID; | ||
1057 | item.ID = assetID; | ||
1058 | item.AssetID = asset.FullID; | ||
1059 | item.Description = asset.Description; | ||
1060 | item.Name = asset.Name; | ||
1061 | item.AssetType = asset.Type; | ||
1062 | item.InvType = asset.InvType; | ||
1063 | |||
1064 | // Sticking it in root folder for now.. objects folder later? | ||
1065 | |||
1066 | item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID; | ||
1067 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; | ||
1068 | if (agentID != objectGroup.RootPart.OwnerID) | ||
1069 | { | ||
1070 | item.BasePermissions = objectGroup.RootPart.NextOwnerMask; | ||
1071 | item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; | ||
1072 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; | ||
1073 | } | ||
1074 | else | ||
1075 | { | ||
1076 | item.BasePermissions = objectGroup.RootPart.BaseMask; | ||
1077 | item.CurrentPermissions = objectGroup.RootPart.OwnerMask; | ||
1078 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; | ||
1079 | } | ||
1080 | |||
1081 | userInfo.AddItem(agentID, item); | ||
1082 | |||
1083 | // this gets called when the agent loggs off! | ||
1084 | if (remoteClient != null) | ||
1085 | { | ||
1086 | remoteClient.SendInventoryItemCreateUpdate(item); | ||
1087 | } | ||
1088 | |||
1089 | } | ||
1090 | } | ||
1091 | } | ||
1005 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) | 1092 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) |
1006 | { | 1093 | { |
1007 | SceneObjectGroup objectGroup = grp; | 1094 | SceneObjectGroup objectGroup = grp; |
@@ -1184,7 +1271,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1184 | } | 1271 | } |
1185 | 1272 | ||
1186 | rootPart.TrimPermissions(); | 1273 | rootPart.TrimPermissions(); |
1187 | group.ApplyPhysics(m_physicalPrim); | 1274 | |
1275 | if (!attachment) | ||
1276 | { | ||
1277 | if (group.RootPart.Shape.PCode == (byte)PCode.Prim) | ||
1278 | { | ||
1279 | group.RootPart.Shape.State = (byte)0; | ||
1280 | } | ||
1281 | group.ApplyPhysics(m_physicalPrim); | ||
1282 | } | ||
1283 | |||
1284 | |||
1188 | group.StartScripts(); | 1285 | group.StartScripts(); |
1189 | 1286 | ||
1190 | 1287 | ||