aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
6 files changed, 397 insertions, 723 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}