diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index ace40e5a0c..a032670588 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -137,7 +137,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); - + cmd.ExecuteNonQuery(); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f0f3932564..b3f5f09c04 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -7069,6 +7069,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + /// + /// This is the entry point for the UDP route by which the client can retrieve asset data. If the request + /// is successful then a TransferInfo packet will be sent back, followed by one or more TransferPackets + /// + /// + /// + /// This parameter may be ignored since we appear to return true whatever happens private bool HandleTransferRequest(IClientAPI sender, Packet Pack) { //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); @@ -7079,7 +7086,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Has to be done here, because AssetCache can't do it // UUID taskID = UUID.Zero; - if (transfer.TransferInfo.SourceType == 3) + if (transfer.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) { taskID = new UUID(transfer.TransferInfo.Params, 48); UUID itemID = new UUID(transfer.TransferInfo.Params, 64); @@ -11356,17 +11363,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP return String.Empty; } - public void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID) + /// + /// Make an asset request to the asset service in response to a client request. + /// + /// + /// + protected void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID) { UUID requestID = UUID.Zero; - if (transferRequest.TransferInfo.SourceType == 2) + if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) { - //direct asset request requestID = new UUID(transferRequest.TransferInfo.Params, 0); } - else if (transferRequest.TransferInfo.SourceType == 3) + else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) { - //inventory asset request requestID = new UUID(transferRequest.TransferInfo.Params, 80); //m_log.Debug("[XXX] inventory asset request " + requestID); //if (taskID == UUID.Zero) // Agent @@ -11379,29 +11389,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP // } } - //check to see if asset is in local cache, if not we need to request it from asset server. - //m_log.Debug("asset request " + requestID); + //m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); - } + /// + /// When we get a reply back from the asset service in response to a client request, send back the data. + /// + /// + /// + /// protected void AssetReceived(string id, Object sender, AssetBase asset) { TransferRequestPacket transferRequest = (TransferRequestPacket)sender; UUID requestID = UUID.Zero; - byte source = 2; - if ((transferRequest.TransferInfo.SourceType == 2) || (transferRequest.TransferInfo.SourceType == 2222)) + byte source = (byte)SourceType.Asset; + + if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) + || (transferRequest.TransferInfo.SourceType == 2222)) { - //direct asset request requestID = new UUID(transferRequest.TransferInfo.Params, 0); } - else if ((transferRequest.TransferInfo.SourceType == 3) || (transferRequest.TransferInfo.SourceType == 3333)) + else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) + || (transferRequest.TransferInfo.SourceType == 3333)) { - //inventory asset request requestID = new UUID(transferRequest.TransferInfo.Params, 80); - source = 3; + source = (byte)SourceType.SimInventoryItem; //m_log.Debug("asset request " + requestID); } @@ -11414,9 +11429,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer())) { m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id); - if (transferRequest.TransferInfo.SourceType == 2) + if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) transferRequest.TransferInfo.SourceType = 2222; // marker - else if (transferRequest.TransferInfo.SourceType == 3) + else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) transferRequest.TransferInfo.SourceType = 3333; // marker m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived); @@ -11431,7 +11446,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } // Scripts cannot be retrieved by direct request - if (transferRequest.TransferInfo.SourceType == 2 && asset.Type == 10) + if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) return; // The asset is known to exist and is in our cache, so add it to the AssetRequests list diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 9005e947fd..dc68259d93 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -792,7 +792,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } if (extraData.ContainsKey("LinkedItemType")) - invItem.AssetType = extraData["LinkedItemType"].AsInteger(); + invItem.AssetType = SLUtil.ContentTypeToSLAssetType(extraData["LinkedItemType"].AsString()); } if (invItem.BasePermissions == 0)