Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

slimupdates
John Hurliman 2010-04-14 19:49:02 -07:00
commit a7449a82bc
4 changed files with 96 additions and 19 deletions

View File

@ -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();
}
}

View File

@ -7069,6 +7069,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
/// <summary>
/// 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
/// </summary>
/// <param name="sender"></param>
/// <param name="Pack"></param>
/// <returns>This parameter may be ignored since we appear to return true whatever happens</returns>
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)
/// <summary>
/// Make an asset request to the asset service in response to a client request.
/// </summary>
/// <param name="transferRequest"></param>
/// <param name="taskID"></param>
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);
}
/// <summary>
/// When we get a reply back from the asset service in response to a client request, send back the data.
/// </summary>
/// <param name="id"></param>
/// <param name="sender"></param>
/// <param name="asset"></param>
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

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{595D67F3-B413-4A43-8568-5B5930E3B31D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Robust._32BitLaunch</RootNamespace>
<AssemblyName>Robust.32BitLaunch</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\bin\log4net.dll</HintPath>
</Reference>
<Reference Include="OpenSim.Server, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\bin\OpenSim.Server.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.