aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.Region/Caps.cs116
-rw-r--r--OpenSim/OpenSim.Region/OpenSim.Region.csproj55
-rw-r--r--OpenSim/OpenSim.Region/RegionManager.cs30
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Primitive.cs4
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Scene.cs8
-rw-r--r--OpenSim/OpenSim.Region/Scenes/ScenePresence.cs27
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs10
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs94
8 files changed, 294 insertions, 50 deletions
diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs
index c86061f..5be481e 100644
--- a/OpenSim/OpenSim.Region/Caps.cs
+++ b/OpenSim/OpenSim.Region/Caps.cs
@@ -1,23 +1,34 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.IO;
4using OpenSim.Servers; 5using OpenSim.Servers;
6using OpenSim.Framework.Utilities;
7using OpenSim.Framework.Types;
8using OpenSim.Caches;
5using libsecondlife; 9using libsecondlife;
6 10
7namespace OpenSim.Region 11namespace OpenSim.Region
8{ 12{
13 public delegate void UpLoadedTexture(LLUUID assetID, LLUUID inventoryItem, byte[] data);
14
9 public class Caps 15 public class Caps
10 { 16 {
17
11 private string httpListenerAddress; 18 private string httpListenerAddress;
12 private uint httpListenPort; 19 private uint httpListenPort;
13 private string capsObjectPath = "00001-"; 20 private string capsObjectPath = "00001-";
14 private string requestPath = "0000/"; 21 private string requestPath = "0000/";
15 private string mapLayerPath = "0001/"; 22 private string mapLayerPath = "0001/";
23 private string newInventory = "0002/";
24 private string requestTexture = "0003/";
16 private BaseHttpServer httpListener; 25 private BaseHttpServer httpListener;
17 private LLUUID agentID; 26 private LLUUID agentID;
27 private AssetCache assetCache;
18 28
19 public Caps(BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) 29 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent)
20 { 30 {
31 assetCache = assetCach;
21 capsObjectPath = capsPath; 32 capsObjectPath = capsPath;
22 httpListener = httpServer; 33 httpListener = httpServer;
23 httpListenerAddress = httpListen; 34 httpListenerAddress = httpListen;
@@ -31,8 +42,9 @@ namespace OpenSim.Region
31 public void RegisterHandlers() 42 public void RegisterHandlers()
32 { 43 {
33 Console.WriteLine("registering CAPS handlers"); 44 Console.WriteLine("registering CAPS handlers");
34 httpListener.AddRestHandler("POST", "/CAPS/" +capsObjectPath+ requestPath, CapsRequest); 45 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + requestPath, CapsRequest);
35 httpListener.AddRestHandler("POST", "/CAPS/" +capsObjectPath+ mapLayerPath, MapLayer); 46 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + mapLayerPath, MapLayer);
47 httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + newInventory, NewAgentInventory);
36 } 48 }
37 49
38 /// <summary> 50 /// <summary>
@@ -44,7 +56,7 @@ namespace OpenSim.Region
44 /// <returns></returns> 56 /// <returns></returns>
45 public string CapsRequest(string request, string path, string param) 57 public string CapsRequest(string request, string path, string param)
46 { 58 {
47 //Console.WriteLine("Caps Request " + request); 59 Console.WriteLine("Caps Request " + request);
48 string result = "<llsd><map>"; 60 string result = "<llsd><map>";
49 result += this.GetCapabilities(); 61 result += this.GetCapabilities();
50 result += "</map></llsd>"; 62 result += "</map></llsd>";
@@ -57,10 +69,11 @@ namespace OpenSim.Region
57 /// <returns></returns> 69 /// <returns></returns>
58 protected string GetCapabilities() 70 protected string GetCapabilities()
59 { 71 {
60 string capURLS=""; 72 string capURLS = "";
61 73
62 capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" +capsObjectPath+ mapLayerPath + "</string>"; 74 capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>";
63 75 capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>";
76 //capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>";
64 return capURLS; 77 return capURLS;
65 } 78 }
66 79
@@ -93,15 +106,94 @@ namespace OpenSim.Region
93 int bottom; 106 int bottom;
94 LLUUID image = null; 107 LLUUID image = null;
95 108
96 left = 500; 109 left = 0;
97 bottom = 500; 110 bottom = 0;
98 top = 1500; 111 top = 5000;
99 right = 1500; 112 right = 5000;
100 image = new LLUUID("00000000-0000-0000-9999-000000000006"); 113 image = new LLUUID("00000000-0000-0000-9999-000000000006");
101 114
102 res += "<map><key>Left</key><integer>" + left + "</integer><key>Bottom</key><integer>" + bottom + "</integer><key>Top</key><integer>" + top + "</integer><key>Right</key><integer>" + right + "</integer><key>ImageID</key><uuid>" + image.ToStringHyphenated() + "</uuid></map>"; 115 res += "<map><key>Left</key><integer>" + left + "</integer><key>Bottom</key><integer>" + bottom + "</integer><key>Top</key><integer>" + top + "</integer><key>Right</key><integer>" + right + "</integer><key>ImageID</key><uuid>" + image.ToStringHyphenated() + "</uuid></map>";
103 116
117 return res;
118 }
119
120 public string NewAgentInventory(string request, string path, string param)
121 {
122
123 //Console.WriteLine("received upload request:"+ request);
124 string res = "";
125 LLUUID newAsset = LLUUID.Random();
126 string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 7000).ToString("0000");
127 AssetUploader uploader = new AssetUploader(newAsset, uploaderPath, this.httpListener);
128 httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps);
129 string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath;
130 Console.WriteLine("uploader url is " + uploaderURL);
131 res += "<llsd><map>";
132 res += "<key>uploader</key><string>"+uploaderURL +"</string>";
133 //res += "<key>success</key><boolean>true</boolean>";
134 res += "<key>state</key><string>upload</string>";
135 res += "</map></llsd>";
136 uploader.OnUpLoad += this.UploadHandler;
104 return res; 137 return res;
105 } 138 }
139
140 public void UploadHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data)
141 {
142 // Console.WriteLine("upload handler called");
143 AssetBase asset;
144 asset = new AssetBase();
145 asset.FullID = assetID;
146 asset.Type = 0;
147 asset.InvType = 0;
148 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
149 asset.Data = data;
150 this.assetCache.AddAsset(asset);
151
152 }
153
154 public class AssetUploader
155 {
156 public event UpLoadedTexture OnUpLoad;
157
158 private string uploaderPath = "";
159 private LLUUID newAssetID;
160 //private LLUUID inventoryItemID;
161 private BaseHttpServer httpListener;
162 public AssetUploader(LLUUID assetID, string path,BaseHttpServer httpServer)
163 {
164 newAssetID = assetID;
165 uploaderPath = path;
166 httpListener = httpServer;
167
168 }
169
170 public string uploaderCaps(string request, string path, string param)
171 {
172 Encoding _enc = System.Text.Encoding.UTF8;
173 byte[] data = _enc.GetBytes(request);
174 //Console.WriteLine("recieved upload " + Util.FieldToString(data));
175 LLUUID inv = LLUUID.Random();
176 string res = "";
177 res += "<llsd><map>";
178 res += "<key>new_asset</key><string>" + newAssetID.ToStringHyphenated() + "</string>";
179 res += "<key>new_inventory_item</key><uuid>" + inv.ToStringHyphenated() + "</uuid>";
180 res += "<key>state</key><string>complete</string>";
181 res += "</map></llsd>";
182
183 Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated());
184 httpListener.RemoveRestHandler("POST", "/CAPS/"+uploaderPath);
185 if (OnUpLoad != null)
186 {
187 OnUpLoad(newAssetID, inv, data);
188 }
189
190 /*FileStream fs = File.Create("upload.jp2");
191 BinaryWriter bw = new BinaryWriter(fs);
192 bw.Write(data);
193 bw.Close();
194 fs.Close();*/
195 return res;
196 }
197 }
106 } 198 }
107} 199}
diff --git a/OpenSim/OpenSim.Region/OpenSim.Region.csproj b/OpenSim/OpenSim.Region/OpenSim.Region.csproj
index d18bf3f..fd583a9 100644
--- a/OpenSim/OpenSim.Region/OpenSim.Region.csproj
+++ b/OpenSim/OpenSim.Region/OpenSim.Region.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>{196916AF-0000-0000-0000-000000000000}</ProjectGuid> 6 <ProjectGuid>{196916AF-0000-0000-0000-000000000000}</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.Region</AssemblyName> 13 <AssemblyName>OpenSim.Region</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.Region</RootNamespace> 21 <RootNamespace>OpenSim.Region</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,28 @@
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="Axiom.MathLib.dll" > 68 <Reference Include="Axiom.MathLib.dll">
62 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath> 69 <HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="Db4objects.Db4o.dll" > 72 <Reference Include="Db4objects.Db4o.dll">
66 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath> 73 <HintPath>..\..\bin\Db4objects.Db4o.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="System" > 80 <Reference Include="System">
74 <HintPath>System.dll</HintPath> 81 <HintPath>System.dll</HintPath>
75 <Private>False</Private> 82 <Private>False</Private>
76 </Reference> 83 </Reference>
77 <Reference Include="System.Xml" > 84 <Reference Include="System.Data" />
85 <Reference Include="System.Xml">
78 <HintPath>System.Xml.dll</HintPath> 86 <HintPath>System.Xml.dll</HintPath>
79 <Private>False</Private> 87 <Private>False</Private>
80 </Reference> 88 </Reference>
@@ -84,55 +92,55 @@
84 <Name>OpenGrid.Framework.Communications</Name> 92 <Name>OpenGrid.Framework.Communications</Name>
85 <Project>{683344D5-0000-0000-0000-000000000000}</Project> 93 <Project>{683344D5-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 94 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private> 95 <Private>False</Private>
88 </ProjectReference> 96 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Caches\OpenSim.Caches.csproj"> 97 <ProjectReference Include="..\OpenSim.Caches\OpenSim.Caches.csproj">
90 <Name>OpenSim.Caches</Name> 98 <Name>OpenSim.Caches</Name>
91 <Project>{1938EB12-0000-0000-0000-000000000000}</Project> 99 <Project>{1938EB12-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 100 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private> 101 <Private>False</Private>
94 </ProjectReference> 102 </ProjectReference>
95 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> 103 <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
96 <Name>OpenSim.Framework</Name> 104 <Name>OpenSim.Framework</Name>
97 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> 105 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private> 107 <Private>False</Private>
100 </ProjectReference> 108 </ProjectReference>
101 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> 109 <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
102 <Name>OpenSim.Framework.Console</Name> 110 <Name>OpenSim.Framework.Console</Name>
103 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> 111 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private> 113 <Private>False</Private>
106 </ProjectReference> 114 </ProjectReference>
107 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> 115 <ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
108 <Name>OpenSim.GenericConfig.Xml</Name> 116 <Name>OpenSim.GenericConfig.Xml</Name>
109 <Project>{E88EF749-0000-0000-0000-000000000000}</Project> 117 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 118 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private> 119 <Private>False</Private>
112 </ProjectReference> 120 </ProjectReference>
113 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> 121 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
114 <Name>OpenSim.Physics.Manager</Name> 122 <Name>OpenSim.Physics.Manager</Name>
115 <Project>{8BE16150-0000-0000-0000-000000000000}</Project> 123 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 124 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private> 125 <Private>False</Private>
118 </ProjectReference> 126 </ProjectReference>
119 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj"> 127 <ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
120 <Name>OpenSim.Servers</Name> 128 <Name>OpenSim.Servers</Name>
121 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> 129 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
122 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 130 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
123 <Private>False</Private> 131 <Private>False</Private>
124 </ProjectReference> 132 </ProjectReference>
125 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj"> 133 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj">
126 <Name>OpenSim.Terrain.BasicTerrain</Name> 134 <Name>OpenSim.Terrain.BasicTerrain</Name>
127 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project> 135 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
128 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 136 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
129 <Private>False</Private> 137 <Private>False</Private>
130 </ProjectReference> 138 </ProjectReference>
131 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj"> 139 <ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
132 <Name>XMLRPC</Name> 140 <Name>XMLRPC</Name>
133 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> 141 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
134 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 142 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
135 <Private>False</Private> 143 <Private>False</Private>
136 </ProjectReference> 144 </ProjectReference>
137 </ItemGroup> 145 </ItemGroup>
138 <ItemGroup> 146 <ItemGroup>
@@ -145,6 +153,7 @@
145 <Compile Include="ParcelManager.cs"> 153 <Compile Include="ParcelManager.cs">
146 <SubType>Code</SubType> 154 <SubType>Code</SubType>
147 </Compile> 155 </Compile>
156 <Compile Include="RegionManager.cs" />
148 <Compile Include="Scenes\Entity.cs"> 157 <Compile Include="Scenes\Entity.cs">
149 <SubType>Code</SubType> 158 <SubType>Code</SubType>
150 </Compile> 159 </Compile>
@@ -204,4 +213,4 @@
204 <PostBuildEvent> 213 <PostBuildEvent>
205 </PostBuildEvent> 214 </PostBuildEvent>
206 </PropertyGroup> 215 </PropertyGroup>
207</Project> 216</Project> \ No newline at end of file
diff --git a/OpenSim/OpenSim.Region/RegionManager.cs b/OpenSim/OpenSim.Region/RegionManager.cs
new file mode 100644
index 0000000..a317f0f
--- /dev/null
+++ b/OpenSim/OpenSim.Region/RegionManager.cs
@@ -0,0 +1,30 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Communications;
5using OpenSim.Framework;
6using OpenSim.Framework.Types;
7using OpenSim.Servers;
8
9namespace OpenSim.Region
10{
11 public class RegionManager //needs renaming , but first we need to rename the namespace
12 {
13 protected AuthenticateSessionsBase authenticateHandler;
14 protected RegionCommsListener regionCommsHost;
15 protected CommunicationsManager commsManager;
16 protected List<Caps> capsHandlers = new List<Caps>();
17 protected BaseHttpServer httpListener;
18
19 protected Scenes.Scene m_Scene;
20
21 public ParcelManager parcelManager;
22 public EstateManager estateManager;
23
24 public RegionManager()
25 {
26
27 }
28
29 }
30}
diff --git a/OpenSim/OpenSim.Region/Scenes/Primitive.cs b/OpenSim/OpenSim.Region/Scenes/Primitive.cs
index 8192bf0..62f401c 100644
--- a/OpenSim/OpenSim.Region/Scenes/Primitive.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Primitive.cs
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Scenes
273 /// <param name="tex"></param> 273 /// <param name="tex"></param>
274 public void UpdateTexture(byte[] tex) 274 public void UpdateTexture(byte[] tex)
275 { 275 {
276 this.primData.Texture = tex; 276 this.primData.TextureEntry = tex;
277 } 277 }
278 278
279 /// <summary> 279 /// <summary>
@@ -411,7 +411,7 @@ namespace OpenSim.Region.Scenes
411 lPos = this.Pos; 411 lPos = this.Pos;
412 } 412 }
413 413
414 remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-1000-5005-000000000018")); 414 remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-0000-9999-000000000005"));
415 } 415 }
416 416
417 /// <summary> 417 /// <summary>
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs
index 07f1d70..07b1ee4 100644
--- a/OpenSim/OpenSim.Region/Scenes/Scene.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs
@@ -730,7 +730,7 @@ namespace OpenSim.Region.Scenes
730 if (agent.CapsPath != "") 730 if (agent.CapsPath != "")
731 { 731 {
732 //Console.WriteLine("new user, so creating caps handler for it"); 732 //Console.WriteLine("new user, so creating caps handler for it");
733 Caps cap = new Caps(httpListener, this.m_regInfo.IPListenAddr, 9000, agent.CapsPath, agent.AgentID); 733 Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.IPListenAddr, 9000, agent.CapsPath, agent.AgentID);
734 cap.RegisterHandlers(); 734 cap.RegisterHandlers();
735 this.capsHandlers.Add(cap); 735 this.capsHandlers.Add(cap);
736 } 736 }
@@ -795,7 +795,7 @@ namespace OpenSim.Region.Scenes
795 { 795 {
796 List<MapBlockData> mapBlocks; 796 List<MapBlockData> mapBlocks;
797 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); 797 mapBlocks = this.commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
798 798 Console.WriteLine("number of mapblocks " + mapBlocks.Count +" in "+ minX +" , " + minY + " , "+ maxX + " , "+ maxY);
799 remoteClient.SendMapBlock(mapBlocks); 799 remoteClient.SendMapBlock(mapBlocks);
800 } 800 }
801 801
@@ -843,9 +843,9 @@ namespace OpenSim.Region.Scenes
843 /// <param name="regionhandle"></param> 843 /// <param name="regionhandle"></param>
844 /// <param name="agentID"></param> 844 /// <param name="agentID"></param>
845 /// <param name="position"></param> 845 /// <param name="position"></param>
846 public void InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position) 846 public bool InformNeighbourOfCrossing(ulong regionhandle, LLUUID agentID, LLVector3 position)
847 { 847 {
848 this.commsManager.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position); 848 return this.commsManager.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position);
849 } 849 }
850 850
851 #endregion 851 #endregion
diff --git a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
index 1255606..fe82130 100644
--- a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
+++ b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs
@@ -43,6 +43,7 @@ namespace OpenSim.Region.Scenes
43 { 43 {
44 public static bool PhysicsEngineFlying = false; 44 public static bool PhysicsEngineFlying = false;
45 public static AvatarAnimations Animations; 45 public static AvatarAnimations Animations;
46 public static byte[] DefaultTexture;
46 public string firstname; 47 public string firstname;
47 public string lastname; 48 public string lastname;
48 public IClientAPI ControllingClient; 49 public IClientAPI ControllingClient;
@@ -324,7 +325,7 @@ namespace OpenSim.Region.Scenes
324 /// <param name="remoteAvatar"></param> 325 /// <param name="remoteAvatar"></param>
325 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) 326 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
326 { 327 {
327 remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos); 328 remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos, DefaultTexture);
328 } 329 }
329 330
330 /// <summary> 331 /// <summary>
@@ -332,7 +333,7 @@ namespace OpenSim.Region.Scenes
332 /// </summary> 333 /// </summary>
333 public void SendInitialData() 334 public void SendInitialData()
334 { 335 {
335 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos); 336 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos, DefaultTexture);
336 if (this.newAvatar) 337 if (this.newAvatar)
337 { 338 {
338 this.m_world.InformClientOfNeighbours(this.ControllingClient); 339 this.m_world.InformClientOfNeighbours(this.ControllingClient);
@@ -439,10 +440,12 @@ namespace OpenSim.Region.Scenes
439 RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle); 440 RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle);
440 if (neighbourRegion != null) 441 if (neighbourRegion != null)
441 { 442 {
442 this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos); 443 bool res = this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos);
443 this.MakeChildAgent(); 444 if (res)
444 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort); 445 {
445 446 this.MakeChildAgent();
447 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort);
448 }
446 } 449 }
447 } 450 }
448 #endregion 451 #endregion
@@ -481,6 +484,18 @@ namespace OpenSim.Region.Scenes
481 } 484 }
482 } 485 }
483 486
487 public static void LoadTextureFile(string name)
488 {
489 FileInfo fInfo = new FileInfo(name);
490 long numBytes = fInfo.Length;
491 FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
492 BinaryReader br = new BinaryReader(fStream);
493 byte[] data1 = br.ReadBytes((int)numBytes);
494 br.Close();
495 fStream.Close();
496 DefaultTexture = data1;
497 }
498
484 public class NewForce 499 public class NewForce
485 { 500 {
486 public float X; 501 public float X;
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 1a03216..ca473e3 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -491,7 +491,7 @@ namespace OpenSim
491 /// <param name="avatarID"></param> 491 /// <param name="avatarID"></param>
492 /// <param name="avatarLocalID"></param> 492 /// <param name="avatarLocalID"></param>
493 /// <param name="Pos"></param> 493 /// <param name="Pos"></param>
494 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos) 494 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry)
495 { 495 {
496 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 496 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
497 //send a objectupdate packet with information about the clients avatar 497 //send a objectupdate packet with information about the clients avatar
@@ -500,7 +500,7 @@ namespace OpenSim
500 objupdate.RegionData.RegionHandle = regionHandle; 500 objupdate.RegionData.RegionHandle = regionHandle;
501 objupdate.RegionData.TimeDilation = 64096; 501 objupdate.RegionData.TimeDilation = 64096;
502 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 502 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
503 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(); 503 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry);
504 //give this avatar object a local id and assign the user a name 504 //give this avatar object a local id and assign the user a name
505 505
506 objupdate.ObjectData[0].ID = avatarLocalID; 506 objupdate.ObjectData[0].ID = avatarLocalID;
@@ -859,7 +859,7 @@ namespace OpenSim
859 /// 859 ///
860 /// </summary> 860 /// </summary>
861 /// <returns></returns> 861 /// <returns></returns>
862 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() 862 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
863 { 863 {
864 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); 864 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
865 865
@@ -873,6 +873,10 @@ namespace OpenSim
873 objdata.OwnerID = LLUUID.Zero; 873 objdata.OwnerID = LLUUID.Zero;
874 objdata.Scale = new LLVector3(1, 1, 1); 874 objdata.Scale = new LLVector3(1, 1, 1);
875 objdata.PCode = 47; 875 objdata.PCode = 47;
876 if (textureEntry != null)
877 {
878 objdata.TextureEntry = textureEntry;
879 }
876 System.Text.Encoding enc = System.Text.Encoding.ASCII; 880 System.Text.Encoding enc = System.Text.Encoding.ASCII;
877 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 881 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
878 pos.X = 100f; 882 pos.X = 100f;
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
index 31749d8..1b01f24 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.AgentAssetUpload.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Text; 30using System.Text;
31using OpenSim.Assets; 31using OpenSim.Assets;
32using OpenSim.Framework.Types; 32using OpenSim.Framework.Types;
33using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Utilities; 34using OpenSim.Framework.Utilities;
34using OpenSim.Caches; 35using OpenSim.Caches;
35using libsecondlife; 36using libsecondlife;
@@ -258,6 +259,99 @@ namespace OpenSim
258 259
259 } 260 }
260 } 261 }
262
263 //new class , not currently used.
264 public class AssetXferUploader
265 {
266 private IClientAPI ourClient;
267
268 public bool UploadComplete = false;
269
270 public bool AddToInventory;
271 public LLUUID InventFolder = LLUUID.Zero;
272
273 public uint XferID;
274 public AssetBase Asset;
275 public LLUUID TransactionID = LLUUID.Zero;
276
277
278 public AssetXferUploader(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data)
279 {
280 ourClient = remoteClient;
281 Asset = new AssetBase();
282 Asset.FullID = assetID;
283 Asset.InvType = type;
284 Asset.Type = type;
285 Asset.Data = data;
286 Asset.Name = "blank";
287 Asset.Description = "empty";
288 TransactionID = transaction;
289
290 if (Asset.Data.Length > 2)
291 {
292 this.SendCompleteMessage();
293 }
294 else
295 {
296 this.ReqestStartXfer();
297 }
298 }
299
300 protected void SendCompleteMessage()
301 {
302 UploadComplete = true;
303 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
304 response.AssetBlock.Type = Asset.Type;
305 response.AssetBlock.Success = true;
306 response.AssetBlock.UUID = Asset.FullID;
307 this.ourClient.OutPacket(response);
308
309 //TODO trigger event
310 }
311
312 protected void ReqestStartXfer()
313 {
314 UploadComplete = false;
315 XferID = Util.GetNextXferID();
316 RequestXferPacket xfer = new RequestXferPacket();
317 xfer.XferID.ID = XferID;
318 xfer.XferID.VFileType = Asset.Type;
319 xfer.XferID.VFileID = Asset.FullID;
320 xfer.XferID.FilePath = 0;
321 xfer.XferID.Filename = new byte[0];
322 this.ourClient.OutPacket(xfer);
323 }
324
325 public void HandleXferPacket(uint xferID, uint packetID, byte[] data)
326 {
327 if (XferID == xferID)
328 {
329 if (Asset.Data.Length > 1)
330 {
331 byte[] newArray = new byte[Asset.Data.Length + data.Length];
332 Array.Copy(Asset.Data, 0, newArray, 0, Asset.Data.Length);
333 Array.Copy(data, 0, newArray, Asset.Data.Length, data.Length);
334 Asset.Data = newArray;
335 }
336 else
337 {
338 byte[] newArray = new byte[data.Length - 4];
339 Array.Copy(data, 4, newArray, 0, data.Length - 4);
340 Asset.Data = newArray;
341 }
342
343 ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket();
344 confirmXfer.XferID.ID = xferID;
345 confirmXfer.XferID.Packet = packetID;
346 this.ourClient.OutPacket(confirmXfer);
347
348 if ((packetID & 2147483648) != 0)
349 {
350 this.SendCompleteMessage();
351 }
352 }
353 }
354 }
261 } 355 }
262 } 356 }
263} 357}