aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorSean Dague2007-12-03 20:06:01 +0000
committerSean Dague2007-12-03 20:06:01 +0000
commit8f58a9a107047bf9d9aff4d8c25171acaa8e9805 (patch)
treebde9e5b6c29792d19c487549f99f198709e61bc8 /OpenSim/Region/ClientStack
parent* Now using interpolation to expand the 256x256 heightfield data to 512x512 b... (diff)
downloadopensim-SC_OLD-8f58a9a107047bf9d9aff4d8c25171acaa8e9805.zip
opensim-SC_OLD-8f58a9a107047bf9d9aff4d8c25171acaa8e9805.tar.gz
opensim-SC_OLD-8f58a9a107047bf9d9aff4d8c25171acaa8e9805.tar.bz2
opensim-SC_OLD-8f58a9a107047bf9d9aff4d8c25171acaa8e9805.tar.xz
From Justin Casey (IBM)
While exploring what it would take to get the 'new script' button working, I encountered the fact, some way down in the rabbit hole, that if a user renamed an item in their inventory and logged out (without a restart of the simulator), on log in the new name was not preserved. As far as I can see, this was because any updates which didn't occur inside a transaction were ignored by opensim. This patch pays attention to those changes. It generates a new asset when an item is updated and changes the user's inventory properties appropriately. I believe this behaviour is in line with the copy-on-write semantics used in the Second Life protocol - perhaps it could be optimized if we knew for sure that the only copy of the object was in the user's inventory. This also means that if you rename an item (e.g. a script) before you drag it into an object's inventory, the inventory will receive the item's most recent name and description.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs32
1 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index f04a70a..1c16a95 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -59,7 +59,14 @@ namespace OpenSim.Region.ClientStack
59 //local handlers for this instance 59 //local handlers for this instance
60 60
61 private LLUUID m_sessionId; 61 private LLUUID m_sessionId;
62 public LLUUID SecureSessionID = LLUUID.Zero; 62
63 private LLUUID m_secureSessionId = LLUUID.Zero;
64
65 public LLUUID SecureSessionId
66 {
67 get { return m_secureSessionId; }
68 }
69
63 public string firstName; 70 public string firstName;
64 public string lastName; 71 public string lastName;
65 private UseCircuitCodePacket cirpack; 72 private UseCircuitCodePacket cirpack;
@@ -540,7 +547,7 @@ namespace OpenSim.Region.ClientStack
540 547
541 if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero) 548 if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
542 { 549 {
543 SecureSessionID = sessionInfo.LoginInfo.SecureSession; 550 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
544 } 551 }
545 InitNewClient(); 552 InitNewClient();
546 553
@@ -615,7 +622,7 @@ namespace OpenSim.Region.ClientStack
615 public event FetchInventoryDescendents OnFetchInventoryDescendents; 622 public event FetchInventoryDescendents OnFetchInventoryDescendents;
616 public event FetchInventory OnFetchInventory; 623 public event FetchInventory OnFetchInventory;
617 public event RequestTaskInventory OnRequestTaskInventory; 624 public event RequestTaskInventory OnRequestTaskInventory;
618 public event UpdateInventoryItemTransaction OnUpdateInventoryItem; 625 public event UpdateInventoryItem OnUpdateInventoryItem;
619 public event CopyInventoryItem OnCopyInventoryItem; 626 public event CopyInventoryItem OnCopyInventoryItem;
620 public event UDPAssetUploadRequest OnAssetUploadRequest; 627 public event UDPAssetUploadRequest OnAssetUploadRequest;
621 public event XferReceive OnXferReceive; 628 public event XferReceive OnXferReceive;
@@ -888,7 +895,7 @@ namespace OpenSim.Region.ClientStack
888 AgentCircuitData agentData = new AgentCircuitData(); 895 AgentCircuitData agentData = new AgentCircuitData();
889 agentData.AgentID = AgentId; 896 agentData.AgentID = AgentId;
890 agentData.SessionID = m_sessionId; 897 agentData.SessionID = m_sessionId;
891 agentData.SecureSessionID = SecureSessionID; 898 agentData.SecureSessionID = SecureSessionId;
892 agentData.circuitcode = m_circuitCode; 899 agentData.circuitcode = m_circuitCode;
893 agentData.child = false; 900 agentData.child = false;
894 agentData.firstname = firstName; 901 agentData.firstname = firstName;
@@ -2953,10 +2960,10 @@ namespace OpenSim.Region.ClientStack
2953 case PacketType.AssetUploadRequest: 2960 case PacketType.AssetUploadRequest:
2954 AssetUploadRequestPacket request = (AssetUploadRequestPacket) Pack; 2961 AssetUploadRequestPacket request = (AssetUploadRequestPacket) Pack;
2955 // Console.WriteLine("upload request " + Pack.ToString()); 2962 // Console.WriteLine("upload request " + Pack.ToString());
2956 // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated()); 2963 // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated());
2957 if (OnAssetUploadRequest != null) 2964 if (OnAssetUploadRequest != null)
2958 { 2965 {
2959 OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(SecureSessionID), 2966 OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(SecureSessionId),
2960 request.AssetBlock.TransactionID, request.AssetBlock.Type, 2967 request.AssetBlock.TransactionID, request.AssetBlock.Type,
2961 request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); 2968 request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
2962 } 2969 }
@@ -3033,12 +3040,11 @@ namespace OpenSim.Region.ClientStack
3033 { 3040 {
3034 for (int i = 0; i < update.InventoryData.Length; i++) 3041 for (int i = 0; i < update.InventoryData.Length; i++)
3035 { 3042 {
3036 if (update.InventoryData[i].TransactionID != LLUUID.Zero) 3043 OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID,
3037 { 3044 update.InventoryData[i].ItemID,
3038 OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, 3045 Util.FieldToString(update.InventoryData[i].Name),
3039 update.InventoryData[i].TransactionID.Combine(SecureSessionID), 3046 Util.FieldToString(update.InventoryData[i].Description),
3040 update.InventoryData[i].ItemID); 3047 update.InventoryData[i].NextOwnerMask);
3041 }
3042 } 3048 }
3043 } 3049 }
3044 //Console.WriteLine(Pack.ToString()); 3050 //Console.WriteLine(Pack.ToString());
@@ -3046,7 +3052,7 @@ namespace OpenSim.Region.ClientStack
3046 { 3052 {
3047 if (update.InventoryData[i].TransactionID != LLUUID.Zero) 3053 if (update.InventoryData[i].TransactionID != LLUUID.Zero)
3048 { 3054 {
3049 AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); 3055 AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionId));
3050 if (asset != null) 3056 if (asset != null)
3051 { 3057 {
3052 // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache"); 3058 // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");