aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-08-27 15:34:21 +0000
committerMW2007-08-27 15:34:21 +0000
commit653a4ff22ddb80d586a19648a239f01322ef78be (patch)
tree0a72cc52c2e14391f66ea59df4c209b1cc7f4930 /OpenSim
parentStopped EntityBase from implementing IScriptHost, as don't think it should, m... (diff)
downloadopensim-SC-653a4ff22ddb80d586a19648a239f01322ef78be.zip
opensim-SC-653a4ff22ddb80d586a19648a239f01322ef78be.tar.gz
opensim-SC-653a4ff22ddb80d586a19648a239f01322ef78be.tar.bz2
opensim-SC-653a4ff22ddb80d586a19648a239f01322ef78be.tar.xz
Deleted a few old files that are no longer used.
Deleted the GridInterfaces projects, and for now moved the old local asset server into Framework.Communications, as we prepare to rewrite the asset cache and asset server. Deleted Framework.manager as I am sure this is no longer in use.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs6
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServer.cs (renamed from OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs)795
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs2
-rw-r--r--OpenSim/Framework/General/Types/PrimData.cs228
-rw-r--r--OpenSim/Framework/General/Types/RegionInfo.cs2
-rw-r--r--OpenSim/Framework/General/UserProfile.cs87
-rw-r--r--OpenSim/Grid/Framework.Manager/GridManagementAgent.cs138
-rw-r--r--OpenSim/Grid/Framework.Manager/GridServerManager.cs93
-rw-r--r--OpenSim/Grid/UserServer/Main.cs3
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs6
-rw-r--r--OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs357
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive(Old).cs724
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject(Old).cs319
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs1
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs1
-rw-r--r--OpenSim/Region/GridInterfaces/Local/AssemblyInfo.cs56
-rw-r--r--OpenSim/Region/GridInterfaces/Remote/AssemblyInfo.cs56
-rw-r--r--OpenSim/Region/GridInterfaces/Remote/RemoteAssetServer.cs133
22 files changed, 406 insertions, 2620 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 1b3bb18..3d31ba6 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Caches
72 /// </summary> 72 /// </summary>
73 public AssetCache(IAssetServer assetServer) 73 public AssetCache(IAssetServer assetServer)
74 { 74 {
75 Console.WriteLine("Creating Asset cache"); 75 System.Console.WriteLine("Creating Asset cache");
76 _assetServer = assetServer; 76 _assetServer = assetServer;
77 _assetServer.SetReceiver(this); 77 _assetServer.SetReceiver(this);
78 Assets = new Dictionary<LLUUID, AssetInfo>(); 78 Assets = new Dictionary<LLUUID, AssetInfo>();
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Communications.Caches
89 89
90 public AssetCache(string assetServerDLLName, string assetServerURL, string assetServerKey) 90 public AssetCache(string assetServerDLLName, string assetServerURL, string assetServerKey)
91 { 91 {
92 Console.WriteLine("Creating Asset cache"); 92 System.Console.WriteLine("Creating Asset cache");
93 _assetServer = this.LoadAssetDll(assetServerDLLName); 93 _assetServer = this.LoadAssetDll(assetServerDLLName);
94 _assetServer.SetServerInfo(assetServerURL, assetServerKey); 94 _assetServer.SetServerInfo(assetServerURL, assetServerKey);
95 _assetServer.SetReceiver(this); 95 _assetServer.SetReceiver(this);
@@ -119,7 +119,7 @@ namespace OpenSim.Framework.Communications.Caches
119 } 119 }
120 catch (Exception e) 120 catch (Exception e)
121 { 121 {
122 Console.WriteLine(e.Message + " : " + e.StackTrace); 122 System.Console.WriteLine(e.Message + " : " + e.StackTrace);
123 } 123 }
124 } 124 }
125 } 125 }
diff --git a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs
index 835212e..fd203f7 100644
--- a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs
@@ -1,403 +1,392 @@
1/* 1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Threading; 30using System.Threading;
31using Db4objects.Db4o; 31using Db4objects.Db4o;
32using Db4objects.Db4o.Query; 32using Db4objects.Db4o.Query;
33using libsecondlife; 33using libsecondlife;
34using Nini.Config; 34using Nini.Config;
35using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Interfaces; 36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types; 37using OpenSim.Framework.Types;
38using OpenSim.Framework.Utilities; 38using OpenSim.Framework.Utilities;
39 39
40namespace OpenSim.Region.GridInterfaces.Local 40namespace OpenSim.Framework.Communications.Caches
41{ 41{
42 public class LocalAssetPlugin : IAssetPlugin 42
43 { 43 public class LocalAssetServer : IAssetServer
44 public LocalAssetPlugin() 44 {
45 { 45 private IAssetReceiver _receiver;
46 46 private BlockingQueue<ARequest> _assetRequests;
47 } 47 private IObjectContainer db;
48 48 private Thread _localAssetServerThread;
49 public IAssetServer GetAssetServer() 49
50 { 50 public LocalAssetServer()
51 return (new LocalAssetServer()); 51 {
52 } 52 bool yapfile;
53 } 53 this._assetRequests = new BlockingQueue<ARequest>();
54 54 yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap"));
55 public class LocalAssetServer : IAssetServer 55
56 { 56 MainLog.Instance.Verbose("Local Asset Server class created");
57 private IAssetReceiver _receiver; 57 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap"));
58 private BlockingQueue<ARequest> _assetRequests; 58 MainLog.Instance.Verbose("Db4 Asset database creation");
59 private IObjectContainer db; 59
60 private Thread _localAssetServerThread; 60 if (!yapfile)
61 61 {
62 public LocalAssetServer() 62 this.SetUpAssetDatabase();
63 { 63 }
64 bool yapfile; 64
65 this._assetRequests = new BlockingQueue<ARequest>(); 65 this._localAssetServerThread = new Thread(new ThreadStart(RunRequests));
66 yapfile = File.Exists(Path.Combine(Util.dataDir(),"regionassets.yap")); 66 this._localAssetServerThread.IsBackground = true;
67 67 this._localAssetServerThread.Start();
68 MainLog.Instance.Verbose("Local Asset Server class created"); 68
69 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(),"regionassets.yap")); 69 }
70 MainLog.Instance.Verbose("Db4 Asset database creation"); 70
71 71 public void SetReceiver(IAssetReceiver receiver)
72 if (!yapfile) 72 {
73 { 73 this._receiver = receiver;
74 this.SetUpAssetDatabase(); 74 }
75 } 75
76 76 public void RequestAsset(LLUUID assetID, bool isTexture)
77 this._localAssetServerThread = new Thread(new ThreadStart(RunRequests)); 77 {
78 this._localAssetServerThread.IsBackground = true; 78 ARequest req = new ARequest();
79 this._localAssetServerThread.Start(); 79 req.AssetID = assetID;
80 80 req.IsTexture = isTexture;
81 } 81 this._assetRequests.Enqueue(req);
82 82 }
83 public void SetReceiver(IAssetReceiver receiver) 83
84 { 84 public void UpdateAsset(AssetBase asset)
85 this._receiver = receiver; 85 {
86 } 86
87 87 }
88 public void RequestAsset(LLUUID assetID, bool isTexture) 88
89 { 89 public void UploadNewAsset(AssetBase asset)
90 ARequest req = new ARequest(); 90 {
91 req.AssetID = assetID; 91 AssetStorage store = new AssetStorage();
92 req.IsTexture = isTexture; 92 store.Data = asset.Data;
93 this._assetRequests.Enqueue(req); 93 store.Name = asset.Name;
94 } 94 store.UUID = asset.FullID;
95 95 db.Set(store);
96 public void UpdateAsset(AssetBase asset) 96 db.Commit();
97 { 97 }
98 98
99 } 99 public void SetServerInfo(string ServerUrl, string ServerKey)
100 100 {
101 public void UploadNewAsset(AssetBase asset) 101
102 { 102 }
103 AssetStorage store = new AssetStorage(); 103 public void Close()
104 store.Data = asset.Data; 104 {
105 store.Name = asset.Name; 105 if (db != null)
106 store.UUID = asset.FullID; 106 {
107 db.Set(store); 107 MainLog.Instance.Verbose("Closing local asset server database");
108 db.Commit(); 108 db.Close();
109 } 109 }
110 110 }
111 public void SetServerInfo(string ServerUrl, string ServerKey) 111
112 { 112 private void RunRequests()
113 113 {
114 } 114 while (true)
115 public void Close() 115 {
116 { 116 byte[] idata = null;
117 if (db != null) 117 bool found = false;
118 { 118 AssetStorage foundAsset = null;
119 MainLog.Instance.Verbose("Closing local asset server database"); 119 ARequest req = this._assetRequests.Dequeue();
120 db.Close(); 120 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID));
121 } 121 if (result.Count > 0)
122 } 122 {
123 123 foundAsset = (AssetStorage)result.Next();
124 private void RunRequests() 124 found = true;
125 { 125 }
126 while (true) 126
127 { 127 AssetBase asset = new AssetBase();
128 byte[] idata = null; 128 if (found)
129 bool found = false; 129 {
130 AssetStorage foundAsset = null; 130 asset.FullID = foundAsset.UUID;
131 ARequest req = this._assetRequests.Dequeue(); 131 asset.Type = foundAsset.Type;
132 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); 132 asset.InvType = foundAsset.Type;
133 if (result.Count > 0) 133 asset.Name = foundAsset.Name;
134 { 134 idata = foundAsset.Data;
135 foundAsset = (AssetStorage)result.Next(); 135 asset.Data = idata;
136 found = true; 136 _receiver.AssetReceived(asset, req.IsTexture);
137 } 137 }
138 138 else
139 AssetBase asset = new AssetBase(); 139 {
140 if (found) 140 //asset.FullID = ;
141 { 141 _receiver.AssetNotFound(req.AssetID);
142 asset.FullID = foundAsset.UUID; 142 }
143 asset.Type = foundAsset.Type; 143
144 asset.InvType = foundAsset.Type; 144 }
145 asset.Name = foundAsset.Name; 145
146 idata = foundAsset.Data; 146 }
147 asset.Data = idata; 147
148 _receiver.AssetReceived(asset, req.IsTexture); 148 private void SetUpAssetDatabase()
149 } 149 {
150 else 150 MainLog.Instance.Verbose("Setting up asset database");
151 { 151
152 //asset.FullID = ; 152 AssetBase Image = new AssetBase();
153 _receiver.AssetNotFound(req.AssetID); 153 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");
154 } 154 Image.Name = "Bricks";
155 155 this.LoadAsset(Image, true, "bricks.jp2");
156 } 156 AssetStorage store = new AssetStorage();
157 157 store.Data = Image.Data;
158 } 158 store.Name = Image.Name;
159 159 store.UUID = Image.FullID;
160 private void SetUpAssetDatabase() 160 db.Set(store);
161 { 161 db.Commit();
162 MainLog.Instance.Verbose("Setting up asset database"); 162
163 163 Image = new AssetBase();
164 AssetBase Image = new AssetBase(); 164 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002");
165 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); 165 Image.Name = "Plywood";
166 Image.Name = "Bricks"; 166 this.LoadAsset(Image, true, "plywood.jp2");
167 this.LoadAsset(Image, true, "bricks.jp2"); 167 store = new AssetStorage();
168 AssetStorage store = new AssetStorage(); 168 store.Data = Image.Data;
169 store.Data = Image.Data; 169 store.Name = Image.Name;
170 store.Name = Image.Name; 170 store.UUID = Image.FullID;
171 store.UUID = Image.FullID; 171 db.Set(store);
172 db.Set(store); 172 db.Commit();
173 db.Commit(); 173
174 174 Image = new AssetBase();
175 Image = new AssetBase(); 175 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003");
176 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002"); 176 Image.Name = "Rocks";
177 Image.Name = "Plywood"; 177 this.LoadAsset(Image, true, "rocks.jp2");
178 this.LoadAsset(Image, true, "plywood.jp2"); 178 store = new AssetStorage();
179 store = new AssetStorage(); 179 store.Data = Image.Data;
180 store.Data = Image.Data; 180 store.Name = Image.Name;
181 store.Name = Image.Name; 181 store.UUID = Image.FullID;
182 store.UUID = Image.FullID; 182 db.Set(store);
183 db.Set(store); 183 db.Commit();
184 db.Commit(); 184
185 185 Image = new AssetBase();
186 Image = new AssetBase(); 186 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004");
187 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003"); 187 Image.Name = "Granite";
188 Image.Name = "Rocks"; 188 this.LoadAsset(Image, true, "granite.jp2");
189 this.LoadAsset(Image, true, "rocks.jp2"); 189 store = new AssetStorage();
190 store = new AssetStorage(); 190 store.Data = Image.Data;
191 store.Data = Image.Data; 191 store.Name = Image.Name;
192 store.Name = Image.Name; 192 store.UUID = Image.FullID;
193 store.UUID = Image.FullID; 193 db.Set(store);
194 db.Set(store); 194 db.Commit();
195 db.Commit(); 195
196 196 Image = new AssetBase();
197 Image = new AssetBase(); 197 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005");
198 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004"); 198 Image.Name = "Hardwood";
199 Image.Name = "Granite"; 199 this.LoadAsset(Image, true, "hardwood.jp2");
200 this.LoadAsset(Image, true, "granite.jp2"); 200 store = new AssetStorage();
201 store = new AssetStorage(); 201 store.Data = Image.Data;
202 store.Data = Image.Data; 202 store.Name = Image.Name;
203 store.Name = Image.Name; 203 store.UUID = Image.FullID;
204 store.UUID = Image.FullID; 204 db.Set(store);
205 db.Set(store); 205 db.Commit();
206 db.Commit(); 206
207 207 Image = new AssetBase();
208 Image = new AssetBase(); 208 Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005");
209 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005"); 209 Image.Name = "Prim Base Texture";
210 Image.Name = "Hardwood"; 210 this.LoadAsset(Image, true, "plywood.jp2");
211 this.LoadAsset(Image, true, "hardwood.jp2"); 211 store = new AssetStorage();
212 store = new AssetStorage(); 212 store.Data = Image.Data;
213 store.Data = Image.Data; 213 store.Name = Image.Name;
214 store.Name = Image.Name; 214 store.UUID = Image.FullID;
215 store.UUID = Image.FullID; 215 db.Set(store);
216 db.Set(store); 216 db.Commit();
217 db.Commit(); 217
218 218 Image = new AssetBase();
219 Image = new AssetBase(); 219 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000006");
220 Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005"); 220 Image.Name = "Map Base Texture";
221 Image.Name = "Prim Base Texture"; 221 this.LoadAsset(Image, true, "map_base.jp2");
222 this.LoadAsset(Image, true, "plywood.jp2"); 222 store = new AssetStorage();
223 store = new AssetStorage(); 223 store.Data = Image.Data;
224 store.Data = Image.Data; 224 store.Name = Image.Name;
225 store.Name = Image.Name; 225 store.UUID = Image.FullID;
226 store.UUID = Image.FullID; 226 db.Set(store);
227 db.Set(store); 227 db.Commit();
228 db.Commit(); 228
229 229 Image = new AssetBase();
230 Image = new AssetBase(); 230 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000007");
231 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000006"); 231 Image.Name = "Map Texture";
232 Image.Name = "Map Base Texture"; 232 this.LoadAsset(Image, true, "map1.jp2");
233 this.LoadAsset(Image, true, "map_base.jp2"); 233 store = new AssetStorage();
234 store = new AssetStorage(); 234 store.Data = Image.Data;
235 store.Data = Image.Data; 235 store.Name = Image.Name;
236 store.Name = Image.Name; 236 store.UUID = Image.FullID;
237 store.UUID = Image.FullID; 237 db.Set(store);
238 db.Set(store); 238 db.Commit();
239 db.Commit(); 239
240 240 Image = new AssetBase();
241 Image = new AssetBase(); 241 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000010");
242 Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000007"); 242 Image.Name = "Female Body Texture";
243 Image.Name = "Map Texture"; 243 this.LoadAsset(Image, true, "femalebody.jp2");
244 this.LoadAsset(Image, true, "map1.jp2"); 244 store = new AssetStorage();
245 store = new AssetStorage(); 245 store.Data = Image.Data;
246 store.Data = Image.Data; 246 store.Name = Image.Name;
247 store.Name = Image.Name; 247 store.UUID = Image.FullID;
248 store.UUID = Image.FullID; 248 db.Set(store);
249 db.Set(store); 249 db.Commit();
250 db.Commit(); 250
251 251 Image = new AssetBase();
252 Image = new AssetBase(); 252 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000011");
253 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000010"); 253 Image.Name = "Female Bottom Texture";
254 Image.Name = "Female Body Texture"; 254 this.LoadAsset(Image, true, "femalebottom.jp2");
255 this.LoadAsset(Image, true, "femalebody.jp2"); 255 store = new AssetStorage();
256 store = new AssetStorage(); 256 store.Data = Image.Data;
257 store.Data = Image.Data; 257 store.Name = Image.Name;
258 store.Name = Image.Name; 258 store.UUID = Image.FullID;
259 store.UUID = Image.FullID; 259 db.Set(store);
260 db.Set(store); 260 db.Commit();
261 db.Commit(); 261
262 262 Image = new AssetBase();
263 Image = new AssetBase(); 263 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000012");
264 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000011"); 264 Image.Name = "Female Face Texture";
265 Image.Name = "Female Bottom Texture"; 265 this.LoadAsset(Image, true, "femaleface.jp2");
266 this.LoadAsset(Image, true, "femalebottom.jp2"); 266 store = new AssetStorage();
267 store = new AssetStorage(); 267 store.Data = Image.Data;
268 store.Data = Image.Data; 268 store.Name = Image.Name;
269 store.Name = Image.Name; 269 store.UUID = Image.FullID;
270 store.UUID = Image.FullID; 270 db.Set(store);
271 db.Set(store); 271 db.Commit();
272 db.Commit(); 272
273 273 Image = new AssetBase();
274 Image = new AssetBase(); 274 Image.FullID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
275 Image.FullID = new LLUUID("00000000-0000-1111-9999-000000000012"); 275 Image.Name = "Skin";
276 Image.Name = "Female Face Texture"; 276 Image.Type = 13;
277 this.LoadAsset(Image, true, "femaleface.jp2"); 277 Image.InvType = 13;
278 store = new AssetStorage(); 278 this.LoadAsset(Image, false, "base_skin.dat");
279 store.Data = Image.Data; 279 store = new AssetStorage();
280 store.Name = Image.Name; 280 store.Data = Image.Data;
281 store.UUID = Image.FullID; 281 store.Name = Image.Name;
282 db.Set(store); 282 store.UUID = Image.FullID;
283 db.Commit(); 283 db.Set(store);
284 284 db.Commit();
285 Image = new AssetBase(); 285
286 Image.FullID = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"); 286
287 Image.Name = "Skin"; 287 Image = new AssetBase();
288 Image.Type = 13; 288 Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
289 Image.InvType = 13; 289 Image.Name = "Shape";
290 this.LoadAsset(Image, false, "base_skin.dat"); 290 Image.Type = 13;
291 store = new AssetStorage(); 291 Image.InvType = 13;
292 store.Data = Image.Data; 292 this.LoadAsset(Image, false, "base_shape.dat");
293 store.Name = Image.Name; 293 store = new AssetStorage();
294 store.UUID = Image.FullID; 294 store.Data = Image.Data;
295 db.Set(store); 295 store.Name = Image.Name;
296 db.Commit(); 296 store.UUID = Image.FullID;
297 297 db.Set(store);
298 298 db.Commit();
299 Image = new AssetBase(); 299
300 Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); 300 Image = new AssetBase();
301 Image.Name = "Shape"; 301 Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111110");
302 Image.Type = 13; 302 Image.Name = "Shirt";
303 Image.InvType = 13; 303 Image.Type = 5;
304 this.LoadAsset(Image, false, "base_shape.dat"); 304 Image.InvType = 18;
305 store = new AssetStorage(); 305 this.LoadAsset(Image, false, "newshirt.dat");
306 store.Data = Image.Data; 306 store = new AssetStorage();
307 store.Name = Image.Name; 307 store.Data = Image.Data;
308 store.UUID = Image.FullID; 308 store.Name = Image.Name;
309 db.Set(store); 309 store.UUID = Image.FullID;
310 db.Commit(); 310 db.Set(store);
311 311 db.Commit();
312 Image = new AssetBase(); 312
313 Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111110"); 313 Image = new AssetBase();
314 Image.Name = "Shirt"; 314 Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111120");
315 Image.Type = 5; 315 Image.Name = "Shirt";
316 Image.InvType = 18; 316 Image.Type = 5;
317 this.LoadAsset(Image, false, "newshirt.dat"); 317 Image.InvType = 18;
318 store = new AssetStorage(); 318 this.LoadAsset(Image, false, "newpants.dat");
319 store.Data = Image.Data; 319 store = new AssetStorage();
320 store.Name = Image.Name; 320 store.Data = Image.Data;
321 store.UUID = Image.FullID; 321 store.Name = Image.Name;
322 db.Set(store); 322 store.UUID = Image.FullID;
323 db.Commit(); 323 db.Set(store);
324 324 db.Commit();
325 Image = new AssetBase(); 325
326 Image.FullID = new LLUUID("00000000-38f9-1111-024e-222222111120"); 326 string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml");
327 Image.Name = "Shirt"; 327 if (File.Exists(filePath))
328 Image.Type = 5; 328 {
329 Image.InvType = 18; 329 XmlConfigSource source = new XmlConfigSource(filePath);
330 this.LoadAsset(Image, false, "newpants.dat"); 330 ReadAssetDetails(source);
331 store = new AssetStorage(); 331 }
332 store.Data = Image.Data; 332 }
333 store.Name = Image.Name; 333
334 store.UUID = Image.FullID; 334 protected void ReadAssetDetails(IConfigSource source)
335 db.Set(store); 335 {
336 db.Commit(); 336 AssetBase newAsset = null;
337 337 for (int i = 0; i < source.Configs.Count; i++)
338 string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml"); 338 {
339 if(File.Exists(filePath)) 339 newAsset = new AssetBase();
340 { 340 newAsset.FullID = new LLUUID(source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated()));
341 XmlConfigSource source = new XmlConfigSource(filePath); 341 newAsset.Name = source.Configs[i].GetString("name", "");
342 ReadAssetDetails(source); 342 newAsset.Type = (sbyte)source.Configs[i].GetInt("assetType", 0);
343 } 343 newAsset.InvType = (sbyte)source.Configs[i].GetInt("inventoryType", 0);
344 } 344 string fileName = source.Configs[i].GetString("fileName", "");
345 345 if (fileName != "")
346 protected void ReadAssetDetails(IConfigSource source) 346 {
347 { 347 this.LoadAsset(newAsset, false, fileName);
348 AssetBase newAsset = null; 348 AssetStorage store = new AssetStorage();
349 for (int i = 0; i < source.Configs.Count; i++) 349 store.Data = newAsset.Data;
350 { 350 store.Name = newAsset.Name;
351 newAsset = new AssetBase(); 351 store.UUID = newAsset.FullID;
352 newAsset.FullID = new LLUUID(source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated())); 352 db.Set(store);
353 newAsset.Name = source.Configs[i].GetString("name", ""); 353 db.Commit();
354 newAsset.Type =(sbyte) source.Configs[i].GetInt("assetType", 0); 354 }
355 newAsset.InvType =(sbyte) source.Configs[i].GetInt("inventoryType", 0); 355 }
356 string fileName = source.Configs[i].GetString("fileName", ""); 356 }
357 if (fileName != "") 357
358 { 358 private void LoadAsset(AssetBase info, bool image, string filename)
359 this.LoadAsset(newAsset, false, fileName); 359 {
360 AssetStorage store = new AssetStorage(); 360 //should request Asset from storage manager
361 store.Data = newAsset.Data; 361 //but for now read from file
362 store.Name = newAsset.Name; 362
363 store.UUID = newAsset.FullID; 363 string dataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder;
364 db.Set(store); 364 string fileName = Path.Combine(dataPath, filename);
365 db.Commit(); 365 FileInfo fInfo = new FileInfo(fileName);
366 } 366 long numBytes = fInfo.Length;
367 } 367 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
368 } 368 byte[] idata = new byte[numBytes];
369 369 BinaryReader br = new BinaryReader(fStream);
370 private void LoadAsset(AssetBase info, bool image, string filename) 370 idata = br.ReadBytes((int)numBytes);
371 { 371 br.Close();
372 //should request Asset from storage manager 372 fStream.Close();
373 //but for now read from file 373 info.Data = idata;
374 374 //info.loaded=true;
375 string dataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; 375 }
376 string fileName = Path.Combine(dataPath, filename); 376 }
377 FileInfo fInfo = new FileInfo(fileName); 377 public class AssetUUIDQuery : Predicate
378 long numBytes = fInfo.Length; 378 {
379 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); 379 private LLUUID _findID;
380 byte[] idata = new byte[numBytes]; 380
381 BinaryReader br = new BinaryReader(fStream); 381 public AssetUUIDQuery(LLUUID find)
382 idata = br.ReadBytes((int)numBytes); 382 {
383 br.Close(); 383 _findID = find;
384 fStream.Close(); 384 }
385 info.Data = idata; 385 public bool Match(AssetStorage asset)
386 //info.loaded=true; 386 {
387 } 387 return (asset.UUID == _findID);
388 } 388 }
389 public class AssetUUIDQuery : Predicate 389 }
390 { 390
391 private LLUUID _findID; 391}
392 392
393 public AssetUUIDQuery(LLUUID find)
394 {
395 _findID = find;
396 }
397 public bool Match(AssetStorage asset)
398 {
399 return (asset.UUID == _findID);
400 }
401 }
402
403}
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index a599a19..07d7cf4 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Framework.Communications.Caches
70 } 70 }
71 else 71 else
72 { 72 {
73 Console.WriteLine("CACHE", "User profile for user not found"); 73 System.Console.WriteLine("CACHE", "User profile for user not found");
74 } 74 }
75 } 75 }
76 } 76 }
diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs
deleted file mode 100644
index 9b24c0f..0000000
--- a/OpenSim/Framework/General/Types/PrimData.cs
+++ /dev/null
@@ -1,228 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using libsecondlife;
30
31namespace OpenSim.Framework.Types
32{
33 public class PrimData
34 {
35 private const uint FULL_MASK_PERMISSIONS = 2147483647;
36
37 public LLUUID OwnerID;
38 public byte PCode;
39 public ushort PathBegin;
40 public ushort PathEnd;
41 public byte PathScaleX;
42 public byte PathScaleY;
43 public byte PathShearX;
44 public byte PathShearY;
45 public sbyte PathSkew;
46 public ushort ProfileBegin;
47 public ushort ProfileEnd;
48 public LLVector3 Scale;
49 public byte PathCurve;
50 public byte ProfileCurve;
51 public uint ParentID = 0;
52 public ushort ProfileHollow;
53 public sbyte PathRadiusOffset;
54 public byte PathRevolutions;
55 public sbyte PathTaperX;
56 public sbyte PathTaperY;
57 public sbyte PathTwist;
58 public sbyte PathTwistBegin;
59 public byte[] TextureEntry; // a LL textureEntry in byte[] format
60
61 public Int32 CreationDate;
62 public uint OwnerMask = FULL_MASK_PERMISSIONS;
63 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
64 public uint GroupMask = FULL_MASK_PERMISSIONS;
65 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
66 public uint BaseMask = FULL_MASK_PERMISSIONS;
67
68 //following only used during prim storage
69 public LLVector3 Position;
70 public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0);
71 public uint LocalID;
72 public LLUUID FullID;
73
74 public PrimData()
75 {
76
77 }
78
79 public PrimData(byte[] data)
80 {
81 int i = 0;
82
83 this.OwnerID = new LLUUID(data, i); i += 16;
84 this.PCode = data[i++];
85 this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
86 this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
87 this.PathScaleX = data[i++];
88 this.PathScaleY = data[i++];
89 this.PathShearX = data[i++];
90 this.PathShearY = data[i++];
91 this.PathSkew = (sbyte)data[i++];
92 this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
93 this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
94 this.Scale = new LLVector3(data, i); i += 12;
95 this.PathCurve = data[i++];
96 this.ProfileCurve = data[i++];
97 this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
98 this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
99 this.PathRadiusOffset = (sbyte)data[i++];
100 this.PathRevolutions = data[i++];
101 this.PathTaperX = (sbyte)data[i++];
102 this.PathTaperY = (sbyte)data[i++];
103 this.PathTwist = (sbyte)data[i++];
104 this.PathTwistBegin = (sbyte)data[i++];
105 ushort length = (ushort)(data[i++] + (data[i++] << 8));
106 this.TextureEntry = new byte[length];
107 Array.Copy(data, i, TextureEntry, 0, length); i += length;
108 this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
109 this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
110 this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
111 this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
112 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
113 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
114 this.Position = new LLVector3(data, i); i += 12;
115 this.Rotation = new LLQuaternion(data, i, true); i += 12;
116 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
117 this.FullID = new LLUUID(data, i); i += 16;
118
119 }
120
121 public byte[] ToBytes()
122 {
123 int i = 0;
124 byte[] bytes = new byte[126 + TextureEntry.Length];
125 Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
126 bytes[i++] = this.PCode;
127 bytes[i++] = (byte)(this.PathBegin % 256);
128 bytes[i++] = (byte)((this.PathBegin >> 8) % 256);
129 bytes[i++] = (byte)(this.PathEnd % 256);
130 bytes[i++] = (byte)((this.PathEnd >> 8) % 256);
131 bytes[i++] = this.PathScaleX;
132 bytes[i++] = this.PathScaleY;
133 bytes[i++] = this.PathShearX;
134 bytes[i++] = this.PathShearY;
135 bytes[i++] = (byte)this.PathSkew;
136 bytes[i++] = (byte)(this.ProfileBegin % 256);
137 bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256);
138 bytes[i++] = (byte)(this.ProfileEnd % 256);
139 bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256);
140 Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
141 bytes[i++] = this.PathCurve;
142 bytes[i++] = this.ProfileCurve;
143 bytes[i++] = (byte)(ParentID % 256);
144 bytes[i++] = (byte)((ParentID >> 8) % 256);
145 bytes[i++] = (byte)((ParentID >> 16) % 256);
146 bytes[i++] = (byte)((ParentID >> 24) % 256);
147 bytes[i++] = (byte)(this.ProfileHollow % 256);
148 bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256);
149 bytes[i++] = ((byte)this.PathRadiusOffset);
150 bytes[i++] = this.PathRevolutions;
151 bytes[i++] = ((byte)this.PathTaperX);
152 bytes[i++] = ((byte)this.PathTaperY);
153 bytes[i++] = ((byte)this.PathTwist);
154 bytes[i++] = ((byte)this.PathTwistBegin);
155 bytes[i++] = (byte)(TextureEntry.Length % 256);
156 bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256);
157 Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length;
158 bytes[i++] = (byte)(this.CreationDate % 256);
159 bytes[i++] = (byte)((this.CreationDate >> 8) % 256);
160 bytes[i++] = (byte)((this.CreationDate >> 16) % 256);
161 bytes[i++] = (byte)((this.CreationDate >> 24) % 256);
162 bytes[i++] = (byte)(this.OwnerMask % 256);
163 bytes[i++] = (byte)((this.OwnerMask >> 8) % 256);
164 bytes[i++] = (byte)((this.OwnerMask >> 16) % 256);
165 bytes[i++] = (byte)((this.OwnerMask >> 24) % 256);
166 bytes[i++] = (byte)(this.NextOwnerMask % 256);
167 bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256);
168 bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256);
169 bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256);
170 bytes[i++] = (byte)(this.GroupMask % 256);
171 bytes[i++] = (byte)((this.GroupMask >> 8) % 256);
172 bytes[i++] = (byte)((this.GroupMask >> 16) % 256);
173 bytes[i++] = (byte)((this.GroupMask >> 24) % 256);
174 bytes[i++] = (byte)(this.EveryoneMask % 256);
175 bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256);
176 bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256);
177 bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256);
178 bytes[i++] = (byte)(this.BaseMask % 256);
179 bytes[i++] = (byte)((this.BaseMask >> 8) % 256);
180 bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
181 bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
182 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
183 if (this.Rotation == new LLQuaternion(0, 0, 0, 0))
184 {
185 this.Rotation = new LLQuaternion(0, 1, 0, 0);
186 }
187 Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
188 bytes[i++] = (byte)(this.LocalID % 256);
189 bytes[i++] = (byte)((this.LocalID >> 8) % 256);
190 bytes[i++] = (byte)((this.LocalID >> 16) % 256);
191 bytes[i++] = (byte)((this.LocalID >> 24) % 256);
192 Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
193
194 return bytes;
195 }
196
197 //public static PrimData DefaultCube()
198 //{
199 // PrimData primData = new PrimData();
200 // primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
201 // primData.FullID = LLUUID.Random();
202 // primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
203 // primData.Rotation = new LLQuaternion(0, 0, 0, 1);
204 // primData.PCode = 9;
205 // primData.ParentID = 0;
206 // primData.PathBegin = 0;
207 // primData.PathEnd = 0;
208 // primData.PathScaleX = 0;
209 // primData.PathScaleY = 0;
210 // primData.PathShearX = 0;
211 // primData.PathShearY = 0;
212 // primData.PathSkew = 0;
213 // primData.ProfileBegin = 0;
214 // primData.ProfileEnd = 0;
215 // primData.PathCurve = 16;
216 // primData.ProfileCurve = 1;
217 // primData.ProfileHollow = 0;
218 // primData.PathRadiusOffset = 0;
219 // primData.PathRevolutions = 0;
220 // primData.PathTaperX = 0;
221 // primData.PathTaperY = 0;
222 // primData.PathTwist = 0;
223 // primData.PathTwistBegin = 0;
224
225 // return primData;
226 //}
227 }
228}
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs
index c567aa6..b7dff17 100644
--- a/OpenSim/Framework/General/Types/RegionInfo.cs
+++ b/OpenSim/Framework/General/Types/RegionInfo.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Framework.Types
216 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false); 216 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false);
217 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); 217 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false);
218 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); 218 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false);
219 configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "localworld.yap", false); 219 configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
220 configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); 220 configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false);
221 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000", false); 221 configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000", false);
222 configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); 222 configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false);
diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs
deleted file mode 100644
index ec5a485..0000000
--- a/OpenSim/Framework/General/UserProfile.cs
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Collections.Generic;
29using System.Security.Cryptography;
30using libsecondlife;
31using OpenSim.Framework.Inventory;
32
33namespace OpenSim.Framework.User
34{
35 public class UserProfile
36 {
37
38 public string firstname;
39 public string lastname;
40 public ulong homeregionhandle;
41 public LLVector3 homepos;
42 public LLVector3 homelookat;
43
44 public bool IsGridGod = false;
45 public bool IsLocal = true; // will be used in future for visitors from foreign grids
46 public string AssetURL;
47 public string MD5passwd;
48
49 public LLUUID CurrentSessionID;
50 public LLUUID CurrentSecureSessionID;
51 public LLUUID UUID;
52 public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes
53
54 public AgentInventory Inventory;
55
56 public UserProfile()
57 {
58 Circuits = new Dictionary<LLUUID, uint>();
59 Inventory = new AgentInventory();
60 homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256));
61 homepos = new LLVector3();
62 homelookat = new LLVector3();
63 }
64
65 public void InitSessionData()
66 {
67 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
68
69 byte[] randDataS = new byte[16];
70 byte[] randDataSS = new byte[16];
71
72 rand.GetBytes(randDataS);
73 rand.GetBytes(randDataSS);
74
75 CurrentSecureSessionID = new LLUUID(randDataSS,0);
76 CurrentSessionID = new LLUUID(randDataS,0);
77
78 }
79
80 public void AddSimCircuit(uint circuitCode, LLUUID regionUUID)
81 {
82 if (this.Circuits.ContainsKey(regionUUID) == false)
83 this.Circuits.Add(regionUUID, circuitCode);
84 }
85
86 }
87}
diff --git a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs
deleted file mode 100644
index 989df26..0000000
--- a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Collections;
29using libsecondlife;
30using Nwc.XmlRpc;
31using OpenSim.Framework.Servers;
32
33namespace OpenSim.Framework.Manager
34{
35 /// <summary>
36 /// Used to pass messages to the gridserver
37 /// </summary>
38 /// <param name="param">Pass this argument</param>
39 public delegate void GridManagerCallback(string param);
40
41 /// <summary>
42 /// Serverside listener for grid commands
43 /// </summary>
44 public class GridManagementAgent
45 {
46 /// <summary>
47 /// Passes grid server messages
48 /// </summary>
49 private GridManagerCallback thecallback;
50
51 /// <summary>
52 /// Security keys
53 /// </summary>
54 private string sendkey;
55 private string recvkey;
56
57 /// <summary>
58 /// Our component type
59 /// </summary>
60 private string component_type;
61
62 /// <summary>
63 /// List of active sessions
64 /// </summary>
65 private static ArrayList Sessions;
66
67 /// <summary>
68 /// Initialises a new GridManagementAgent
69 /// </summary>
70 /// <param name="app_httpd">HTTP Daemon for this server</param>
71 /// <param name="component_type">What component type are we?</param>
72 /// <param name="sendkey">Security send key</param>
73 /// <param name="recvkey">Security recieve key</param>
74 /// <param name="thecallback">Message callback</param>
75 public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback)
76 {
77 this.sendkey = sendkey;
78 this.recvkey = recvkey;
79 this.component_type = component_type;
80 this.thecallback = thecallback;
81 Sessions = new ArrayList();
82
83 app_httpd.AddXmlRPCHandler("manager_login", XmlRpcLoginMethod);
84
85 switch (component_type)
86 {
87 case "gridserver":
88 GridServerManager.sendkey = this.sendkey;
89 GridServerManager.recvkey = this.recvkey;
90 GridServerManager.thecallback = thecallback;
91 app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod);
92 break;
93 }
94 }
95
96 /// <summary>
97 /// Checks if a session exists
98 /// </summary>
99 /// <param name="sessionID">The session ID</param>
100 /// <returns>Exists?</returns>
101 public static bool SessionExists(LLUUID sessionID)
102 {
103 return Sessions.Contains(sessionID);
104 }
105
106 /// <summary>
107 /// Logs a new session to the grid manager
108 /// </summary>
109 /// <param name="request">the XMLRPC request</param>
110 /// <returns>An XMLRPC reply</returns>
111 public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
112 {
113 XmlRpcResponse response = new XmlRpcResponse();
114 Hashtable requestData = (Hashtable)request.Params[0];
115 Hashtable responseData = new Hashtable();
116
117 // TODO: Switch this over to using OpenSim.Framework.Data
118 if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret"))
119 {
120 response.IsFault = false;
121 LLUUID new_session = LLUUID.Random();
122 Sessions.Add(new_session);
123 responseData["session_id"] = new_session.ToString();
124 responseData["msg"] = "Login OK";
125 }
126 else
127 {
128 response.IsFault = true;
129 responseData["error"] = "Invalid username or password";
130 }
131
132 response.Value = responseData;
133 return response;
134
135 }
136
137 }
138}
diff --git a/OpenSim/Grid/Framework.Manager/GridServerManager.cs b/OpenSim/Grid/Framework.Manager/GridServerManager.cs
deleted file mode 100644
index 729e42b..0000000
--- a/OpenSim/Grid/Framework.Manager/GridServerManager.cs
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
29using System;
30using System.Collections;
31using System.Threading;
32using libsecondlife;
33using Nwc.XmlRpc;
34
35namespace OpenSim.Framework.Manager {
36
37 /// <summary>
38 /// A remote management system for the grid server
39 /// </summary>
40 public class GridServerManager
41 {
42 /// <summary>
43 /// Triggers events from the grid manager
44 /// </summary>
45 public static GridManagerCallback thecallback;
46
47 /// <summary>
48 /// Security keys
49 /// </summary>
50 public static string sendkey;
51 public static string recvkey;
52
53 /// <summary>
54 /// Disconnects the grid server and shuts it down
55 /// </summary>
56 /// <param name="request">XmlRpc Request</param>
57 /// <returns>An XmlRpc response containing either a "msg" or an "error"</returns>
58 public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
59 {
60 XmlRpcResponse response = new XmlRpcResponse();
61 Hashtable requestData = (Hashtable)request.Params[0];
62 Hashtable responseData = new Hashtable();
63
64 if(requestData.ContainsKey("session_id")) {
65 if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) {
66 responseData["msg"]="Shutdown command accepted";
67 (new Thread(new ThreadStart(ShutdownServer))).Start();
68 } else {
69 response.IsFault=true;
70 responseData["error"]="bad session ID";
71 }
72 } else {
73 response.IsFault=true;
74 responseData["error"]="no session ID";
75 }
76
77 response.Value = responseData;
78 return response;
79 }
80
81 /// <summary>
82 /// Shuts down the grid server
83 /// </summary>
84 public static void ShutdownServer()
85 {
86 Console.WriteLine("Shutting down the grid server - recieved a grid manager request");
87 Console.WriteLine("Terminating in three seconds...");
88 Thread.Sleep(3000);
89 thecallback("shutdown");
90 }
91 }
92}
93
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 82bbd57..289f77a 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -34,7 +34,6 @@ using libsecondlife;
34using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
35using OpenSim.Framework.Interfaces; 35using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
37using OpenSim.Framework.User;
38using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
39using OpenSim.Framework.Configuration; 38using OpenSim.Framework.Configuration;
40 39
@@ -49,8 +48,6 @@ namespace OpenSim.Grid.UserServer
49 public UserManager m_userManager; 48 public UserManager m_userManager;
50 public UserLoginService m_loginService; 49 public UserLoginService m_loginService;
51 50
52 public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>();
53
54 LogBase m_console; 51 LogBase m_console;
55 52
56 [STAThread] 53 [STAThread]
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 955f179..ec660f3 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -231,7 +231,11 @@ namespace OpenSim
231 protected override void Initialize() 231 protected override void Initialize()
232 { 232 {
233 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 233 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
234 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); 234
235 LocalAssetServer assetServer = new LocalAssetServer();
236 assetServer.SetServerInfo(m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
237 m_assetCache = new AssetCache(assetServer);
238 // m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
235 } 239 }
236 240
237 protected override LogBase CreateLog() 241 protected override LogBase CreateLog()
diff --git a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs b/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs
deleted file mode 100644
index 6a05ba2..0000000
--- a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs
+++ /dev/null
@@ -1,357 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using libsecondlife;
31using libsecondlife.Packets;
32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types;
34using OpenSim.Framework.Utilities;
35using OpenSim.Framework.Communications.Caches;
36
37
38namespace OpenSim.Region.ClientStack
39{
40 partial class ClientView
41 {
42 public class AgentAssetUpload
43 {
44 private Dictionary<LLUUID, AssetTransaction> transactions = new Dictionary<LLUUID, AssetTransaction>();
45 private ClientView ourClient;
46 private AssetCache m_assetCache;
47 // private InventoryCache m_inventoryCache;
48
49 public AgentAssetUpload(ClientView client, AssetCache assetCache )
50 {
51 this.ourClient = client;
52 m_assetCache = assetCache;
53 // m_inventoryCache = inventoryCache;
54 }
55
56 public void AddUpload(LLUUID transactionID, AssetBase asset)
57 {
58 AssetTransaction upload = new AssetTransaction();
59 lock (this.transactions)
60 {
61 upload.Asset = asset;
62 upload.TransactionID = transactionID;
63 this.transactions.Add(transactionID, upload);
64 }
65 if (upload.Asset.Data.Length > 2)
66 {
67 //is complete
68 upload.UploadComplete = true;
69 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
70 response.AssetBlock.Type = asset.Type;
71 response.AssetBlock.Success = true;
72 response.AssetBlock.UUID = transactionID.Combine(this.ourClient.SecureSessionID);
73 this.ourClient.OutPacket(response);
74 m_assetCache.AddAsset(asset);
75 }
76 else
77 {
78 upload.UploadComplete = false;
79 upload.XferID = Util.GetNextXferID();
80 RequestXferPacket xfer = new RequestXferPacket();
81 xfer.XferID.ID = upload.XferID;
82 xfer.XferID.VFileType = upload.Asset.Type;
83 xfer.XferID.VFileID = transactionID.Combine(this.ourClient.SecureSessionID);
84 xfer.XferID.FilePath = 0;
85 xfer.XferID.Filename = new byte[0];
86 this.ourClient.OutPacket(xfer);
87 }
88
89 }
90
91 public AssetBase GetUpload(LLUUID transactionID)
92 {
93 if (this.transactions.ContainsKey(transactionID))
94 {
95 return this.transactions[transactionID].Asset;
96 }
97
98 return null;
99 }
100
101 public void HandleUploadPacket(AssetUploadRequestPacket pack, LLUUID assetID)
102 {
103 // Console.Write("asset upload request , type = " + pack.AssetBlock.Type.ToString());
104 AssetBase asset = null;
105 if (pack.AssetBlock.Type == 0)
106 {
107
108 //first packet for transaction
109 asset = new AssetBase();
110 asset.FullID = assetID;
111 asset.Type = pack.AssetBlock.Type;
112 asset.InvType = asset.Type;
113 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
114 asset.Data = pack.AssetBlock.AssetData;
115
116
117 }
118 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7)
119 {
120
121 asset = new AssetBase();
122 asset.FullID = assetID;
123 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
124 asset.Type = pack.AssetBlock.Type;
125 asset.InvType = asset.Type;
126 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
127 asset.Data = pack.AssetBlock.AssetData;
128
129
130 }
131
132 if (asset != null)
133 {
134 this.AddUpload(pack.AssetBlock.TransactionID, asset);
135 }
136 else
137 {
138
139 //currently we don't support this asset type
140 //so lets just tell the client that the upload is complete
141 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
142 response.AssetBlock.Type = pack.AssetBlock.Type;
143 response.AssetBlock.Success = true;
144 response.AssetBlock.UUID = pack.AssetBlock.TransactionID.Combine(this.ourClient.SecureSessionID);
145 this.ourClient.OutPacket(response);
146 }
147
148 }
149
150 #region Xfer packet system for larger uploads
151
152 public void HandleXferPacket(SendXferPacketPacket xferPacket)
153 {
154 lock (this.transactions)
155 {
156 foreach (AssetTransaction trans in this.transactions.Values)
157 {
158 if (trans.XferID == xferPacket.XferID.ID)
159 {
160 if (trans.Asset.Data.Length > 1)
161 {
162 byte[] newArray = new byte[trans.Asset.Data.Length + xferPacket.DataPacket.Data.Length];
163 Array.Copy(trans.Asset.Data, 0, newArray, 0, trans.Asset.Data.Length);
164 Array.Copy(xferPacket.DataPacket.Data, 0, newArray, trans.Asset.Data.Length, xferPacket.DataPacket.Data.Length);
165 trans.Asset.Data = newArray;
166 }
167 else
168 {
169 byte[] newArray = new byte[xferPacket.DataPacket.Data.Length - 4];
170 Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length - 4);
171 trans.Asset.Data = newArray;
172 }
173
174 if ((xferPacket.XferID.Packet & 2147483648) != 0)
175 {
176 //end of transfer
177 trans.UploadComplete = true;
178 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
179 response.AssetBlock.Type = trans.Asset.Type;
180 response.AssetBlock.Success = true;
181 response.AssetBlock.UUID = trans.TransactionID.Combine(this.ourClient.SecureSessionID);
182 this.ourClient.OutPacket(response);
183
184 m_assetCache.AddAsset(trans.Asset);
185 //check if we should add it to inventory
186 if (trans.AddToInventory)
187 {
188 // m_assetCache.AddAsset(trans.Asset);
189 //m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
190 }
191
192
193 }
194 break;
195 }
196
197 }
198 }
199
200 ConfirmXferPacketPacket confirmXfer = new ConfirmXferPacketPacket();
201 confirmXfer.XferID.ID = xferPacket.XferID.ID;
202 confirmXfer.XferID.Packet = xferPacket.XferID.Packet;
203 this.ourClient.OutPacket(confirmXfer);
204 }
205
206 #endregion
207
208 public AssetBase AddUploadToAssetCache(LLUUID transactionID)
209 {
210 AssetBase asset = null;
211 if (this.transactions.ContainsKey(transactionID))
212 {
213 AssetTransaction trans = this.transactions[transactionID];
214 if (trans.UploadComplete)
215 {
216 m_assetCache.AddAsset(trans.Asset);
217 asset = trans.Asset;
218 }
219 }
220
221 return asset;
222 }
223
224 public void CreateInventoryItem(CreateInventoryItemPacket packet)
225 {
226 if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
227 {
228 AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
229 trans.Asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
230 trans.Asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
231 trans.Asset.Type = packet.InventoryBlock.Type;
232 trans.Asset.InvType = packet.InventoryBlock.InvType;
233 if (trans.UploadComplete)
234 {
235 //already complete so we can add it to the inventory
236 //m_assetCache.AddAsset(trans.Asset);
237 // m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset);
238 }
239 else
240 {
241 trans.AddToInventory = true;
242 trans.InventFolder = packet.InventoryBlock.FolderID;
243 }
244 }
245 }
246
247 private class AssetTransaction
248 {
249 public uint XferID;
250 public AssetBase Asset;
251 public bool AddToInventory;
252 public LLUUID InventFolder = LLUUID.Zero;
253 public bool UploadComplete = false;
254 public LLUUID TransactionID = LLUUID.Zero;
255
256 public AssetTransaction()
257 {
258
259 }
260 }
261
262 //new class , not currently used.
263 public class AssetXferUploader
264 {
265 private IClientAPI ourClient;
266
267 public bool UploadComplete = false;
268
269 public bool AddToInventory;
270 public LLUUID InventFolder = LLUUID.Zero;
271
272 public uint XferID;
273 public AssetBase Asset;
274 public LLUUID TransactionID = LLUUID.Zero;
275
276
277 public AssetXferUploader(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data)
278 {
279 ourClient = remoteClient;
280 Asset = new AssetBase();
281 Asset.FullID = assetID;
282 Asset.InvType = type;
283 Asset.Type = type;
284 Asset.Data = data;
285 Asset.Name = "blank";
286 Asset.Description = "empty";
287 TransactionID = transaction;
288
289 if (Asset.Data.Length > 2)
290 {
291 //data block should only have data in it, if there is no more data to be uploaded
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 }
355 }
356 }
357}
diff --git a/OpenSim/Region/Environment/Scenes/Primitive(Old).cs b/OpenSim/Region/Environment/Scenes/Primitive(Old).cs
deleted file mode 100644
index 0efa570..0000000
--- a/OpenSim/Region/Environment/Scenes/Primitive(Old).cs
+++ /dev/null
@@ -1,724 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Xml;
4using System.Xml.Serialization;
5using Axiom.Math;
6using libsecondlife;
7using libsecondlife.Packets;
8using OpenSim.Framework.Interfaces;
9using OpenSim.Framework.Inventory;
10using OpenSim.Framework.Types;
11
12using InventoryItem = OpenSim.Framework.Inventory.InventoryItem;
13
14namespace OpenSim.Region.Environment.Scenes
15{
16 public delegate void PrimCountTaintedDelegate();
17
18 public class Primitive : EntityBase
19 {
20 private const uint FULL_MASK_PERMISSIONS = 2147483647;
21
22 private LLVector3 m_positionLastFrame = new LLVector3(0, 0, 0);
23 private ulong m_regionHandle;
24 private byte m_updateFlag;
25 private uint m_flags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128;
26
27 private Dictionary<LLUUID, InventoryItem> m_inventoryItems;
28
29 private string m_description = "";
30
31 public LLUUID CreatorID;
32 public LLUUID OwnerID;
33 public LLUUID LastOwnerID;
34
35 public Int32 CreationDate;
36
37 public uint ParentID = 0;
38
39 public uint OwnerMask = FULL_MASK_PERMISSIONS;
40 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
41 public uint GroupMask = 0;// FULL_MASK_PERMISSIONS;
42 public uint EveryoneMask = 0;//FULL_MASK_PERMISSIONS;
43 public uint BaseMask = 0;//FULL_MASK_PERMISSIONS;
44
45 private PrimitiveBaseShape m_shape;
46 private byte[] m_particleSystem = new byte[0];
47
48 public SceneObjectOLD m_RootParent;
49 public bool m_isRootPrim;
50 public EntityBase m_Parent;
51
52 public event PrimCountTaintedDelegate OnPrimCountTainted;
53
54 #region Properties
55
56 /// <summary>
57 /// If rootprim, will return world position
58 /// otherwise will return local offset from rootprim
59 /// </summary>
60 public override LLVector3 AbsolutePosition
61 {
62 get
63 {
64 if (m_isRootPrim)
65 {
66 //if we are rootprim then our offset should be zero
67 return m_pos + m_Parent.AbsolutePosition;
68 }
69 else
70 {
71 return m_pos;
72 }
73 }
74 set
75 {
76 if (m_isRootPrim)
77 {
78 m_Parent.AbsolutePosition = value;
79 }
80 m_pos = value - m_Parent.AbsolutePosition;
81 }
82 }
83
84 public PrimitiveBaseShape Shape
85 {
86 get { return m_shape; }
87 }
88
89 public LLVector3 WorldPos
90 {
91 get
92 {
93 if (!m_isRootPrim)
94 {
95 Primitive parentPrim = (Primitive)m_Parent;
96 Vector3 offsetPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z);
97 offsetPos = parentPrim.Rotation * offsetPos;
98 return parentPrim.WorldPos + new LLVector3(offsetPos.x, offsetPos.y, offsetPos.z);
99 }
100 else
101 {
102 return AbsolutePosition;
103 }
104 }
105 }
106
107 public string Description
108 {
109 get { return m_description; }
110 set { m_description = value; }
111 }
112
113 public LLVector3 Scale
114 {
115 set { m_shape.Scale = value; }
116 get { return m_shape.Scale; }
117 }
118
119 private string m_sitName = "";
120 public string SitName
121 {
122 get { return m_sitName; }
123 }
124
125 private string m_touchName = "";
126 public string TouchName
127 {
128 get { return m_touchName; }
129 }
130
131 private string m_text = "";
132 public string Text
133 {
134 get { return m_text; }
135 set
136 {
137 m_text = value;
138 ScheduleFullUpdate();
139 }
140 }
141
142 #endregion
143
144 #region Constructors
145
146 public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
147 SceneObjectOLD rootObject, PrimitiveBaseShape shape, LLVector3 pos)
148 {
149 m_regionHandle = regionHandle;
150 m_scene = scene;
151 m_inventoryItems = new Dictionary<LLUUID, InventoryItem>();
152 m_Parent = parent;
153 m_isRootPrim = isRoot;
154 m_RootParent = rootObject;
155 ClearUpdateSchedule();
156 CreateFromShape(ownerID, localID, pos, shape);
157
158 Rotation = Quaternion.Identity;
159
160 m_scene.AcknowledgeNewPrim(this);
161
162 OnPrimCountTainted();
163 }
164
165 /// <summary>
166 ///
167 /// </summary>
168 /// <remarks>Empty constructor for duplication</remarks>
169 public Primitive()
170 {
171 }
172
173 #endregion
174
175 #region Destructors
176
177 ~Primitive()
178 {
179 if (OnPrimCountTainted != null)
180 OnPrimCountTainted();
181 }
182
183 #endregion
184
185 #region Duplication
186
187 public Primitive Copy(EntityBase parent, SceneObjectOLD rootParent)
188 {
189 Primitive dupe = (Primitive)MemberwiseClone();
190
191 dupe.m_Parent = parent;
192 dupe.m_RootParent = rootParent;
193
194 // TODO: Copy this properly.
195
196 dupe.m_inventoryItems = m_inventoryItems;
197 dupe.m_children = new List<EntityBase>();
198 dupe.m_shape = m_shape.Copy();
199 dupe.m_regionHandle = m_regionHandle;
200 dupe.m_scene = m_scene;
201
202
203 uint newLocalID = m_scene.PrimIDAllocate();
204 dupe.m_uuid = LLUUID.Random();
205 dupe.LocalId = newLocalID;
206
207 if (parent is SceneObjectGroup)
208 {
209 dupe.m_isRootPrim = true;
210 dupe.ParentID = 0;
211 }
212 else
213 {
214 dupe.m_isRootPrim = false;
215 dupe.ParentID = ((Primitive)parent).LocalId;
216 }
217
218 dupe.Scale = new LLVector3(Scale.X, Scale.Y, Scale.Z);
219 dupe.Rotation = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z);
220 dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z);
221
222 rootParent.AddChildToList(dupe);
223 m_scene.AcknowledgeNewPrim(dupe);
224 dupe.TriggerOnPrimCountTainted();
225
226
227 foreach (Primitive prim in m_children)
228 {
229 Primitive primClone = prim.Copy(dupe, rootParent);
230
231 dupe.m_children.Add(primClone);
232 }
233
234 return dupe;
235 }
236
237 #endregion
238
239 #region Override from EntityBase
240
241 /// <summary>
242 ///
243 /// </summary>
244 public override void Update()
245 {
246 if (m_updateFlag == 1) //some change has been made so update the clients
247 {
248 SendTerseUpdateToALLClients();
249 ClearUpdateSchedule();
250 }
251 else
252 {
253 if (m_updateFlag == 2) // is a new prim just been created/reloaded or has major changes
254 {
255 SendFullUpdateToAllClients();
256 ClearUpdateSchedule();
257 }
258 }
259
260 foreach (EntityBase child in m_children)
261 {
262 child.Update();
263 }
264 }
265
266 private void ClearUpdateSchedule()
267 {
268 m_updateFlag = 0;
269 }
270
271 #endregion
272
273 #region Setup
274
275 /// <summary>
276 ///
277 /// </summary>
278 /// <param name="addPacket"></param>
279 /// <param name="ownerID"></param>
280 /// <param name="localID"></param>
281 public void CreateFromShape(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
282 {
283 CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
284 OwnerID = ownerID;
285 CreatorID = OwnerID;
286 LastOwnerID = LLUUID.Zero;
287 AbsolutePosition = pos;
288 m_uuid = LLUUID.Random();
289 m_localId = (uint)(localID);
290
291 m_shape = shape;
292
293 ScheduleFullUpdate();
294 }
295
296 private void ScheduleFullUpdate()
297 {
298 m_updateFlag = 2;
299 }
300
301 private void ScheduleTerseUpdate()
302 {
303 if (m_updateFlag < 1)
304 {
305 m_updateFlag = 1;
306 }
307 }
308
309 #endregion
310
311 #region Linking / unlinking
312
313 /// <summary>
314 ///
315 /// </summary>
316 /// <param name="linkObject"></param>
317 public void AddNewChildren(SceneObjectOLD linkObject)
318 {
319 // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")");
320 //TODO check permissions
321
322 m_children.Add(linkObject.rootPrimitive);
323 linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
324
325 m_scene.DeleteEntity(linkObject.rootUUID);
326 linkObject.DeleteAllChildren();
327
328 OnPrimCountTainted();
329 }
330
331 /// <summary>
332 ///
333 /// </summary>
334 /// <param name="newParent"></param>
335 /// <param name="rootParent"></param>
336 public void SetNewParent(Primitive newParent, SceneObjectOLD rootParent)
337 {
338 LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
339 m_isRootPrim = false;
340 m_Parent = newParent;
341 ParentID = newParent.LocalId;
342 m_RootParent = rootParent;
343 m_RootParent.AddChildToList(this);
344 AbsolutePosition = oldPos;
345 Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z);
346 axPos = m_Parent.Rotation.Inverse() * axPos;
347 m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
348 Quaternion oldRot = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z);
349 Rotation = m_Parent.Rotation.Inverse() * Rotation;
350 ScheduleFullUpdate();
351
352
353 foreach (Primitive child in m_children)
354 {
355 child.SetRootParent(rootParent, newParent, oldPos, oldRot);
356 }
357
358 m_children.Clear();
359
360 }
361
362 /// <summary>
363 ///
364 /// </summary>
365 /// <param name="newRoot"></param>
366 public void SetRootParent(SceneObjectOLD newRoot, Primitive newParent, LLVector3 oldParentPosition,
367 Quaternion oldParentRotation)
368 {
369 LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
370 Vector3 axOldPos = new Vector3(oldPos.X, oldPos.Y, oldPos.Z);
371 axOldPos = oldParentRotation * axOldPos;
372 oldPos = new LLVector3(axOldPos.x, axOldPos.y, axOldPos.z);
373 oldPos += oldParentPosition;
374 Quaternion oldRot = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z);
375 m_isRootPrim = false;
376 m_Parent = newParent;
377 ParentID = newParent.LocalId;
378 newParent.AddToChildrenList(this);
379
380 m_RootParent = newRoot;
381 m_RootParent.AddChildToList(this);
382 AbsolutePosition = oldPos;
383 Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z);
384 axPos = m_Parent.Rotation.Inverse() * axPos;
385 m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
386 Rotation = oldParentRotation * Rotation;
387 Rotation = m_Parent.Rotation.Inverse() * Rotation;
388 ScheduleFullUpdate();
389 foreach (Primitive child in m_children)
390 {
391 child.SetRootParent(newRoot, newParent, oldPos, oldRot);
392 }
393
394 m_children.Clear();
395
396 }
397
398 /// <summary>
399 ///
400 /// </summary>
401 /// <param name="offset"></param>
402 public void AddOffsetToChildren(LLVector3 offset)
403 {
404 foreach (Primitive prim in m_children)
405 {
406 prim.m_pos += offset;
407 prim.ScheduleTerseUpdate();
408 }
409 OnPrimCountTainted();
410 }
411
412 /// <summary>
413 ///
414 /// </summary>
415 /// <param name="prim"></param>
416 public void AddToChildrenList(Primitive prim)
417 {
418 m_children.Add(prim);
419 }
420
421 #endregion
422
423 #region Resizing/Scale
424
425 /// <summary>
426 ///
427 /// </summary>
428 /// <param name="scale"></param>
429 public void ResizeGoup(LLVector3 scale)
430 {
431 m_shape.Scale = scale;
432
433 ScheduleFullUpdate();
434 }
435
436 #endregion
437
438 #region Position
439
440 /// <summary>
441 ///
442 /// </summary>
443 /// <param name="pos"></param>
444 public void UpdateGroupPosition(LLVector3 pos)
445 {
446 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
447
448 AbsolutePosition = newPos;
449 ScheduleTerseUpdate();
450
451 OnPrimCountTainted();
452 }
453
454 /// <summary>
455 ///
456 /// </summary>
457 /// <param name="pos"></param>
458 public void UpdateSinglePosition(LLVector3 pos)
459 {
460 // Console.WriteLine("updating single prim position");
461 if (m_isRootPrim)
462 {
463 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
464 LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
465 LLVector3 diff = oldPos - newPos;
466 Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
467 axDiff = Rotation.Inverse() * axDiff;
468 diff.X = axDiff.x;
469 diff.Y = axDiff.y;
470 diff.Z = axDiff.z;
471 AbsolutePosition = newPos;
472
473 foreach (Primitive prim in m_children)
474 {
475 prim.m_pos += diff;
476 prim.ScheduleTerseUpdate();
477 }
478 ScheduleTerseUpdate();
479 }
480 else
481 {
482 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
483 m_pos = newPos;
484 ScheduleTerseUpdate();
485 }
486 }
487
488 #endregion
489
490 #region Rotation
491
492 /// <summary>
493 ///
494 /// </summary>
495 /// <param name="rot"></param>
496 public void UpdateGroupRotation(LLQuaternion rot)
497 {
498 Rotation = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
499 ScheduleTerseUpdate();
500 }
501
502 /// <summary>
503 ///
504 /// </summary>
505 /// <param name="pos"></param>
506 /// <param name="rot"></param>
507 public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot)
508 {
509 Rotation = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
510 AbsolutePosition = pos;
511 ScheduleTerseUpdate();
512 }
513
514 /// <summary>
515 ///
516 /// </summary>
517 /// <param name="rot"></param>
518 public void UpdateSingleRotation(LLQuaternion rot)
519 {
520 //Console.WriteLine("updating single prim rotation");
521
522 Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
523 Quaternion oldParentRot = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z);
524 Rotation = axRot;
525 foreach (Primitive prim in m_children)
526 {
527 Vector3 axPos = new Vector3(prim.m_pos.X, prim.m_pos.Y, prim.m_pos.Z);
528 axPos = oldParentRot * axPos;
529 axPos = axRot.Inverse() * axPos;
530 prim.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
531 prim.Rotation = oldParentRot * prim.Rotation;
532 prim.Rotation = axRot.Inverse() * prim.Rotation;
533 prim.ScheduleTerseUpdate();
534 }
535 ScheduleTerseUpdate();
536 }
537
538 #endregion
539
540 #region Shape
541
542 /// <summary>
543 ///
544 /// </summary>
545 /// <param name="shapeBlock"></param>
546 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
547 {
548 m_shape.PathBegin = shapeBlock.PathBegin;
549 m_shape.PathEnd = shapeBlock.PathEnd;
550 m_shape.PathScaleX = shapeBlock.PathScaleX;
551 m_shape.PathScaleY = shapeBlock.PathScaleY;
552 m_shape.PathShearX = shapeBlock.PathShearX;
553 m_shape.PathShearY = shapeBlock.PathShearY;
554 m_shape.PathSkew = shapeBlock.PathSkew;
555 m_shape.ProfileBegin = shapeBlock.ProfileBegin;
556 m_shape.ProfileEnd = shapeBlock.ProfileEnd;
557 m_shape.PathCurve = shapeBlock.PathCurve;
558 m_shape.ProfileCurve = shapeBlock.ProfileCurve;
559 m_shape.ProfileHollow = shapeBlock.ProfileHollow;
560 m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
561 m_shape.PathRevolutions = shapeBlock.PathRevolutions;
562 m_shape.PathTaperX = shapeBlock.PathTaperX;
563 m_shape.PathTaperY = shapeBlock.PathTaperY;
564 m_shape.PathTwist = shapeBlock.PathTwist;
565 m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
566 ScheduleFullUpdate();
567 }
568
569 #endregion
570
571 #region Inventory
572 public void GetInventory(IClientAPI client, uint localID)
573 {
574 if (localID == this.m_localId)
575 {
576 client.SendTaskInventory(this.m_uuid, 0, new byte[0]);
577 }
578 }
579 #endregion
580
581 public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
582 {
583 this.m_shape.ExtraParams = new byte[data.Length + 7];
584 int i =0;
585 uint length = (uint) data.Length;
586 this.m_shape.ExtraParams[i++] = 1;
587 this.m_shape.ExtraParams[i++] = (byte)(type % 256);
588 this.m_shape.ExtraParams[i++] = (byte)((type >> 8) % 256);
589
590 this.m_shape.ExtraParams[i++] = (byte)(length % 256);
591 this.m_shape.ExtraParams[i++] = (byte)((length >> 8) % 256);
592 this.m_shape.ExtraParams[i++] = (byte)((length >> 16) % 256);
593 this.m_shape.ExtraParams[i++] = (byte)((length >> 24) % 256);
594 Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length);
595
596 this.ScheduleFullUpdate();
597 }
598
599 #region Texture
600
601 /// <summary>
602 ///
603 /// </summary>
604 /// <param name="textureEntry"></param>
605 public void UpdateTextureEntry(byte[] textureEntry)
606 {
607 m_shape.TextureEntry = textureEntry;
608 ScheduleFullUpdate();
609 }
610
611 #endregion
612
613 public void AddNewParticleSystem(libsecondlife.Primitive.ParticleSystem pSystem)
614 {
615 this.m_particleSystem = pSystem.GetBytes();
616 ScheduleFullUpdate();
617 }
618
619 #region Client Update Methods
620
621 /// <summary>
622 ///
623 /// </summary>
624 /// <param name="remoteClient"></param>
625 public void SendFullUpdateForAllChildren(IClientAPI remoteClient)
626 {
627
628 SendFullUpdateToClient(remoteClient);
629 for (int i = 0; i < m_children.Count; i++)
630
631 {
632
633 if (m_children[i] is Primitive)
634 {
635 ((Primitive)m_children[i]).SendFullUpdateForAllChildren(remoteClient);
636 }
637 }
638 }
639
640 /// <summary>
641 ///
642 /// </summary>
643 /// <param name="remoteClient"></param>
644 public void SendFullUpdateToClient(IClientAPI remoteClient)
645 {
646 LLVector3 lPos;
647 lPos = AbsolutePosition;
648 LLQuaternion lRot;
649 lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w);
650
651 remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalId, m_shape, lPos, m_flags, m_uuid, OwnerID,
652 m_text, ParentID, this.m_particleSystem, lRot);
653 }
654
655 /// <summary>
656 ///
657 /// </summary>
658 public void SendFullUpdateToAllClients()
659 {
660 List<ScenePresence> avatars = m_scene.RequestAvatarList();
661 for (int i = 0; i < avatars.Count; i++)
662 {
663 SendFullUpdateToClient(avatars[i].ControllingClient);
664 }
665 }
666
667 /// <summary>
668 ///
669 /// </summary>
670 /// <param name="remoteClient"></param>
671 public void SendTerseUpdateForAllChildren(IClientAPI remoteClient)
672 {
673
674 SendTerseUpdateToClient(remoteClient);
675 for (int i = 0; i < m_children.Count; i++)
676 {
677 if (m_children[i] is Primitive)
678 {
679 ((Primitive)m_children[i]).SendTerseUpdateForAllChildren(remoteClient);
680 }
681 }
682 }
683
684 /// <summary>
685 ///
686 /// </summary>
687 /// <param name="RemoteClient"></param>
688 public void SendTerseUpdateToClient(IClientAPI RemoteClient)
689 {
690 LLVector3 lPos;
691 Quaternion lRot;
692
693 lPos = AbsolutePosition;
694 lRot = Rotation;
695
696 LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w);
697 RemoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalId, lPos, mRot);
698 }
699
700 /// <summary>
701 ///
702 /// </summary>
703 public void SendTerseUpdateToALLClients()
704 {
705 List<ScenePresence> avatars = m_scene.RequestAvatarList();
706 for (int i = 0; i < avatars.Count; i++)
707 {
708 SendTerseUpdateToClient(avatars[i].ControllingClient);
709 }
710 }
711
712 #endregion
713
714 public void TriggerOnPrimCountTainted()
715 {
716 OnPrimCountTainted();
717 }
718
719 public override void SetText(string text, Vector3 color, double alpha)
720 {
721 throw new Exception("The method or operation is not implemented.");
722 }
723 }
724} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index e0fd459..16cd484 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -281,11 +281,9 @@ namespace OpenSim.Region.Environment.Scenes
281 281
282 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID); 282 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
283 ((SceneObjectGroup)ent).GetProperites(remoteClient); 283 ((SceneObjectGroup)ent).GetProperites(remoteClient);
284
285 } 284 }
286 } 285 }
287 } 286 }
288
289 } 287 }
290 } 288 }
291 } 289 }
@@ -301,7 +299,6 @@ namespace OpenSim.Region.Environment.Scenes
301 { 299 {
302 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet; 300 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;
303 301
304
305 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) 302 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
306 { 303 {
307 //currently following code not used (or don't know of any case of destination being zero 304 //currently following code not used (or don't know of any case of destination being zero
@@ -421,8 +418,6 @@ namespace OpenSim.Region.Environment.Scenes
421 new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 418 new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
422 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 419 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
423 } 420 }
424
425
426 } 421 }
427 422
428} 423}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 49ba655..1fca719 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -513,13 +513,7 @@ namespace OpenSim.Region.Environment.Scenes
513 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 513 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
514 } 514 }
515 515
516 /// <summary> 516
517 /// Loads a specific object from storage
518 /// </summary>
519 /// <param name="prim">The object to load</param>
520 public void PrimFromStorage(PrimData prim)
521 {
522 }
523 517
524 /// <summary> 518 /// <summary>
525 /// Returns a new unallocated primitive ID 519 /// Returns a new unallocated primitive ID
@@ -603,7 +597,7 @@ namespace OpenSim.Region.Environment.Scenes
603 /// Called by a prim when it has been created/cloned, so that its events can be subscribed to 597 /// Called by a prim when it has been created/cloned, so that its events can be subscribed to
604 /// </summary> 598 /// </summary>
605 /// <param name="prim"></param> 599 /// <param name="prim"></param>
606 public void AcknowledgeNewPrim(Primitive prim) 600 public void AcknowledgeNewPrim(SceneObjectGroup prim)
607 { 601 {
608 prim.OnPrimCountTainted += m_LandManager.setPrimsTainted; 602 prim.OnPrimCountTainted += m_LandManager.setPrimsTainted;
609 } 603 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs b/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs
deleted file mode 100644
index 6f06b5a..0000000
--- a/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs
+++ /dev/null
@@ -1,319 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Collections.Generic;
29using System.Text;
30using System.IO;
31using System.Xml;
32using System.Xml.Serialization;
33using libsecondlife;
34using libsecondlife.Packets;
35using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Types;
37using OpenSim.Physics.Manager;
38
39namespace OpenSim.Region.Environment.Scenes
40{
41 public class SceneObjectOLD : EntityBase
42 {
43 private Encoding enc = Encoding.ASCII;
44 private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group
45 public Primitive rootPrimitive;
46 protected ulong m_regionHandle;
47
48 private EventManager m_eventManager;
49
50 public bool isSelected = false;
51
52 public LLUUID rootUUID
53 {
54 get
55 {
56 this.m_uuid = this.rootPrimitive.m_uuid;
57 return this.m_uuid;
58 }
59 }
60
61 public uint rootLocalID
62 {
63 get
64 {
65 this.m_localId = this.rootPrimitive.LocalId;
66 return this.LocalId;
67 }
68 }
69
70 public int primCount
71 {
72 get
73 {
74 return this.ChildPrimitives.Count;
75 }
76 }
77
78 public Dictionary<LLUUID, Primitive> Children
79 {
80 get
81 {
82 return this.ChildPrimitives;
83 }
84 }
85
86 /// <summary>
87 ///
88 /// </summary>
89 public SceneObjectOLD(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
90 {
91 m_regionHandle = world.RegionInfo.RegionHandle;
92 m_scene = world;
93 m_eventManager = eventManager;
94
95 this.AbsolutePosition = pos;
96 this.CreateRootFromShape(ownerID, localID, shape, pos);
97
98 registerEvents();
99 }
100
101 /// <summary>
102 ///
103 /// </summary>
104 /// <remarks>Need a null constructor for duplication</remarks>
105 public SceneObjectOLD()
106 {
107
108 }
109
110 public void registerEvents()
111 {
112 m_eventManager.OnBackup += new EventManager.OnBackupDelegate(ProcessBackup);
113 m_eventManager.OnParcelPrimCountUpdate += new EventManager.OnParcelPrimCountUpdateDelegate(ProcessParcelPrimCountUpdate);
114 }
115
116 public void unregisterEvents()
117 {
118 m_eventManager.OnBackup -= new EventManager.OnBackupDelegate(ProcessBackup);
119 m_eventManager.OnParcelPrimCountUpdate -= new EventManager.OnParcelPrimCountUpdateDelegate(ProcessParcelPrimCountUpdate);
120 }
121
122 /// <summary>
123 /// Processes backup
124 /// </summary>
125 /// <param name="datastore"></param>
126 public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore)
127 {
128 // datastore.StoreObject(this);
129 }
130
131 /// <summary>
132 /// Sends my primitive info to the land manager for it to keep tally of all of the prims!
133 /// </summary>
134 private void ProcessParcelPrimCountUpdate()
135 {
136
137 // m_eventManager.TriggerParcelPrimCountAdd(this);
138 }
139
140 /// <summary>
141 ///
142 /// </summary>
143 /// <param name="addPacket"></param>
144 /// <param name="agentID"></param>
145 /// <param name="localID"></param>
146 public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
147 {
148
149 // this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos);
150 this.m_children.Add(rootPrimitive);
151
152 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
153 }
154
155 /// <summary>
156 ///
157 /// </summary>
158 /// <param name="data"></param>
159 public void CreateFromBytes(byte[] data)
160 {
161
162 }
163
164 /// <summary>
165 /// Makes a copy of this SceneObject (and child primitives)
166 /// </summary>
167 /// <returns>A complete copy of the object</returns>
168 public new SceneObjectOLD Copy()
169 {
170 SceneObjectOLD dupe = new SceneObjectOLD();
171
172 dupe.m_scene = this.m_scene;
173 dupe.m_eventManager = this.m_eventManager;
174 dupe.m_regionHandle = this.m_regionHandle;
175 Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
176 dupe.rootPrimitive = newRoot;
177
178 dupe.m_children.Add(dupe.rootPrimitive);
179 dupe.rootPrimitive.AbsolutePosition = this.AbsolutePosition;
180 dupe.Rotation = this.Rotation;
181 dupe.LocalId = m_scene.PrimIDAllocate();
182
183 dupe.registerEvents();
184 return dupe;
185 }
186
187 /// <summary>
188 ///
189 /// </summary>
190 public void Serialise()
191 {
192
193 }
194
195 /// <summary>
196 ///
197 /// </summary>
198 public void DeleteAllChildren()
199 {
200 this.m_children.Clear();
201 this.ChildPrimitives.Clear();
202 this.rootPrimitive = null;
203 unregisterEvents();
204 }
205
206 /// <summary>
207 ///
208 /// </summary>
209 /// <param name="primObject"></param>
210 public void AddNewChildPrims(SceneObjectOLD primObject)
211 {
212 this.rootPrimitive.AddNewChildren(primObject);
213 }
214
215 public void AddChildToList(Primitive prim)
216 {
217 if (!this.ChildPrimitives.ContainsKey(prim.m_uuid))
218 {
219 this.ChildPrimitives.Add(prim.m_uuid, prim);
220 }
221 }
222 /// <summary>
223 ///
224 /// </summary>
225 /// <param name="primID"></param>
226 /// <returns></returns>
227 public Primitive HasChildPrim(LLUUID primID)
228 {
229 if (this.ChildPrimitives.ContainsKey(primID))
230 {
231 return this.ChildPrimitives[primID];
232 }
233
234 return null;
235 }
236
237 /// <summary>
238 ///
239 /// </summary>
240 /// <param name="localID"></param>
241 /// <returns></returns>
242 public Primitive HasChildPrim(uint localID)
243 {
244 Primitive returnPrim = null;
245 foreach (Primitive prim in this.ChildPrimitives.Values)
246 {
247 if (prim.LocalId == localID)
248 {
249 returnPrim = prim;
250 break;
251 }
252 }
253 return returnPrim;
254 }
255
256 public void SendAllChildPrimsToClient(IClientAPI client)
257 {
258 this.rootPrimitive.SendFullUpdateForAllChildren(client);
259 }
260
261 /// <summary>
262 ///
263 /// </summary>
264 public override void BackUp()
265 {
266
267 }
268
269 /// <summary>
270 ///
271 /// </summary>
272 /// <param name="offset"></param>
273 /// <param name="pos"></param>
274 /// <param name="remoteClient"></param>
275 public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
276 {
277 this.rootPrimitive.AbsolutePosition = pos;
278 this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient);
279 }
280
281 /// <summary>
282 ///
283 /// </summary>
284 /// <param name="client"></param>
285 public void GetProperites(IClientAPI client)
286 {
287 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
288 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
289 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
290 proper.ObjectData[0].ItemID = LLUUID.Zero;
291 proper.ObjectData[0].CreationDate = (ulong)this.rootPrimitive.CreationDate;
292 proper.ObjectData[0].CreatorID = this.rootPrimitive.CreatorID;
293 proper.ObjectData[0].FolderID = LLUUID.Zero;
294 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
295 proper.ObjectData[0].GroupID = LLUUID.Zero;
296 proper.ObjectData[0].InventorySerial = 0;
297 proper.ObjectData[0].LastOwnerID = this.rootPrimitive.LastOwnerID;
298 proper.ObjectData[0].ObjectID = this.rootUUID;
299 proper.ObjectData[0].OwnerID = this.rootPrimitive.OwnerID;
300 proper.ObjectData[0].TouchName = enc.GetBytes(this.rootPrimitive.TouchName + "\0");
301 proper.ObjectData[0].TextureID = new byte[0];
302 proper.ObjectData[0].SitName = enc.GetBytes(this.rootPrimitive.SitName + "\0");
303 proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name + "\0");
304 proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description + "\0");
305 proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask;
306 proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask;
307 proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask;
308 proper.ObjectData[0].EveryoneMask = this.rootPrimitive.EveryoneMask;
309 proper.ObjectData[0].BaseMask = this.rootPrimitive.BaseMask;
310
311 client.OutPacket(proper);
312 }
313
314 public override void SetText(string text, Axiom.Math.Vector3 color, double alpha)
315 {
316 throw new System.Exception("The method or operation is not implemented.");
317 }
318 }
319}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index b3e3fe3..2fd7b57 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -14,7 +14,7 @@ using OpenSim.Framework.Data;
14 14
15namespace OpenSim.Region.Environment.Scenes 15namespace OpenSim.Region.Environment.Scenes
16{ 16{
17 // public delegate void PrimCountTaintedDelegate(); 17 public delegate void PrimCountTaintedDelegate();
18 18
19 public class SceneObjectGroup : EntityBase 19 public class SceneObjectGroup : EntityBase
20 { 20 {
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs b/OpenSim/Region/Environment/Scenes/Scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs
index 97b1ada..80d77f2 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Scripting.Examples
51 }*/ 51 }*/
52 } 52 }
53 53
54 string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim) 54 string processPrimitiveToString(OpenSim.Region.Environment.Scenes.SceneObjectPart prim)
55 { 55 {
56 /*string desc = prim.Description; 56 /*string desc = prim.Description;
57 string name = prim.Name; 57 string name = prim.Name;
diff --git a/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
index 7cfdb46..9c950f8 100644
--- a/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
@@ -7,7 +7,6 @@ using OpenSim.Framework.Types;
7using System.Timers; 7using System.Timers;
8using System.Diagnostics; 8using System.Diagnostics;
9using System.IO; 9using System.IO;
10using Primitive = OpenSim.Region.Environment.Scenes.Primitive;
11 10
12namespace SimpleApp 11namespace SimpleApp
13{ 12{
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index daa4203..2346109 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -12,7 +12,6 @@ using OpenSim.Region.Capabilities;
12using OpenSim.Region.ClientStack; 12using OpenSim.Region.ClientStack;
13using OpenSim.Region.Communications.Local; 13using OpenSim.Region.Communications.Local;
14using OpenSim.Framework.Communications.Caches; 14using OpenSim.Framework.Communications.Caches;
15using OpenSim.Region.GridInterfaces.Local;
16using System.Timers; 15using System.Timers;
17using OpenSim.Region.Environment.Scenes; 16using OpenSim.Region.Environment.Scenes;
18using OpenSim.Framework.Data; 17using OpenSim.Framework.Data;
diff --git a/OpenSim/Region/GridInterfaces/Local/AssemblyInfo.cs b/OpenSim/Region/GridInterfaces/Local/AssemblyInfo.cs
deleted file mode 100644
index 61adf80..0000000
--- a/OpenSim/Region/GridInterfaces/Local/AssemblyInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Reflection;
29using System.Runtime.InteropServices;
30// Information about this assembly is defined by the following
31// attributes.
32//
33// change them to the information which is associated with the assembly
34// you compile.
35
36[assembly: AssemblyTitle("LocalGridServers")]
37[assembly: AssemblyDescription("")]
38[assembly: AssemblyConfiguration("")]
39[assembly: AssemblyCompany("")]
40[assembly: AssemblyProduct("LocalGridServers")]
41[assembly: AssemblyCopyright("")]
42[assembly: AssemblyTrademark("")]
43[assembly: AssemblyCulture("")]
44
45// This sets the default COM visibility of types in the assembly to invisible.
46// If you need to expose a type to COM, use [ComVisible(true)] on that type.
47[assembly: ComVisible(false)]
48
49// The assembly version has following format :
50//
51// Major.Minor.Build.Revision
52//
53// You can specify all values by your own or you can build default build and revision
54// numbers with the '*' character (the default):
55
56[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/Region/GridInterfaces/Remote/AssemblyInfo.cs b/OpenSim/Region/GridInterfaces/Remote/AssemblyInfo.cs
deleted file mode 100644
index a658f2f..0000000
--- a/OpenSim/Region/GridInterfaces/Remote/AssemblyInfo.cs
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Reflection;
29using System.Runtime.InteropServices;
30// Information about this assembly is defined by the following
31// attributes.
32//
33// change them to the information which is associated with the assembly
34// you compile.
35
36[assembly: AssemblyTitle("RemoteGridServers")]
37[assembly: AssemblyDescription("")]
38[assembly: AssemblyConfiguration("")]
39[assembly: AssemblyCompany("")]
40[assembly: AssemblyProduct("RemoteGridServers")]
41[assembly: AssemblyCopyright("")]
42[assembly: AssemblyTrademark("")]
43[assembly: AssemblyCulture("")]
44
45// This sets the default COM visibility of types in the assembly to invisible.
46// If you need to expose a type to COM, use [ComVisible(true)] on that type.
47[assembly: ComVisible(false)]
48
49// The assembly version has following format :
50//
51// Major.Minor.Build.Revision
52//
53// You can specify all values by your own or you can build default build and revision
54// numbers with the '*' character (the default):
55
56[assembly: AssemblyVersion("1.0.*")]
diff --git a/OpenSim/Region/GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim/Region/GridInterfaces/Remote/RemoteAssetServer.cs
deleted file mode 100644
index f81bb8d..0000000
--- a/OpenSim/Region/GridInterfaces/Remote/RemoteAssetServer.cs
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.IO;
29using System.Net;
30using System.Text;
31using System.Threading;
32using libsecondlife;
33using OpenSim.Framework.Console;
34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities;
37
38namespace OpenSim.Region.GridInterfaces.Remote
39{
40 public class RemoteAssetServer : IAssetServer
41 {
42 private IAssetReceiver _receiver;
43 private BlockingQueue<ARequest> _assetRequests;
44 private Thread _remoteAssetServerThread;
45 private string AssetServerUrl;
46 private string AssetSendKey;
47
48 public RemoteAssetServer()
49 {
50 this._assetRequests = new BlockingQueue<ARequest>();
51 this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests));
52 this._remoteAssetServerThread.IsBackground = true;
53 this._remoteAssetServerThread.Start();
54 MainLog.Instance.Verbose("Remote Asset Server class created");
55 }
56
57 public void SetReceiver(IAssetReceiver receiver)
58 {
59 this._receiver = receiver;
60 }
61
62 public void RequestAsset(LLUUID assetID, bool isTexture)
63 {
64 ARequest req = new ARequest();
65 req.AssetID = assetID;
66 req.IsTexture = isTexture;
67 this._assetRequests.Enqueue(req);
68 }
69
70 public void UpdateAsset(AssetBase asset)
71 {
72
73 }
74
75 public void UploadNewAsset(AssetBase asset)
76 {
77 Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
78 string ret = Windows1252Encoding.GetString(asset.Data);
79 byte[] buffer = Windows1252Encoding.GetBytes(ret);
80 WebClient client = new WebClient();
81 client.UploadData(this.AssetServerUrl + "assets/" + asset.FullID, buffer);
82
83 }
84
85 public void SetServerInfo(string ServerUrl, string ServerKey)
86 {
87 this.AssetServerUrl = ServerUrl;
88 this.AssetSendKey = ServerKey;
89 }
90
91 private void RunRequests()
92 {
93 while (true)
94 {
95 //we need to add support for the asset server not knowing about a requested asset
96 // 404... THE MAGIC FILE NOT FOUND ERROR, very useful for telling you things such as a file (or asset ;) ) not being found!!!!!!!!!!! it's 2:22AM
97 ARequest req = this._assetRequests.Dequeue();
98 LLUUID assetID = req.AssetID;
99 // OpenSim.Framework.Console.MainLog.Instance.Verbose(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID);
100 WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID);
101 WebResponse AssetResponse = AssetLoad.GetResponse();
102 byte[] idata = new byte[(int)AssetResponse.ContentLength];
103 BinaryReader br = new BinaryReader(AssetResponse.GetResponseStream());
104 idata = br.ReadBytes((int)AssetResponse.ContentLength);
105 br.Close();
106
107 AssetBase asset = new AssetBase();
108 asset.FullID = assetID;
109 asset.Data = idata;
110 _receiver.AssetReceived(asset, req.IsTexture);
111 }
112 }
113
114 public void Close()
115 {
116
117 }
118 }
119
120 public class RemoteAssetPlugin : IAssetPlugin
121 {
122 public RemoteAssetPlugin()
123 {
124
125 }
126
127 public IAssetServer GetAssetServer()
128 {
129 return (new RemoteAssetServer());
130 }
131 }
132
133}