aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/IAssetCache.cs5
-rw-r--r--OpenSim/Framework/IClientAPI.cs14
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs13
-rw-r--r--OpenSim/Framework/OutboundUrlFilter.cs14
-rw-r--r--OpenSim/Framework/PhysicsInertia.cs262
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs64
-rw-r--r--OpenSim/Framework/RegionInfo.cs4
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs17
-rw-r--r--OpenSim/Framework/Util.cs51
-rw-r--r--OpenSim/Framework/WearableCacheItem.cs3
10 files changed, 421 insertions, 26 deletions
diff --git a/OpenSim/Framework/IAssetCache.cs b/OpenSim/Framework/IAssetCache.cs
index 8477116..2df9199 100644
--- a/OpenSim/Framework/IAssetCache.cs
+++ b/OpenSim/Framework/IAssetCache.cs
@@ -47,8 +47,9 @@ namespace OpenSim.Framework
47 /// Get an asset by its id. 47 /// Get an asset by its id.
48 /// </summary> 48 /// </summary>
49 /// <param name='id'></param> 49 /// <param name='id'></param>
50 /// <returns>null if the asset does not exist.</returns> 50 /// <param name='asset'>Will be set to null if no asset was found</param>
51 AssetBase Get(string id); 51 /// <returns>False if the asset has been negative-cached</returns>
52 bool Get(string id, out AssetBase asset);
52 53
53 /// <summary> 54 /// <summary>
54 /// Check whether an asset with the specified id exists in the cache. 55 /// Check whether an asset with the specified id exists in the cache.
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1267993..5ca8c88 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Framework
107 public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); 107 public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
108 108
109 public delegate void DeRezObject( 109 public delegate void DeRezObject(
110 IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID); 110 IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID, bool AddToReturns = true);
111 111
112 public delegate void GenericCall5(IClientAPI remoteClient, bool status); 112 public delegate void GenericCall5(IClientAPI remoteClient, bool status);
113 113
@@ -685,9 +685,10 @@ namespace OpenSim.Framework
685 ExtraData = 1 << 20, 685 ExtraData = 1 << 20,
686 Sound = 1 << 21, 686 Sound = 1 << 21,
687 Joint = 1 << 22, 687 Joint = 1 << 22,
688 FullUpdate = 0x3fffffff, 688 FullUpdate = 0x0fffffff,
689 CancelKill = 0x7fffffff, 689 SendInTransit = 0x20000000,
690 Kill = 0x80000000 690 CancelKill = 0x4fffffff, // 1 << 30
691 Kill = 0x80000000 // 1 << 31
691 } 692 }
692 693
693/* included in .net 4.0 694/* included in .net 4.0
@@ -1112,7 +1113,7 @@ namespace OpenSim.Framework
1112 /// <param name="localID"></param> 1113 /// <param name="localID"></param>
1113 void SendKillObject(List<uint> localID); 1114 void SendKillObject(List<uint> localID);
1114 1115
1115 void SendPartFullUpdate(ISceneEntity ent, uint? parentID); 1116// void SendPartFullUpdate(ISceneEntity ent, uint? parentID);
1116 1117
1117 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); 1118 void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
1118 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); 1119 void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
@@ -1187,7 +1188,8 @@ namespace OpenSim.Framework
1187 void SetAgentThrottleSilent(int throttle, int setting); 1188 void SetAgentThrottleSilent(int throttle, int setting);
1188 int GetAgentThrottleSilent(int throttle); 1189 int GetAgentThrottleSilent(int throttle);
1189 1190
1190 void SendAvatarDataImmediate(ISceneEntity avatar); 1191 void SendEntityFullUpdateImmediate(ISceneEntity entity);
1192 void SendEntityTerseUpdateImmediate(ISceneEntity entity);
1191 1193
1192 /// <summary> 1194 /// <summary>
1193 /// Send a positional, velocity, etc. update to the viewer for a given entity. 1195 /// Send a positional, velocity, etc. update to the viewer for a given entity.
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 55c3276..a6b341f 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Framework.Monitoring
47 // Subcommand used to list other stats. 47 // Subcommand used to list other stats.
48 public const string ListSubCommand = "list"; 48 public const string ListSubCommand = "list";
49 49
50 public static string StatsPassword { get; set; }
51
50 // All subcommands 52 // All subcommands
51 public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand }; 53 public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand };
52 54
@@ -302,6 +304,17 @@ namespace OpenSim.Framework.Monitoring
302 int response_code = 200; 304 int response_code = 200;
303 string contenttype = "text/json"; 305 string contenttype = "text/json";
304 306
307 if (StatsPassword != String.Empty && (!request.ContainsKey("pass") || request["pass"].ToString() != StatsPassword))
308 {
309 responsedata["int_response_code"] = response_code;
310 responsedata["content_type"] = "text/plain";
311 responsedata["keepalive"] = false;
312 responsedata["str_response_string"] = "Access denied";
313 responsedata["access_control_allow_origin"] = "*";
314
315 return responsedata;
316 }
317
305 string pCategoryName = StatsManager.AllSubCommand; 318 string pCategoryName = StatsManager.AllSubCommand;
306 string pContainerName = StatsManager.AllSubCommand; 319 string pContainerName = StatsManager.AllSubCommand;
307 string pStatName = StatsManager.AllSubCommand; 320 string pStatName = StatsManager.AllSubCommand;
diff --git a/OpenSim/Framework/OutboundUrlFilter.cs b/OpenSim/Framework/OutboundUrlFilter.cs
index ee4707f..63ae361 100644
--- a/OpenSim/Framework/OutboundUrlFilter.cs
+++ b/OpenSim/Framework/OutboundUrlFilter.cs
@@ -212,7 +212,17 @@ namespace OpenSim.Framework
212 // Check that we are permitted to make calls to this endpoint. 212 // Check that we are permitted to make calls to this endpoint.
213 bool foundIpv4Address = false; 213 bool foundIpv4Address = false;
214 214
215 IPAddress[] addresses = Dns.GetHostAddresses(url.Host); 215 IPAddress[] addresses = null;
216
217 try
218 {
219 addresses = Dns.GetHostAddresses(url.Host);
220 }
221 catch
222 {
223 // If there is a DNS error, we can't stop the script!
224 return true;
225 }
216 226
217 foreach (IPAddress addr in addresses) 227 foreach (IPAddress addr in addresses)
218 { 228 {
@@ -253,4 +263,4 @@ namespace OpenSim.Framework
253 return allowed; 263 return allowed;
254 } 264 }
255 } 265 }
256} \ No newline at end of file 266}
diff --git a/OpenSim/Framework/PhysicsInertia.cs b/OpenSim/Framework/PhysicsInertia.cs
new file mode 100644
index 0000000..af70634
--- /dev/null
+++ b/OpenSim/Framework/PhysicsInertia.cs
@@ -0,0 +1,262 @@
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
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using System.Text;
32using System.IO;
33using System.Xml;
34
35namespace OpenSim.Framework
36{
37 public class PhysicsInertiaData
38 {
39 public float TotalMass; // the total mass of a linkset
40 public Vector3 CenterOfMass; // the center of mass position relative to root part position
41 public Vector3 Inertia; // (Ixx, Iyy, Izz) moment of inertia relative to center of mass and principal axis in local coords
42 public Vector4 InertiaRotation; // if principal axis don't match local axis, the principal axis rotation
43 // or the upper triangle of the inertia tensor
44 // Ixy (= Iyx), Ixz (= Izx), Iyz (= Izy))
45
46 public PhysicsInertiaData()
47 {
48 }
49
50 public PhysicsInertiaData(PhysicsInertiaData source)
51 {
52 TotalMass = source.TotalMass;
53 CenterOfMass = source.CenterOfMass;
54 Inertia = source.Inertia;
55 InertiaRotation = source.InertiaRotation;
56 }
57
58 private XmlTextWriter writer;
59
60 private void XWint(string name, int i)
61 {
62 writer.WriteElementString(name, i.ToString());
63 }
64
65 private void XWfloat(string name, float f)
66 {
67 writer.WriteElementString(name, f.ToString(Utils.EnUsCulture));
68 }
69
70 private void XWVector(string name, Vector3 vec)
71 {
72 writer.WriteStartElement(name);
73 writer.WriteElementString("X", vec.X.ToString(Utils.EnUsCulture));
74 writer.WriteElementString("Y", vec.Y.ToString(Utils.EnUsCulture));
75 writer.WriteElementString("Z", vec.Z.ToString(Utils.EnUsCulture));
76 writer.WriteEndElement();
77 }
78
79 private void XWVector4(string name, Vector4 quat)
80 {
81 writer.WriteStartElement(name);
82 writer.WriteElementString("X", quat.X.ToString(Utils.EnUsCulture));
83 writer.WriteElementString("Y", quat.Y.ToString(Utils.EnUsCulture));
84 writer.WriteElementString("Z", quat.Z.ToString(Utils.EnUsCulture));
85 writer.WriteElementString("W", quat.W.ToString(Utils.EnUsCulture));
86 writer.WriteEndElement();
87 }
88
89 public void ToXml2(XmlTextWriter twriter)
90 {
91 writer = twriter;
92 writer.WriteStartElement("PhysicsInertia");
93
94 XWfloat("MASS", TotalMass);
95 XWVector("CM", CenterOfMass);
96 XWVector("INERTIA", Inertia);
97 XWVector4("IROT", InertiaRotation);
98
99 writer.WriteEndElement();
100 writer = null;
101 }
102
103 XmlReader reader;
104
105 private int XRint()
106 {
107 return reader.ReadElementContentAsInt();
108 }
109
110 private float XRfloat()
111 {
112 return reader.ReadElementContentAsFloat();
113 }
114
115 public Vector3 XRvector()
116 {
117 Vector3 vec;
118 reader.ReadStartElement();
119 vec.X = reader.ReadElementContentAsFloat();
120 vec.Y = reader.ReadElementContentAsFloat();
121 vec.Z = reader.ReadElementContentAsFloat();
122 reader.ReadEndElement();
123 return vec;
124 }
125
126 public Vector4 XRVector4()
127 {
128 Vector4 q;
129 reader.ReadStartElement();
130 q.X = reader.ReadElementContentAsFloat();
131 q.Y = reader.ReadElementContentAsFloat();
132 q.Z = reader.ReadElementContentAsFloat();
133 q.W = reader.ReadElementContentAsFloat();
134 reader.ReadEndElement();
135 return q;
136 }
137
138 public static bool EReadProcessors(
139 Dictionary<string, Action> processors,
140 XmlReader xtr)
141 {
142 bool errors = false;
143
144 string nodeName = string.Empty;
145 while (xtr.NodeType != XmlNodeType.EndElement)
146 {
147 nodeName = xtr.Name;
148
149 Action p = null;
150 if (processors.TryGetValue(xtr.Name, out p))
151 {
152 try
153 {
154 p();
155 }
156 catch
157 {
158 errors = true;
159 if (xtr.NodeType == XmlNodeType.EndElement)
160 xtr.Read();
161 }
162 }
163 else
164 {
165 xtr.ReadOuterXml(); // ignore
166 }
167 }
168
169 return errors;
170 }
171
172 public string ToXml2()
173 {
174 using (StringWriter sw = new StringWriter())
175 {
176 using (XmlTextWriter xwriter = new XmlTextWriter(sw))
177 {
178 ToXml2(xwriter);
179 }
180
181 return sw.ToString();
182 }
183 }
184
185 public static PhysicsInertiaData FromXml2(string text)
186 {
187 if (text == String.Empty)
188 return null;
189
190 UTF8Encoding enc = new UTF8Encoding();
191 MemoryStream ms = new MemoryStream(enc.GetBytes(text));
192 XmlTextReader xreader = new XmlTextReader(ms);
193
194 PhysicsInertiaData v = new PhysicsInertiaData();
195 bool error;
196
197 v.FromXml2(xreader, out error);
198
199 xreader.Close();
200
201 if (error)
202 return null;
203
204 return v;
205 }
206
207 public static PhysicsInertiaData FromXml2(XmlReader reader)
208 {
209 PhysicsInertiaData data = new PhysicsInertiaData();
210
211 bool errors = false;
212
213 data.FromXml2(reader, out errors);
214 if (errors)
215 return null;
216
217 return data;
218 }
219
220 private void FromXml2(XmlReader _reader, out bool errors)
221 {
222 errors = false;
223 reader = _reader;
224
225 Dictionary<string, Action> m_XmlProcessors = new Dictionary<string, Action>();
226
227 m_XmlProcessors.Add("MASS", ProcessXR_Mass);
228 m_XmlProcessors.Add("CM", ProcessXR_CM);
229 m_XmlProcessors.Add("INERTIA", ProcessXR_Inertia);
230 m_XmlProcessors.Add("IROT", ProcessXR_InertiaRotation);
231
232 reader.ReadStartElement("PhysicsInertia", String.Empty);
233
234 errors = EReadProcessors(
235 m_XmlProcessors,
236 reader);
237
238 reader.ReadEndElement();
239 reader = null;
240 }
241
242 private void ProcessXR_Mass()
243 {
244 TotalMass = XRfloat();
245 }
246
247 private void ProcessXR_CM()
248 {
249 CenterOfMass = XRvector();
250 }
251
252 private void ProcessXR_Inertia()
253 {
254 Inertia = XRvector();
255 }
256
257 private void ProcessXR_InertiaRotation()
258 {
259 InertiaRotation = XRVector4();
260 }
261 }
262}
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 29985d2..a830551 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -328,6 +328,70 @@ namespace OpenSim.Framework
328 return shape; 328 return shape;
329 } 329 }
330 330
331 public static PrimitiveBaseShape CreateMesh(int numberOfFaces, UUID meshAssetID)
332 {
333 PrimitiveBaseShape shape = new PrimitiveBaseShape();
334
335 shape._pathScaleX = 100;
336 shape._pathScaleY = 100;
337
338 if(numberOfFaces <= 0) // oops ?
339 numberOfFaces = 1;
340
341 switch(numberOfFaces)
342 {
343 case 1: // torus
344 shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
345 shape.PathCurve = (byte)Extrusion.Curve1;
346 break;
347
348 case 2: // torus with hollow (a sl viewer whould see 4 faces on a hollow sphere)
349 shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
350 shape.PathCurve = (byte)Extrusion.Curve1;
351 shape.ProfileHollow = 1;
352 break;
353
354 case 3: // cylinder
355 shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
356 shape.PathCurve = (byte)Extrusion.Straight;
357 break;
358
359 case 4: // cylinder with hollow
360 shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
361 shape.PathCurve = (byte)Extrusion.Straight;
362 shape.ProfileHollow = 1;
363 break;
364
365 case 5: // prism
366 shape.ProfileCurve = (byte)ProfileShape.EquilateralTriangle | (byte)HollowShape.Triangle;
367 shape.PathCurve = (byte)Extrusion.Straight;
368 break;
369
370 case 6: // box
371 shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
372 shape.PathCurve = (byte)Extrusion.Straight;
373 break;
374
375 case 7: // box with hollow
376 shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
377 shape.PathCurve = (byte)Extrusion.Straight;
378 shape.ProfileHollow = 1;
379 break;
380
381 default: // 8 faces box with cut
382 shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
383 shape.PathCurve = (byte)Extrusion.Straight;
384 shape.ProfileBegin = 1;
385 break;
386 }
387
388 shape.SculptEntry = true;
389 shape.SculptType = (byte)OpenMetaverse.SculptType.Mesh;
390 shape.SculptTexture = meshAssetID;
391
392 return shape;
393 }
394
331 public void SetScale(float side) 395 public void SetScale(float side)
332 { 396 {
333 _scale = new Vector3(side, side, side); 397 _scale = new Vector3(side, side, side);
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 99e97e8..7de8c52 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Framework
130 private float m_physPrimMin = 0; 130 private float m_physPrimMin = 0;
131 private int m_physPrimMax = 0; 131 private int m_physPrimMax = 0;
132 private bool m_clampPrimSize = false; 132 private bool m_clampPrimSize = false;
133 private int m_objectCapacity = 0; 133 private int m_objectCapacity = 15000;
134 private int m_maxPrimsPerUser = -1; 134 private int m_maxPrimsPerUser = -1;
135 private int m_linksetCapacity = 0; 135 private int m_linksetCapacity = 0;
136 private string m_regionType = String.Empty; 136 private string m_regionType = String.Empty;
@@ -753,7 +753,7 @@ namespace OpenSim.Framework
753 m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); 753 m_clampPrimSize = config.GetBoolean("ClampPrimSize", false);
754 allKeys.Remove("ClampPrimSize"); 754 allKeys.Remove("ClampPrimSize");
755 755
756 m_objectCapacity = config.GetInt("MaxPrims", 15000); 756 m_objectCapacity = config.GetInt("MaxPrims", m_objectCapacity);
757 allKeys.Remove("MaxPrims"); 757 allKeys.Remove("MaxPrims");
758 758
759 m_maxPrimsPerUser = config.GetInt("MaxPrimsPerUser", -1); 759 m_maxPrimsPerUser = config.GetInt("MaxPrimsPerUser", -1);
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index 8965e71..f627ae6 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers
57 57
58 protected OpenSimAppender m_consoleAppender; 58 protected OpenSimAppender m_consoleAppender;
59 protected FileAppender m_logFileAppender; 59 protected FileAppender m_logFileAppender;
60 protected FileAppender m_statsLogFileAppender;
60 61
61 protected DateTime m_startuptime; 62 protected DateTime m_startuptime;
62 protected string m_startupDirectory = Environment.CurrentDirectory; 63 protected string m_startupDirectory = Environment.CurrentDirectory;
@@ -156,6 +157,10 @@ namespace OpenSim.Framework.Servers
156 { 157 {
157 m_logFileAppender = (FileAppender)appender; 158 m_logFileAppender = (FileAppender)appender;
158 } 159 }
160 else if (appender.Name == "StatsLogFileAppender")
161 {
162 m_statsLogFileAppender = (FileAppender)appender;
163 }
159 } 164 }
160 165
161 if (null == m_consoleAppender) 166 if (null == m_consoleAppender)
@@ -185,6 +190,18 @@ namespace OpenSim.Framework.Servers
185 190
186 m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File); 191 m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File);
187 } 192 }
193
194 if (m_statsLogFileAppender != null && startupConfig != null)
195 {
196 string cfgStatsFileName = startupConfig.GetString("StatsLogFile", null);
197 if (cfgStatsFileName != null)
198 {
199 m_statsLogFileAppender.File = cfgStatsFileName;
200 m_statsLogFileAppender.ActivateOptions();
201 }
202
203 m_log.InfoFormat("[SERVER BASE]: Stats Logging started to file {0}", m_statsLogFileAppender.File);
204 }
188 } 205 }
189 206
190 /// <summary> 207 /// <summary>
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 6d679f2..0ec24e6 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -63,22 +63,34 @@ namespace OpenSim.Framework
63 None = 0, 63 None = 0,
64 64
65 // folded perms 65 // folded perms
66 foldedTransfer = 1, 66 FoldedTransfer = 1,
67 foldedModify = 1 << 1, 67 FoldedModify = 1 << 1,
68 foldedCopy = 1 << 2, 68 FoldedCopy = 1 << 2,
69 69 FoldedExport = 1 << 3,
70 foldedMask = 0x07, 70
71 // DO NOT USE THIS FOR NEW WORK. IT IS DEPRECATED AND
72 // EXISTS ONLY TO REACT TO EXISTING OBJECTS HAVING IT.
73 // NEW CODE SHOULD NEVER SET THIS BIT!
74 // Use InventoryItemFlags.ObjectSlamPerm in the Flags field of
75 // this legacy slam bit. It comes from prior incomplete
76 // understanding of the code and the prohibition on
77 // reading viewer code that used to be in place.
78 Slam = (1 << 4),
79
80 FoldedMask = 0x0f,
71 81
72 // 82 //
73 Transfer = 1 << 13, 83 Transfer = 1 << 13, // 0x02000
74 Modify = 1 << 14, 84 Modify = 1 << 14, // 0x04000
75 Copy = 1 << 15, 85 Copy = 1 << 15, // 0x08000
76 Export = 1 << 16, 86 Export = 1 << 16, // 0x10000
77 Move = 1 << 19, 87 Move = 1 << 19, // 0x80000
78 Damage = 1 << 20, 88 Damage = 1 << 20, // 0x100000 does not seem to be in use
79 // All does not contain Export, which is special and must be 89 // All does not contain Export, which is special and must be
80 // explicitly given 90 // explicitly given
81 All = (1 << 13) | (1 << 14) | (1 << 15) | (1 << 19) 91 All = 0x8e000,
92 AllAndExport = 0x9e000,
93 AllEffective = 0x9e000
82 } 94 }
83 95
84 /// <summary> 96 /// <summary>
@@ -1180,7 +1192,7 @@ namespace OpenSim.Framework
1180 { 1192 {
1181 foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) 1193 foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
1182 { 1194 {
1183 if (appender is FileAppender) 1195 if (appender is FileAppender && appender.Name == "LogFileAppender")
1184 { 1196 {
1185 return ((FileAppender)appender).File; 1197 return ((FileAppender)appender).File;
1186 } 1198 }
@@ -1189,6 +1201,19 @@ namespace OpenSim.Framework
1189 return "./OpenSim.log"; 1201 return "./OpenSim.log";
1190 } 1202 }
1191 1203
1204 public static string statsLogFile()
1205 {
1206 foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
1207 {
1208 if (appender is FileAppender && appender.Name == "StatsLogFileAppender")
1209 {
1210 return ((FileAppender)appender).File;
1211 }
1212 }
1213
1214 return "./OpenSimStats.log";
1215 }
1216
1192 public static string logDir() 1217 public static string logDir()
1193 { 1218 {
1194 return Path.GetDirectoryName(logFile()); 1219 return Path.GetDirectoryName(logFile());
diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs
index ccaf69e..427e149 100644
--- a/OpenSim/Framework/WearableCacheItem.cs
+++ b/OpenSim/Framework/WearableCacheItem.cs
@@ -113,7 +113,8 @@ namespace OpenSim.Framework
113 { 113 {
114 if (dataCache.Check(item.TextureID.ToString())) 114 if (dataCache.Check(item.TextureID.ToString()))
115 { 115 {
116 AssetBase assetItem = dataCache.Get(item.TextureID.ToString()); 116 AssetBase assetItem;
117 dataCache.Get(item.TextureID.ToString(), out assetItem);
117 if (assetItem != null) 118 if (assetItem != null)
118 { 119 {
119 itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data)); 120 itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data));