aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.Framework/AgentInventory.cs (renamed from OpenSim.Framework/Inventory.cs)21
-rw-r--r--OpenSim.Framework/OpenSim.Framework.csproj35
-rw-r--r--OpenSim.Framework/OpenSim.Framework.dll.build126
-rw-r--r--OpenSim.Framework/Util.cs13
-rw-r--r--OpenSim.RegionServer/AgentAssetUpload.cs212
-rw-r--r--OpenSim.RegionServer/Assets/AssetCache.cs79
-rw-r--r--OpenSim.RegionServer/Assets/InventoryCache.cs27
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj42
-rw-r--r--OpenSim.RegionServer/OpenSim.exe.build1
-rw-r--r--OpenSim.RegionServer/SimClient.cs61
-rw-r--r--OpenSim.sln130
11 files changed, 511 insertions, 236 deletions
diff --git a/OpenSim.Framework/Inventory.cs b/OpenSim.Framework/AgentInventory.cs
index e34ea75..8ab2f3a 100644
--- a/OpenSim.Framework/Inventory.cs
+++ b/OpenSim.Framework/AgentInventory.cs
@@ -25,12 +25,12 @@ namespace OpenSim.Framework.Inventory
25 25
26 public virtual void Initialise() 26 public virtual void Initialise()
27 { 27 {
28 Wearables = new AvatarWearable[2]; //should be 12 of these 28 Wearables = new AvatarWearable[13]; //should be 12 of these
29 for (int i = 0; i < 2; i++) 29 for (int i = 0; i < 13; i++)
30 { 30 {
31 Wearables[i] = new AvatarWearable(); 31 Wearables[i] = new AvatarWearable();
32 } 32 }
33 33
34 InventoryRoot = new InventoryFolder(); 34 InventoryRoot = new InventoryFolder();
35 InventoryRoot.FolderID = LLUUID.Random(); 35 InventoryRoot.FolderID = LLUUID.Random();
36 InventoryRoot.ParentID = new LLUUID(); 36 InventoryRoot.ParentID = new LLUUID();
@@ -40,16 +40,29 @@ namespace OpenSim.Framework.Inventory
40 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); 40 InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
41 } 41 }
42 42
43 public bool CreateNewFolder(LLUUID folderID) 43 public bool CreateNewFolder(LLUUID folderID, ushort type)
44 { 44 {
45 InventoryFolder Folder = new InventoryFolder(); 45 InventoryFolder Folder = new InventoryFolder();
46 Folder.FolderID = folderID; 46 Folder.FolderID = folderID;
47 Folder.OwnerID = this.AgentID; 47 Folder.OwnerID = this.AgentID;
48 Folder.DefaultType = type;
48 this.InventoryFolders.Add(Folder.FolderID, Folder); 49 this.InventoryFolders.Add(Folder.FolderID, Folder);
49 50
50 return (true); 51 return (true);
51 } 52 }
52 53
54 public bool UpdateItem(LLUUID itemID, AssetBase asset)
55 {
56 if(this.InventoryItems.ContainsKey(itemID))
57 {
58 InventoryItem Item = this.InventoryItems[itemID];
59 Item.AssetID = asset.FullID;
60 Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
61 //TODO need to update the rest of the info
62 }
63 return true;
64 }
65
53 public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) 66 public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
54 { 67 {
55 if (this.InventoryFolders.ContainsKey(folderID)) 68 if (this.InventoryFolders.ContainsKey(folderID))
diff --git a/OpenSim.Framework/OpenSim.Framework.csproj b/OpenSim.Framework/OpenSim.Framework.csproj
index 745874c..b250d18 100644
--- a/OpenSim.Framework/OpenSim.Framework.csproj
+++ b/OpenSim.Framework/OpenSim.Framework.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{71848571-2BC0-41DC-A69C-28B6DDB8C8CE}</ProjectGuid> 6 <ProjectGuid>{71848571-2BC0-41DC-A69C-28B6DDB8C8CE}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Framework</AssemblyName> 13 <AssemblyName>OpenSim.Framework</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenSim.Framework</RootNamespace> 21 <RootNamespace>OpenSim.Framework</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,18 +61,19 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="System" > 68 <Reference Include="System">
62 <HintPath>System.dll</HintPath> 69 <HintPath>System.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="System.Xml" > 72 <Reference Include="System.Xml">
66 <HintPath>System.Xml.dll</HintPath> 73 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private> 74 <Private>False</Private>
68 </Reference> 75 </Reference>
69 <Reference Include="libsecondlife.dll" > 76 <Reference Include="libsecondlife.dll">
70 <HintPath>..\bin\libsecondlife.dll</HintPath> 77 <HintPath>..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private> 78 <Private>False</Private>
72 </Reference> 79 </Reference>
@@ -77,6 +84,7 @@
77 <Compile Include="AgentCiruitData.cs"> 84 <Compile Include="AgentCiruitData.cs">
78 <SubType>Code</SubType> 85 <SubType>Code</SubType>
79 </Compile> 86 </Compile>
87 <Compile Include="AgentInventory.cs" />
80 <Compile Include="AssetBase.cs"> 88 <Compile Include="AssetBase.cs">
81 <SubType>Code</SubType> 89 <SubType>Code</SubType>
82 </Compile> 90 </Compile>
@@ -98,9 +106,6 @@
98 <Compile Include="ILocalStorage.cs"> 106 <Compile Include="ILocalStorage.cs">
99 <SubType>Code</SubType> 107 <SubType>Code</SubType>
100 </Compile> 108 </Compile>
101 <Compile Include="Inventory.cs">
102 <SubType>Code</SubType>
103 </Compile>
104 <Compile Include="IUserServer.cs"> 109 <Compile Include="IUserServer.cs">
105 <SubType>Code</SubType> 110 <SubType>Code</SubType>
106 </Compile> 111 </Compile>
@@ -151,4 +156,4 @@
151 <PostBuildEvent> 156 <PostBuildEvent>
152 </PostBuildEvent> 157 </PostBuildEvent>
153 </PropertyGroup> 158 </PropertyGroup>
154</Project> 159</Project> \ No newline at end of file
diff --git a/OpenSim.Framework/OpenSim.Framework.dll.build b/OpenSim.Framework/OpenSim.Framework.dll.build
index 3d29b2b..ccb2a60 100644
--- a/OpenSim.Framework/OpenSim.Framework.dll.build
+++ b/OpenSim.Framework/OpenSim.Framework.dll.build
@@ -1,63 +1,63 @@
1<?xml version="1.0" ?> 1<?xml version="1.0" ?>
2<project name="OpenSim.Framework" default="build"> 2<project name="OpenSim.Framework" default="build">
3 <target name="build"> 3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> 4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" /> 5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}"> 6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}"> 7 <fileset basedir="${project::get-base-directory()}">
8 </fileset> 8 </fileset>
9 </copy> 9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> 10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework" dynamicprefix="true" > 11 <resources prefix="OpenSim.Framework" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AgentCiruitData.cs" /> 14 <include name="AgentCiruitData.cs" />
15 <include name="AssetBase.cs" /> 15 <include name="AgentInventory.cs" />
16 <include name="BlockingQueue.cs" /> 16 <include name="AssetBase.cs" />
17 <include name="HeightMapGenHills.cs" /> 17 <include name="BlockingQueue.cs" />
18 <include name="IAssetServer.cs" /> 18 <include name="HeightMapGenHills.cs" />
19 <include name="IConfig.cs" /> 19 <include name="IAssetServer.cs" />
20 <include name="IGridServer.cs" /> 20 <include name="IConfig.cs" />
21 <include name="ILocalStorage.cs" /> 21 <include name="IGridServer.cs" />
22 <include name="IUserServer.cs" /> 22 <include name="ILocalStorage.cs" />
23 <include name="Inventory.cs" /> 23 <include name="IUserServer.cs" />
24 <include name="LocalGridBase.cs" /> 24 <include name="LocalGridBase.cs" />
25 <include name="Login.cs" /> 25 <include name="Login.cs" />
26 <include name="LoginService.cs" /> 26 <include name="LoginService.cs" />
27 <include name="NeighbourInfo.cs" /> 27 <include name="NeighbourInfo.cs" />
28 <include name="PrimData.cs" /> 28 <include name="PrimData.cs" />
29 <include name="RemoteGridBase.cs" /> 29 <include name="RemoteGridBase.cs" />
30 <include name="SimProfile.cs" /> 30 <include name="SimProfile.cs" />
31 <include name="SimProfileBase.cs" /> 31 <include name="SimProfileBase.cs" />
32 <include name="UserProfile.cs" /> 32 <include name="UserProfile.cs" />
33 <include name="UserProfileManager.cs" /> 33 <include name="UserProfileManager.cs" />
34 <include name="UserProfileManagerBase.cs" /> 34 <include name="UserProfileManagerBase.cs" />
35 <include name="Util.cs" /> 35 <include name="Util.cs" />
36 <include name="Properties/AssemblyInfo.cs" /> 36 <include name="Properties/AssemblyInfo.cs" />
37 </sources> 37 </sources>
38 <references basedir="${project::get-base-directory()}"> 38 <references basedir="${project::get-base-directory()}">
39 <lib> 39 <lib>
40 <include name="${project::get-base-directory()}" /> 40 <include name="${project::get-base-directory()}" />
41 <include name="${project::get-base-directory()}/${build.dir}" /> 41 <include name="${project::get-base-directory()}/${build.dir}" />
42 </lib> 42 </lib>
43 <include name="System.dll" /> 43 <include name="System.dll" />
44 <include name="System.Xml.dll" /> 44 <include name="System.Xml.dll" />
45 <include name="../bin/libsecondlife.dll" /> 45 <include name="../bin/libsecondlife.dll" />
46 </references> 46 </references>
47 </csc> 47 </csc>
48 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> 48 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
49 <mkdir dir="${project::get-base-directory()}/../bin/"/> 49 <mkdir dir="${project::get-base-directory()}/../bin/"/>
50 <copy todir="${project::get-base-directory()}/../bin/"> 50 <copy todir="${project::get-base-directory()}/../bin/">
51 <fileset basedir="${project::get-base-directory()}/${build.dir}/" > 51 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
52 <include name="*.dll"/> 52 <include name="*.dll"/>
53 <include name="*.exe"/> 53 <include name="*.exe"/>
54 </fileset> 54 </fileset>
55 </copy> 55 </copy>
56 </target> 56 </target>
57 <target name="clean"> 57 <target name="clean">
58 <delete dir="${bin.dir}" failonerror="false" /> 58 <delete dir="${bin.dir}" failonerror="false" />
59 <delete dir="${obj.dir}" failonerror="false" /> 59 <delete dir="${obj.dir}" failonerror="false" />
60 </target> 60 </target>
61 <target name="doc" description="Creates documentation."> 61 <target name="doc" description="Creates documentation.">
62 </target> 62 </target>
63</project> 63</project>
diff --git a/OpenSim.Framework/Util.cs b/OpenSim.Framework/Util.cs
index 042360d..440ce41 100644
--- a/OpenSim.Framework/Util.cs
+++ b/OpenSim.Framework/Util.cs
@@ -9,6 +9,8 @@ namespace OpenSim.Framework.Utilities
9 public class Util 9 public class Util
10 { 10 {
11 private static Random randomClass = new Random(); 11 private static Random randomClass = new Random();
12 private static uint nextXferID = 10000;
13 private static object XferLock = new object();
12 14
13 public static ulong UIntsToLong(uint X, uint Y) 15 public static ulong UIntsToLong(uint X, uint Y)
14 { 16 {
@@ -23,6 +25,17 @@ namespace OpenSim.Framework.Utilities
23 } 25 }
24 } 26 }
25 27
28 public static uint GetNextXferID()
29 {
30 uint id = 0;
31 lock(XferLock)
32 {
33 id = nextXferID;
34 nextXferID++;
35 }
36 return id;
37 }
38
26 public Util() 39 public Util()
27 { 40 {
28 41
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs
new file mode 100644
index 0000000..2b4d78f
--- /dev/null
+++ b/OpenSim.RegionServer/AgentAssetUpload.cs
@@ -0,0 +1,212 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Assets;
5using OpenSim.Framework.Utilities;
6using libsecondlife;
7using libsecondlife.Packets;
8
9namespace OpenSim
10{
11 public class AgentAssetUpload
12 {
13 private Dictionary<LLUUID, AssetTransaction> transactions = new Dictionary<LLUUID, AssetTransaction>();
14 private SimClient ourClient;
15
16 public AgentAssetUpload(SimClient client)
17 {
18 this.ourClient = client;
19 }
20
21 public void AddUpload(LLUUID transactionID, AssetBase asset)
22 {
23 Console.WriteLine("adding upload asset");
24 AssetTransaction upload = new AssetTransaction();
25 lock (this.transactions)
26 {
27 upload.Asset = asset;
28 upload.TransactionID = transactionID;
29 this.transactions.Add(transactionID, upload);
30 }
31 if (upload.Asset.Data.Length > 2)
32 {
33 //is complete
34 upload.UploadComplete = true;
35 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
36 response.AssetBlock.Type = asset.Type;
37 response.AssetBlock.Success = true;
38 response.AssetBlock.UUID = transactionID.Combine(this.ourClient.SecureSessionID);
39 this.ourClient.OutPacket(response);
40 }
41 else
42 {
43 Console.WriteLine(" no data in upload request so use xfer system");
44 upload.UploadComplete = false;
45 upload.XferID = Util.GetNextXferID();
46 RequestXferPacket xfer = new RequestXferPacket();
47 xfer.XferID.ID = upload.XferID;
48 xfer.XferID.VFileType = upload.Asset.Type;
49 xfer.XferID.VFileID = transactionID.Combine(this.ourClient.SecureSessionID);
50 xfer.XferID.FilePath = 0;
51 xfer.XferID.Filename = new byte[0];
52 this.ourClient.OutPacket(xfer);
53 }
54
55 }
56
57 public AssetBase GetUpload(LLUUID transactionID)
58 {
59 if (this.transactions.ContainsKey(transactionID))
60 {
61 return this.transactions[transactionID].Asset;
62 }
63
64 return null;
65 }
66
67 public void HandleUploadPacket(AssetUploadRequestPacket pack, LLUUID assetID)
68 {
69
70 AssetBase asset = null;
71 if (pack.AssetBlock.Type == 0)
72 {
73
74 //first packet for transaction
75 asset = new AssetBase();
76 asset.FullID = assetID;
77 asset.Type = pack.AssetBlock.Type;
78 asset.InvType = asset.Type;
79 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
80 asset.Data = pack.AssetBlock.AssetData;
81
82
83 }
84 /* for now we will only support uploading of textures
85 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5)
86 {
87
88 asset = new AssetBase();
89 asset.FullID = assetID;
90 Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
91 asset.Type = pack.AssetBlock.Type;
92 asset.InvType = asset.Type;
93 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
94 asset.Data = pack.AssetBlock.AssetData;
95
96
97 }*/
98
99 if (asset != null)
100 {
101 this.AddUpload(pack.AssetBlock.TransactionID, asset);
102 }
103 else
104 {
105
106 //currently we don't support this asset type
107 //so lets just tell the client that the upload is complete
108 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
109 response.AssetBlock.Type = pack.AssetBlock.Type;
110 response.AssetBlock.Success = true;
111 response.AssetBlock.UUID = pack.AssetBlock.TransactionID.Combine(this.ourClient.SecureSessionID);
112 this.ourClient.OutPacket(response);
113 }
114
115 }
116
117 #region Xfer packet system for larger uploads
118
119 public void HandleXferPacket(SendXferPacketPacket xferPacket)
120 {
121 lock (this.transactions)
122 {
123 foreach (AssetTransaction trans in this.transactions.Values)
124 {
125 if (trans.XferID == xferPacket.XferID.ID)
126 {
127 if (trans.Asset.Data.Length > 1)
128 {
129 byte[] newArray = new byte[trans.Asset.Data.Length + xferPacket.DataPacket.Data.Length];
130 Array.Copy(trans.Asset.Data, 0, newArray, 0, trans.Asset.Data.Length);
131 Array.Copy(xferPacket.DataPacket.Data, 0, newArray, trans.Asset.Data.Length, xferPacket.DataPacket.Data.Length);
132 trans.Asset.Data = newArray;
133 }
134 else
135 {
136 byte[] newArray = new byte[xferPacket.DataPacket.Data.Length-4];
137 Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length-4);
138 trans.Asset.Data = newArray;
139 }
140
141 if ((xferPacket.XferID.Packet & 2147483648) != 0)
142 {
143 //end of transfer
144 trans.UploadComplete = true;
145 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
146 response.AssetBlock.Type = trans.Asset.Type;
147 response.AssetBlock.Success = true;
148 response.AssetBlock.UUID = trans.TransactionID.Combine(this.ourClient.SecureSessionID);
149 this.ourClient.OutPacket(response);
150
151 //check if we should add it to inventory
152 if (trans.AddToInventory)
153 {
154 OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset);
155 OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
156 }
157
158 Console.WriteLine(Helpers.FieldToString(trans.Asset.Data));
159 }
160 break;
161 }
162
163 }
164 }
165
166 ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket();
167 confirmXfer.XferID.ID = xferPacket.XferID.ID;
168 confirmXfer.XferID.Packet = xferPacket.XferID.Packet;
169 this.ourClient.OutPacket(confirmXfer);
170 }
171
172 #endregion
173
174 public void CreateInventoryItem(CreateInventoryItemPacket packet)
175 {
176 if(this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
177 {
178 AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
179 trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
180 trans.Asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name);
181 trans.Asset.Type = packet.InventoryBlock.Type;
182 if (trans.UploadComplete)
183 {
184 //already complete so we can add it to the inventory
185 OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset);
186 OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset);
187 }
188 else
189 {
190 trans.AddToInventory = true;
191 trans.InventFolder = packet.InventoryBlock.FolderID;
192 }
193 }
194 }
195
196 }
197
198 public class AssetTransaction
199 {
200 public uint XferID;
201 public AssetBase Asset;
202 public bool AddToInventory;
203 public LLUUID InventFolder = LLUUID.Zero;
204 public bool UploadComplete = false;
205 public LLUUID TransactionID = LLUUID.Zero;
206
207 public AssetTransaction()
208 {
209
210 }
211 }
212}
diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs
index 4149cb2..c1b3472 100644
--- a/OpenSim.RegionServer/Assets/AssetCache.cs
+++ b/OpenSim.RegionServer/Assets/AssetCache.cs
@@ -123,6 +123,36 @@ namespace OpenSim.Assets
123 return inventorySet; 123 return inventorySet;
124 } 124 }
125 125
126 public AssetBase GetAsset(LLUUID assetID)
127 {
128 AssetBase asset = null;
129 if(this.Textures.ContainsKey(assetID))
130 {
131 asset = this.Textures[assetID];
132 }
133 else if (this.Assets.ContainsKey(assetID))
134 {
135 asset = this.Assets[assetID];
136 }
137 return asset;
138 }
139
140 public void AddAsset(AssetBase asset)
141 {
142 this._assetServer.UploadNewAsset(asset);
143 if (asset.Type == 0)
144 {
145 //texture
146 TextureImage textur = new TextureImage(asset);
147 this.Textures.Add(textur.FullID, textur);
148 }
149 else
150 {
151 AssetInfo assetInf = new AssetInfo(asset);
152 this.Assets.Add(assetInf.FullID, assetInf);
153 }
154 }
155
126 /// <summary> 156 /// <summary>
127 /// 157 ///
128 /// </summary> 158 /// </summary>
@@ -150,7 +180,7 @@ namespace OpenSim.Assets
150 req = (AssetRequest)this.TextureRequests[i]; 180 req = (AssetRequest)this.TextureRequests[i];
151 if (req.PacketCounter != req.NumPackets) 181 if (req.PacketCounter != req.NumPackets)
152 { 182 {
153 183 // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005"))
154 if (req.PacketCounter == 0) 184 if (req.PacketCounter == 0)
155 { 185 {
156 //first time for this request so send imagedata packet 186 //first time for this request so send imagedata packet
@@ -186,7 +216,7 @@ namespace OpenSim.Assets
186 } 216 }
187 else 217 else
188 { 218 {
189 //send imagepacket 219 //send imagepacket
190 //more than one packet so split file up 220 //more than one packet so split file up
191 ImagePacketPacket im = new ImagePacketPacket(); 221 ImagePacketPacket im = new ImagePacketPacket();
192 im.ImageID.Packet = (ushort)req.PacketCounter; 222 im.ImageID.Packet = (ushort)req.PacketCounter;
@@ -461,7 +491,6 @@ namespace OpenSim.Assets
461 { 491 {
462 req.NumPackets = 1; 492 req.NumPackets = 1;
463 } 493 }
464
465 this.TextureRequests.Add(req); 494 this.TextureRequests.Add(req);
466 } 495 }
467 496
@@ -477,50 +506,6 @@ namespace OpenSim.Assets
477 } 506 }
478 #endregion 507 #endregion
479 508
480 #region viewer asset uploading
481 public AssetBase UploadPacket(AssetUploadRequestPacket pack, LLUUID assetID)
482 {
483
484 AssetBase asset = null;
485 if (pack.AssetBlock.Type == 0)
486 {
487 if (pack.AssetBlock.AssetData.Length > 0)
488 {
489 //first packet for transaction
490 asset = new AssetBase();
491 asset.FullID = assetID;
492 asset.Type = pack.AssetBlock.Type;
493 asset.InvType = asset.Type;
494 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
495 asset.Data = pack.AssetBlock.AssetData;
496 this._assetServer.UploadNewAsset(asset);
497 TextureImage image = new TextureImage(asset);
498 this.Textures.Add(image.FullID, image);
499 }
500 }
501
502 return asset;
503 }
504
505 /*
506 public AssetBase TransactionComplete(LLUUID transactionID)
507 {
508 AssetBase asset = null;
509 if(this.IncomingAssets.ContainsKey(transactionID))
510 {
511 // not the first packet of this transaction
512 asset = this.IncomingAssets[transactionID];
513 if(asset.Type == 0)
514 {
515 TextureImage image = new TextureImage(asset);
516 this.Textures.Add(image.FullID, image);
517 }
518 }
519 return asset;
520 }*/
521
522 #endregion
523
524 } 509 }
525 510
526 public class AssetRequest 511 public class AssetRequest
diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim.RegionServer/Assets/InventoryCache.cs
index e4d0a90..9e73fe5 100644
--- a/OpenSim.RegionServer/Assets/InventoryCache.cs
+++ b/OpenSim.RegionServer/Assets/InventoryCache.cs
@@ -65,14 +65,20 @@ namespace OpenSim.Assets
65 } 65 }
66 66
67 } 67 }
68
68 public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID) 69 public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID)
69 { 70 {
71 return this.CreateNewInventoryFolder(remoteClient, folderID, 0);
72 }
73
74 public bool CreateNewInventoryFolder(SimClient remoteClient, LLUUID folderID, ushort type)
75 {
70 bool res = false; 76 bool res = false;
71 if (folderID != LLUUID.Zero) //don't create a folder with a zero id 77 if (folderID != LLUUID.Zero) //don't create a folder with a zero id
72 { 78 {
73 if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) 79 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
74 { 80 {
75 res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID); 81 res = this._agentsInventory[remoteClient.AgentID].CreateNewFolder(folderID, type);
76 } 82 }
77 } 83 }
78 return res; 84 return res;
@@ -94,6 +100,22 @@ namespace OpenSim.Assets
94 return newItem; 100 return newItem;
95 } 101 }
96 102
103 public bool UpdateInventoryItem(SimClient remoteClient, LLUUID itemID, OpenSim.Framework.Assets.AssetBase asset)
104 {
105 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
106 {
107 bool res = _agentsInventory[remoteClient.AgentID].UpdateItem(itemID, asset);
108 if (res)
109 {
110 InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
111 this.SendItemUpdateCreate(remoteClient, Item);
112 }
113 return res;
114 }
115
116 return false;
117 }
118
97 public void FetchInventoryDescendents(SimClient userInfo, FetchInventoryDescendentsPacket FetchDescend) 119 public void FetchInventoryDescendents(SimClient userInfo, FetchInventoryDescendentsPacket FetchDescend)
98 { 120 {
99 if (this._agentsInventory.ContainsKey(userInfo.AgentID)) 121 if (this._agentsInventory.ContainsKey(userInfo.AgentID))
@@ -190,6 +212,7 @@ namespace OpenSim.Assets
190 } 212 }
191 } 213 }
192 } 214 }
215
193 private void SendItemUpdateCreate(SimClient remoteClient, InventoryItem Item) 216 private void SendItemUpdateCreate(SimClient remoteClient, InventoryItem Item)
194 { 217 {
195 218
@@ -223,7 +246,7 @@ namespace OpenSim.Assets
223 } 246 }
224 } 247 }
225 248
226 249
227 250
228 public class UserServerRequest 251 public class UserServerRequest
229 { 252 {
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index b191922..cc58347 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{457CE564-0922-4F15-846F-147E5BE62D67}</ProjectGuid> 6 <ProjectGuid>{457CE564-0922-4F15-846F-147E5BE62D67}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.RegionServer</AssemblyName> 13 <AssemblyName>OpenSim.RegionServer</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenSim.RegionServer</RootNamespace> 21 <RootNamespace>OpenSim.RegionServer</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,26 +61,27 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="System" > 68 <Reference Include="System">
62 <HintPath>System.dll</HintPath> 69 <HintPath>System.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="System.Xml" > 72 <Reference Include="System.Xml">
66 <HintPath>System.Xml.dll</HintPath> 73 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private> 74 <Private>False</Private>
68 </Reference> 75 </Reference>
69 <Reference Include="libsecondlife.dll" > 76 <Reference Include="libsecondlife.dll">
70 <HintPath>..\bin\libsecondlife.dll</HintPath> 77 <HintPath>..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private> 78 <Private>False</Private>
72 </Reference> 79 </Reference>
73 <Reference Include="Axiom.MathLib.dll" > 80 <Reference Include="Axiom.MathLib.dll">
74 <HintPath>..\bin\Axiom.MathLib.dll</HintPath> 81 <HintPath>..\bin\Axiom.MathLib.dll</HintPath>
75 <Private>False</Private> 82 <Private>False</Private>
76 </Reference> 83 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" > 84 <Reference Include="Db4objects.Db4o.dll">
78 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath> 85 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private> 86 <Private>False</Private>
80 </Reference> 87 </Reference>
@@ -84,22 +91,23 @@
84 <Name>OpenSim.Framework.Console</Name> 91 <Name>OpenSim.Framework.Console</Name>
85 <Project>{CE124F22-69FC-4499-AE68-1B877C5898C4}</Project> 92 <Project>{CE124F22-69FC-4499-AE68-1B877C5898C4}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 93 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private> 94 <Private>False</Private>
88 </ProjectReference> 95 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> 96 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
90 <Name>OpenSim.Physics.Manager</Name> 97 <Name>OpenSim.Physics.Manager</Name>
91 <Project>{79C8C9A7-EF80-426D-B815-AC88E7998DFE}</Project> 98 <Project>{79C8C9A7-EF80-426D-B815-AC88E7998DFE}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 99 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private> 100 <Private>False</Private>
94 </ProjectReference> 101 </ProjectReference>
95 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> 102 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
96 <Name>OpenSim.Framework</Name> 103 <Name>OpenSim.Framework</Name>
97 <Project>{71848571-2BC0-41DC-A69C-28B6DDB8C8CE}</Project> 104 <Project>{71848571-2BC0-41DC-A69C-28B6DDB8C8CE}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 105 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private> 106 <Private>False</Private>
100 </ProjectReference> 107 </ProjectReference>
101 </ItemGroup> 108 </ItemGroup>
102 <ItemGroup> 109 <ItemGroup>
110 <Compile Include="AgentAssetUpload.cs" />
103 <Compile Include="Grid.cs"> 111 <Compile Include="Grid.cs">
104 <SubType>Code</SubType> 112 <SubType>Code</SubType>
105 </Compile> 113 </Compile>
@@ -177,4 +185,4 @@
177 <PostBuildEvent> 185 <PostBuildEvent>
178 </PostBuildEvent> 186 </PostBuildEvent>
179 </PropertyGroup> 187 </PropertyGroup>
180</Project> 188</Project> \ No newline at end of file
diff --git a/OpenSim.RegionServer/OpenSim.exe.build b/OpenSim.RegionServer/OpenSim.exe.build
index 2b5e012..529f5fb 100644
--- a/OpenSim.RegionServer/OpenSim.exe.build
+++ b/OpenSim.RegionServer/OpenSim.exe.build
@@ -11,6 +11,7 @@
11 <resources prefix="OpenSim" dynamicprefix="true" > 11 <resources prefix="OpenSim" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AgentAssetUpload.cs" />
14 <include name="Grid.cs" /> 15 <include name="Grid.cs" />
15 <include name="OpenSimApplication.cs" /> 16 <include name="OpenSimApplication.cs" />
16 <include name="OpenSimMain.cs" /> 17 <include name="OpenSimMain.cs" />
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index d271ea9..9ae1baf 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -68,6 +68,7 @@ namespace OpenSim
68 private const int MAX_APPENDED_ACKS = 10; 68 private const int MAX_APPENDED_ACKS = 10;
69 private const int RESEND_TIMEOUT = 4000; 69 private const int RESEND_TIMEOUT = 4000;
70 private const int MAX_SEQUENCE = 0xFFFFFF; 70 private const int MAX_SEQUENCE = 0xFFFFFF;
71 private AgentAssetUpload UploadAssets;
71 private LLUUID newAssetFolder = LLUUID.Zero; 72 private LLUUID newAssetFolder = LLUUID.Zero;
72 private bool debug = false; 73 private bool debug = false;
73 74
@@ -278,28 +279,37 @@ namespace OpenSim
278 279
279 break; 280 break;
280 case PacketType.AssetUploadRequest: 281 case PacketType.AssetUploadRequest:
282 //this.debug = true;
281 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; 283 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
282 AssetBase newAsset = OpenSimRoot.Instance.AssetCache.UploadPacket(request, LLUUID.Random()); 284 Console.WriteLine(Pack.ToString());
283 if ((newAsset != null) && (this.newAssetFolder != LLUUID.Zero)) 285 if (request.AssetBlock.Type == 0)
284 { 286 {
285 OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this, this.newAssetFolder, newAsset); 287 this.UploadAssets.HandleUploadPacket(request, LLUUID.Random());
288 }
289 else
290 {
291 this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
286 } 292 }
287 293 break;
288 AssetUploadCompletePacket response = new AssetUploadCompletePacket(); 294 case PacketType.SendXferPacket:
289 response.AssetBlock.Type =request.AssetBlock.Type; 295 Console.WriteLine(Pack.ToString());
290 response.AssetBlock.Success = true; 296 this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack);
291 response.AssetBlock.UUID = request.AssetBlock.TransactionID.Combine(this.SecureSessionID);
292
293 this.OutPacket(response);
294 break; 297 break;
295 case PacketType.CreateInventoryFolder: 298 case PacketType.CreateInventoryFolder:
296 //Console.WriteLine(Pack.ToString()); 299 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
300 OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type);
301 Console.WriteLine(Pack.ToString());
297 break; 302 break;
298 case PacketType.CreateInventoryItem: 303 case PacketType.CreateInventoryItem:
299 //Console.WriteLine(Pack.ToString()); 304 Console.WriteLine(Pack.ToString());
305 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
306 if (createItem.InventoryBlock.TransactionID != LLUUID.Zero)
307 {
308 this.UploadAssets.CreateInventoryItem(createItem);
309 }
300 break; 310 break;
301 case PacketType.FetchInventory: 311 case PacketType.FetchInventory:
302 Console.WriteLine("fetch item packet"); 312 //Console.WriteLine("fetch item packet");
303 FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; 313 FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack;
304 OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory); 314 OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory);
305 break; 315 break;
@@ -307,6 +317,29 @@ namespace OpenSim
307 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; 317 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
308 OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch); 318 OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch);
309 break; 319 break;
320 case PacketType.UpdateInventoryItem:
321 /* UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack;
322 for (int i = 0; i < update.InventoryData.Length; i++)
323 {
324 if (update.InventoryData[i].TransactionID != LLUUID.Zero)
325 {
326 AssetBase asset = OpenSimRoot.Instance.AssetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
327 OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
328 }
329 }*/
330 break;
331 case PacketType.ViewerEffect:
332 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
333 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
334 {
335 if (client.AgentID != this.AgentID)
336 {
337 viewer.AgentData.AgentID = client.AgentID;
338 viewer.AgentData.SessionID = client.SessionID;
339 client.OutPacket(viewer);
340 }
341 }
342 break;
310 case PacketType.DeRezObject: 343 case PacketType.DeRezObject:
311 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); 344 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet");
312 OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this); 345 OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this);
@@ -522,6 +555,8 @@ namespace OpenSim
522 cirpack = initialcirpack; 555 cirpack = initialcirpack;
523 userEP = remoteEP; 556 userEP = remoteEP;
524 PacketQueue = new BlockingQueue<QueItem>(); 557 PacketQueue = new BlockingQueue<QueItem>();
558
559 this.UploadAssets = new AgentAssetUpload(this);
525 AckTimer = new System.Timers.Timer(500); 560 AckTimer = new System.Timers.Timer(500);
526 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); 561 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
527 AckTimer.Start(); 562 AckTimer.Start();
diff --git a/OpenSim.sln b/OpenSim.sln
index bd0abb1..88366cc 100644
--- a/OpenSim.sln
+++ b/OpenSim.sln
@@ -1,10 +1,10 @@
1Microsoft Visual Studio Solution File, Format Version 9.00 1Microsoft Visual Studio Solution File, Format Version 9.00
2# Visual Studio 2005 2# Visual C# Express 2005
3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim.Physics\PhysXPlugin\OpenSim.Physics.PhysXPlugin.csproj", "{62652FE9-20CC-4855-9D1C-6C1CCD706CC1}" 3Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim.Physics\PhysXPlugin\OpenSim.Physics.PhysXPlugin.csproj", "{62652FE9-20CC-4855-9D1C-6C1CCD706CC1}"
4EndProject 4EndProject
5Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{CE124F22-69FC-4499-AE68-1B877C5898C4}" 5Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{CE124F22-69FC-4499-AE68-1B877C5898C4}"
6EndProject 6EndProject
7Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Config.SimConfigDb4o", "OpenSim.Config\SimConfigDb4o\OpenSim.Config.SimConfigDb4o.csproj", "{C77FAE85-A786-4DEB-9AEB-46B75169079C}" 7Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Config.SimConfigDb4o", "OpenSim.Framework.Config\SimConfigDb4o\OpenSim.Config.SimConfigDb4o.csproj", "{C77FAE85-A786-4DEB-9AEB-46B75169079C}"
8EndProject 8EndProject
9Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.BasicPhysicsPlugin", "OpenSim.Physics\BasicPhysicsPlugin\OpenSim.Physics.BasicPhysicsPlugin.csproj", "{0A4D5E28-88B6-474E-AC5F-3F99822DD976}" 9Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.BasicPhysicsPlugin", "OpenSim.Physics\BasicPhysicsPlugin\OpenSim.Physics.BasicPhysicsPlugin.csproj", "{0A4D5E28-88B6-474E-AC5F-3F99822DD976}"
10EndProject 10EndProject
@@ -23,77 +23,57 @@ EndProject
23Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim.csproj", "{778D384D-088A-42DF-A683-2244BD9530DE}" 23Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim.csproj", "{778D384D-088A-42DF-A683-2244BD9530DE}"
24EndProject 24EndProject
25Global 25Global
26 GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 GlobalSection(SolutionConfigurationPlatforms) = preSolution
27 Debug|Any CPU = Debug|Any CPU 27 Debug|Any CPU = Debug|Any CPU
28 Release|Any CPU = Release|Any CPU 28 Release|Any CPU = Release|Any CPU
29 EndGlobalSection 29 EndGlobalSection
30 GlobalSection(ProjectDependencies) = postSolution 30 GlobalSection(ProjectConfigurationPlatforms) = postSolution
31 ({62652FE9-20CC-4855-9D1C-6C1CCD706CC1}).3 = ({79C8C9A7-EF80-426D-B815-AC88E7998DFE}) 31 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 ({C77FAE85-A786-4DEB-9AEB-46B75169079C}).5 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 32 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 ({C77FAE85-A786-4DEB-9AEB-46B75169079C}).6 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 33 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 ({0A4D5E28-88B6-474E-AC5F-3F99822DD976}).2 = ({79C8C9A7-EF80-426D-B815-AC88E7998DFE}) 34 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Release|Any CPU.Build.0 = Release|Any CPU
35 ({E0C662BD-1B64-4782-B8F2-9511255DB971}).3 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 35 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36 ({E0C662BD-1B64-4782-B8F2-9511255DB971}).4 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 36 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
37 ({455B4201-F942-48A1-ADE3-E38641ABB4D2}).4 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 37 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
38 ({455B4201-F942-48A1-ADE3-E38641ABB4D2}).5 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 38 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Release|Any CPU.Build.0 = Release|Any CPU
39 ({457CE564-0922-4F15-846F-147E5BE62D67}).5 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 39 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40 ({457CE564-0922-4F15-846F-147E5BE62D67}).6 = ({79C8C9A7-EF80-426D-B815-AC88E7998DFE}) 40 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Debug|Any CPU.Build.0 = Debug|Any CPU
41 ({457CE564-0922-4F15-846F-147E5BE62D67}).7 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 41 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Release|Any CPU.ActiveCfg = Release|Any CPU
42 ({79C8C9A7-EF80-426D-B815-AC88E7998DFE}).3 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 42 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Release|Any CPU.Build.0 = Release|Any CPU
43 ({5A852B3E-E770-4B00-A34B-1F8B4ABDA570}).4 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 43 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44 ({5A852B3E-E770-4B00-A34B-1F8B4ABDA570}).5 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 44 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Debug|Any CPU.Build.0 = Debug|Any CPU
45 ({778D384D-088A-42DF-A683-2244BD9530DE}).5 = ({71848571-2BC0-41DC-A69C-28B6DDB8C8CE}) 45 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Release|Any CPU.ActiveCfg = Release|Any CPU
46 ({778D384D-088A-42DF-A683-2244BD9530DE}).6 = ({CE124F22-69FC-4499-AE68-1B877C5898C4}) 46 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Release|Any CPU.Build.0 = Release|Any CPU
47 ({778D384D-088A-42DF-A683-2244BD9530DE}).7 = ({79C8C9A7-EF80-426D-B815-AC88E7998DFE}) 47 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48 ({778D384D-088A-42DF-A683-2244BD9530DE}).8 = ({457CE564-0922-4F15-846F-147E5BE62D67}) 48 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Debug|Any CPU.Build.0 = Debug|Any CPU
49 EndGlobalSection 49 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Release|Any CPU.ActiveCfg = Release|Any CPU
50 GlobalSection(ProjectConfigurationPlatforms) = postSolution 50 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Release|Any CPU.Build.0 = Release|Any CPU
51 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
53 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
54 {62652FE9-20CC-4855-9D1C-6C1CCD706CC1}.Release|Any CPU.Build.0 = Release|Any CPU 54 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Release|Any CPU.Build.0 = Release|Any CPU
55 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
57 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
58 {CE124F22-69FC-4499-AE68-1B877C5898C4}.Release|Any CPU.Build.0 = Release|Any CPU 58 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Release|Any CPU.Build.0 = Release|Any CPU
59 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 {457CE564-0922-4F15-846F-147E5BE62D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 {457CE564-0922-4F15-846F-147E5BE62D67}.Debug|Any CPU.Build.0 = Debug|Any CPU
61 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 {457CE564-0922-4F15-846F-147E5BE62D67}.Release|Any CPU.ActiveCfg = Release|Any CPU
62 {C77FAE85-A786-4DEB-9AEB-46B75169079C}.Release|Any CPU.Build.0 = Release|Any CPU 62 {457CE564-0922-4F15-846F-147E5BE62D67}.Release|Any CPU.Build.0 = Release|Any CPU
63 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
65 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
66 {0A4D5E28-88B6-474E-AC5F-3F99822DD976}.Release|Any CPU.Build.0 = Release|Any CPU 66 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Release|Any CPU.Build.0 = Release|Any CPU
67 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 67 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Debug|Any CPU.Build.0 = Debug|Any CPU 68 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Debug|Any CPU.Build.0 = Debug|Any CPU
69 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Release|Any CPU.ActiveCfg = Release|Any CPU 69 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Release|Any CPU.ActiveCfg = Release|Any CPU
70 {E0C662BD-1B64-4782-B8F2-9511255DB971}.Release|Any CPU.Build.0 = Release|Any CPU 70 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Release|Any CPU.Build.0 = Release|Any CPU
71 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 71 {778D384D-088A-42DF-A683-2244BD9530DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Debug|Any CPU.Build.0 = Debug|Any CPU 72 {778D384D-088A-42DF-A683-2244BD9530DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
73 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Release|Any CPU.ActiveCfg = Release|Any CPU 73 {778D384D-088A-42DF-A683-2244BD9530DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
74 {455B4201-F942-48A1-ADE3-E38641ABB4D2}.Release|Any CPU.Build.0 = Release|Any CPU 74 {778D384D-088A-42DF-A683-2244BD9530DE}.Release|Any CPU.Build.0 = Release|Any CPU
75 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 75 EndGlobalSection
76 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU 76 GlobalSection(SolutionProperties) = preSolution
77 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU 77 HideSolutionNode = FALSE
78 {71848571-2BC0-41DC-A69C-28B6DDB8C8CE}.Release|Any CPU.Build.0 = Release|Any CPU 78 EndGlobalSection
79 {457CE564-0922-4F15-846F-147E5BE62D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
80 {457CE564-0922-4F15-846F-147E5BE62D67}.Debug|Any CPU.Build.0 = Debug|Any CPU
81 {457CE564-0922-4F15-846F-147E5BE62D67}.Release|Any CPU.ActiveCfg = Release|Any CPU
82 {457CE564-0922-4F15-846F-147E5BE62D67}.Release|Any CPU.Build.0 = Release|Any CPU
83 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
85 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
86 {79C8C9A7-EF80-426D-B815-AC88E7998DFE}.Release|Any CPU.Build.0 = Release|Any CPU
87 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
88 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Debug|Any CPU.Build.0 = Debug|Any CPU
89 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Release|Any CPU.ActiveCfg = Release|Any CPU
90 {5A852B3E-E770-4B00-A34B-1F8B4ABDA570}.Release|Any CPU.Build.0 = Release|Any CPU
91 {778D384D-088A-42DF-A683-2244BD9530DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
92 {778D384D-088A-42DF-A683-2244BD9530DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
93 {778D384D-088A-42DF-A683-2244BD9530DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
94 {778D384D-088A-42DF-A683-2244BD9530DE}.Release|Any CPU.Build.0 = Release|Any CPU
95 EndGlobalSection
96 GlobalSection(SolutionProperties) = preSolution
97 HideSolutionNode = FALSE
98 EndGlobalSection
99EndGlobal 79EndGlobal