opensim-development – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 eva 1 /*
2 * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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 using System;
29 using OpenMetaverse;
30  
31 namespace OpenSim.Framework
32 {
33 /// <summary>
34 /// Inventory Item - contains all the properties associated with an individual inventory piece.
35 /// </summary>
36 public class InventoryItemBase : InventoryNodeBase, ICloneable
37 {
38 /// <value>
39 /// The inventory type of the item. This is slightly different from the asset type in some situations.
40 /// </value>
41 public int InvType
42 {
43 get
44 {
45 return m_invType;
46 }
47  
48 set
49 {
50 m_invType = value;
51 }
52 }
53 protected int m_invType;
54  
55 /// <value>
56 /// The folder this item is contained in
57 /// </value>
58 public UUID Folder
59 {
60 get
61 {
62 return m_folder;
63 }
64  
65 set
66 {
67 m_folder = value;
68 }
69 }
70 protected UUID m_folder;
71  
72 /// <value>
73 /// The creator of this item
74 /// </value>
75 public string CreatorId
76 {
77 get
78 {
79 return m_creatorId;
80 }
81  
82 set
83 {
84 m_creatorId = value;
85 }
86 }
87 protected string m_creatorId;
88  
89 /// <value>
90 /// The CreatorId expressed as a UUID.tely
91 /// </value>
92 public UUID CreatorIdAsUuid
93 {
94 get
95 {
96 if (UUID.Zero == m_creatorIdAsUuid)
97 {
98 UUID.TryParse(CreatorId, out m_creatorIdAsUuid);
99 }
100  
101 return m_creatorIdAsUuid;
102 }
103 }
104 protected UUID m_creatorIdAsUuid = UUID.Zero;
105  
106 /// <summary>
107 /// Extended creator information of the form <profile url>;<name>
108 /// </summary>
109 public string CreatorData // = <profile url>;<name>
110 {
111 get { return m_creatorData; }
112 set { m_creatorData = value; }
113 }
114 protected string m_creatorData = string.Empty;
115  
116 /// <summary>
117 /// Used by the DB layer to retrieve / store the entire user identification.
118 /// The identification can either be a simple UUID or a string of the form
119 /// uuid[;profile_url[;name]]
120 /// </summary>
121 public string CreatorIdentification
122 {
123 get
124 {
125 if (!string.IsNullOrEmpty(m_creatorData))
126 return m_creatorId + ';' + m_creatorData;
127 else
128 return m_creatorId;
129 }
130 set
131 {
132 if ((value == null) || (value != null && value == string.Empty))
133 {
134 m_creatorData = string.Empty;
135 return;
136 }
137  
138 if (!value.Contains(";")) // plain UUID
139 {
140 m_creatorId = value;
141 }
142 else // <uuid>[;<endpoint>[;name]]
143 {
144 string name = "Unknown User";
145 string[] parts = value.Split(';');
146 if (parts.Length >= 1)
147 m_creatorId = parts[0];
148 if (parts.Length >= 2)
149 m_creatorData = parts[1];
150 if (parts.Length >= 3)
151 name = parts[2];
152  
153 m_creatorData += ';' + name;
154 }
155 }
156 }
157  
158 /// <value>
159 /// The description of the inventory item (must be less than 64 characters)
160 /// </value>
161 public string Description
162 {
163 get
164 {
165 return m_description;
166 }
167  
168 set
169 {
170 m_description = value;
171 }
172 }
173 protected string m_description = String.Empty;
174  
175 /// <value>
176 ///
177 /// </value>
178 public uint NextPermissions
179 {
180 get
181 {
182 return m_nextPermissions;
183 }
184  
185 set
186 {
187 m_nextPermissions = value;
188 }
189 }
190 protected uint m_nextPermissions;
191  
192 /// <value>
193 /// A mask containing permissions for the current owner (cannot be enforced)
194 /// </value>
195 public uint CurrentPermissions
196 {
197 get
198 {
199 return m_currentPermissions;
200 }
201  
202 set
203 {
204 m_currentPermissions = value;
205 }
206 }
207 protected uint m_currentPermissions;
208  
209 /// <value>
210 ///
211 /// </value>
212 public uint BasePermissions
213 {
214 get
215 {
216 return m_basePermissions;
217 }
218  
219 set
220 {
221 m_basePermissions = value;
222 }
223 }
224 protected uint m_basePermissions;
225  
226 /// <value>
227 ///
228 /// </value>
229 public uint EveryOnePermissions
230 {
231 get
232 {
233 return m_everyonePermissions;
234 }
235  
236 set
237 {
238 m_everyonePermissions = value;
239 }
240 }
241 protected uint m_everyonePermissions;
242  
243 /// <value>
244 ///
245 /// </value>
246 public uint GroupPermissions
247 {
248 get
249 {
250 return m_groupPermissions;
251 }
252  
253 set
254 {
255 m_groupPermissions = value;
256 }
257 }
258 protected uint m_groupPermissions;
259  
260 /// <value>
261 /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
262 /// </value>
263 public int AssetType
264 {
265 get
266 {
267 return m_assetType;
268 }
269  
270 set
271 {
272 m_assetType = value;
273 }
274 }
275 protected int m_assetType;
276  
277 /// <value>
278 /// The UUID of the associated asset on the asset server
279 /// </value>
280 public UUID AssetID
281 {
282 get
283 {
284 return m_assetID;
285 }
286  
287 set
288 {
289 m_assetID = value;
290 }
291 }
292 protected UUID m_assetID;
293  
294 /// <value>
295 ///
296 /// </value>
297 public UUID GroupID
298 {
299 get
300 {
301 return m_groupID;
302 }
303  
304 set
305 {
306 m_groupID = value;
307 }
308 }
309 protected UUID m_groupID;
310  
311 /// <value>
312 ///
313 /// </value>
314 public bool GroupOwned
315 {
316 get
317 {
318 return m_groupOwned;
319 }
320  
321 set
322 {
323 m_groupOwned = value;
324 }
325 }
326 protected bool m_groupOwned;
327  
328 /// <value>
329 ///
330 /// </value>
331 public int SalePrice
332 {
333 get
334 {
335 return m_salePrice;
336 }
337  
338 set
339 {
340 m_salePrice = value;
341 }
342 }
343 protected int m_salePrice;
344  
345 /// <value>
346 ///
347 /// </value>
348 public byte SaleType
349 {
350 get
351 {
352 return m_saleType;
353 }
354  
355 set
356 {
357 m_saleType = value;
358 }
359 }
360 protected byte m_saleType;
361  
362 /// <value>
363 ///
364 /// </value>
365 public uint Flags
366 {
367 get
368 {
369 return m_flags;
370 }
371  
372 set
373 {
374 m_flags = value;
375 }
376 }
377 protected uint m_flags;
378  
379 /// <value>
380 ///
381 /// </value>
382 public int CreationDate
383 {
384 get
385 {
386 return m_creationDate;
387 }
388  
389 set
390 {
391 m_creationDate = value;
392 }
393 }
394 protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
395  
396 public InventoryItemBase()
397 {
398 }
399  
400 public InventoryItemBase(UUID id)
401 {
402 ID = id;
403 }
404  
405 public InventoryItemBase(UUID id, UUID owner)
406 {
407 ID = id;
408 Owner = owner;
409 }
410  
411 public object Clone()
412 {
413 return MemberwiseClone();
414 }
415 }
416 }