aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Client/Linden/LLClientStackModule.cs6
-rw-r--r--OpenSim/Data/Tests/BasicUserTest.cs12
-rw-r--r--OpenSim/Data/Tests/PropertyCompareConstraint.cs298
-rw-r--r--OpenSim/Data/Tests/ScrambleForTesting.cs102
-rw-r--r--OpenSim/Framework/ACL.cs19
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs68
-rw-r--r--OpenSim/Framework/AgentUpdateArgs.cs34
-rw-r--r--OpenSim/Framework/Animation.cs30
-rw-r--r--OpenSim/Framework/AssetBase.cs29
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs7
-rw-r--r--OpenSim/Framework/AvatarPickerAvatar.cs14
-rw-r--r--OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs10
-rw-r--r--OpenSim/Framework/Culture.cs3
-rw-r--r--OpenSim/Framework/IProfileModule.cs37
-rw-r--r--OpenSim/Framework/InventoryFolderBase.cs19
-rw-r--r--OpenSim/Framework/LandData.cs129
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs6
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitDataTest.cs339
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitManagerTests.cs201
-rw-r--r--OpenSim/Framework/Tests/ThreadTrackerTests.cs192
-rw-r--r--OpenSim/Framework/ThreadTracker.cs36
-rw-r--r--OpenSim/Region/Application/Application.cs33
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs45
-rw-r--r--OpenSim/Region/Application/IApplicationPlugin.cs12
-rw-r--r--OpenSim/Region/Application/OpenSim.cs95
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs55
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs206
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs52
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs75
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs52
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs52
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs178
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs72
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs49
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs115
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs4
-rw-r--r--OpenSim/Services/Interfaces/IAssetService.cs46
-rw-r--r--OpenSim/Tests/Common/Mock/TestAssetService.cs14
-rw-r--r--OpenSim/Tests/Common/Mock/TestInventoryService.cs29
51 files changed, 2635 insertions, 261 deletions
diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs
index a964989..f882d5d 100644
--- a/OpenSim/Client/Linden/LLClientStackModule.cs
+++ b/OpenSim/Client/Linden/LLClientStackModule.cs
@@ -41,12 +41,18 @@ using OpenSim.Region.Framework.Interfaces;
41 41
42namespace OpenSim.Client.Linden 42namespace OpenSim.Client.Linden
43{ 43{
44 /// <summary>
45 /// Linden UDP Stack Region Module
46 /// </summary>
44 public class LLClientStackModule : INonSharedRegionModule 47 public class LLClientStackModule : INonSharedRegionModule
45 { 48 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 50
48 #region IRegionModule Members 51 #region IRegionModule Members
49 52
53 /// <summary>
54 /// Scene that contains the region's data
55 /// </summary>
50 protected Scene m_scene; 56 protected Scene m_scene;
51 protected bool m_createClientStack = false; 57 protected bool m_createClientStack = false;
52 protected IClientNetworkServer m_clientServer; 58 protected IClientNetworkServer m_clientServer;
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs
index d3e6f41..4e4ddc8 100644
--- a/OpenSim/Data/Tests/BasicUserTest.cs
+++ b/OpenSim/Data/Tests/BasicUserTest.cs
@@ -204,8 +204,16 @@ namespace OpenSim.Data.Tests
204 UUID webloginkey = UUID.Random(); 204 UUID webloginkey = UUID.Random();
205 uint homeregx = (uint) random.Next(); 205 uint homeregx = (uint) random.Next();
206 uint homeregy = (uint) random.Next(); 206 uint homeregy = (uint) random.Next();
207 Vector3 homeloc = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); 207 Vector3 homeloc
208 Vector3 homelookat = new Vector3((float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5),(float)Math.Round(random.NextDouble(),5)); 208 = new Vector3(
209 (float)Math.Round(random.NextDouble(), 5),
210 (float)Math.Round(random.NextDouble(), 5),
211 (float)Math.Round(random.NextDouble(), 5));
212 Vector3 homelookat
213 = new Vector3(
214 (float)Math.Round(random.NextDouble(), 5),
215 (float)Math.Round(random.NextDouble(), 5),
216 (float)Math.Round(random.NextDouble(), 5));
209 int created = random.Next(); 217 int created = random.Next();
210 int lastlogin = random.Next(); 218 int lastlogin = random.Next();
211 string userinvuri = RandomName(); 219 string userinvuri = RandomName();
diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs
new file mode 100644
index 0000000..678501e
--- /dev/null
+++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs
@@ -0,0 +1,298 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Drawing;
5using System.Linq;
6using System.Linq.Expressions;
7using System.Reflection;
8using NUnit.Framework;
9using NUnit.Framework.Constraints;
10using NUnit.Framework.SyntaxHelpers;
11using OpenMetaverse;
12using OpenSim.Framework;
13
14namespace OpenSim.Data.Tests
15{
16 public static class Constraints
17 {
18 //This is here because C# has a gap in the language, you can't infer type from a constructor
19 public static PropertyCompareConstraint<T> PropertyCompareConstraint<T>(T expected)
20 {
21 return new PropertyCompareConstraint<T>(expected);
22 }
23 }
24
25 public class PropertyCompareConstraint<T> : NUnit.Framework.Constraints.Constraint
26 {
27 private readonly object _expected;
28 //the reason everywhere uses propertyNames.Reverse().ToArray() is because the stack is backwards of the order we want to display the properties in.
29 private string failingPropertyName = string.Empty;
30 private object failingExpected;
31 private object failingActual;
32
33 public PropertyCompareConstraint(T expected)
34 {
35 _expected = expected;
36 }
37
38 public override bool Matches(object actual)
39 {
40 return ObjectCompare(_expected, actual, new Stack<string>());
41 }
42
43 private bool ObjectCompare(object expected, object actual, Stack<string> propertyNames)
44 {
45 if (actual.GetType() != expected.GetType())
46 {
47 propertyNames.Push("GetType()");
48 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
49 propertyNames.Pop();
50 failingActual = actual.GetType();
51 failingExpected = expected.GetType();
52 return false;
53 }
54
55 if(actual.GetType() == typeof(Color))
56 {
57 Color actualColor = (Color) actual;
58 Color expectedColor = (Color) expected;
59 if (actualColor.R != expectedColor.R)
60 {
61 propertyNames.Push("R");
62 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
63 propertyNames.Pop();
64 failingActual = actualColor.R;
65 failingExpected = expectedColor.R;
66 return false;
67 }
68 if (actualColor.G != expectedColor.G)
69 {
70 propertyNames.Push("G");
71 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
72 propertyNames.Pop();
73 failingActual = actualColor.G;
74 failingExpected = expectedColor.G;
75 return false;
76 }
77 if (actualColor.B != expectedColor.B)
78 {
79 propertyNames.Push("B");
80 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
81 propertyNames.Pop();
82 failingActual = actualColor.B;
83 failingExpected = expectedColor.B;
84 return false;
85 }
86 if (actualColor.A != expectedColor.A)
87 {
88 propertyNames.Push("A");
89 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
90 propertyNames.Pop();
91 failingActual = actualColor.A;
92 failingExpected = expectedColor.A;
93 return false;
94 }
95 return true;
96 }
97
98 //Skip static properties. I had a nasty problem comparing colors because of all of the public static colors.
99 PropertyInfo[] properties = expected.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
100 foreach (var property in properties)
101 {
102 if (ignores.Contains(property.Name))
103 continue;
104
105 object actualValue = property.GetValue(actual, null);
106 object expectedValue = property.GetValue(expected, null);
107
108 //If they are both null, they are equal
109 if (actualValue == null && expectedValue == null)
110 continue;
111
112 //If only one is null, then they aren't
113 if (actualValue == null || expectedValue == null)
114 {
115 propertyNames.Push(property.Name);
116 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
117 propertyNames.Pop();
118 failingActual = actualValue;
119 failingExpected = expectedValue;
120 return false;
121 }
122
123 IComparable comp = actualValue as IComparable;
124 if (comp != null)
125 {
126 if (comp.CompareTo(expectedValue) != 0)
127 {
128 propertyNames.Push(property.Name);
129 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
130 propertyNames.Pop();
131 failingActual = actualValue;
132 failingExpected = expectedValue;
133 return false;
134 }
135 continue;
136 }
137
138 IEnumerable arr = actualValue as IEnumerable;
139 if (arr != null)
140 {
141 List<object> actualList = arr.Cast<object>().ToList();
142 List<object> expectedList = ((IEnumerable)expectedValue).Cast<object>().ToList();
143 if (actualList.Count != expectedList.Count)
144 {
145 propertyNames.Push(property.Name);
146 propertyNames.Push("Count");
147 failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
148 failingActual = actualList.Count;
149 failingExpected = expectedList.Count;
150 propertyNames.Pop();
151 propertyNames.Pop();
152 }
153 //Todo: A value-wise comparison of all of the values.
154 //Everything seems okay...
155 continue;
156 }
157
158 propertyNames.Push(property.Name);
159 if (!ObjectCompare(expectedValue, actualValue, propertyNames))
160 return false;
161 propertyNames.Pop();
162 }
163
164 return true;
165 }
166
167 public override void WriteDescriptionTo(MessageWriter writer)
168 {
169 writer.WriteExpectedValue(failingExpected);
170 }
171
172 public override void WriteActualValueTo(MessageWriter writer)
173 {
174 writer.WriteActualValue(failingActual);
175 writer.WriteLine();
176 writer.Write(" On Property: " + failingPropertyName);
177 }
178
179 //These notes assume the lambda: (x=>x.Parent.Value)
180 //ignores should really contain like a fully dotted version of the property name, but I'm starting with small steps
181 readonly List<string> ignores = new List<string>();
182 public PropertyCompareConstraint<T> IgnoreProperty(Expression<Func<T, object>> func)
183 {
184 Expression express = func.Body;
185 PullApartExpression(express);
186
187 return this;
188 }
189
190 private void PullApartExpression(Expression express)
191 {
192 //This deals with any casts... like implicit casts to object. Not all UnaryExpression are casts, but this is a first attempt.
193 if (express is UnaryExpression)
194 PullApartExpression(((UnaryExpression)express).Operand);
195 if (express is MemberExpression)
196 {
197 //If the inside of the lambda is the access to x, we've hit the end of the chain.
198 // We should track by the fully scoped parameter name, but this is the first rev of doing this.
199 if (((MemberExpression)express).Expression is ParameterExpression)
200 {
201 ignores.Add(((MemberExpression)express).Member.Name);
202 }
203 else
204 {
205 //Otherwise there could be more parameters inside...
206 PullApartExpression(((MemberExpression)express).Expression);
207 }
208 }
209 }
210 }
211
212 [TestFixture]
213 public class PropertyCompareConstraintTest
214 {
215 public class HasInt
216 {
217 public int TheValue { get; set; }
218 }
219
220 [Test]
221 public void IntShouldMatch()
222 {
223 HasInt actual = new HasInt { TheValue = 5 };
224 HasInt expected = new HasInt { TheValue = 5 };
225 var constraint = Constraints.PropertyCompareConstraint(expected);
226
227 Assert.That(constraint.Matches(actual), Is.True);
228 }
229
230 [Test]
231 public void IntShouldNotMatch()
232 {
233 HasInt actual = new HasInt { TheValue = 5 };
234 HasInt expected = new HasInt { TheValue = 4 };
235 var constraint = Constraints.PropertyCompareConstraint(expected);
236
237 Assert.That(constraint.Matches(actual), Is.False);
238 }
239
240
241 [Test]
242 public void IntShouldIgnore()
243 {
244 HasInt actual = new HasInt { TheValue = 5 };
245 HasInt expected = new HasInt { TheValue = 4 };
246 var constraint = Constraints.PropertyCompareConstraint(expected).IgnoreProperty(x=>x.TheValue);
247
248 Assert.That(constraint.Matches(actual), Is.True);
249 }
250
251 [Test]
252 public void AssetShouldMatch()
253 {
254 UUID uuid1 = UUID.Random();
255 AssetBase actual = new AssetBase(uuid1, "asset one");
256 AssetBase expected = new AssetBase(uuid1, "asset one");
257
258 var constraint = Constraints.PropertyCompareConstraint(expected);
259
260 Assert.That(constraint.Matches(actual), Is.True);
261 }
262
263 [Test]
264 public void AssetShouldNotMatch()
265 {
266 UUID uuid1 = UUID.Random();
267 AssetBase actual = new AssetBase(uuid1, "asset one");
268 AssetBase expected = new AssetBase(UUID.Random(), "asset one");
269
270 var constraint = Constraints.PropertyCompareConstraint(expected);
271
272 Assert.That(constraint.Matches(actual), Is.False);
273 }
274
275 [Test]
276 public void AssetShouldNotMatch2()
277 {
278 UUID uuid1 = UUID.Random();
279 AssetBase actual = new AssetBase(uuid1, "asset one");
280 AssetBase expected = new AssetBase(uuid1, "asset two");
281
282 var constraint = Constraints.PropertyCompareConstraint(expected);
283
284 Assert.That(constraint.Matches(actual), Is.False);
285 }
286
287 [Test]
288 public void TestColors()
289 {
290 Color actual = Color.Red;
291 Color expected = Color.FromArgb(actual.A, actual.R, actual.G, actual.B);
292
293 var constraint = Constraints.PropertyCompareConstraint(expected);
294
295 Assert.That(constraint.Matches(actual), Is.True);
296 }
297 }
298} \ No newline at end of file
diff --git a/OpenSim/Data/Tests/ScrambleForTesting.cs b/OpenSim/Data/Tests/ScrambleForTesting.cs
new file mode 100644
index 0000000..c6e467f
--- /dev/null
+++ b/OpenSim/Data/Tests/ScrambleForTesting.cs
@@ -0,0 +1,102 @@
1using System;
2using System.Collections;
3using System.Reflection;
4using System.Text;
5using NUnit.Framework;
6using OpenMetaverse;
7using OpenSim.Framework;
8
9namespace OpenSim.Data.Tests
10{
11 public static class ScrambleForTesting
12 {
13 private static readonly Random random = new Random();
14 public static void Scramble(object obj)
15 {
16 PropertyInfo[] properties = obj.GetType().GetProperties();
17 foreach (var property in properties)
18 {
19 //Skip indexers of classes. We will assume that everything that has an indexer
20 // is also IEnumberable. May not always be true, but should be true normally.
21 if(property.GetIndexParameters().Length > 0)
22 continue;
23
24 RandomizeProperty(obj, property, null);
25 }
26 //Now if it implments IEnumberable, it's probably some kind of list, so we should randomize
27 // everything inside of it.
28 IEnumerable enumerable = obj as IEnumerable;
29 if(enumerable != null)
30 {
31 foreach (object value in enumerable)
32 {
33 Scramble(value);
34 }
35 }
36 }
37
38 private static void RandomizeProperty(object obj, PropertyInfo property, object[] index)
39 {
40 Type t = property.PropertyType;
41 if (!property.CanWrite)
42 return;
43 object value = property.GetValue(obj, index);
44 if (value == null)
45 return;
46
47 if (t == typeof (string))
48 property.SetValue(obj, RandomName(), index);
49 else if (t == typeof (UUID))
50 property.SetValue(obj, UUID.Random(), index);
51 else if (t == typeof (sbyte))
52 property.SetValue(obj, (sbyte)random.Next(sbyte.MinValue, sbyte.MaxValue), index);
53 else if (t == typeof (short))
54 property.SetValue(obj, (short)random.Next(short.MinValue, short.MaxValue), index);
55 else if (t == typeof (int))
56 property.SetValue(obj, random.Next(), index);
57 else if (t == typeof (long))
58 property.SetValue(obj, random.Next() * int.MaxValue, index);
59 else if (t == typeof (byte))
60 property.SetValue(obj, (byte)random.Next(byte.MinValue, byte.MaxValue), index);
61 else if (t == typeof (ushort))
62 property.SetValue(obj, (ushort)random.Next(ushort.MinValue, ushort.MaxValue), index);
63 else if (t == typeof (uint))
64 property.SetValue(obj, Convert.ToUInt32(random.Next()), index);
65 else if (t == typeof (ulong))
66 property.SetValue(obj, Convert.ToUInt64(random.Next()) * Convert.ToUInt64(UInt32.MaxValue), index);
67 else if (t == typeof (bool))
68 property.SetValue(obj, true, index);
69 else if (t == typeof (byte[]))
70 {
71 byte[] bytes = new byte[30];
72 random.NextBytes(bytes);
73 property.SetValue(obj, bytes, index);
74 }
75 else
76 Scramble(value);
77 }
78
79 private static string RandomName()
80 {
81 StringBuilder name = new StringBuilder();
82 int size = random.Next(5, 12);
83 for (int i = 0; i < size; i++)
84 {
85 char ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
86 name.Append(ch);
87 }
88 return name.ToString();
89 }
90 }
91
92 [TestFixture]
93 public class ScrableForTestingTest
94 {
95 [Test]
96 public void TestScramble()
97 {
98 AssetBase actual = new AssetBase(UUID.Random(), "asset one");
99 ScrambleForTesting.Scramble(actual);
100 }
101 }
102} \ No newline at end of file
diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs
index 9d7827e..3b1c0f0 100644
--- a/OpenSim/Framework/ACL.cs
+++ b/OpenSim/Framework/ACL.cs
@@ -46,6 +46,11 @@ namespace OpenSim.Framework
46 private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>(); 46 private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>();
47 private Dictionary<string, Role> Roles = new Dictionary<string, Role>(); 47 private Dictionary<string, Role> Roles = new Dictionary<string, Role>();
48 48
49 /// <summary>
50 /// Adds a new role
51 /// </summary>
52 /// <param name="role"></param>
53 /// <returns></returns>
49 public ACL AddRole(Role role) 54 public ACL AddRole(Role role)
50 { 55 {
51 if (Roles.ContainsKey(role.Name)) 56 if (Roles.ContainsKey(role.Name))
@@ -56,6 +61,11 @@ namespace OpenSim.Framework
56 return this; 61 return this;
57 } 62 }
58 63
64 /// <summary>
65 /// Adds a new resource
66 /// </summary>
67 /// <param name="resource"></param>
68 /// <returns></returns>
59 public ACL AddResource(Resource resource) 69 public ACL AddResource(Resource resource)
60 { 70 {
61 Resources.Add(resource.Name, resource); 71 Resources.Add(resource.Name, resource);
@@ -63,6 +73,12 @@ namespace OpenSim.Framework
63 return this; 73 return this;
64 } 74 }
65 75
76 /// <summary>
77 /// Permision for user/roll on a resource
78 /// </summary>
79 /// <param name="role"></param>
80 /// <param name="resource"></param>
81 /// <returns></returns>
66 public Permission HasPermission(string role, string resource) 82 public Permission HasPermission(string role, string resource)
67 { 83 {
68 if (!Roles.ContainsKey(role)) 84 if (!Roles.ContainsKey(role))
@@ -234,6 +250,9 @@ namespace OpenSim.Framework
234 250
235 #region Tests 251 #region Tests
236 252
253 /// <summary>
254 /// ACL Test class
255 /// </summary>
237 internal class ACLTester 256 internal class ACLTester
238 { 257 {
239 public ACLTester() 258 public ACLTester()
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index c38f0c3..6472f31 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -32,26 +32,83 @@ using OpenMetaverse.StructuredData;
32 32
33namespace OpenSim.Framework 33namespace OpenSim.Framework
34{ 34{
35 /// <summary>
36 /// Circuit data for an agent. Connection information shared between
37 /// regions that accept UDP connections from a client
38 /// </summary>
35 public class AgentCircuitData 39 public class AgentCircuitData
36 { 40 {
41 /// <summary>
42 /// Avatar Unique Agent Identifier
43 /// </summary>
37 public UUID AgentID; 44 public UUID AgentID;
45
46 /// <summary>
47 /// Avatar's Appearance
48 /// </summary>
38 public AvatarAppearance Appearance; 49 public AvatarAppearance Appearance;
50
51 /// <summary>
52 /// Agent's root inventory folder
53 /// </summary>
39 public UUID BaseFolder; 54 public UUID BaseFolder;
55
56 /// <summary>
57 /// Base Caps path for user
58 /// </summary>
40 public string CapsPath = String.Empty; 59 public string CapsPath = String.Empty;
60
61 /// <summary>
62 /// Seed caps for neighbor regions that the user can see into
63 /// </summary>
41 public Dictionary<ulong, string> ChildrenCapSeeds; 64 public Dictionary<ulong, string> ChildrenCapSeeds;
65
66 /// <summary>
67 /// Root agent, or Child agent
68 /// </summary>
42 public bool child; 69 public bool child;
70
71 /// <summary>
72 /// Number given to the client when they log-in that they provide
73 /// as credentials to the UDP server
74 /// </summary>
43 public uint circuitcode; 75 public uint circuitcode;
76
77 /// <summary>
78 /// Agent's account first name
79 /// </summary>
44 public string firstname; 80 public string firstname;
45 public UUID InventoryFolder; 81 public UUID InventoryFolder;
82
83 /// <summary>
84 /// Agent's account last name
85 /// </summary>
46 public string lastname; 86 public string lastname;
87
88 /// <summary>
89 /// Random Unique GUID for this session. Client gets this at login and it's
90 /// only supposed to be disclosed over secure channels
91 /// </summary>
47 public UUID SecureSessionID; 92 public UUID SecureSessionID;
93
94 /// <summary>
95 /// Non secure Session ID
96 /// </summary>
48 public UUID SessionID; 97 public UUID SessionID;
98
99 /// <summary>
100 /// Position the Agent's Avatar starts in the region
101 /// </summary>
49 public Vector3 startpos; 102 public Vector3 startpos;
50 103
51 public AgentCircuitData() 104 public AgentCircuitData()
52 { 105 {
53 } 106 }
54 107
108 /// <summary>
109 /// Create AgentCircuitData from a Serializable AgentCircuitData
110 /// </summary>
111 /// <param name="cAgent"></param>
55 public AgentCircuitData(sAgentCircuitData cAgent) 112 public AgentCircuitData(sAgentCircuitData cAgent)
56 { 113 {
57 AgentID = new UUID(cAgent.AgentID); 114 AgentID = new UUID(cAgent.AgentID);
@@ -68,6 +125,10 @@ namespace OpenSim.Framework
68 ChildrenCapSeeds = cAgent.ChildrenCapSeeds; 125 ChildrenCapSeeds = cAgent.ChildrenCapSeeds;
69 } 126 }
70 127
128 /// <summary>
129 /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
130 /// </summary>
131 /// <returns>map of the agent circuit data</returns>
71 public OSDMap PackAgentCircuitData() 132 public OSDMap PackAgentCircuitData()
72 { 133 {
73 OSDMap args = new OSDMap(); 134 OSDMap args = new OSDMap();
@@ -98,6 +159,10 @@ namespace OpenSim.Framework
98 return args; 159 return args;
99 } 160 }
100 161
162 /// <summary>
163 /// Unpack agent circuit data map into an AgentCiruitData object
164 /// </summary>
165 /// <param name="args"></param>
101 public void UnpackAgentCircuitData(OSDMap args) 166 public void UnpackAgentCircuitData(OSDMap args)
102 { 167 {
103 if (args["agent_id"] != null) 168 if (args["agent_id"] != null)
@@ -150,6 +215,9 @@ namespace OpenSim.Framework
150 } 215 }
151 } 216 }
152 217
218 /// <summary>
219 /// Serializable Agent Circuit Data
220 /// </summary>
153 [Serializable] 221 [Serializable]
154 public class sAgentCircuitData 222 public class sAgentCircuitData
155 { 223 {
diff --git a/OpenSim/Framework/AgentUpdateArgs.cs b/OpenSim/Framework/AgentUpdateArgs.cs
index a19795d..7b9ec68 100644
--- a/OpenSim/Framework/AgentUpdateArgs.cs
+++ b/OpenSim/Framework/AgentUpdateArgs.cs
@@ -30,18 +30,52 @@ using OpenMetaverse;
30 30
31namespace OpenSim.Framework 31namespace OpenSim.Framework
32{ 32{
33 /// <summary>
34 /// Client provided parameters for avatar movement
35 /// </summary>
33 public class AgentUpdateArgs : EventArgs 36 public class AgentUpdateArgs : EventArgs
34 { 37 {
38 /// <summary>
39 /// Agent's unique ID
40 /// </summary>
35 public UUID AgentID; 41 public UUID AgentID;
42
43 /// <summary>
44 /// Rotation of the avatar's body
45 /// </summary>
36 public Quaternion BodyRotation; 46 public Quaternion BodyRotation;
47
48 /// <summary>
49 /// AT portion of the camera matrix
50 /// </summary>
37 public Vector3 CameraAtAxis; 51 public Vector3 CameraAtAxis;
52
53 /// <summary>
54 /// Position of the camera in the Scene
55 /// </summary>
38 public Vector3 CameraCenter; 56 public Vector3 CameraCenter;
39 public Vector3 CameraLeftAxis; 57 public Vector3 CameraLeftAxis;
40 public Vector3 CameraUpAxis; 58 public Vector3 CameraUpAxis;
59
60 /// <summary>
61 /// Bitflag field for agent movement. Fly, forward, backward, turn left, turn right, go up, go down, Straffe, etc.
62 /// </summary>
41 public uint ControlFlags; 63 public uint ControlFlags;
64
65 /// <summary>
66 /// Agent's client Draw distance setting
67 /// </summary>
42 public float Far; 68 public float Far;
43 public byte Flags; 69 public byte Flags;
70
71 /// <summary>
72 /// Rotation of the avatar's head
73 /// </summary>
44 public Quaternion HeadRotation; 74 public Quaternion HeadRotation;
75
76 /// <summary>
77 /// Session Id
78 /// </summary>
45 public UUID SessionID; 79 public UUID SessionID;
46 public byte State; 80 public byte State;
47 } 81 }
diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs
index 9f86513..232f5a1 100644
--- a/OpenSim/Framework/Animation.cs
+++ b/OpenSim/Framework/Animation.cs
@@ -31,10 +31,17 @@ using OpenMetaverse.StructuredData;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 /// <summary>
35 /// Information about an Animation
36 /// </summary>
34 [Serializable] 37 [Serializable]
35 public class Animation 38 public class Animation
36 { 39 {
37 private UUID animID; 40 private UUID animID;
41
42 /// <summary>
43 /// ID of Animation
44 /// </summary>
38 public UUID AnimID 45 public UUID AnimID
39 { 46 {
40 get { return animID; } 47 get { return animID; }
@@ -49,6 +56,10 @@ namespace OpenSim.Framework
49 } 56 }
50 57
51 private UUID objectID; 58 private UUID objectID;
59
60 /// <summary>
61 /// Unique ID of object that is being animated
62 /// </summary>
52 public UUID ObjectID 63 public UUID ObjectID
53 { 64 {
54 get { return objectID; } 65 get { return objectID; }
@@ -59,6 +70,12 @@ namespace OpenSim.Framework
59 { 70 {
60 } 71 }
61 72
73 /// <summary>
74 /// Creates an Animation based on the data
75 /// </summary>
76 /// <param name="animID">UUID ID of animation</param>
77 /// <param name="sequenceNum"></param>
78 /// <param name="objectID">ID of object to be animated</param>
62 public Animation(UUID animID, int sequenceNum, UUID objectID) 79 public Animation(UUID animID, int sequenceNum, UUID objectID)
63 { 80 {
64 this.animID = animID; 81 this.animID = animID;
@@ -66,11 +83,20 @@ namespace OpenSim.Framework
66 this.objectID = objectID; 83 this.objectID = objectID;
67 } 84 }
68 85
86 /// <summary>
87 /// Animation from OSDMap from LLSD XML or LLSD json
88 /// </summary>
89 /// <param name="args"></param>
69 public Animation(OSDMap args) 90 public Animation(OSDMap args)
70 { 91 {
71 UnpackUpdateMessage(args); 92 UnpackUpdateMessage(args);
72 } 93 }
73 94
95
96 /// <summary>
97 /// Pack this object up as an OSDMap for transferring via LLSD XML or LLSD json
98 /// </summary>
99 /// <returns></returns>
74 public OSDMap PackUpdateMessage() 100 public OSDMap PackUpdateMessage()
75 { 101 {
76 OSDMap anim = new OSDMap(); 102 OSDMap anim = new OSDMap();
@@ -80,6 +106,10 @@ namespace OpenSim.Framework
80 return anim; 106 return anim;
81 } 107 }
82 108
109 /// <summary>
110 /// Fill object with data from OSDMap
111 /// </summary>
112 /// <param name="args"></param>
83 public void UnpackUpdateMessage(OSDMap args) 113 public void UnpackUpdateMessage(OSDMap args)
84 { 114 {
85 if (args["animation"] != null) 115 if (args["animation"] != null)
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index 614670c..9679ff2 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -31,10 +31,20 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 /// <summary>
35 /// Asset class. All Assets are reference by this class or a class derived from this class
36 /// </summary>
34 [Serializable] 37 [Serializable]
35 public class AssetBase 38 public class AssetBase
36 { 39 {
40 /// <summary>
41 /// Data of the Asset
42 /// </summary>
37 private byte[] m_data; 43 private byte[] m_data;
44
45 /// <summary>
46 /// Meta Data of the Asset
47 /// </summary>
38 private AssetMetadata m_metadata; 48 private AssetMetadata m_metadata;
39 49
40 public AssetBase() 50 public AssetBase()
@@ -71,6 +81,9 @@ namespace OpenSim.Framework
71 81
72 } 82 }
73 83
84 /// <summary>
85 /// Checks if this asset is a binary or text asset
86 /// </summary>
74 public bool IsBinaryAsset 87 public bool IsBinaryAsset
75 { 88 {
76 get 89 get
@@ -102,12 +115,17 @@ namespace OpenSim.Framework
102 set { m_data = value; } 115 set { m_data = value; }
103 } 116 }
104 117
118 /// <summary>
119 /// Asset UUID
120 /// </summary>
105 public UUID FullID 121 public UUID FullID
106 { 122 {
107 get { return m_metadata.FullID; } 123 get { return m_metadata.FullID; }
108 set { m_metadata.FullID = value; } 124 set { m_metadata.FullID = value; }
109 } 125 }
110 126 /// <summary>
127 /// Asset MetaData ID (transferring from UUID to string ID)
128 /// </summary>
111 public string ID 129 public string ID
112 { 130 {
113 get { return m_metadata.ID; } 131 get { return m_metadata.ID; }
@@ -126,18 +144,27 @@ namespace OpenSim.Framework
126 set { m_metadata.Description = value; } 144 set { m_metadata.Description = value; }
127 } 145 }
128 146
147 /// <summary>
148 /// (sbyte) AssetType enum
149 /// </summary>
129 public sbyte Type 150 public sbyte Type
130 { 151 {
131 get { return m_metadata.Type; } 152 get { return m_metadata.Type; }
132 set { m_metadata.Type = value; } 153 set { m_metadata.Type = value; }
133 } 154 }
134 155
156 /// <summary>
157 /// Is this a region only asset, or does this exist on the asset server also
158 /// </summary>
135 public bool Local 159 public bool Local
136 { 160 {
137 get { return m_metadata.Local; } 161 get { return m_metadata.Local; }
138 set { m_metadata.Local = value; } 162 set { m_metadata.Local = value; }
139 } 163 }
140 164
165 /// <summary>
166 /// Is this asset going to be saved to the asset database?
167 /// </summary>
141 public bool Temporary 168 public bool Temporary
142 { 169 {
143 get { return m_metadata.Temporary; } 170 get { return m_metadata.Temporary; }
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 6a07bc9..7270f32 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -28,14 +28,13 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Runtime.Serialization;
32using System.Security.Permissions;
33using OpenMetaverse; 31using OpenMetaverse;
34using log4net;
35using System.Reflection;
36 32
37namespace OpenSim.Framework 33namespace OpenSim.Framework
38{ 34{
35 /// <summary>
36 /// Contains the Avatar's Appearance and methods to manipulate the appearance.
37 /// </summary>
39 public class AvatarAppearance 38 public class AvatarAppearance
40 { 39 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Framework/AvatarPickerAvatar.cs b/OpenSim/Framework/AvatarPickerAvatar.cs
index 0e8602d..200c054 100644
--- a/OpenSim/Framework/AvatarPickerAvatar.cs
+++ b/OpenSim/Framework/AvatarPickerAvatar.cs
@@ -29,10 +29,24 @@ using OpenMetaverse;
29 29
30namespace OpenSim.Framework 30namespace OpenSim.Framework
31{ 31{
32 /// <summary>
33 /// Avatar returned by the Avatar Picker request
34 /// </summary>
32 public class AvatarPickerAvatar 35 public class AvatarPickerAvatar
33 { 36 {
37 /// <summary>
38 /// Avatar's Unique ID
39 /// </summary>
34 public UUID AvatarID; 40 public UUID AvatarID;
41
42 /// <summary>
43 /// Avatar's Account first name
44 /// </summary>
35 public string firstName; 45 public string firstName;
46
47 /// <summary>
48 /// Avatar's Account last name
49 /// </summary>
36 public string lastName; 50 public string lastName;
37 } 51 }
38} 52}
diff --git a/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs
index 8fd21d7..54835da 100644
--- a/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs
+++ b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs
@@ -30,9 +30,19 @@ using OpenMetaverse;
30 30
31namespace OpenSim.Framework 31namespace OpenSim.Framework
32{ 32{
33 /// <summary>
34 /// Args to return to a client that queries picker data
35 /// </summary>
33 public class AvatarPickerReplyAgentDataArgs : EventArgs 36 public class AvatarPickerReplyAgentDataArgs : EventArgs
34 { 37 {
38 /// <summary>
39 /// Unique Agent ID
40 /// </summary>
35 public UUID AgentID; 41 public UUID AgentID;
42
43 /// <summary>
44 /// ID of query user submitted
45 /// </summary>
36 public UUID QueryID; 46 public UUID QueryID;
37 } 47 }
38} 48}
diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs
index c76841d..2066794 100644
--- a/OpenSim/Framework/Culture.cs
+++ b/OpenSim/Framework/Culture.cs
@@ -45,6 +45,9 @@ namespace OpenSim.Framework
45 get { return m_cultureInfo; } 45 get { return m_cultureInfo; }
46 } 46 }
47 47
48 /// <summary>
49 /// Set Culture to en-US to make string processing of numbers simpler.
50 /// </summary>
48 public static void SetCurrentCulture() 51 public static void SetCurrentCulture()
49 { 52 {
50 Thread.CurrentThread.CurrentCulture = m_cultureInfo; 53 Thread.CurrentThread.CurrentCulture = m_cultureInfo;
diff --git a/OpenSim/Framework/IProfileModule.cs b/OpenSim/Framework/IProfileModule.cs
new file mode 100644
index 0000000..f54810e
--- /dev/null
+++ b/OpenSim/Framework/IProfileModule.cs
@@ -0,0 +1,37 @@
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.Collections;
29using OpenMetaverse;
30
31namespace OpenSim.Framework
32{
33 public interface IProfileModule
34 {
35 Hashtable GetProfileData(UUID userID);
36 }
37}
diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs
index e923f39..05f11a4 100644
--- a/OpenSim/Framework/InventoryFolderBase.cs
+++ b/OpenSim/Framework/InventoryFolderBase.cs
@@ -68,5 +68,24 @@ namespace OpenSim.Framework
68 get { return _version; } 68 get { return _version; }
69 set { _version = value; } 69 set { _version = value; }
70 } 70 }
71
72 public InventoryFolderBase()
73 {
74 }
75
76 public InventoryFolderBase(UUID id)
77 {
78 ID = id;
79 }
80
81 public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version)
82 {
83 ID = id;
84 Name = name;
85 Owner = owner;
86 Type = type;
87 ParentID = parent;
88 Version = version;
89 }
71 } 90 }
72} 91}
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index d6afb95..a24af04 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -31,6 +31,9 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 /// <summary>
35 /// Details of a Parcel of land
36 /// </summary>
34 public class LandData 37 public class LandData
35 { 38 {
36 private Vector3 _AABBMax = new Vector3(); 39 private Vector3 _AABBMax = new Vector3();
@@ -80,6 +83,9 @@ namespace OpenSim.Framework
80 private int _dwell = 0; 83 private int _dwell = 0;
81 private int _otherCleanTime = 0; 84 private int _otherCleanTime = 0;
82 85
86 /// <summary>
87 /// Upper corner of the AABB for the parcel
88 /// </summary>
83 public Vector3 AABBMax { 89 public Vector3 AABBMax {
84 get { 90 get {
85 return _AABBMax; 91 return _AABBMax;
@@ -88,7 +94,9 @@ namespace OpenSim.Framework
88 _AABBMax = value; 94 _AABBMax = value;
89 } 95 }
90 } 96 }
91 97 /// <summary>
98 /// Lower corner of the AABB for the parcel
99 /// </summary>
92 public Vector3 AABBMin { 100 public Vector3 AABBMin {
93 get { 101 get {
94 return _AABBMin; 102 return _AABBMin;
@@ -98,6 +106,9 @@ namespace OpenSim.Framework
98 } 106 }
99 } 107 }
100 108
109 /// <summary>
110 /// Area in meters^2 the parcel contains
111 /// </summary>
101 public int Area { 112 public int Area {
102 get { 113 get {
103 return _area; 114 return _area;
@@ -107,6 +118,9 @@ namespace OpenSim.Framework
107 } 118 }
108 } 119 }
109 120
121 /// <summary>
122 /// ID of auction (3rd Party Integration) when parcel is being auctioned
123 /// </summary>
110 public uint AuctionID { 124 public uint AuctionID {
111 get { 125 get {
112 return _auctionID; 126 return _auctionID;
@@ -116,6 +130,9 @@ namespace OpenSim.Framework
116 } 130 }
117 } 131 }
118 132
133 /// <summary>
134 /// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
135 /// </summary>
119 public UUID AuthBuyerID { 136 public UUID AuthBuyerID {
120 get { 137 get {
121 return _authBuyerID; 138 return _authBuyerID;
@@ -125,6 +142,9 @@ namespace OpenSim.Framework
125 } 142 }
126 } 143 }
127 144
145 /// <summary>
146 /// Category of parcel. Used for classifying the parcel in classified listings
147 /// </summary>
128 public ParcelCategory Category { 148 public ParcelCategory Category {
129 get { 149 get {
130 return _category; 150 return _category;
@@ -134,6 +154,9 @@ namespace OpenSim.Framework
134 } 154 }
135 } 155 }
136 156
157 /// <summary>
158 /// Date that the current owner purchased or claimed the parcel
159 /// </summary>
137 public int ClaimDate { 160 public int ClaimDate {
138 get { 161 get {
139 return _claimDate; 162 return _claimDate;
@@ -143,6 +166,9 @@ namespace OpenSim.Framework
143 } 166 }
144 } 167 }
145 168
169 /// <summary>
170 /// The last price that the parcel was sold at
171 /// </summary>
146 public int ClaimPrice { 172 public int ClaimPrice {
147 get { 173 get {
148 return _claimPrice; 174 return _claimPrice;
@@ -152,6 +178,9 @@ namespace OpenSim.Framework
152 } 178 }
153 } 179 }
154 180
181 /// <summary>
182 /// Global ID for the parcel. (3rd Party Integration)
183 /// </summary>
155 public UUID GlobalID { 184 public UUID GlobalID {
156 get { 185 get {
157 return _globalID; 186 return _globalID;
@@ -161,6 +190,9 @@ namespace OpenSim.Framework
161 } 190 }
162 } 191 }
163 192
193 /// <summary>
194 /// Unique ID of the Group that owns
195 /// </summary>
164 public UUID GroupID { 196 public UUID GroupID {
165 get { 197 get {
166 return _groupID; 198 return _groupID;
@@ -170,6 +202,9 @@ namespace OpenSim.Framework
170 } 202 }
171 } 203 }
172 204
205 /// <summary>
206 /// Number of SceneObjectPart that are owned by a Group
207 /// </summary>
173 public int GroupPrims { 208 public int GroupPrims {
174 get { 209 get {
175 return _groupPrims; 210 return _groupPrims;
@@ -179,6 +214,9 @@ namespace OpenSim.Framework
179 } 214 }
180 } 215 }
181 216
217 /// <summary>
218 /// Returns true if the Land Parcel is owned by a group
219 /// </summary>
182 public bool IsGroupOwned { 220 public bool IsGroupOwned {
183 get { 221 get {
184 return _isGroupOwned; 222 return _isGroupOwned;
@@ -188,6 +226,9 @@ namespace OpenSim.Framework
188 } 226 }
189 } 227 }
190 228
229 /// <summary>
230 /// jp2 data for the image representative of the parcel in the parcel dialog
231 /// </summary>
191 public byte[] Bitmap { 232 public byte[] Bitmap {
192 get { 233 get {
193 return _bitmap; 234 return _bitmap;
@@ -197,6 +238,9 @@ namespace OpenSim.Framework
197 } 238 }
198 } 239 }
199 240
241 /// <summary>
242 /// Parcel Description
243 /// </summary>
200 public string Description { 244 public string Description {
201 get { 245 get {
202 return _description; 246 return _description;
@@ -206,6 +250,9 @@ namespace OpenSim.Framework
206 } 250 }
207 } 251 }
208 252
253 /// <summary>
254 /// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
255 /// </summary>
209 public uint Flags { 256 public uint Flags {
210 get { 257 get {
211 return _flags; 258 return _flags;
@@ -215,6 +262,10 @@ namespace OpenSim.Framework
215 } 262 }
216 } 263 }
217 264
265 /// <summary>
266 /// Determines if people are able to teleport where they please on the parcel or if they
267 /// get constrainted to a specific point on teleport within the parcel
268 /// </summary>
218 public byte LandingType { 269 public byte LandingType {
219 get { 270 get {
220 return _landingType; 271 return _landingType;
@@ -224,6 +275,9 @@ namespace OpenSim.Framework
224 } 275 }
225 } 276 }
226 277
278 /// <summary>
279 /// Parcel Name
280 /// </summary>
227 public string Name { 281 public string Name {
228 get { 282 get {
229 return _name; 283 return _name;
@@ -233,6 +287,9 @@ namespace OpenSim.Framework
233 } 287 }
234 } 288 }
235 289
290 /// <summary>
291 /// Status of Parcel, Leased, Abandoned, For Sale
292 /// </summary>
236 public ParcelStatus Status { 293 public ParcelStatus Status {
237 get { 294 get {
238 return _status; 295 return _status;
@@ -242,6 +299,9 @@ namespace OpenSim.Framework
242 } 299 }
243 } 300 }
244 301
302 /// <summary>
303 /// Internal ID of the parcel. Sometimes the client will try to use this value
304 /// </summary>
245 public int LocalID { 305 public int LocalID {
246 get { 306 get {
247 return _localID; 307 return _localID;
@@ -251,6 +311,9 @@ namespace OpenSim.Framework
251 } 311 }
252 } 312 }
253 313
314 /// <summary>
315 /// Determines if we scale the media based on the surface it's on
316 /// </summary>
254 public byte MediaAutoScale { 317 public byte MediaAutoScale {
255 get { 318 get {
256 return _mediaAutoScale; 319 return _mediaAutoScale;
@@ -260,6 +323,9 @@ namespace OpenSim.Framework
260 } 323 }
261 } 324 }
262 325
326 /// <summary>
327 /// Texture Guid to replace with the output of the media stream
328 /// </summary>
263 public UUID MediaID { 329 public UUID MediaID {
264 get { 330 get {
265 return _mediaID; 331 return _mediaID;
@@ -269,6 +335,9 @@ namespace OpenSim.Framework
269 } 335 }
270 } 336 }
271 337
338 /// <summary>
339 /// URL to the media file to display
340 /// </summary>
272 public string MediaURL { 341 public string MediaURL {
273 get { 342 get {
274 return _mediaURL; 343 return _mediaURL;
@@ -278,6 +347,9 @@ namespace OpenSim.Framework
278 } 347 }
279 } 348 }
280 349
350 /// <summary>
351 /// URL to the shoutcast music stream to play on the parcel
352 /// </summary>
281 public string MusicURL { 353 public string MusicURL {
282 get { 354 get {
283 return _musicURL; 355 return _musicURL;
@@ -287,6 +359,10 @@ namespace OpenSim.Framework
287 } 359 }
288 } 360 }
289 361
362 /// <summary>
363 /// Number of SceneObjectPart that are owned by users who do not own the parcel
364 /// and don't have the 'group. These are elegable for AutoReturn collection
365 /// </summary>
290 public int OtherPrims { 366 public int OtherPrims {
291 get { 367 get {
292 return _otherPrims; 368 return _otherPrims;
@@ -296,6 +372,10 @@ namespace OpenSim.Framework
296 } 372 }
297 } 373 }
298 374
375 /// <summary>
376 /// Owner Avatar or Group of the parcel. Naturally, all land masses must be
377 /// owned by someone
378 /// </summary>
299 public UUID OwnerID { 379 public UUID OwnerID {
300 get { 380 get {
301 return _ownerID; 381 return _ownerID;
@@ -305,6 +385,9 @@ namespace OpenSim.Framework
305 } 385 }
306 } 386 }
307 387
388 /// <summary>
389 /// Number of SceneObjectPart that are owned by the owner of the parcel
390 /// </summary>
308 public int OwnerPrims { 391 public int OwnerPrims {
309 get { 392 get {
310 return _ownerPrims; 393 return _ownerPrims;
@@ -314,6 +397,9 @@ namespace OpenSim.Framework
314 } 397 }
315 } 398 }
316 399
400 /// <summary>
401 /// List of access data for the parcel. User data, some bitflags, and a time
402 /// </summary>
317 public List<ParcelManager.ParcelAccessEntry> ParcelAccessList { 403 public List<ParcelManager.ParcelAccessEntry> ParcelAccessList {
318 get { 404 get {
319 return _parcelAccessList; 405 return _parcelAccessList;
@@ -323,6 +409,9 @@ namespace OpenSim.Framework
323 } 409 }
324 } 410 }
325 411
412 /// <summary>
413 /// How long in hours a Pass to the parcel is given
414 /// </summary>
326 public float PassHours { 415 public float PassHours {
327 get { 416 get {
328 return _passHours; 417 return _passHours;
@@ -332,6 +421,9 @@ namespace OpenSim.Framework
332 } 421 }
333 } 422 }
334 423
424 /// <summary>
425 /// Price to purchase a Pass to a restricted parcel
426 /// </summary>
335 public int PassPrice { 427 public int PassPrice {
336 get { 428 get {
337 return _passPrice; 429 return _passPrice;
@@ -341,6 +433,9 @@ namespace OpenSim.Framework
341 } 433 }
342 } 434 }
343 435
436 /// <summary>
437 /// When the parcel is being sold, this is the price to purchase the parcel
438 /// </summary>
344 public int SalePrice { 439 public int SalePrice {
345 get { 440 get {
346 return _salePrice; 441 return _salePrice;
@@ -350,6 +445,9 @@ namespace OpenSim.Framework
350 } 445 }
351 } 446 }
352 447
448 /// <summary>
449 /// Number of SceneObjectPart that are currently selected by avatar
450 /// </summary>
353 public int SelectedPrims { 451 public int SelectedPrims {
354 get { 452 get {
355 return _selectedPrims; 453 return _selectedPrims;
@@ -359,6 +457,9 @@ namespace OpenSim.Framework
359 } 457 }
360 } 458 }
361 459
460 /// <summary>
461 /// Number of meters^2 in the Simulator
462 /// </summary>
362 public int SimwideArea { 463 public int SimwideArea {
363 get { 464 get {
364 return _simwideArea; 465 return _simwideArea;
@@ -368,6 +469,9 @@ namespace OpenSim.Framework
368 } 469 }
369 } 470 }
370 471
472 /// <summary>
473 /// Number of SceneObjectPart in the Simulator
474 /// </summary>
371 public int SimwidePrims { 475 public int SimwidePrims {
372 get { 476 get {
373 return _simwidePrims; 477 return _simwidePrims;
@@ -377,6 +481,9 @@ namespace OpenSim.Framework
377 } 481 }
378 } 482 }
379 483
484 /// <summary>
485 /// ID of the snapshot used in the client parcel dialog of the parcel
486 /// </summary>
380 public UUID SnapshotID { 487 public UUID SnapshotID {
381 get { 488 get {
382 return _snapshotID; 489 return _snapshotID;
@@ -386,6 +493,10 @@ namespace OpenSim.Framework
386 } 493 }
387 } 494 }
388 495
496 /// <summary>
497 /// When teleporting is restricted to a certain point, this is the location
498 /// that the user will be redirected to
499 /// </summary>
389 public Vector3 UserLocation { 500 public Vector3 UserLocation {
390 get { 501 get {
391 return _userLocation; 502 return _userLocation;
@@ -395,6 +506,10 @@ namespace OpenSim.Framework
395 } 506 }
396 } 507 }
397 508
509 /// <summary>
510 /// When teleporting is restricted to a certain point, this is the rotation
511 /// that the user will be positioned
512 /// </summary>
398 public Vector3 UserLookAt { 513 public Vector3 UserLookAt {
399 get { 514 get {
400 return _userLookAt; 515 return _userLookAt;
@@ -404,6 +519,9 @@ namespace OpenSim.Framework
404 } 519 }
405 } 520 }
406 521
522 /// <summary>
523 /// Depreciated idea. Number of visitors ~= free money
524 /// </summary>
407 public int Dwell { 525 public int Dwell {
408 get { 526 get {
409 return _dwell; 527 return _dwell;
@@ -413,6 +531,10 @@ namespace OpenSim.Framework
413 } 531 }
414 } 532 }
415 533
534 /// <summary>
535 /// Number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
536 /// the parcel and isn't set to the same 'group' as the parcel.
537 /// </summary>
416 public int OtherCleanTime { 538 public int OtherCleanTime {
417 get { 539 get {
418 return _otherCleanTime; 540 return _otherCleanTime;
@@ -422,11 +544,16 @@ namespace OpenSim.Framework
422 } 544 }
423 } 545 }
424 546
547
425 public LandData() 548 public LandData()
426 { 549 {
427 _globalID = UUID.Random(); 550 _globalID = UUID.Random();
428 } 551 }
429 552
553 /// <summary>
554 /// Make a new copy of the land data
555 /// </summary>
556 /// <returns></returns>
430 public LandData Copy() 557 public LandData Copy()
431 { 558 {
432 LandData landData = new LandData(); 559 LandData landData = new LandData();
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 2a97528..7a244ff 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -443,7 +443,7 @@ namespace OpenSim.Framework.Servers
443 string inputLine; 443 string inputLine;
444 int strcmp; 444 int strcmp;
445 445
446 if (File.Exists( gitCommitFileName)) 446 if (File.Exists(gitCommitFileName))
447 { 447 {
448 StreamReader CommitFile = File.OpenText(gitCommitFileName); 448 StreamReader CommitFile = File.OpenText(gitCommitFileName);
449 buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine(); 449 buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine();
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index c74eab1..75c9310 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -964,8 +964,10 @@ namespace OpenSim.Framework.Servers.HttpServer
964 } 964 }
965 } 965 }
966 966
967 response.ContentType = "application/llsd+json"; 967 // response.ContentType = "application/llsd+json";
968 return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); 968 // return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
969 response.ContentType = "application/llsd+xml";
970 return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
969 } 971 }
970 972
971 /// <summary> 973 /// <summary>
diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
new file mode 100644
index 0000000..0bf8f64
--- /dev/null
+++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
@@ -0,0 +1,339 @@
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 */
27using System.Collections.Generic;
28using OpenMetaverse;
29using OpenMetaverse.StructuredData;
30using NUnit.Framework;
31
32
33namespace OpenSim.Framework.Tests
34{
35 [TestFixture]
36 public class AgentCircuitDataTest
37 {
38 private UUID AgentId;
39 private AvatarAppearance AvAppearance;
40 private byte[] VisualParams;
41 private UUID BaseFolder;
42 private string CapsPath;
43 private Dictionary<ulong, string> ChildrenCapsPaths;
44 private uint circuitcode = 0949030;
45 private string firstname;
46 private string lastname;
47 private UUID SecureSessionId;
48 private UUID SessionId;
49 private Vector3 StartPos;
50
51
52 [SetUp]
53 public void setup()
54 {
55 AgentId = UUID.Random();
56 BaseFolder = UUID.Random();
57 CapsPath = "http://www.opensimulator.org/Caps/Foo";
58 ChildrenCapsPaths = new Dictionary<ulong, string>();
59 ChildrenCapsPaths.Add(ulong.MaxValue, "http://www.opensimulator.org/Caps/Foo2");
60 firstname = "CoolAvatarTest";
61 lastname = "test";
62 StartPos = new Vector3(5,23,125);
63
64 SecureSessionId = UUID.Random();
65 SessionId = UUID.Random();
66
67 AvAppearance = new AvatarAppearance(AgentId);
68 AvAppearance.SetDefaultWearables();
69 VisualParams = new byte[218];
70 AvAppearance.SetDefaultParams(VisualParams);
71
72 //body
73 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEIGHT] = 155;
74 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_THICKNESS] = 00;
75 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BODY_FAT] = 0;
76
77 //Torso
78 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TORSO_MUSCLES] = 48;
79 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NECK_THICKNESS] = 43;
80 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NECK_LENGTH] = 255;
81 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SHOULDERS] = 94;
82 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CHEST_MALE_NO_PECS] = 199;
83 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_ARM_LENGTH] = 255;
84 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HAND_SIZE] = 33;
85 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TORSO_LENGTH] = 240;
86 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOVE_HANDLES] = 0;
87 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BELLY_SIZE] = 0;
88
89 // legs
90 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LEG_MUSCLES] = 82;
91 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LEG_LENGTH] = 255;
92 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIP_WIDTH] = 84;
93 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIP_LENGTH] = 166;
94 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BUTT_SIZE] = 64;
95 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SADDLEBAGS] = 89;
96 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BOWED_LEGS] = 127;
97 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45;
98
99
100 // head
101 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255;
102 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch
103 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155;
104 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EGG_HEAD] = 127;
105 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POINTY_EARS] = 255;
106 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_LENGTH] = 45;
107 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127;
108 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104;
109 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94;
110 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks
111 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; // lower cheeks
112 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130;
113
114
115
116 // eyes
117 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_SIZE] = 105;
118 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_EYES] = 135;
119 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_SPACING] = 184;
120 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELID_CORNER_UP] = 230;
121 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELID_INNER_CORNER_UP] = 120;
122 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYE_DEPTH] = 158;
123 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_UPPER_EYELID_FOLD] = 69;
124 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BAGGY_EYES] = 38;
125 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EYELASHES_LONG] = 127;
126 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POP_EYE] = 127;
127
128 VisualParams[(int)AvatarAppearance.VPElement.EYES_EYE_COLOR] = 25;
129 VisualParams[(int)AvatarAppearance.VPElement.EYES_EYE_LIGHTNESS] = 127;
130
131 // ears
132 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_EARS] = 255;
133 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_EARS_OUT] = 127;
134 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_ATTACHED_EARLOBES] = 127;
135 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_POINTY_EARS] = 255;
136
137 // nose
138 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NOSE_BIG_OUT] = 79;
139 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_NOSE] = 35;
140 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BROAD_NOSTRILS] = 86;
141 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOW_SEPTUM_NOSE] = 112; // nostril division
142 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BULBOUS_NOSE] = 25;
143 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_NOBLE_NOSE_BRIDGE] = 25; // upper bridge
144 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LOWER_BRIDGE_NOSE] = 25; // lower bridge
145 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_NOSE_BRIDGE] = 25;
146 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_UPTURNED_NOSE_TIP] = 107;
147 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BULBOUS_NOSE_TIP] = 25;
148 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CROOKED_NOSE] = 127;
149
150
151 // Mouth
152 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_WIDTH] = 122;
153 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_TALL_LIPS] = 10; // lip fullness
154 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_THICKNESS] = 112;
155 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_RATIO] = 137;
156 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_MOUTH_HEIGHT] = 176;
157 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_MOUTH_CORNER] = 140; // Sad --> happy
158 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_LIP_CLEFT_DEEP] = 84;
159 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WIDE_LIP_CLEFT] = 84;
160 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SHIFT_MOUTH] = 127;
161
162
163 // chin
164 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_WEAK_CHIN] = 119;
165 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUARE_JAW] = 5;
166 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DEEP_CHIN] = 132;
167 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_JAW_ANGLE] = 153;
168 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_JAW_JUT] = 100;
169 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_JOWLS] = 38;
170 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CLEFT_CHIN] = 89;
171 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_CLEFT_CHIN_UPPER] = 89;
172 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 0;
173
174
175 // hair color
176 VisualParams[(int)AvatarAppearance.VPElement.HAIR_WHITE_HAIR] = 0;
177 VisualParams[(int)AvatarAppearance.VPElement.HAIR_RAINBOW_COLOR_39] = 0;
178 VisualParams[(int)AvatarAppearance.VPElement.HAIR_BLONDE_HAIR] = 24;
179 VisualParams[(int)AvatarAppearance.VPElement.HAIR_RED_HAIR] = 0;
180
181 // hair style
182 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_VOLUME] = 160;
183 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_FRONT] = 153;
184 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SIDES] = 153;
185 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_BACK] = 170;
186 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_BIG_FRONT] = 0;
187 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_BIG_TOP] = 117;
188 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_BIG_BACK] = 170;
189 VisualParams[(int)AvatarAppearance.VPElement.HAIR_FRONT_FRINGE] = 0;
190 VisualParams[(int)AvatarAppearance.VPElement.HAIR_SIDE_FRINGE] = 142;
191 VisualParams[(int)AvatarAppearance.VPElement.HAIR_BACK_FRINGE] = 0;
192 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SIDES_FULL] = 146;
193 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SWEEP] = 0;
194 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SHEAR_FRONT] = 0;
195 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SHEAR_BACK] = 0;
196 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_TAPER_FRONT] = 0;
197 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_TAPER_BACK] = 0;
198 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_RUMPLED] = 0;
199 VisualParams[(int)AvatarAppearance.VPElement.HAIR_PIGTAILS] = 0;
200 VisualParams[(int)AvatarAppearance.VPElement.HAIR_PONYTAIL] = 0;
201 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_SPIKED] = 0;
202 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_TILT] = 0;
203 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_PART_MIDDLE] = 0;
204 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_PART_RIGHT] = 0;
205 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_PART_LEFT] = 0;
206 VisualParams[(int)AvatarAppearance.VPElement.HAIR_BANGS_PART_MIDDLE] = 155;
207
208 //Eyebrows
209 VisualParams[(int)AvatarAppearance.VPElement.HAIR_EYEBROW_SIZE] = 20;
210 VisualParams[(int)AvatarAppearance.VPElement.HAIR_EYEBROW_DENSITY] = 140;
211 VisualParams[(int)AvatarAppearance.VPElement.HAIR_LOWER_EYEBROWS] = 200; // eyebrow height
212 VisualParams[(int)AvatarAppearance.VPElement.HAIR_ARCED_EYEBROWS] = 124;
213 VisualParams[(int)AvatarAppearance.VPElement.HAIR_POINTY_EYEBROWS] = 65;
214
215 //Facial hair
216 VisualParams[(int)AvatarAppearance.VPElement.HAIR_HAIR_THICKNESS] = 65;
217 VisualParams[(int)AvatarAppearance.VPElement.HAIR_SIDEBURNS] = 235;
218 VisualParams[(int)AvatarAppearance.VPElement.HAIR_MOUSTACHE] = 75;
219 VisualParams[(int)AvatarAppearance.VPElement.HAIR_CHIN_CURTAINS] = 140;
220 VisualParams[(int)AvatarAppearance.VPElement.HAIR_SOULPATCH] = 0;
221
222 AvAppearance.VisualParams = VisualParams;
223
224 List<byte> wearbyte = new List<byte>();
225 for (int i = 0; i < VisualParams.Length; i++)
226 {
227 wearbyte.Add(VisualParams[i]);
228 }
229
230
231 AvAppearance.SetAppearance(AvAppearance.Texture.GetBytes(), wearbyte);
232 }
233
234 /// <summary>
235 /// Test to ensure that the serialization format is the same and the underlying types don't change without notice
236 /// oldSerialization is just a json serialization of the OSDMap packed for the AgentCircuitData.
237 /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types
238 /// have changed and are incompatible.
239 /// </summary>
240 [Test]
241 public void HistoricalAgentCircuitDataOSDConversion()
242 {
243 string oldSerialization = "{\"agent_id\":\"522675bd-8214-40c1-b3ca-9c7f7fd170be\",\"base_folder\":\"c40b5f5f-476f-496b-bd69-b5a539c434d8\",\"caps_path\":\"http://www.opensimulator.org/Caps/Foo\",\"children_seeds\":[{\"handle\":\"18446744073709551615\",\"seed\":\"http://www.opensimulator.org/Caps/Foo2\"}],\"child\":false,\"circuit_code\":\"949030\",\"first_name\":\"CoolAvatarTest\",\"last_name\":\"test\",\"inventory_folder\":\"c40b5f5f-476f-496b-bd69-b5a539c434d8\",\"secure_session_id\":\"1e608e2b-0ddb-41f6-be0f-926f61cd3e0a\",\"session_id\":\"aa06f798-9d70-4bdb-9bbf-012a02ee2baf\",\"start_pos\":\"<5, 23, 125>\"}";
244 AgentCircuitData Agent1Data = new AgentCircuitData();
245 Agent1Data.AgentID = new UUID("522675bd-8214-40c1-b3ca-9c7f7fd170be");
246 Agent1Data.Appearance = AvAppearance;
247 Agent1Data.BaseFolder = new UUID("c40b5f5f-476f-496b-bd69-b5a539c434d8");
248 Agent1Data.CapsPath = CapsPath;
249 Agent1Data.child = false;
250 Agent1Data.ChildrenCapSeeds = ChildrenCapsPaths;
251 Agent1Data.circuitcode = circuitcode;
252 Agent1Data.firstname = firstname;
253 Agent1Data.InventoryFolder = new UUID("c40b5f5f-476f-496b-bd69-b5a539c434d8");
254 Agent1Data.lastname = lastname;
255 Agent1Data.SecureSessionID = new UUID("1e608e2b-0ddb-41f6-be0f-926f61cd3e0a");
256 Agent1Data.SessionID = new UUID("aa06f798-9d70-4bdb-9bbf-012a02ee2baf");
257 Agent1Data.startpos = StartPos;
258
259 OSDMap map2 = (OSDMap)OSDParser.DeserializeJson(oldSerialization);
260
261
262 AgentCircuitData Agent2Data = new AgentCircuitData();
263 Agent2Data.UnpackAgentCircuitData(map2);
264
265 Assert.That((Agent1Data.AgentID == Agent2Data.AgentID));
266 Assert.That((Agent1Data.BaseFolder == Agent2Data.BaseFolder));
267
268 Assert.That((Agent1Data.CapsPath == Agent2Data.CapsPath));
269 Assert.That((Agent1Data.child == Agent2Data.child));
270 Assert.That((Agent1Data.ChildrenCapSeeds.Count == Agent2Data.ChildrenCapSeeds.Count));
271 Assert.That((Agent1Data.circuitcode == Agent2Data.circuitcode));
272 Assert.That((Agent1Data.firstname == Agent2Data.firstname));
273 Assert.That((Agent1Data.InventoryFolder == Agent2Data.InventoryFolder));
274 Assert.That((Agent1Data.lastname == Agent2Data.lastname));
275 Assert.That((Agent1Data.SecureSessionID == Agent2Data.SecureSessionID));
276 Assert.That((Agent1Data.SessionID == Agent2Data.SessionID));
277 Assert.That((Agent1Data.startpos == Agent2Data.startpos));
278 /*
279 Enable this once VisualParams go in the packing method
280 for (int i=0;i<208;i++)
281 Assert.That((Agent1Data.Appearance.VisualParams[i] == Agent2Data.Appearance.VisualParams[i]));
282 */
283 }
284
285 /// <summary>
286 /// Test to ensure that the packing and unpacking methods work.
287 /// </summary>
288 [Test]
289 public void TestAgentCircuitDataOSDConversion()
290 {
291 AgentCircuitData Agent1Data = new AgentCircuitData();
292 Agent1Data.AgentID = AgentId;
293 Agent1Data.Appearance = AvAppearance;
294 Agent1Data.BaseFolder = BaseFolder;
295 Agent1Data.CapsPath = CapsPath;
296 Agent1Data.child = false;
297 Agent1Data.ChildrenCapSeeds = ChildrenCapsPaths;
298 Agent1Data.circuitcode = circuitcode;
299 Agent1Data.firstname = firstname;
300 Agent1Data.InventoryFolder = BaseFolder;
301 Agent1Data.lastname = lastname;
302 Agent1Data.SecureSessionID = SecureSessionId;
303 Agent1Data.SessionID = SessionId;
304 Agent1Data.startpos = StartPos;
305
306
307 OSDMap map = Agent1Data.PackAgentCircuitData();
308 string str = OSDParser.SerializeJsonString(map);
309 //System.Console.WriteLine(str);
310 OSDMap map2 = (OSDMap)OSDParser.DeserializeJson(str);
311
312
313 AgentCircuitData Agent2Data = new AgentCircuitData();
314 Agent2Data.UnpackAgentCircuitData(map2);
315
316 Assert.That((Agent1Data.AgentID == Agent2Data.AgentID));
317 Assert.That((Agent1Data.BaseFolder == Agent2Data.BaseFolder));
318
319 Assert.That((Agent1Data.CapsPath == Agent2Data.CapsPath));
320 Assert.That((Agent1Data.child == Agent2Data.child));
321 Assert.That((Agent1Data.ChildrenCapSeeds.Count == Agent2Data.ChildrenCapSeeds.Count));
322 Assert.That((Agent1Data.circuitcode == Agent2Data.circuitcode));
323 Assert.That((Agent1Data.firstname == Agent2Data.firstname));
324 Assert.That((Agent1Data.InventoryFolder == Agent2Data.InventoryFolder));
325 Assert.That((Agent1Data.lastname == Agent2Data.lastname));
326 Assert.That((Agent1Data.SecureSessionID == Agent2Data.SecureSessionID));
327 Assert.That((Agent1Data.SessionID == Agent2Data.SessionID));
328 Assert.That((Agent1Data.startpos == Agent2Data.startpos));
329
330 /*
331 Enable this once VisualParams go in the packing method
332 for (int i = 0; i < 208; i++)
333 Assert.That((Agent1Data.Appearance.VisualParams[i] == Agent2Data.Appearance.VisualParams[i]));
334 */
335
336
337 }
338 }
339}
diff --git a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
new file mode 100644
index 0000000..ab5f04a
--- /dev/null
+++ b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
@@ -0,0 +1,201 @@
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 */
27using System.Collections.Generic;
28using OpenMetaverse;
29using NUnit.Framework;
30using System;
31
32namespace OpenSim.Framework.Tests
33{
34 [TestFixture]
35 public class AgentCircuitManagerTests
36 {
37 private AgentCircuitData m_agentCircuitData1;
38 private AgentCircuitData m_agentCircuitData2;
39 private UUID AgentId1;
40 private UUID AgentId2;
41 private uint circuitcode1;
42 private uint circuitcode2;
43
44 private UUID SessionId1;
45 private UUID SessionId2;
46 private Random rnd = new Random(Environment.TickCount);
47
48 [SetUp]
49 public void setup()
50 {
51
52 AgentId1 = UUID.Random();
53 AgentId2 = UUID.Random();
54 circuitcode1 = (uint) rnd.Next((int)uint.MinValue, int.MaxValue);
55 circuitcode2 = (uint) rnd.Next((int)uint.MinValue, int.MaxValue);
56 SessionId1 = UUID.Random();
57 SessionId2 = UUID.Random();
58 UUID BaseFolder = UUID.Random();
59 string CapsPath = "http://www.opensimulator.org/Caps/Foo";
60 Dictionary<ulong,string> ChildrenCapsPaths = new Dictionary<ulong, string>();
61 ChildrenCapsPaths.Add(ulong.MaxValue, "http://www.opensimulator.org/Caps/Foo2");
62 string firstname = "CoolAvatarTest";
63 string lastname = "test";
64 Vector3 StartPos = new Vector3(5, 23, 125);
65
66 UUID SecureSessionId = UUID.Random();
67 UUID SessionId = UUID.Random();
68
69 m_agentCircuitData1 = new AgentCircuitData();
70 m_agentCircuitData1.AgentID = AgentId1;
71 m_agentCircuitData1.Appearance = new AvatarAppearance(AgentId1);
72 m_agentCircuitData1.BaseFolder = BaseFolder;
73 m_agentCircuitData1.CapsPath = CapsPath;
74 m_agentCircuitData1.child = false;
75 m_agentCircuitData1.ChildrenCapSeeds = ChildrenCapsPaths;
76 m_agentCircuitData1.circuitcode = circuitcode1;
77 m_agentCircuitData1.firstname = firstname;
78 m_agentCircuitData1.InventoryFolder = BaseFolder;
79 m_agentCircuitData1.lastname = lastname;
80 m_agentCircuitData1.SecureSessionID = SecureSessionId;
81 m_agentCircuitData1.SessionID = SessionId1;
82 m_agentCircuitData1.startpos = StartPos;
83
84 m_agentCircuitData2 = new AgentCircuitData();
85 m_agentCircuitData2.AgentID = AgentId2;
86 m_agentCircuitData2.Appearance = new AvatarAppearance(AgentId2);
87 m_agentCircuitData2.BaseFolder = BaseFolder;
88 m_agentCircuitData2.CapsPath = CapsPath;
89 m_agentCircuitData2.child = false;
90 m_agentCircuitData2.ChildrenCapSeeds = ChildrenCapsPaths;
91 m_agentCircuitData2.circuitcode = circuitcode2;
92 m_agentCircuitData2.firstname = firstname;
93 m_agentCircuitData2.InventoryFolder = BaseFolder;
94 m_agentCircuitData2.lastname = lastname;
95 m_agentCircuitData2.SecureSessionID = SecureSessionId;
96 m_agentCircuitData2.SessionID = SessionId2;
97 m_agentCircuitData2.startpos = StartPos;
98 }
99
100 /// <summary>
101 /// Validate that adding the circuit works appropriately
102 /// </summary>
103 [Test]
104 public void AddAgentCircuitTest()
105 {
106 AgentCircuitManager agentCircuitManager = new AgentCircuitManager();
107 agentCircuitManager.AddNewCircuit(circuitcode1,m_agentCircuitData1);
108 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
109 AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode1);
110
111 Assert.That((m_agentCircuitData1.AgentID == agent.AgentID));
112 Assert.That((m_agentCircuitData1.BaseFolder == agent.BaseFolder));
113
114 Assert.That((m_agentCircuitData1.CapsPath == agent.CapsPath));
115 Assert.That((m_agentCircuitData1.child == agent.child));
116 Assert.That((m_agentCircuitData1.ChildrenCapSeeds.Count == agent.ChildrenCapSeeds.Count));
117 Assert.That((m_agentCircuitData1.circuitcode == agent.circuitcode));
118 Assert.That((m_agentCircuitData1.firstname == agent.firstname));
119 Assert.That((m_agentCircuitData1.InventoryFolder == agent.InventoryFolder));
120 Assert.That((m_agentCircuitData1.lastname == agent.lastname));
121 Assert.That((m_agentCircuitData1.SecureSessionID == agent.SecureSessionID));
122 Assert.That((m_agentCircuitData1.SessionID == agent.SessionID));
123 Assert.That((m_agentCircuitData1.startpos == agent.startpos));
124 }
125
126 /// <summary>
127 /// Validate that removing the circuit code removes it appropriately
128 /// </summary>
129 [Test]
130 public void RemoveAgentCircuitTest()
131 {
132 AgentCircuitManager agentCircuitManager = new AgentCircuitManager();
133 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
134 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
135 agentCircuitManager.RemoveCircuit(circuitcode2);
136
137 AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode2);
138 Assert.That(agent == null);
139
140 }
141
142 /// <summary>
143 /// Validate that changing the circuit code works
144 /// </summary>
145 [Test]
146 public void ChangeAgentCircuitCodeTest()
147 {
148 AgentCircuitManager agentCircuitManager = new AgentCircuitManager();
149 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
150 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
151 bool result = false;
152
153 result = agentCircuitManager.TryChangeCiruitCode(circuitcode1, 393930);
154
155 AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(393930);
156 AgentCircuitData agent2 = agentCircuitManager.GetAgentCircuitData(circuitcode1);
157 Assert.That(agent != null);
158 Assert.That(agent2 == null);
159 Assert.That(result);
160
161 }
162
163 /// <summary>
164 /// Validates that the login authentication scheme is working
165 /// First one should be authorized
166 /// Rest should not be authorized
167 /// </summary>
168 [Test]
169 public void ValidateLoginTest()
170 {
171 AgentCircuitManager agentCircuitManager = new AgentCircuitManager();
172 agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
173 agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
174
175 // should be authorized
176 AuthenticateResponse resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode1);
177 Assert.That(resp.Authorised);
178
179
180 //should not be authorized
181 resp = agentCircuitManager.AuthenticateSession(SessionId1, UUID.Random(), circuitcode1);
182 Assert.That(!resp.Authorised);
183
184 resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1);
185 Assert.That(!resp.Authorised);
186
187 resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2);
188 Assert.That(!resp.Authorised);
189
190 resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId1, circuitcode2);
191 Assert.That(!resp.Authorised);
192
193 agentCircuitManager.RemoveCircuit(circuitcode2);
194
195 resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId2, circuitcode2);
196 Assert.That(!resp.Authorised);
197
198 }
199
200 }
201}
diff --git a/OpenSim/Framework/Tests/ThreadTrackerTests.cs b/OpenSim/Framework/Tests/ThreadTrackerTests.cs
new file mode 100644
index 0000000..37c75ef
--- /dev/null
+++ b/OpenSim/Framework/Tests/ThreadTrackerTests.cs
@@ -0,0 +1,192 @@
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 NUnit.Framework;
30using System.Threading;
31using System.Collections.Generic;
32
33namespace OpenSim.Framework.Tests
34{
35 [TestFixture]
36 public class ThreadTrackerTests
37 {
38 private bool running = true;
39 private bool running2 = true;
40
41 [Test]
42 public void DefaultThreadTrackerTest()
43 {
44 List<Thread> lThread = ThreadTracker.GetThreads();
45
46 /*
47 foreach (Thread t in lThread)
48 {
49 System.Console.WriteLine(t.Name);
50 }
51 */
52
53 Assert.That(lThread.Count == 1);
54 Assert.That(lThread[0].Name == "ThreadTrackerThread");
55 }
56
57 /// <summary>
58 /// Validate that adding a thread to the thread tracker works
59 /// Validate that removing a thread from the thread tracker also works.
60 /// </summary>
61 [Test]
62 public void AddThreadToThreadTrackerTestAndRemoveTest()
63 {
64 Thread t = new Thread(run);
65 t.Name = "TestThread";
66 t.Priority = ThreadPriority.BelowNormal;
67 t.IsBackground = true;
68 t.SetApartmentState(ApartmentState.MTA);
69 t.Start();
70 ThreadTracker.Add(t);
71
72 List<Thread> lThread = ThreadTracker.GetThreads();
73
74 Assert.That(lThread.Count == 2);
75
76 foreach (Thread tr in lThread)
77 {
78 Assert.That((tr.Name == "ThreadTrackerThread" || tr.Name == "TestThread"));
79 }
80 running = false;
81 ThreadTracker.Remove(t);
82
83 lThread = ThreadTracker.GetThreads();
84
85 Assert.That(lThread.Count == 1);
86
87 foreach (Thread tr in lThread)
88 {
89 Assert.That((tr.Name == "ThreadTrackerThread"));
90 }
91
92
93 }
94
95 /// <summary>
96 /// Test a dead thread removal by aborting it and setting it's last seen active date to 50 seconds
97 /// </summary>
98 [Test]
99 public void DeadThreadTest()
100 {
101 Thread t = new Thread(run2);
102 t.Name = "TestThread";
103 t.Priority = ThreadPriority.BelowNormal;
104 t.IsBackground = true;
105 t.SetApartmentState(ApartmentState.MTA);
106 t.Start();
107 ThreadTracker.Add(t);
108 t.Abort();
109 Thread.Sleep(5000);
110 ThreadTracker.m_Threads[1].LastSeenActive = DateTime.Now.Ticks - (50*10000000);
111 ThreadTracker.CleanUp();
112 List<Thread> lThread = ThreadTracker.GetThreads();
113
114 Assert.That(lThread.Count == 1);
115
116 foreach (Thread tr in lThread)
117 {
118 Assert.That((tr.Name == "ThreadTrackerThread"));
119 }
120 }
121
122 [Test]
123 public void UnstartedThreadTest()
124 {
125 Thread t = new Thread(run2);
126 t.Name = "TestThread";
127 t.Priority = ThreadPriority.BelowNormal;
128 t.IsBackground = true;
129 t.SetApartmentState(ApartmentState.MTA);
130 ThreadTracker.Add(t);
131 ThreadTracker.m_Threads[1].LastSeenActive = DateTime.Now.Ticks - (50 * 10000000);
132 ThreadTracker.CleanUp();
133 List<Thread> lThread = ThreadTracker.GetThreads();
134
135 Assert.That(lThread.Count == 1);
136
137 foreach (Thread tr in lThread)
138 {
139 Assert.That((tr.Name == "ThreadTrackerThread"));
140 }
141 }
142
143 [Test]
144 public void NullThreadTest()
145 {
146 Thread t = null;
147 ThreadTracker.Add(t);
148
149 List<Thread> lThread = ThreadTracker.GetThreads();
150
151 Assert.That(lThread.Count == 1);
152
153 foreach (Thread tr in lThread)
154 {
155 Assert.That((tr.Name == "ThreadTrackerThread"));
156 }
157 }
158
159
160 /// <summary>
161 /// Worker thread 0
162 /// </summary>
163 /// <param name="o"></param>
164 public void run( object o)
165 {
166 while (running)
167 {
168 Thread.Sleep(5000);
169 }
170 }
171
172 /// <summary>
173 /// Worker thread 1
174 /// </summary>
175 /// <param name="o"></param>
176 public void run2(object o)
177 {
178 try
179 {
180 while (running2)
181 {
182 Thread.Sleep(5000);
183 }
184
185 }
186 catch (ThreadAbortException)
187 {
188 }
189 }
190
191 }
192}
diff --git a/OpenSim/Framework/ThreadTracker.cs b/OpenSim/Framework/ThreadTracker.cs
index d8bd2c0..fa6f0b8 100644
--- a/OpenSim/Framework/ThreadTracker.cs
+++ b/OpenSim/Framework/ThreadTracker.cs
@@ -77,12 +77,15 @@ namespace OpenSim.Framework
77 public static void Add(Thread thread) 77 public static void Add(Thread thread)
78 { 78 {
79#if DEBUG 79#if DEBUG
80 lock (m_Threads) 80 if (thread != null)
81 { 81 {
82 ThreadTrackerItem tti = new ThreadTrackerItem(); 82 lock (m_Threads)
83 tti.Thread = thread; 83 {
84 tti.LastSeenActive = DateTime.Now.Ticks; 84 ThreadTrackerItem tti = new ThreadTrackerItem();
85 m_Threads.Add(tti); 85 tti.Thread = thread;
86 tti.LastSeenActive = DateTime.Now.Ticks;
87 m_Threads.Add(tti);
88 }
86 } 89 }
87#endif 90#endif
88 } 91 }
@@ -107,16 +110,25 @@ namespace OpenSim.Framework
107 { 110 {
108 foreach (ThreadTrackerItem tti in new ArrayList(m_Threads)) 111 foreach (ThreadTrackerItem tti in new ArrayList(m_Threads))
109 { 112 {
110 if (tti.Thread.IsAlive) 113 try
111 { 114 {
112 // Its active 115
113 tti.LastSeenActive = DateTime.Now.Ticks; 116
117 if (tti.Thread.IsAlive)
118 {
119 // Its active
120 tti.LastSeenActive = DateTime.Now.Ticks;
121 }
122 else
123 {
124 // Its not active -- if its expired then remove it
125 if (tti.LastSeenActive + ThreadTimeout < DateTime.Now.Ticks)
126 m_Threads.Remove(tti);
127 }
114 } 128 }
115 else 129 catch (NullReferenceException)
116 { 130 {
117 // Its not active -- if its expired then remove it 131 m_Threads.Remove(tti);
118 if (tti.LastSeenActive + ThreadTimeout < DateTime.Now.Ticks)
119 m_Threads.Remove(tti);
120 } 132 }
121 } 133 }
122 } 134 }
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index ad157c6..df80290 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -36,25 +36,47 @@ using OpenSim.Framework.Console;
36 36
37namespace OpenSim 37namespace OpenSim
38{ 38{
39 /// <summary>
40 /// Starting class for the OpenSimulator Region
41 /// </summary>
39 public class Application 42 public class Application
40 { 43 {
44 /// <summary>
45 /// Text Console Logger
46 /// </summary>
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 48
49 /// <summary>
50 /// Path to the main ini Configuration file
51 /// </summary>
43 public static string iniFilePath = ""; 52 public static string iniFilePath = "";
44 53
54 /// <summary>
55 /// Save Crashes in the bin/crashes folder. Configurable with m_crashDir
56 /// </summary>
45 public static bool m_saveCrashDumps = false; 57 public static bool m_saveCrashDumps = false;
58
59 /// <summary>
60 /// Directory to save crash reports to. Relative to bin/
61 /// </summary>
46 public static string m_crashDir = "crashes"; 62 public static string m_crashDir = "crashes";
47 63
64 /// <summary>
65 /// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration
66 /// </summary>
48 protected static OpenSimBase m_sim = null; 67 protected static OpenSimBase m_sim = null;
49 68
50 //could move our main function into OpenSimMain and kill this class 69 //could move our main function into OpenSimMain and kill this class
51 public static void Main(string[] args) 70 public static void Main(string[] args)
52 { 71 {
53 // First line 72 // First line, hook the appdomain to the crash reporter
54 AppDomain.CurrentDomain.UnhandledException += 73 AppDomain.CurrentDomain.UnhandledException +=
55 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 74 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
56 75
76 // Add the arguments supplied when running the application to the configuration
57 ArgvConfigSource configSource = new ArgvConfigSource(args); 77 ArgvConfigSource configSource = new ArgvConfigSource(args);
78
79 // Configure Log4Net
58 configSource.AddSwitch("Startup", "logconfig"); 80 configSource.AddSwitch("Startup", "logconfig");
59 string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); 81 string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty);
60 if (logConfigFile != String.Empty) 82 if (logConfigFile != String.Empty)
@@ -69,6 +91,8 @@ namespace OpenSim
69 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); 91 m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
70 } 92 }
71 93
94 // Check if the system is compatible with OpenSimulator.
95 // Ensures that the minimum system requirements are met
72 m_log.Info("Performing compatibility checks... "); 96 m_log.Info("Performing compatibility checks... ");
73 string supported = String.Empty; 97 string supported = String.Empty;
74 if (Util.IsEnvironmentSupported(ref supported)) 98 if (Util.IsEnvironmentSupported(ref supported))
@@ -80,6 +104,7 @@ namespace OpenSim
80 m_log.Warn("Environment is unsupported (" + supported + ")\n"); 104 m_log.Warn("Environment is unsupported (" + supported + ")\n");
81 } 105 }
82 106
107 // Configure nIni aliases and localles
83 Culture.SetCurrentCulture(); 108 Culture.SetCurrentCulture();
84 109
85 110
@@ -99,8 +124,13 @@ namespace OpenSim
99 configSource.AddConfig("StandAlone"); 124 configSource.AddConfig("StandAlone");
100 configSource.AddConfig("Network"); 125 configSource.AddConfig("Network");
101 126
127 // Check if we're running in the background or not
102 bool background = configSource.Configs["Startup"].GetBoolean("background", false); 128 bool background = configSource.Configs["Startup"].GetBoolean("background", false);
129
130 // Check if we're saving crashes
103 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); 131 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false);
132
133 // load Crash directory config
104 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); 134 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
105 135
106 if (background) 136 if (background)
@@ -118,6 +148,7 @@ namespace OpenSim
118 { 148 {
119 try 149 try
120 { 150 {
151 // Block thread here for input
121 MainConsole.Instance.Prompt(); 152 MainConsole.Instance.Prompt();
122 } 153 }
123 catch (Exception e) 154 catch (Exception e)
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 3a65242..c3e7b86 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -37,12 +37,32 @@ using OpenSim.Framework;
37 37
38namespace OpenSim 38namespace OpenSim
39{ 39{
40 /// <summary>
41 /// Loads the Configuration files into nIni
42 /// </summary>
40 public class ConfigurationLoader 43 public class ConfigurationLoader
41 { 44 {
45 /// <summary>
46 /// Various Config settings the region needs to start
47 /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor,
48 /// StorageDLL, Storage Connection String, Estate connection String, Client Stack
49 /// Standalone settings.
50 /// </summary>
42 protected ConfigSettings m_configSettings; 51 protected ConfigSettings m_configSettings;
52
53 /// <summary>
54 /// A source of Configuration data
55 /// </summary>
43 protected OpenSimConfigSource m_config; 56 protected OpenSimConfigSource m_config;
57
58 /// <summary>
59 /// Grid Service Information. This refers to classes and addresses of the grid service
60 /// </summary>
44 protected NetworkServersInfo m_networkServersInfo; 61 protected NetworkServersInfo m_networkServersInfo;
45 62
63 /// <summary>
64 /// Console logger
65 /// </summary>
46 private static readonly ILog m_log = 66 private static readonly ILog m_log =
47 LogManager.GetLogger( 67 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 68 MethodBase.GetCurrentMethod().DeclaringType);
@@ -51,6 +71,13 @@ namespace OpenSim
51 { 71 {
52 } 72 }
53 73
74 /// <summary>
75 /// Loads the region configuration
76 /// </summary>
77 /// <param name="argvSource">Parameters passed into the process when started</param>
78 /// <param name="configSettings"></param>
79 /// <param name="networkInfo"></param>
80 /// <returns>A configuration that gets passed to modules</returns>
54 public OpenSimConfigSource LoadConfigSettings( 81 public OpenSimConfigSource LoadConfigSettings(
55 IConfigSource argvSource, out ConfigSettings configSettings, 82 IConfigSource argvSource, out ConfigSettings configSettings,
56 out NetworkServersInfo networkInfo) 83 out NetworkServersInfo networkInfo)
@@ -169,15 +196,22 @@ namespace OpenSim
169 return m_config; 196 return m_config;
170 } 197 }
171 198
199 /// <summary>
200 /// Adds the included files as ini configuration files
201 /// </summary>
202 /// <param name="sources">List of URL strings or filename strings</param>
172 private void AddIncludes(List<string> sources) 203 private void AddIncludes(List<string> sources)
173 { 204 {
205 //loop over config sources
174 foreach (IConfig config in m_config.Source.Configs) 206 foreach (IConfig config in m_config.Source.Configs)
175 { 207 {
208 // Look for Include-* in the key name
176 string[] keys = config.GetKeys(); 209 string[] keys = config.GetKeys();
177 foreach (string k in keys) 210 foreach (string k in keys)
178 { 211 {
179 if (k.StartsWith("Include-")) 212 if (k.StartsWith("Include-"))
180 { 213 {
214 // read the config file to be included.
181 string file = config.GetString(k); 215 string file = config.GetString(k);
182 if (IsUri(file)) 216 if (IsUri(file))
183 { 217 {
@@ -199,7 +233,11 @@ namespace OpenSim
199 } 233 }
200 } 234 }
201 } 235 }
202 236 /// <summary>
237 /// Check if we can convert the string to a URI
238 /// </summary>
239 /// <param name="file">String uri to the remote resource</param>
240 /// <returns>true if we can convert the string to a Uri object</returns>
203 bool IsUri(string file) 241 bool IsUri(string file)
204 { 242 {
205 Uri configUri; 243 Uri configUri;
@@ -253,7 +291,7 @@ namespace OpenSim
253 /// <summary> 291 /// <summary>
254 /// Setup a default config values in case they aren't present in the ini file 292 /// Setup a default config values in case they aren't present in the ini file
255 /// </summary> 293 /// </summary>
256 /// <returns></returns> 294 /// <returns>A Configuration source containing the default configuration</returns>
257 private static IConfigSource DefaultConfig() 295 private static IConfigSource DefaultConfig()
258 { 296 {
259 IConfigSource defaultConfig = new IniConfigSource(); 297 IConfigSource defaultConfig = new IniConfigSource();
@@ -322,6 +360,9 @@ namespace OpenSim
322 return defaultConfig; 360 return defaultConfig;
323 } 361 }
324 362
363 /// <summary>
364 /// Read initial region settings from the ConfigSource
365 /// </summary>
325 protected virtual void ReadConfigSettings() 366 protected virtual void ReadConfigSettings()
326 { 367 {
327 IConfig startupConfig = m_config.Source.Configs["Startup"]; 368 IConfig startupConfig = m_config.Source.Configs["Startup"];
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs
index 1e1dae0..6e6d48c 100644
--- a/OpenSim/Region/Application/IApplicationPlugin.cs
+++ b/OpenSim/Region/Application/IApplicationPlugin.cs
@@ -29,12 +29,24 @@ using OpenSim.Framework;
29 29
30namespace OpenSim 30namespace OpenSim
31{ 31{
32 /// <summary>
33 /// OpenSimulator Application Plugin framework interface
34 /// </summary>
32 public interface IApplicationPlugin : IPlugin 35 public interface IApplicationPlugin : IPlugin
33 { 36 {
37 /// <summary>
38 /// Initialize the Plugin
39 /// </summary>
40 /// <param name="openSim">The Application instance</param>
34 void Initialise(OpenSimBase openSim); 41 void Initialise(OpenSimBase openSim);
42
43 /// <summary>
44 /// Called when the application loading is completed
45 /// </summary>
35 void PostInitialise(); 46 void PostInitialise();
36 } 47 }
37 48
49
38 public class ApplicationPluginInitialiser : PluginInitialiserBase 50 public class ApplicationPluginInitialiser : PluginInitialiserBase
39 { 51 {
40 private OpenSimBase server; 52 private OpenSimBase server;
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index aeb6f57..390cfcd 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -146,6 +146,9 @@ namespace OpenSim
146 ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); 146 ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
147 } 147 }
148 148
149 /// <summary>
150 /// Register standard set of region console commands
151 /// </summary>
149 private void RegisterConsoleCommands() 152 private void RegisterConsoleCommands()
150 { 153 {
151 m_console.Commands.AddCommand("region", false, "clear assets", 154 m_console.Commands.AddCommand("region", false, "clear assets",
@@ -332,6 +335,11 @@ namespace OpenSim
332 base.ShutdownSpecific(); 335 base.ShutdownSpecific();
333 } 336 }
334 337
338 /// <summary>
339 /// Timer to run a specific text file as console commands. Configured in in the main ini file
340 /// </summary>
341 /// <param name="sender"></param>
342 /// <param name="e"></param>
335 private void RunAutoTimerScript(object sender, EventArgs e) 343 private void RunAutoTimerScript(object sender, EventArgs e)
336 { 344 {
337 if (m_timedScript != "disabled") 345 if (m_timedScript != "disabled")
@@ -342,6 +350,11 @@ namespace OpenSim
342 350
343 #region Console Commands 351 #region Console Commands
344 352
353 /// <summary>
354 /// Kicks users off the region
355 /// </summary>
356 /// <param name="module"></param>
357 /// <param name="cmdparams">name of avatar to kick</param>
345 private void KickUserCommand(string module, string[] cmdparams) 358 private void KickUserCommand(string module, string[] cmdparams)
346 { 359 {
347 if (cmdparams.Length < 4) 360 if (cmdparams.Length < 4)
@@ -401,6 +414,10 @@ namespace OpenSim
401 } 414 }
402 } 415 }
403 416
417 /// <summary>
418 /// Opens a file and uses it as input to the console command parser.
419 /// </summary>
420 /// <param name="fileName">name of file to use as input to the console</param>
404 private static void PrintFileToConsole(string fileName) 421 private static void PrintFileToConsole(string fileName)
405 { 422 {
406 if (File.Exists(fileName)) 423 if (File.Exists(fileName))
@@ -419,12 +436,22 @@ namespace OpenSim
419 m_log.Info("Not implemented."); 436 m_log.Info("Not implemented.");
420 } 437 }
421 438
439 /// <summary>
440 /// Force resending of all updates to all clients in active region(s)
441 /// </summary>
442 /// <param name="module"></param>
443 /// <param name="args"></param>
422 private void HandleForceUpdate(string module, string[] args) 444 private void HandleForceUpdate(string module, string[] args)
423 { 445 {
424 m_log.Info("Updating all clients"); 446 m_log.Info("Updating all clients");
425 m_sceneManager.ForceCurrentSceneClientUpdate(); 447 m_sceneManager.ForceCurrentSceneClientUpdate();
426 } 448 }
427 449
450 /// <summary>
451 /// Edits the scale of a primative with the name specified
452 /// </summary>
453 /// <param name="module"></param>
454 /// <param name="args">0,1, name, x, y, z</param>
428 private void HandleEditScale(string module, string[] args) 455 private void HandleEditScale(string module, string[] args)
429 { 456 {
430 if (args.Length == 6) 457 if (args.Length == 6)
@@ -437,6 +464,11 @@ namespace OpenSim
437 } 464 }
438 } 465 }
439 466
467 /// <summary>
468 /// Creates a new region based on the parameters specified. This will ask the user questions on the console
469 /// </summary>
470 /// <param name="module"></param>
471 /// <param name="cmd">0,1,region name, region XML file</param>
440 private void HandleCreateRegion(string module, string[] cmd) 472 private void HandleCreateRegion(string module, string[] cmd)
441 { 473 {
442 if (cmd.Length < 4) 474 if (cmd.Length < 4)
@@ -473,16 +505,32 @@ namespace OpenSim
473 } 505 }
474 } 506 }
475 507
508 /// <summary>
509 /// Enable logins
510 /// </summary>
511 /// <param name="module"></param>
512 /// <param name="cmd"></param>
476 private void HandleLoginEnable(string module, string[] cmd) 513 private void HandleLoginEnable(string module, string[] cmd)
477 { 514 {
478 ProcessLogin(true); 515 ProcessLogin(true);
479 } 516 }
480 517
518
519 /// <summary>
520 /// Disable logins
521 /// </summary>
522 /// <param name="module"></param>
523 /// <param name="cmd"></param>
481 private void HandleLoginDisable(string module, string[] cmd) 524 private void HandleLoginDisable(string module, string[] cmd)
482 { 525 {
483 ProcessLogin(false); 526 ProcessLogin(false);
484 } 527 }
485 528
529 /// <summary>
530 /// Log login status to the console
531 /// </summary>
532 /// <param name="module"></param>
533 /// <param name="cmd"></param>
486 private void HandleLoginStatus(string module, string[] cmd) 534 private void HandleLoginStatus(string module, string[] cmd)
487 { 535 {
488 if (m_commsManager.GridService.RegionLoginsEnabled == false) 536 if (m_commsManager.GridService.RegionLoginsEnabled == false)
@@ -492,6 +540,12 @@ namespace OpenSim
492 m_log.Info("[ Login ] Login are enabled"); 540 m_log.Info("[ Login ] Login are enabled");
493 } 541 }
494 542
543
544 /// <summary>
545 /// Change and load configuration file data.
546 /// </summary>
547 /// <param name="module"></param>
548 /// <param name="cmd"></param>
495 private void HandleConfig(string module, string[] cmd) 549 private void HandleConfig(string module, string[] cmd)
496 { 550 {
497 List<string> args = new List<string>(cmd); 551 List<string> args = new List<string>(cmd);
@@ -557,6 +611,12 @@ namespace OpenSim
557 } 611 }
558 } 612 }
559 613
614
615 /// <summary>
616 /// Load, Unload, and list Region modules in use
617 /// </summary>
618 /// <param name="module"></param>
619 /// <param name="cmd"></param>
560 private void HandleModules(string module, string[] cmd) 620 private void HandleModules(string module, string[] cmd)
561 { 621 {
562 List<string> args = new List<string>(cmd); 622 List<string> args = new List<string>(cmd);
@@ -797,6 +857,11 @@ namespace OpenSim
797 } 857 }
798 858
799 // see BaseOpenSimServer 859 // see BaseOpenSimServer
860 /// <summary>
861 /// Many commands list objects for debugging. Some of the types are listed here
862 /// </summary>
863 /// <param name="mod"></param>
864 /// <param name="cmd"></param>
800 public override void HandleShow(string mod, string[] cmd) 865 public override void HandleShow(string mod, string[] cmd)
801 { 866 {
802 base.HandleShow(mod, cmd); 867 base.HandleShow(mod, cmd);
@@ -902,6 +967,10 @@ namespace OpenSim
902 } 967 }
903 } 968 }
904 969
970 /// <summary>
971 /// print UDP Queue data for each client
972 /// </summary>
973 /// <returns></returns>
905 private string GetQueuesReport() 974 private string GetQueuesReport()
906 { 975 {
907 string report = String.Empty; 976 string report = String.Empty;
@@ -1010,6 +1079,11 @@ namespace OpenSim
1010 m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); 1079 m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword);
1011 } 1080 }
1012 1081
1082 /// <summary>
1083 /// Use XML2 format to serialize data to a file
1084 /// </summary>
1085 /// <param name="module"></param>
1086 /// <param name="cmdparams"></param>
1013 protected void SavePrimsXml2(string module, string[] cmdparams) 1087 protected void SavePrimsXml2(string module, string[] cmdparams)
1014 { 1088 {
1015 if (cmdparams.Length > 5) 1089 if (cmdparams.Length > 5)
@@ -1022,6 +1096,11 @@ namespace OpenSim
1022 } 1096 }
1023 } 1097 }
1024 1098
1099 /// <summary>
1100 /// Use XML format to serialize data to a file
1101 /// </summary>
1102 /// <param name="module"></param>
1103 /// <param name="cmdparams"></param>
1025 protected void SaveXml(string module, string[] cmdparams) 1104 protected void SaveXml(string module, string[] cmdparams)
1026 { 1105 {
1027 m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); 1106 m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason.");
@@ -1036,6 +1115,11 @@ namespace OpenSim
1036 } 1115 }
1037 } 1116 }
1038 1117
1118 /// <summary>
1119 /// Loads data and region objects from XML format.
1120 /// </summary>
1121 /// <param name="module"></param>
1122 /// <param name="cmdparams"></param>
1039 protected void LoadXml(string module, string[] cmdparams) 1123 protected void LoadXml(string module, string[] cmdparams)
1040 { 1124 {
1041 m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); 1125 m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason.");
@@ -1079,7 +1163,11 @@ namespace OpenSim
1079 } 1163 }
1080 } 1164 }
1081 } 1165 }
1082 1166 /// <summary>
1167 /// Serialize region data to XML2Format
1168 /// </summary>
1169 /// <param name="module"></param>
1170 /// <param name="cmdparams"></param>
1083 protected void SaveXml2(string module, string[] cmdparams) 1171 protected void SaveXml2(string module, string[] cmdparams)
1084 { 1172 {
1085 if (cmdparams.Length > 2) 1173 if (cmdparams.Length > 2)
@@ -1092,6 +1180,11 @@ namespace OpenSim
1092 } 1180 }
1093 } 1181 }
1094 1182
1183 /// <summary>
1184 /// Load region data from Xml2Format
1185 /// </summary>
1186 /// <param name="module"></param>
1187 /// <param name="cmdparams"></param>
1095 protected void LoadXml2(string module, string[] cmdparams) 1188 protected void LoadXml2(string module, string[] cmdparams)
1096 { 1189 {
1097 if (cmdparams.Length > 2) 1190 if (cmdparams.Length > 2)
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
index 99a4057..381070e 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs
@@ -40,9 +40,6 @@ namespace OpenSim.Region.Communications.Hypergrid
40{ 40{
41 public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1 41 public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1
42 { 42 {
43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45
46 IHyperlink m_osw = null; 43 IHyperlink m_osw = null;
47 public IHyperlink HGServices 44 public IHyperlink HGServices
48 { 45 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 28b4d64..470a386 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
74 /// <summary> 74 /// <summary>
75 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). 75 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
76 /// </summary> 76 /// </summary>
77 //[Test] 77 [Test]
78 public void TestSaveIarV0_1() 78 public void TestSaveIarV0_1()
79 { 79 {
80 TestHelper.InMethod(); 80 TestHelper.InMethod();
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
82 82
83 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 83 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
84 84
85 Scene scene = SceneSetupHelpers.SetupScene(""); 85 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
86 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 86 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
87 CommunicationsManager cm = scene.CommsManager; 87 CommunicationsManager cm = scene.CommsManager;
88 88
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
222 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where 222 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
223 /// an account exists with the creator name. 223 /// an account exists with the creator name.
224 /// </summary> 224 /// </summary>
225 //[Test] 225 [Test]
226 public void TestLoadIarV0_1ExistingUsers() 226 public void TestLoadIarV0_1ExistingUsers()
227 { 227 {
228 TestHelper.InMethod(); 228 TestHelper.InMethod();
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
262 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 262 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
263 263
264 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 264 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
265 Scene scene = SceneSetupHelpers.SetupScene(); 265 Scene scene = SceneSetupHelpers.SetupScene("inventory");
266 IUserAdminService userAdminService = scene.CommsManager.UserAdminService; 266 IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
267 267
268 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 268 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
276 276
277 CachedUserInfo userInfo 277 CachedUserInfo userInfo
278 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); 278 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
279 //userInfo.FetchInventory(); 279
280 /*
281 for (int i = 0 ; i < 50 ; i++)
282 {
283 if (userInfo.HasReceivedInventory == true)
284 break;
285 Thread.Sleep(200);
286 }
287 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
288 */
289 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); 280 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
290 Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); 281 Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item");
291 Assert.That( 282 Assert.That(
@@ -395,17 +386,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
395 userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived); 386 userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived);
396 Monitor.Wait(this, 60000); 387 Monitor.Wait(this, 60000);
397 } 388 }
398
399 //userInfo.FetchInventory();
400 /*
401 for (int i = 0 ; i < 50 ; i++)
402 {
403 if (userInfo.HasReceivedInventory == true)
404 break;
405 Thread.Sleep(200);
406 }
407 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
408 */
409 389
410 Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); 390 Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder);
411 391
@@ -429,22 +409,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
429 409
430 Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); 410 Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder);
431 411
432 try 412 new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null)
433 { 413 .ReplicateArchivePathToUserInventory(
434 new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) 414 itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded);
435 .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); 415
436 416 Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder);
437 Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); 417 InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a");
438 InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); 418 Assert.That(folder1, Is.Not.Null, "Could not find folder a");
439 Assert.That(folder1, Is.Not.Null, "Could not find folder a"); 419 InventoryFolderImpl folder2 = folder1.FindFolderByPath("b");
440 InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); 420 Assert.That(folder2, Is.Not.Null, "Could not find folder b");
441 Assert.That(folder2, Is.Not.Null, "Could not find folder b");
442 }
443 catch (NullReferenceException e)
444 {
445 // Non fatal for now until we resolve the race condition
446 Console.WriteLine("Test failed with {0}", e);
447 }
448 } 421 }
449 } 422 }
450} 423}
diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs
index d3324e4..0f58788 100644
--- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Globalization; 30using System.Globalization;
30using System.Reflection; 31using System.Reflection;
31using log4net; 32using log4net;
@@ -41,6 +42,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
41 { 42 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 private Scene m_scene; 44 private Scene m_scene;
45 private IProfileModule m_profileModule = null;
44 46
45 public AvatarProfilesModule() 47 public AvatarProfilesModule()
46 { 48 {
@@ -56,6 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
56 58
57 public void PostInitialise() 59 public void PostInitialise()
58 { 60 {
61 m_profileModule = m_scene.RequestModuleInterface<IProfileModule>();
59 } 62 }
60 63
61 public void Close() 64 public void Close()
@@ -108,6 +111,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
108 charterMember = Utils.StringToBytes(profile.CustomType); 111 charterMember = Utils.StringToBytes(profile.CustomType);
109 } 112 }
110 113
114 if (m_profileModule != null)
115 {
116 Hashtable profileData = m_profileModule.GetProfileData(remoteClient.AgentId);
117 if (profileData["ProfileUrl"] != null)
118 profile.ProfileUrl = profileData["ProfileUrl"].ToString();
119 }
111 remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, 120 remoteClient.SendAvatarProperties(profile.ID, profile.AboutText,
112 Util.ToDateTime(profile.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture), 121 Util.ToDateTime(profile.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture),
113 charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff), 122 charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff),
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
new file mode 100644
index 0000000..375faf5
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
@@ -0,0 +1,206 @@
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;
30
31using OpenMetaverse;
32using Nini.Config;
33using log4net;
34
35using OpenSim.Framework;
36using OpenSim.Services.Interfaces;
37
38
39namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
40{
41 public abstract class BaseInventoryConnector : IInventoryService
42 {
43 protected InventoryCache m_cache;
44
45 protected virtual void Init(IConfigSource source)
46 {
47 m_cache = new InventoryCache();
48 m_cache.Init(source, this);
49 }
50
51 /// <summary>
52 /// Create the entire inventory for a given user
53 /// </summary>
54 /// <param name="user"></param>
55 /// <returns></returns>
56 public abstract bool CreateUserInventory(UUID user);
57
58 /// <summary>
59 /// Gets the skeleton of the inventory -- folders only
60 /// </summary>
61 /// <param name="userId"></param>
62 /// <returns></returns>
63 public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId);
64
65 /// <summary>
66 /// Synchronous inventory fetch.
67 /// </summary>
68 /// <param name="userID"></param>
69 /// <returns></returns>
70 public abstract InventoryCollection GetUserInventory(UUID userID);
71
72 /// <summary>
73 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
74 /// inventory has been received
75 /// </summary>
76 /// <param name="userID"></param>
77 /// <param name="callback"></param>
78 public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
79
80 /// <summary>
81 /// Retrieve the root inventory folder for the given user.
82 /// </summary>
83 /// <param name="userID"></param>
84 /// <returns>null if no root folder was found</returns>
85 public abstract InventoryFolderBase GetRootFolder(UUID userID);
86
87 public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID);
88
89 /// <summary>
90 /// Gets the user folder for the given folder-type
91 /// </summary>
92 /// <param name="userID"></param>
93 /// <param name="type"></param>
94 /// <returns></returns>
95 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
96 {
97 return m_cache.GetFolderForType(userID, type);
98 }
99
100 /// <summary>
101 /// Gets everything (folders and items) inside a folder
102 /// </summary>
103 /// <param name="userId"></param>
104 /// <param name="folderID"></param>
105 /// <returns></returns>
106 public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID);
107
108 /// <summary>
109 /// Gets the items inside a folder
110 /// </summary>
111 /// <param name="userID"></param>
112 /// <param name="folderID"></param>
113 /// <returns></returns>
114 public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID);
115
116 /// <summary>
117 /// Add a new folder to the user's inventory
118 /// </summary>
119 /// <param name="folder"></param>
120 /// <returns>true if the folder was successfully added</returns>
121 public abstract bool AddFolder(InventoryFolderBase folder);
122
123 /// <summary>
124 /// Update a folder in the user's inventory
125 /// </summary>
126 /// <param name="folder"></param>
127 /// <returns>true if the folder was successfully updated</returns>
128 public abstract bool UpdateFolder(InventoryFolderBase folder);
129
130 /// <summary>
131 /// Move an inventory folder to a new location
132 /// </summary>
133 /// <param name="folder">A folder containing the details of the new location</param>
134 /// <returns>true if the folder was successfully moved</returns>
135 public abstract bool MoveFolder(InventoryFolderBase folder);
136
137 /// <summary>
138 /// Purge an inventory folder of all its items and subfolders.
139 /// </summary>
140 /// <param name="folder"></param>
141 /// <returns>true if the folder was successfully purged</returns>
142 public abstract bool PurgeFolder(InventoryFolderBase folder);
143
144 /// <summary>
145 /// Add a new item to the user's inventory.
146 /// If the given item has to parent folder, it tries to find the most
147 /// suitable folder for it.
148 /// </summary>
149 /// <param name="item"></param>
150 /// <returns>true if the item was successfully added</returns>
151 public bool AddItem(InventoryItemBase item)
152 {
153 if (item.Folder == UUID.Zero)
154 {
155 InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
156 if (f != null)
157 item.Folder = f.ID;
158 else
159 {
160 f = GetRootFolder(item.Owner);
161 if (f != null)
162 item.Folder = f.ID;
163 else
164 return false;
165 }
166 }
167
168 return AddItemPlain(item);
169 }
170
171 protected abstract bool AddItemPlain(InventoryItemBase item);
172
173 /// <summary>
174 /// Update an item in the user's inventory
175 /// </summary>
176 /// <param name="item"></param>
177 /// <returns>true if the item was successfully updated</returns>
178 public abstract bool UpdateItem(InventoryItemBase item);
179
180 /// <summary>
181 /// Delete an item from the user's inventory
182 /// </summary>
183 /// <param name="item"></param>
184 /// <returns>true if the item was successfully deleted</returns>
185 public abstract bool DeleteItem(InventoryItemBase item);
186
187 public abstract InventoryItemBase QueryItem(InventoryItemBase item);
188
189 public abstract InventoryFolderBase QueryFolder(InventoryFolderBase folder);
190
191 /// <summary>
192 /// Does the given user have an inventory structure?
193 /// </summary>
194 /// <param name="userID"></param>
195 /// <returns></returns>
196 public abstract bool HasInventoryForUser(UUID userID);
197
198 /// <summary>
199 /// Get the active gestures of the agent.
200 /// </summary>
201 /// <param name="userId"></param>
202 /// <returns></returns>
203 public abstract List<InventoryItemBase> GetActiveGestures(UUID userId);
204
205 }
206}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index d4168fe..62b9bed 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -41,7 +41,7 @@ using OpenMetaverse;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
43{ 43{
44 public class HGInventoryBroker : InventoryCache, ISharedRegionModule, IInventoryService 44 public class HGInventoryBroker : BaseInventoryConnector, ISharedRegionModule, IInventoryService
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
138 { 138 {
139 } 139 }
140 140
141 public override void AddRegion(Scene scene) 141 public void AddRegion(Scene scene)
142 { 142 {
143 if (!m_Enabled) 143 if (!m_Enabled)
144 return; 144 return;
@@ -156,12 +156,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
156 } 156 }
157 157
158 scene.RegisterModuleInterface<IInventoryService>(this); 158 scene.RegisterModuleInterface<IInventoryService>(this);
159 base.AddRegion(scene); 159 m_cache.AddRegion(scene);
160 } 160 }
161 161
162 public override void RemoveRegion(Scene scene) 162 public void RemoveRegion(Scene scene)
163 { 163 {
164 base.RemoveRegion(scene); 164 if (!m_Enabled)
165 return;
166
167 m_cache.RemoveRegion(scene);
165 } 168 }
166 169
167 public void RegionLoaded(Scene scene) 170 public void RegionLoaded(Scene scene)
@@ -175,17 +178,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
175 178
176 #region IInventoryService 179 #region IInventoryService
177 180
178 public bool CreateUserInventory(UUID userID) 181 public override bool CreateUserInventory(UUID userID)
179 { 182 {
180 return m_GridService.CreateUserInventory(userID); 183 return m_GridService.CreateUserInventory(userID);
181 } 184 }
182 185
183 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) 186 public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
184 { 187 {
185 return m_GridService.GetInventorySkeleton(userId); 188 return m_GridService.GetInventorySkeleton(userId);
186 } 189 }
187 190
188 public InventoryCollection GetUserInventory(UUID userID) 191 public override InventoryCollection GetUserInventory(UUID userID)
189 { 192 {
190 if (IsLocalGridUser(userID)) 193 if (IsLocalGridUser(userID))
191 return m_GridService.GetUserInventory(userID); 194 return m_GridService.GetUserInventory(userID);
@@ -193,7 +196,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
193 return null; 196 return null;
194 } 197 }
195 198
196 public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) 199 public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
197 { 200 {
198 if (IsLocalGridUser(userID)) 201 if (IsLocalGridUser(userID))
199 m_GridService.GetUserInventory(userID, callback); 202 m_GridService.GetUserInventory(userID, callback);
@@ -220,7 +223,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
220 // } 223 // }
221 //} 224 //}
222 225
223 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 226 public override InventoryCollection GetFolderContent(UUID userID, UUID folderID)
224 { 227 {
225 if (IsLocalGridUser(userID)) 228 if (IsLocalGridUser(userID))
226 return m_GridService.GetFolderContent(userID, folderID); 229 return m_GridService.GetFolderContent(userID, folderID);
@@ -271,12 +274,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
271 return new Dictionary<AssetType, InventoryFolderBase>(); 274 return new Dictionary<AssetType, InventoryFolderBase>();
272 } 275 }
273 276
274 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 277 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
275 { 278 {
276 return new List<InventoryItemBase>(); 279 return new List<InventoryItemBase>();
277 } 280 }
278 281
279 public bool AddFolder(InventoryFolderBase folder) 282 public override bool AddFolder(InventoryFolderBase folder)
280 { 283 {
281 if (folder == null) 284 if (folder == null)
282 return false; 285 return false;
@@ -291,7 +294,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
291 } 294 }
292 } 295 }
293 296
294 public bool UpdateFolder(InventoryFolderBase folder) 297 public override bool UpdateFolder(InventoryFolderBase folder)
295 { 298 {
296 if (folder == null) 299 if (folder == null)
297 return false; 300 return false;
@@ -306,7 +309,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
306 } 309 }
307 } 310 }
308 311
309 public bool MoveFolder(InventoryFolderBase folder) 312 public override bool MoveFolder(InventoryFolderBase folder)
310 { 313 {
311 if (folder == null) 314 if (folder == null)
312 return false; 315 return false;
@@ -321,7 +324,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
321 } 324 }
322 } 325 }
323 326
324 public bool PurgeFolder(InventoryFolderBase folder) 327 public override bool PurgeFolder(InventoryFolderBase folder)
325 { 328 {
326 if (folder == null) 329 if (folder == null)
327 return false; 330 return false;
@@ -336,7 +339,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
336 } 339 }
337 } 340 }
338 341
339 public bool AddItem(InventoryItemBase item) 342 // public bool AddItem(InventoryItemBase item) inherited
343 // Uses AddItemPlain
344
345 protected override bool AddItemPlain(InventoryItemBase item)
340 { 346 {
341 if (item == null) 347 if (item == null)
342 return false; 348 return false;
@@ -351,7 +357,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
351 } 357 }
352 } 358 }
353 359
354 public bool UpdateItem(InventoryItemBase item) 360 public override bool UpdateItem(InventoryItemBase item)
355 { 361 {
356 if (item == null) 362 if (item == null)
357 return false; 363 return false;
@@ -366,7 +372,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
366 } 372 }
367 } 373 }
368 374
369 public bool DeleteItem(InventoryItemBase item) 375 public override bool DeleteItem(InventoryItemBase item)
370 { 376 {
371 if (item == null) 377 if (item == null)
372 return false; 378 return false;
@@ -381,7 +387,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
381 } 387 }
382 } 388 }
383 389
384 public InventoryItemBase QueryItem(InventoryItemBase item) 390 public override InventoryItemBase QueryItem(InventoryItemBase item)
385 { 391 {
386 if (item == null) 392 if (item == null)
387 return null; 393 return null;
@@ -396,7 +402,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
396 } 402 }
397 } 403 }
398 404
399 public InventoryFolderBase QueryFolder(InventoryFolderBase folder) 405 public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
400 { 406 {
401 if (folder == null) 407 if (folder == null)
402 return null; 408 return null;
@@ -411,17 +417,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
411 } 417 }
412 } 418 }
413 419
414 public bool HasInventoryForUser(UUID userID) 420 public override bool HasInventoryForUser(UUID userID)
415 { 421 {
416 return false; 422 return false;
417 } 423 }
418 424
419 public InventoryFolderBase GetRootFolder(UUID userID) 425 public override InventoryFolderBase GetRootFolder(UUID userID)
420 { 426 {
421 return null; 427 return null;
422 } 428 }
423 429
424 public List<InventoryItemBase> GetActiveGestures(UUID userId) 430 public override List<InventoryItemBase> GetActiveGestures(UUID userId)
425 { 431 {
426 return new List<InventoryItemBase>(); 432 return new List<InventoryItemBase>();
427 } 433 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
index b4785f4..c16e92e 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
@@ -1,4 +1,31 @@
1using System; 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;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Reflection; 30using System.Reflection;
4 31
@@ -12,21 +39,23 @@ using log4net;
12 39
13namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
14{ 41{
15 public abstract class InventoryCache 42 public class InventoryCache
16 { 43 {
17 private static readonly ILog m_log = 44 private static readonly ILog m_log =
18 LogManager.GetLogger( 45 LogManager.GetLogger(
19 MethodBase.GetCurrentMethod().DeclaringType); 46 MethodBase.GetCurrentMethod().DeclaringType);
20 47
48 protected BaseInventoryConnector m_Connector;
21 protected List<Scene> m_Scenes; 49 protected List<Scene> m_Scenes;
22 50
23 // The cache proper 51 // The cache proper
24 protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache; 52 protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;
25 53
26 protected virtual void Init(IConfigSource source) 54 public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
27 { 55 {
28 m_Scenes = new List<Scene>(); 56 m_Scenes = new List<Scene>();
29 m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>(); 57 m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>();
58 m_Connector = connector;
30 } 59 }
31 60
32 public virtual void AddRegion(Scene scene) 61 public virtual void AddRegion(Scene scene)
@@ -59,9 +88,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
59 } 88 }
60 89
61 // If not, go get them and place them in the cache 90 // If not, go get them and place them in the cache
62 Dictionary<AssetType, InventoryFolderBase> folders = GetSystemFolders(presence.UUID); 91 Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID);
63 m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, fetched system folders for {0} {1}: count {2}", 92 m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
64 presence.Firstname, presence.Lastname, folders.Count); 93 presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
65 if (folders.Count > 0) 94 if (folders.Count > 0)
66 lock (m_InventoryCache) 95 lock (m_InventoryCache)
67 m_InventoryCache.Add(presence.UUID, folders); 96 m_InventoryCache.Add(presence.UUID, folders);
@@ -69,28 +98,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
69 98
70 void OnClientClosed(UUID clientID, Scene scene) 99 void OnClientClosed(UUID clientID, Scene scene)
71 { 100 {
72 ScenePresence sp = null; 101 if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
73 foreach (Scene s in m_Scenes)
74 { 102 {
75 s.TryGetAvatar(clientID, out sp); 103 ScenePresence sp = null;
76 if ((sp != null) && !sp.IsChildAgent) 104 foreach (Scene s in m_Scenes)
77 { 105 {
78 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", 106 s.TryGetAvatar(clientID, out sp);
79 scene.RegionInfo.RegionName, clientID); 107 if ((sp != null) && !sp.IsChildAgent && (s != scene))
80 return; 108 {
109 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
110 scene.RegionInfo.RegionName, clientID);
111 return;
112 }
81 } 113 }
82 }
83 114
84 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", 115 // Drop system folders
85 scene.RegionInfo.RegionName, clientID); 116 lock (m_InventoryCache)
86 // Drop system folders 117 if (m_InventoryCache.ContainsKey(clientID))
87 lock (m_InventoryCache) 118 {
88 if (m_InventoryCache.ContainsKey(clientID)) 119 m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
89 m_InventoryCache.Remove(clientID); 120 scene.RegionInfo.RegionName, clientID);
90 121
122 m_InventoryCache.Remove(clientID);
123 }
124 }
91 } 125 }
92 126
93 public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID);
94 127
95 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) 128 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
96 { 129 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 98e30ce..6efe903 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -41,7 +41,7 @@ using OpenMetaverse;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
43{ 43{
44 public class LocalInventoryServicesConnector : InventoryCache, ISharedRegionModule, IInventoryService 44 public class LocalInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
124 { 124 {
125 } 125 }
126 126
127 public override void AddRegion(Scene scene) 127 public void AddRegion(Scene scene)
128 { 128 {
129 if (!m_Enabled) 129 if (!m_Enabled)
130 return; 130 return;
@@ -141,12 +141,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
141// "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); 141// "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName);
142 142
143 scene.RegisterModuleInterface<IInventoryService>(this); 143 scene.RegisterModuleInterface<IInventoryService>(this);
144 base.AddRegion(scene); 144 m_cache.AddRegion(scene);
145 } 145 }
146 146
147 public override void RemoveRegion(Scene scene) 147 public void RemoveRegion(Scene scene)
148 { 148 {
149 base.RemoveRegion(scene); 149 if (!m_Enabled)
150 return;
151
152 m_cache.RemoveRegion(scene);
150 } 153 }
151 154
152 public void RegionLoaded(Scene scene) 155 public void RegionLoaded(Scene scene)
@@ -160,22 +163,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
160 163
161 #region IInventoryService 164 #region IInventoryService
162 165
163 public bool CreateUserInventory(UUID user) 166 public override bool CreateUserInventory(UUID user)
164 { 167 {
165 return m_InventoryService.CreateUserInventory(user); 168 return m_InventoryService.CreateUserInventory(user);
166 } 169 }
167 170
168 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) 171 public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
169 { 172 {
170 return m_InventoryService.GetInventorySkeleton(userId); 173 return m_InventoryService.GetInventorySkeleton(userId);
171 } 174 }
172 175
173 public InventoryCollection GetUserInventory(UUID id) 176 public override InventoryCollection GetUserInventory(UUID id)
174 { 177 {
175 return m_InventoryService.GetUserInventory(id); 178 return m_InventoryService.GetUserInventory(id);
176 } 179 }
177 180
178 public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) 181 public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
179 { 182 {
180 m_InventoryService.GetUserInventory(userID, callback); 183 m_InventoryService.GetUserInventory(userID, callback);
181 } 184 }
@@ -207,13 +210,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
207 return new Dictionary<AssetType, InventoryFolderBase>(); 210 return new Dictionary<AssetType, InventoryFolderBase>();
208 } 211 }
209 212
210 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 213 public override InventoryCollection GetFolderContent(UUID userID, UUID folderID)
211 { 214 {
212 return m_InventoryService.GetFolderContent(userID, folderID); 215 return m_InventoryService.GetFolderContent(userID, folderID);
213 } 216 }
214 217
215 218
216 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 219 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
217 { 220 {
218 return m_InventoryService.GetFolderItems(userID, folderID); 221 return m_InventoryService.GetFolderItems(userID, folderID);
219 } 222 }
@@ -223,7 +226,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
223 /// </summary> 226 /// </summary>
224 /// <param name="folder"></param> 227 /// <param name="folder"></param>
225 /// <returns>true if the folder was successfully added</returns> 228 /// <returns>true if the folder was successfully added</returns>
226 public bool AddFolder(InventoryFolderBase folder) 229 public override bool AddFolder(InventoryFolderBase folder)
227 { 230 {
228 return m_InventoryService.AddFolder(folder); 231 return m_InventoryService.AddFolder(folder);
229 } 232 }
@@ -233,7 +236,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
233 /// </summary> 236 /// </summary>
234 /// <param name="folder"></param> 237 /// <param name="folder"></param>
235 /// <returns>true if the folder was successfully updated</returns> 238 /// <returns>true if the folder was successfully updated</returns>
236 public bool UpdateFolder(InventoryFolderBase folder) 239 public override bool UpdateFolder(InventoryFolderBase folder)
237 { 240 {
238 return m_InventoryService.UpdateFolder(folder); 241 return m_InventoryService.UpdateFolder(folder);
239 } 242 }
@@ -243,7 +246,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
243 /// </summary> 246 /// </summary>
244 /// <param name="folder">A folder containing the details of the new location</param> 247 /// <param name="folder">A folder containing the details of the new location</param>
245 /// <returns>true if the folder was successfully moved</returns> 248 /// <returns>true if the folder was successfully moved</returns>
246 public bool MoveFolder(InventoryFolderBase folder) 249 public override bool MoveFolder(InventoryFolderBase folder)
247 { 250 {
248 return m_InventoryService.MoveFolder(folder); 251 return m_InventoryService.MoveFolder(folder);
249 } 252 }
@@ -253,17 +256,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
253 /// </summary> 256 /// </summary>
254 /// <param name="folder"></param> 257 /// <param name="folder"></param>
255 /// <returns>true if the folder was successfully purged</returns> 258 /// <returns>true if the folder was successfully purged</returns>
256 public bool PurgeFolder(InventoryFolderBase folder) 259 public override bool PurgeFolder(InventoryFolderBase folder)
257 { 260 {
258 return m_InventoryService.PurgeFolder(folder); 261 return m_InventoryService.PurgeFolder(folder);
259 } 262 }
260 263
261 /// <summary> 264 /// <summary>
262 /// Add a new item to the user's inventory 265 /// Add a new item to the user's inventory, plain
266 /// Called by base class AddItem
263 /// </summary> 267 /// </summary>
264 /// <param name="item"></param> 268 /// <param name="item"></param>
265 /// <returns>true if the item was successfully added</returns> 269 /// <returns>true if the item was successfully added</returns>
266 public bool AddItem(InventoryItemBase item) 270 protected override bool AddItemPlain(InventoryItemBase item)
267 { 271 {
268 return m_InventoryService.AddItem(item); 272 return m_InventoryService.AddItem(item);
269 } 273 }
@@ -273,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
273 /// </summary> 277 /// </summary>
274 /// <param name="item"></param> 278 /// <param name="item"></param>
275 /// <returns>true if the item was successfully updated</returns> 279 /// <returns>true if the item was successfully updated</returns>
276 public bool UpdateItem(InventoryItemBase item) 280 public override bool UpdateItem(InventoryItemBase item)
277 { 281 {
278 return m_InventoryService.UpdateItem(item); 282 return m_InventoryService.UpdateItem(item);
279 } 283 }
@@ -283,17 +287,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
283 /// </summary> 287 /// </summary>
284 /// <param name="item"></param> 288 /// <param name="item"></param>
285 /// <returns>true if the item was successfully deleted</returns> 289 /// <returns>true if the item was successfully deleted</returns>
286 public bool DeleteItem(InventoryItemBase item) 290 public override bool DeleteItem(InventoryItemBase item)
287 { 291 {
288 return m_InventoryService.DeleteItem(item); 292 return m_InventoryService.DeleteItem(item);
289 } 293 }
290 294
291 public InventoryItemBase QueryItem(InventoryItemBase item) 295 public override InventoryItemBase QueryItem(InventoryItemBase item)
292 { 296 {
293 return m_InventoryService.QueryItem(item); 297 return m_InventoryService.QueryItem(item);
294 } 298 }
295 299
296 public InventoryFolderBase QueryFolder(InventoryFolderBase folder) 300 public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
297 { 301 {
298 return m_InventoryService.QueryFolder(folder); 302 return m_InventoryService.QueryFolder(folder);
299 } 303 }
@@ -303,7 +307,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
303 /// </summary> 307 /// </summary>
304 /// <param name="userID"></param> 308 /// <param name="userID"></param>
305 /// <returns></returns> 309 /// <returns></returns>
306 public bool HasInventoryForUser(UUID userID) 310 public override bool HasInventoryForUser(UUID userID)
307 { 311 {
308 return m_InventoryService.HasInventoryForUser(userID); 312 return m_InventoryService.HasInventoryForUser(userID);
309 } 313 }
@@ -313,12 +317,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
313 /// </summary> 317 /// </summary>
314 /// <param name="userID"></param> 318 /// <param name="userID"></param>
315 /// <returns>null if no root folder was found</returns> 319 /// <returns>null if no root folder was found</returns>
316 public InventoryFolderBase GetRootFolder(UUID userID) 320 public override InventoryFolderBase GetRootFolder(UUID userID)
317 { 321 {
318 return m_InventoryService.GetRootFolder(userID); 322 return m_InventoryService.GetRootFolder(userID);
319 } 323 }
320 324
321 public List<InventoryItemBase> GetActiveGestures(UUID userId) 325 public override List<InventoryItemBase> GetActiveGestures(UUID userId)
322 { 326 {
323 return m_InventoryService.GetActiveGestures(userId); 327 return m_InventoryService.GetActiveGestures(userId);
324 } 328 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index dceda38..f87aab9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -40,7 +40,7 @@ using OpenMetaverse;
40 40
41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
42{ 42{
43 public class RemoteInventoryServicesConnector : InventoryCache, ISharedRegionModule, IInventoryService 43 public class RemoteInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService
44 { 44 {
45 private static readonly ILog m_log = 45 private static readonly ILog m_log =
46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
102 { 102 {
103 } 103 }
104 104
105 public override void AddRegion(Scene scene) 105 public void AddRegion(Scene scene)
106 { 106 {
107 if (!m_Enabled) 107 if (!m_Enabled)
108 return; 108 return;
@@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
117 } 117 }
118 118
119 scene.RegisterModuleInterface<IInventoryService>(this); 119 scene.RegisterModuleInterface<IInventoryService>(this);
120 base.AddRegion(scene); 120 m_cache.AddRegion(scene);
121 } 121 }
122 122
123 public override void RemoveRegion(Scene scene) 123 public void RemoveRegion(Scene scene)
124 { 124 {
125 base.RemoveRegion(scene); 125 if (!m_Enabled)
126 return;
127
128 m_cache.RemoveRegion(scene);
126 } 129 }
127 130
128 public void RegionLoaded(Scene scene) 131 public void RegionLoaded(Scene scene)
@@ -138,22 +141,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
138 141
139 #region IInventoryService 142 #region IInventoryService
140 143
141 public bool CreateUserInventory(UUID user) 144 public override bool CreateUserInventory(UUID user)
142 { 145 {
143 return false; 146 return false;
144 } 147 }
145 148
146 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) 149 public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
147 { 150 {
148 return new List<InventoryFolderBase>(); 151 return new List<InventoryFolderBase>();
149 } 152 }
150 153
151 public InventoryCollection GetUserInventory(UUID userID) 154 public override InventoryCollection GetUserInventory(UUID userID)
152 { 155 {
153 return null; 156 return null;
154 } 157 }
155 158
156 public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) 159 public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
157 { 160 {
158 UUID sessionID = GetSessionID(userID); 161 UUID sessionID = GetSessionID(userID);
159 try 162 try
@@ -180,7 +183,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
180 return m_RemoteConnector.GetSystemFolders(userID.ToString(), sessionID); 183 return m_RemoteConnector.GetSystemFolders(userID.ToString(), sessionID);
181 } 184 }
182 185
183 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 186 public override InventoryCollection GetFolderContent(UUID userID, UUID folderID)
184 { 187 {
185 UUID sessionID = GetSessionID(userID); 188 UUID sessionID = GetSessionID(userID);
186 try 189 try
@@ -199,12 +202,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
199 return nullCollection; 202 return nullCollection;
200 } 203 }
201 204
202 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 205 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
203 { 206 {
204 return new List<InventoryItemBase>(); 207 return new List<InventoryItemBase>();
205 } 208 }
206 209
207 public bool AddFolder(InventoryFolderBase folder) 210 public override bool AddFolder(InventoryFolderBase folder)
208 { 211 {
209 if (folder == null) 212 if (folder == null)
210 return false; 213 return false;
@@ -213,7 +216,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
213 return m_RemoteConnector.AddFolder(folder.Owner.ToString(), folder, sessionID); 216 return m_RemoteConnector.AddFolder(folder.Owner.ToString(), folder, sessionID);
214 } 217 }
215 218
216 public bool UpdateFolder(InventoryFolderBase folder) 219 public override bool UpdateFolder(InventoryFolderBase folder)
217 { 220 {
218 if (folder == null) 221 if (folder == null)
219 return false; 222 return false;
@@ -222,7 +225,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
222 return m_RemoteConnector.UpdateFolder(folder.Owner.ToString(), folder, sessionID); 225 return m_RemoteConnector.UpdateFolder(folder.Owner.ToString(), folder, sessionID);
223 } 226 }
224 227
225 public bool MoveFolder(InventoryFolderBase folder) 228 public override bool MoveFolder(InventoryFolderBase folder)
226 { 229 {
227 if (folder == null) 230 if (folder == null)
228 return false; 231 return false;
@@ -231,7 +234,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
231 return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); 234 return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID);
232 } 235 }
233 236
234 public bool PurgeFolder(InventoryFolderBase folder) 237 public override bool PurgeFolder(InventoryFolderBase folder)
235 { 238 {
236 if (folder == null) 239 if (folder == null)
237 return false; 240 return false;
@@ -240,7 +243,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
240 return m_RemoteConnector.PurgeFolder(folder.Owner.ToString(), folder, sessionID); 243 return m_RemoteConnector.PurgeFolder(folder.Owner.ToString(), folder, sessionID);
241 } 244 }
242 245
243 public bool AddItem(InventoryItemBase item) 246 // public bool AddItem(InventoryItemBase item) inherited
247 // Uses AddItemPlain
248
249 protected override bool AddItemPlain(InventoryItemBase item)
244 { 250 {
245 if (item == null) 251 if (item == null)
246 return false; 252 return false;
@@ -249,7 +255,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
249 return m_RemoteConnector.AddItem(item.Owner.ToString(), item, sessionID); 255 return m_RemoteConnector.AddItem(item.Owner.ToString(), item, sessionID);
250 } 256 }
251 257
252 public bool UpdateItem(InventoryItemBase item) 258 public override bool UpdateItem(InventoryItemBase item)
253 { 259 {
254 if (item == null) 260 if (item == null)
255 return false; 261 return false;
@@ -258,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
258 return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); 264 return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID);
259 } 265 }
260 266
261 public bool DeleteItem(InventoryItemBase item) 267 public override bool DeleteItem(InventoryItemBase item)
262 { 268 {
263 if (item == null) 269 if (item == null)
264 return false; 270 return false;
@@ -267,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
267 return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); 273 return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID);
268 } 274 }
269 275
270 public InventoryItemBase QueryItem(InventoryItemBase item) 276 public override InventoryItemBase QueryItem(InventoryItemBase item)
271 { 277 {
272 if (item == null) 278 if (item == null)
273 return null; 279 return null;
@@ -276,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
276 return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); 282 return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID);
277 } 283 }
278 284
279 public InventoryFolderBase QueryFolder(InventoryFolderBase folder) 285 public override InventoryFolderBase QueryFolder(InventoryFolderBase folder)
280 { 286 {
281 if (folder == null) 287 if (folder == null)
282 return null; 288 return null;
@@ -285,17 +291,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
285 return m_RemoteConnector.QueryFolder(folder.Owner.ToString(), folder, sessionID); 291 return m_RemoteConnector.QueryFolder(folder.Owner.ToString(), folder, sessionID);
286 } 292 }
287 293
288 public bool HasInventoryForUser(UUID userID) 294 public override bool HasInventoryForUser(UUID userID)
289 { 295 {
290 return false; 296 return false;
291 } 297 }
292 298
293 public InventoryFolderBase GetRootFolder(UUID userID) 299 public override InventoryFolderBase GetRootFolder(UUID userID)
294 { 300 {
295 return null; 301 return null;
296 } 302 }
297 303
298 public List<InventoryItemBase> GetActiveGestures(UUID userId) 304 public override List<InventoryItemBase> GetActiveGestures(UUID userId)
299 { 305 {
300 return new List<InventoryItemBase>(); 306 return new List<InventoryItemBase>();
301 } 307 }
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 1d4d6d7..7bbe045 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -429,7 +429,7 @@ namespace OpenSim.Region.Framework.Scenes
429 private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null; 429 private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null;
430 private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; 430 private ParcelPrimCountTainted handlerParcelPrimCountTainted = null;
431 private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; 431 private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null;
432 private ScriptTimerEvent handlerScriptTimerEvent = null; 432 // TODO: unused: private ScriptTimerEvent handlerScriptTimerEvent = null;
433 private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; 433 private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null;
434 434
435 private ScriptColliding handlerCollidingStart = null; 435 private ScriptColliding handlerCollidingStart = null;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 9251aa6..113918d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -622,8 +622,26 @@ namespace OpenSim.Region.Framework.Scenes
622 "[AGENT INVENTORY]: Failed to move folder {0} to {1} for user {2}", 622 "[AGENT INVENTORY]: Failed to move folder {0} to {1} for user {2}",
623 folderID, parentID, remoteClient.Name); 623 folderID, parentID, remoteClient.Name);
624 } 624 }
625 }
626
627 public void HandleMoveInventoryFolder2(IClientAPI remoteClient, UUID folderID, UUID parentID)
628 {
629 InventoryFolderBase folder = new InventoryFolderBase(folderID);
630 folder = InventoryService.QueryFolder(folder);
631 if (folder != null)
632 {
633 folder.ParentID = parentID;
634 if (!InventoryService.MoveFolder(folder))
635 m_log.WarnFormat("[AGENT INVENTORY]: could not move folder {0}", folderID);
636 else
637 m_log.DebugFormat("[AGENT INVENTORY]: folder {0} moved to parent {1}", folderID, parentID);
638 }
639 else
640 {
641 m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID);
642 }
625 } 643 }
626 644
627 /// <summary> 645 /// <summary>
628 /// This should delete all the items and folders in the given directory. 646 /// This should delete all the items and folders in the given directory.
629 /// </summary> 647 /// </summary>
@@ -647,6 +665,17 @@ namespace OpenSim.Region.Framework.Scenes
647 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", 665 "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}",
648 remoteClient.Name, remoteClient.AgentId); 666 remoteClient.Name, remoteClient.AgentId);
649 } 667 }
668 }
669
670 public void HandlePurgeInventoryDescendents2(IClientAPI remoteClient, UUID folderID)
671 {
672 InventoryFolderBase folder = new InventoryFolderBase(folderID);
673
674 if (InventoryService.PurgeFolder(folder))
675 m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);
676 else
677 m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID);
650 } 678 }
679
651 } 680 }
652} 681}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7f1936e..18d7bad 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1038,6 +1038,10 @@ namespace OpenSim.Region.Framework.Scenes
1038 } 1038 }
1039 } 1039 }
1040 1040
1041 /// <summary>
1042 /// Send out simstats data to all clients
1043 /// </summary>
1044 /// <param name="stats">Stats on the Simulator's performance</param>
1041 private void SendSimStatsPackets(SimStats stats) 1045 private void SendSimStatsPackets(SimStats stats)
1042 { 1046 {
1043 List<ScenePresence> StatSendAgents = GetScenePresences(); 1047 List<ScenePresence> StatSendAgents = GetScenePresences();
@@ -1050,6 +1054,9 @@ namespace OpenSim.Region.Framework.Scenes
1050 } 1054 }
1051 } 1055 }
1052 1056
1057 /// <summary>
1058 /// Recount SceneObjectPart in parcel aabb
1059 /// </summary>
1053 private void UpdateLand() 1060 private void UpdateLand()
1054 { 1061 {
1055 if (LandChannel != null) 1062 if (LandChannel != null)
@@ -1061,11 +1068,17 @@ namespace OpenSim.Region.Framework.Scenes
1061 } 1068 }
1062 } 1069 }
1063 1070
1071 /// <summary>
1072 /// Update the terrain if it needs to be updated.
1073 /// </summary>
1064 private void UpdateTerrain() 1074 private void UpdateTerrain()
1065 { 1075 {
1066 EventManager.TriggerTerrainTick(); 1076 EventManager.TriggerTerrainTick();
1067 } 1077 }
1068 1078
1079 /// <summary>
1080 /// Back up queued up changes
1081 /// </summary>
1069 private void UpdateStorageBackup() 1082 private void UpdateStorageBackup()
1070 { 1083 {
1071 if (!m_backingup) 1084 if (!m_backingup)
@@ -1078,6 +1091,9 @@ namespace OpenSim.Region.Framework.Scenes
1078 } 1091 }
1079 } 1092 }
1080 1093
1094 /// <summary>
1095 /// Sends out the OnFrame event to the modules
1096 /// </summary>
1081 private void UpdateEvents() 1097 private void UpdateEvents()
1082 { 1098 {
1083 m_eventManager.TriggerOnFrame(); 1099 m_eventManager.TriggerOnFrame();
@@ -1133,6 +1149,10 @@ namespace OpenSim.Region.Framework.Scenes
1133 } 1149 }
1134 } 1150 }
1135 1151
1152 /// <summary>
1153 /// Synchronous force backup. For deletes and links/unlinks
1154 /// </summary>
1155 /// <param name="group">Object to be backed up</param>
1136 public void ForceSceneObjectBackup(SceneObjectGroup group) 1156 public void ForceSceneObjectBackup(SceneObjectGroup group)
1137 { 1157 {
1138 if (group != null) 1158 if (group != null)
@@ -1141,6 +1161,13 @@ namespace OpenSim.Region.Framework.Scenes
1141 } 1161 }
1142 } 1162 }
1143 1163
1164 /// <summary>
1165 /// Return object to avatar Message
1166 /// </summary>
1167 /// <param name="agentID">Avatar Unique Id</param>
1168 /// <param name="objectName">Name of object returned</param>
1169 /// <param name="location">Location of object returned</param>
1170 /// <param name="reason">Reasion for object return</param>
1144 public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason) 1171 public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason)
1145 { 1172 {
1146 lock (m_returns) 1173 lock (m_returns)
@@ -1167,6 +1194,9 @@ namespace OpenSim.Region.Framework.Scenes
1167 1194
1168 #region Load Terrain 1195 #region Load Terrain
1169 1196
1197 /// <summary>
1198 /// Store the terrain in the persistant data store
1199 /// </summary>
1170 public void SaveTerrain() 1200 public void SaveTerrain()
1171 { 1201 {
1172 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1202 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
@@ -1269,6 +1299,10 @@ namespace OpenSim.Region.Framework.Scenes
1269 1299
1270 #region Load Land 1300 #region Load Land
1271 1301
1302 /// <summary>
1303 /// Loads all Parcel data from the datastore for region identified by regionID
1304 /// </summary>
1305 /// <param name="regionID">Unique Identifier of the Region to load parcel data for</param>
1272 public void loadAllLandObjectsFromStorage(UUID regionID) 1306 public void loadAllLandObjectsFromStorage(UUID regionID)
1273 { 1307 {
1274 m_log.Info("[SCENE]: Loading land objects from storage"); 1308 m_log.Info("[SCENE]: Loading land objects from storage");
@@ -1322,6 +1356,20 @@ namespace OpenSim.Region.Framework.Scenes
1322 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 1356 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
1323 } 1357 }
1324 1358
1359
1360 /// <summary>
1361 /// Gets a new rez location based on the raycast and the size of the object that is being rezzed.
1362 /// </summary>
1363 /// <param name="RayStart"></param>
1364 /// <param name="RayEnd"></param>
1365 /// <param name="RayTargetID"></param>
1366 /// <param name="rot"></param>
1367 /// <param name="bypassRayCast"></param>
1368 /// <param name="RayEndIsIntersection"></param>
1369 /// <param name="frontFacesOnly"></param>
1370 /// <param name="scale"></param>
1371 /// <param name="FaceCenter"></param>
1372 /// <returns></returns>
1325 public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) 1373 public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
1326 { 1374 {
1327 Vector3 pos = Vector3.Zero; 1375 Vector3 pos = Vector3.Zero;
@@ -1412,6 +1460,19 @@ namespace OpenSim.Region.Framework.Scenes
1412 } 1460 }
1413 } 1461 }
1414 1462
1463
1464 /// <summary>
1465 /// Create a New SceneObjectGroup/Part by raycasting
1466 /// </summary>
1467 /// <param name="ownerID"></param>
1468 /// <param name="groupID"></param>
1469 /// <param name="RayEnd"></param>
1470 /// <param name="rot"></param>
1471 /// <param name="shape"></param>
1472 /// <param name="bypassRaycast"></param>
1473 /// <param name="RayStart"></param>
1474 /// <param name="RayTargetID"></param>
1475 /// <param name="RayEndIsIntersection"></param>
1415 public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, 1476 public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape,
1416 byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, 1477 byte bypassRaycast, Vector3 RayStart, UUID RayTargetID,
1417 byte RayEndIsIntersection) 1478 byte RayEndIsIntersection)
@@ -1829,6 +1890,12 @@ namespace OpenSim.Region.Framework.Scenes
1829 return true; 1890 return true;
1830 } 1891 }
1831 1892
1893 /// <summary>
1894 /// Attachment rezzing
1895 /// </summary>
1896 /// <param name="userID">Agent Unique ID</param>
1897 /// <param name="itemID">Object ID</param>
1898 /// <returns>False</returns>
1832 public virtual bool IncomingCreateObject(UUID userID, UUID itemID) 1899 public virtual bool IncomingCreateObject(UUID userID, UUID itemID)
1833 { 1900 {
1834 ScenePresence sp = GetScenePresence(userID); 1901 ScenePresence sp = GetScenePresence(userID);
@@ -1841,6 +1908,13 @@ namespace OpenSim.Region.Framework.Scenes
1841 return false; 1908 return false;
1842 } 1909 }
1843 1910
1911 /// <summary>
1912 /// Adds a Scene Object group to the Scene.
1913 /// Verifies that the creator of the object is not banned from the simulator.
1914 /// Checks if the item is an Attachment
1915 /// </summary>
1916 /// <param name="sceneObject"></param>
1917 /// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
1844 public bool AddSceneObject(SceneObjectGroup sceneObject) 1918 public bool AddSceneObject(SceneObjectGroup sceneObject)
1845 { 1919 {
1846 // If the user is banned, we won't let any of their objects 1920 // If the user is banned, we won't let any of their objects
@@ -1933,6 +2007,10 @@ namespace OpenSim.Region.Framework.Scenes
1933 2007
1934 #region Add/Remove Avatar Methods 2008 #region Add/Remove Avatar Methods
1935 2009
2010 /// <summary>
2011 /// Adding a New Client and Create a Presence for it.
2012 /// </summary>
2013 /// <param name="client"></param>
1936 public override void AddNewClient(IClientAPI client) 2014 public override void AddNewClient(IClientAPI client)
1937 { 2015 {
1938 SubscribeToClientEvents(client); 2016 SubscribeToClientEvents(client);
@@ -1977,6 +2055,10 @@ namespace OpenSim.Region.Framework.Scenes
1977 EventManager.TriggerOnNewClient(client); 2055 EventManager.TriggerOnNewClient(client);
1978 } 2056 }
1979 2057
2058 /// <summary>
2059 /// Register for events from the client
2060 /// </summary>
2061 /// <param name="client">The IClientAPI of the connected client</param>
1980 protected virtual void SubscribeToClientEvents(IClientAPI client) 2062 protected virtual void SubscribeToClientEvents(IClientAPI client)
1981 { 2063 {
1982 client.OnRegionHandShakeReply += SendLayerData; 2064 client.OnRegionHandShakeReply += SendLayerData;
@@ -2019,12 +2101,13 @@ namespace OpenSim.Region.Framework.Scenes
2019 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; 2101 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
2020 client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; 2102 client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
2021 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 2103 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
2104
2022 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 2105 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
2023 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; 2106 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
2024 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; 2107 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
2025 client.OnMoveInventoryFolder += HandleMoveInventoryFolder; 2108 client.OnMoveInventoryFolder += HandleMoveInventoryFolder; // 2; //!!
2026 client.OnFetchInventoryDescendents += HandleFetchInventoryDescendents; 2109 client.OnFetchInventoryDescendents += HandleFetchInventoryDescendents;
2027 client.OnPurgeInventoryDescendents += HandlePurgeInventoryDescendents; 2110 client.OnPurgeInventoryDescendents += HandlePurgeInventoryDescendents; // 2; //!!
2028 client.OnFetchInventory += HandleFetchInventory; 2111 client.OnFetchInventory += HandleFetchInventory;
2029 client.OnUpdateInventoryItem += UpdateInventoryItemAsset; 2112 client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
2030 client.OnCopyInventoryItem += CopyInventoryItem; 2113 client.OnCopyInventoryItem += CopyInventoryItem;
@@ -2036,6 +2119,7 @@ namespace OpenSim.Region.Framework.Scenes
2036 client.OnRemoveTaskItem += RemoveTaskInventory; 2119 client.OnRemoveTaskItem += RemoveTaskInventory;
2037 client.OnUpdateTaskInventory += UpdateTaskInventory; 2120 client.OnUpdateTaskInventory += UpdateTaskInventory;
2038 client.OnMoveTaskItem += ClientMoveTaskInventoryItem; 2121 client.OnMoveTaskItem += ClientMoveTaskInventoryItem;
2122
2039 client.OnGrabObject += ProcessObjectGrab; 2123 client.OnGrabObject += ProcessObjectGrab;
2040 client.OnDeGrabObject += ProcessObjectDeGrab; 2124 client.OnDeGrabObject += ProcessObjectDeGrab;
2041 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 2125 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
@@ -2068,8 +2152,8 @@ namespace OpenSim.Region.Framework.Scenes
2068 /// <summary> 2152 /// <summary>
2069 /// Teleport an avatar to their home region 2153 /// Teleport an avatar to their home region
2070 /// </summary> 2154 /// </summary>
2071 /// <param name="agentId"></param> 2155 /// <param name="agentId">The avatar's Unique ID</param>
2072 /// <param name="client"></param> 2156 /// <param name="client">The IClientAPI for the client</param>
2073 public virtual void TeleportClientHome(UUID agentId, IClientAPI client) 2157 public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
2074 { 2158 {
2075 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); 2159 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
@@ -2097,6 +2181,21 @@ namespace OpenSim.Region.Framework.Scenes
2097 } 2181 }
2098 } 2182 }
2099 2183
2184 /// <summary>
2185 /// Duplicates object specified by localID at position raycasted against RayTargetObject using
2186 /// RayEnd and RayStart to determine what the angle of the ray is
2187 /// </summary>
2188 /// <param name="localID">ID of object to duplicate</param>
2189 /// <param name="dupeFlags"></param>
2190 /// <param name="AgentID">Agent doing the duplication</param>
2191 /// <param name="GroupID">Group of new object</param>
2192 /// <param name="RayTargetObj">The target of the Ray</param>
2193 /// <param name="RayEnd">The ending of the ray (farthest away point)</param>
2194 /// <param name="RayStart">The Beginning of the ray (closest point)</param>
2195 /// <param name="BypassRaycast">Bool to bypass raycasting</param>
2196 /// <param name="RayEndIsIntersection">The End specified is the place to add the object</param>
2197 /// <param name="CopyCenters">Position the object at the center of the face that it's colliding with</param>
2198 /// <param name="CopyRotates">Rotate the object the same as the localID object</param>
2100 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, 2199 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID,
2101 UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, 2200 UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart,
2102 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 2201 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
@@ -2168,6 +2267,14 @@ namespace OpenSim.Region.Framework.Scenes
2168 } 2267 }
2169 } 2268 }
2170 2269
2270 /// <summary>
2271 /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in
2272 /// </summary>
2273 /// <param name="remoteClient"></param>
2274 /// <param name="regionHandle"></param>
2275 /// <param name="position"></param>
2276 /// <param name="lookAt"></param>
2277 /// <param name="flags"></param>
2171 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) 2278 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
2172 { 2279 {
2173 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); 2280 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId);
@@ -2338,6 +2445,12 @@ namespace OpenSim.Region.Framework.Scenes
2338 } 2445 }
2339 } 2446 }
2340 2447
2448 /// <summary>
2449 /// Removes region from an avatar's known region list. This coincides with child agents. For each child agent, there will be a known region entry.
2450 ///
2451 /// </summary>
2452 /// <param name="avatarID"></param>
2453 /// <param name="regionslst"></param>
2341 public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst) 2454 public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst)
2342 { 2455 {
2343 ScenePresence av = GetScenePresence(avatarID); 2456 ScenePresence av = GetScenePresence(avatarID);
@@ -2353,12 +2466,19 @@ namespace OpenSim.Region.Framework.Scenes
2353 } 2466 }
2354 } 2467 }
2355 2468
2469 /// <summary>
2470 /// Closes all endpoints with the circuitcode provided.
2471 /// </summary>
2472 /// <param name="circuitcode">Circuit Code of the endpoint to close</param>
2356 public override void CloseAllAgents(uint circuitcode) 2473 public override void CloseAllAgents(uint circuitcode)
2357 { 2474 {
2358 // Called by ClientView to kill all circuit codes 2475 // Called by ClientView to kill all circuit codes
2359 ClientManager.CloseAllAgents(circuitcode); 2476 ClientManager.CloseAllAgents(circuitcode);
2360 } 2477 }
2361 2478
2479 /// <summary>
2480 /// Inform all other ScenePresences on this Scene that someone else has changed position on the minimap.
2481 /// </summary>
2362 public void NotifyMyCoarseLocationChange() 2482 public void NotifyMyCoarseLocationChange()
2363 { 2483 {
2364 ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); 2484 ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
@@ -2453,9 +2573,10 @@ namespace OpenSim.Region.Framework.Scenes
2453 /// The return bool should allow for connections to be refused, but as not all calling paths 2573 /// The return bool should allow for connections to be refused, but as not all calling paths
2454 /// take proper notice of it let, we allowed banned users in still. 2574 /// take proper notice of it let, we allowed banned users in still.
2455 /// </summary> 2575 /// </summary>
2456 /// <param name="regionHandle"></param> 2576 /// <param name="agent">CircuitData of the agent who is connecting</param>
2457 /// <param name="agent"></param> 2577 /// <param name="reason">Outputs the reason for the false response on this string</param>
2458 /// <param name="reason"></param> 2578 /// <returns>True if the region accepts this agent. False if it does not. False will
2579 /// also return a reason.</returns>
2459 public bool NewUserConnection(AgentCircuitData agent, out string reason) 2580 public bool NewUserConnection(AgentCircuitData agent, out string reason)
2460 { 2581 {
2461 // Don't disable this log message - it's too helpful 2582 // Don't disable this log message - it's too helpful
@@ -2528,6 +2649,13 @@ namespace OpenSim.Region.Framework.Scenes
2528 return true; 2649 return true;
2529 } 2650 }
2530 2651
2652 /// <summary>
2653 /// Verifies that the user has a session on the Grid
2654 /// </summary>
2655 /// <param name="agent">Circuit Data of the Agent we're verifying</param>
2656 /// <param name="reason">Outputs the reason for the false response on this string</param>
2657 /// <returns>True if the user has a session on the grid. False if it does not. False will
2658 /// also return a reason.</returns>
2531 public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) 2659 public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason)
2532 { 2660 {
2533 reason = String.Empty; 2661 reason = String.Empty;
@@ -2540,6 +2668,13 @@ namespace OpenSim.Region.Framework.Scenes
2540 return result; 2668 return result;
2541 } 2669 }
2542 2670
2671 /// <summary>
2672 /// Verify if the user can connect to this region. Checks the banlist and ensures that the region is set for public access
2673 /// </summary>
2674 /// <param name="agent">The circuit data for the agent</param>
2675 /// <param name="reason">outputs the reason to this string</param>
2676 /// <returns>True if the region accepts this agent. False if it does not. False will
2677 /// also return a reason.</returns>
2543 protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) 2678 protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason)
2544 { 2679 {
2545 reason = String.Empty; 2680 reason = String.Empty;
@@ -2598,16 +2733,32 @@ namespace OpenSim.Region.Framework.Scenes
2598 return true; 2733 return true;
2599 } 2734 }
2600 2735
2736 /// <summary>
2737 /// Update an AgentCircuitData object with new information
2738 /// </summary>
2739 /// <param name="data">Information to update the AgentCircuitData with</param>
2601 public void UpdateCircuitData(AgentCircuitData data) 2740 public void UpdateCircuitData(AgentCircuitData data)
2602 { 2741 {
2603 m_authenticateHandler.UpdateAgentData(data); 2742 m_authenticateHandler.UpdateAgentData(data);
2604 } 2743 }
2605 2744
2745 /// <summary>
2746 /// Change the Circuit Code for the user's Circuit Data
2747 /// </summary>
2748 /// <param name="oldcc">The old Circuit Code. Must match a previous circuit code</param>
2749 /// <param name="newcc">The new Circuit Code. Must not be an already existing circuit code</param>
2750 /// <returns>True if we successfully changed it. False if we did not</returns>
2606 public bool ChangeCircuitCode(uint oldcc, uint newcc) 2751 public bool ChangeCircuitCode(uint oldcc, uint newcc)
2607 { 2752 {
2608 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 2753 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
2609 } 2754 }
2610 2755
2756 /// <summary>
2757 /// The Grid has requested that we log-off a user. Log them off.
2758 /// </summary>
2759 /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
2760 /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
2761 /// <param name="message">message to display to the user. Reason for being logged off</param>
2611 public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) 2762 public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
2612 { 2763 {
2613 ScenePresence loggingOffUser = null; 2764 ScenePresence loggingOffUser = null;
@@ -2673,6 +2824,13 @@ namespace OpenSim.Region.Framework.Scenes
2673 } 2824 }
2674 } 2825 }
2675 2826
2827 /// <summary>
2828 /// We've got an update about an agent that sees into this region,
2829 /// send it to ScenePresence for processing It's the full data.
2830 /// </summary>
2831 /// <param name="cAgentData">Agent that contains all of the relevant things about an agent.
2832 /// Appearance, animations, position, etc.</param>
2833 /// <returns>true if we handled it.</returns>
2676 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) 2834 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData)
2677 { 2835 {
2678// m_log.DebugFormat( 2836// m_log.DebugFormat(
@@ -2690,6 +2848,12 @@ namespace OpenSim.Region.Framework.Scenes
2690 return false; 2848 return false;
2691 } 2849 }
2692 2850
2851 /// <summary>
2852 /// We've got an update about an agent that sees into this region,
2853 /// send it to ScenePresence for processing It's only positional data
2854 /// </summary>
2855 /// <param name="cAgentData">AgentPosition that contains agent positional data so we can know what to send</param>
2856 /// <returns>true if we handled it.</returns>
2693 public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) 2857 public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData)
2694 { 2858 {
2695 //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); 2859 //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 0140faa..c1e39a9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -48,6 +48,9 @@ namespace OpenSim.Region.Framework.Scenes
48 48
49 public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); 49 public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst);
50 50
51 /// <summary>
52 /// Class that Region communications runs through
53 /// </summary>
51 public class SceneCommunicationService //one instance per region 54 public class SceneCommunicationService //one instance per region
52 { 55 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 56 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -60,15 +63,46 @@ namespace OpenSim.Region.Framework.Scenes
60 63
61 protected List<UUID> m_agentsInTransit; 64 protected List<UUID> m_agentsInTransit;
62 65
66 /// <summary>
67 /// An agent is crossing into this region
68 /// </summary>
63 public event AgentCrossing OnAvatarCrossingIntoRegion; 69 public event AgentCrossing OnAvatarCrossingIntoRegion;
70
71 /// <summary>
72 /// A user will arrive shortly, set up appropriate credentials so it can connect
73 /// </summary>
64 public event ExpectUserDelegate OnExpectUser; 74 public event ExpectUserDelegate OnExpectUser;
75
76 /// <summary>
77 /// A Prim will arrive shortly
78 /// </summary>
65 public event ExpectPrimDelegate OnExpectPrim; 79 public event ExpectPrimDelegate OnExpectPrim;
66 public event CloseAgentConnection OnCloseAgentConnection; 80 public event CloseAgentConnection OnCloseAgentConnection;
81
82 /// <summary>
83 /// A new prim has arrived
84 /// </summary>
67 public event PrimCrossing OnPrimCrossingIntoRegion; 85 public event PrimCrossing OnPrimCrossingIntoRegion;
86
87 /// <summary>
88 /// A New Region is up and available
89 /// </summary>
68 public event RegionUp OnRegionUp; 90 public event RegionUp OnRegionUp;
91
92 /// <summary>
93 /// We have a child agent for this avatar and we're getting a status update about it
94 /// </summary>
69 public event ChildAgentUpdate OnChildAgentUpdate; 95 public event ChildAgentUpdate OnChildAgentUpdate;
70 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; 96 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
97
98 /// <summary>
99 /// Time to log one of our users off. Grid Service sends this mostly
100 /// </summary>
71 public event LogOffUser OnLogOffUser; 101 public event LogOffUser OnLogOffUser;
102
103 /// <summary>
104 /// A region wants land data from us!
105 /// </summary>
72 public event GetLandData OnGetLandData; 106 public event GetLandData OnGetLandData;
73 107
74 private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; 108 private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
@@ -123,11 +157,20 @@ namespace OpenSim.Region.Framework.Scenes
123 } 157 }
124 } 158 }
125 159
160 /// <summary>
161 /// Returns a region with the name closest to string provided
162 /// </summary>
163 /// <param name="name">Partial Region Name for matching</param>
164 /// <returns>Region Information for the region</returns>
126 public RegionInfo RequestClosestRegion(string name) 165 public RegionInfo RequestClosestRegion(string name)
127 { 166 {
128 return m_commsProvider.GridService.RequestClosestRegion(name); 167 return m_commsProvider.GridService.RequestClosestRegion(name);
129 } 168 }
130 169
170 /// <summary>
171 /// This region is shutting down, de-register all events!
172 /// De-Register region from Grid!
173 /// </summary>
131 public void Close() 174 public void Close()
132 { 175 {
133 if (regionCommsHost != null) 176 if (regionCommsHost != null)
@@ -159,10 +202,9 @@ namespace OpenSim.Region.Framework.Scenes
159 #region CommsManager Event handlers 202 #region CommsManager Event handlers
160 203
161 /// <summary> 204 /// <summary>
162 /// 205 /// A New User will arrive shortly, Informs the scene that there's a new user on the way
163 /// </summary> 206 /// </summary>
164 /// <param name="regionHandle"></param> 207 /// <param name="agent">Data we need to ensure that the agent can connect</param>
165 /// <param name="agent"></param>
166 /// 208 ///
167 protected void NewUserConnection(AgentCircuitData agent) 209 protected void NewUserConnection(AgentCircuitData agent)
168 { 210 {
@@ -174,6 +216,12 @@ namespace OpenSim.Region.Framework.Scenes
174 } 216 }
175 } 217 }
176 218
219 /// <summary>
220 /// The Grid has requested us to log-off the user
221 /// </summary>
222 /// <param name="AgentID">Unique ID of agent to log-off</param>
223 /// <param name="RegionSecret">The secret string that the region establishes with the grid when registering</param>
224 /// <param name="message">The message to send to the user that tells them why they were logged off</param>
177 protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message) 225 protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message)
178 { 226 {
179 handlerLogOffUser = OnLogOffUser; 227 handlerLogOffUser = OnLogOffUser;
@@ -183,6 +231,11 @@ namespace OpenSim.Region.Framework.Scenes
183 } 231 }
184 } 232 }
185 233
234 /// <summary>
235 /// A New Region is now available. Inform the scene that there is a new region available.
236 /// </summary>
237 /// <param name="region">Information about the new region that is available</param>
238 /// <returns>True if the event was handled</returns>
186 protected bool newRegionUp(RegionInfo region) 239 protected bool newRegionUp(RegionInfo region)
187 { 240 {
188 handlerRegionUp = OnRegionUp; 241 handlerRegionUp = OnRegionUp;
@@ -194,6 +247,11 @@ namespace OpenSim.Region.Framework.Scenes
194 return true; 247 return true;
195 } 248 }
196 249
250 /// <summary>
251 /// Inform the scene that we've got an update about a child agent that we have
252 /// </summary>
253 /// <param name="cAgentData"></param>
254 /// <returns></returns>
197 protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData) 255 protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData)
198 { 256 {
199 handlerChildAgentUpdate = OnChildAgentUpdate; 257 handlerChildAgentUpdate = OnChildAgentUpdate;
@@ -204,6 +262,7 @@ namespace OpenSim.Region.Framework.Scenes
204 return true; 262 return true;
205 } 263 }
206 264
265
207 protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) 266 protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
208 { 267 {
209 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; 268 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
@@ -213,6 +272,13 @@ namespace OpenSim.Region.Framework.Scenes
213 } 272 }
214 } 273 }
215 274
275 /// <summary>
276 /// We have a new prim from a neighbor
277 /// </summary>
278 /// <param name="primID">unique ID for the primative</param>
279 /// <param name="objXMLData">XML2 encoded data of the primative</param>
280 /// <param name="XMLMethod">An Int that represents the version of the XMLMethod</param>
281 /// <returns>True if the prim was accepted, false if it was not</returns>
216 protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) 282 protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
217 { 283 {
218 handlerExpectPrim = OnExpectPrim; 284 handlerExpectPrim = OnExpectPrim;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 61dfa52..3646811 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1098,30 +1098,29 @@ if (m_shape != null) {
1098 } 1098 }
1099 } 1099 }
1100 1100
1101 private void handleTimerAccounting(uint localID, double interval) 1101 // TODO: unused:
1102 { 1102 // private void handleTimerAccounting(uint localID, double interval)
1103 if (localID == LocalId) 1103 // {
1104 { 1104 // if (localID == LocalId)
1105 1105 // {
1106 float sec = (float)interval; 1106 // float sec = (float)interval;
1107 if (m_parentGroup != null) 1107 // if (m_parentGroup != null)
1108 { 1108 // {
1109 if (sec == 0) 1109 // if (sec == 0)
1110 { 1110 // {
1111 if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001) 1111 // if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001)
1112 m_parentGroup.scriptScore = 0; 1112 // m_parentGroup.scriptScore = 0;
1113 1113 //
1114 m_parentGroup.scriptScore += 0.001f; 1114 // m_parentGroup.scriptScore += 0.001f;
1115 return; 1115 // return;
1116 } 1116 // }
1117 1117 //
1118 if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec)) 1118 // if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec))
1119 m_parentGroup.scriptScore = 0; 1119 // m_parentGroup.scriptScore = 0;
1120 m_parentGroup.scriptScore += (0.001f / sec); 1120 // m_parentGroup.scriptScore += (0.001f / sec);
1121 } 1121 // }
1122 1122 // }
1123 } 1123 // }
1124 }
1125 1124
1126 #endregion Private Methods 1125 #endregion Private Methods
1127 1126
@@ -1248,7 +1247,6 @@ if (m_shape != null) {
1248 } 1247 }
1249 } 1248 }
1250 1249
1251
1252 /// <summary> 1250 /// <summary>
1253 /// hook to the physics scene to apply angular impulse 1251 /// hook to the physics scene to apply angular impulse
1254 /// This is sent up to the group, which then finds the root prim 1252 /// This is sent up to the group, which then finds the root prim
@@ -1809,7 +1807,6 @@ if (m_shape != null) {
1809 m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); 1807 m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f);
1810 } 1808 }
1811 1809
1812
1813 public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) 1810 public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient)
1814 { 1811 {
1815 } 1812 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index 1836447..88452d2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
113 agent.InventoryFolder = UUID.Zero; 113 agent.InventoryFolder = UUID.Zero;
114 agent.startpos = Vector3.Zero; 114 agent.startpos = Vector3.Zero;
115 agent.CapsPath = GetRandomCapsObjectPath(); 115 agent.CapsPath = GetRandomCapsObjectPath();
116 agent.ChildrenCapSeeds = new Dictionary<ulong, string>();
116 117
117 string reason; 118 string reason;
118 scene.NewUserConnection(agent, out reason); 119 scene.NewUserConnection(agent, out reason);
@@ -147,7 +148,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
147 TestHelper.InMethod(); 148 TestHelper.InMethod();
148 149
149 string reason; 150 string reason;
151
152 if (acd1 == null)
153 fixNullPresence();
154
150 scene.NewUserConnection(acd1, out reason); 155 scene.NewUserConnection(acd1, out reason);
156 if (testclient == null)
157 testclient = new TestClient(acd1, scene);
151 scene.AddNewClient(testclient); 158 scene.AddNewClient(testclient);
152 159
153 ScenePresence presence = scene.GetScenePresence(agent1); 160 ScenePresence presence = scene.GetScenePresence(agent1);
@@ -162,6 +169,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests
162 169
163 Assert.That(neighbours.Count, Is.EqualTo(2)); 170 Assert.That(neighbours.Count, Is.EqualTo(2));
164 } 171 }
172 public void fixNullPresence()
173 {
174 string firstName = "testfirstname";
175
176 AgentCircuitData agent = new AgentCircuitData();
177 agent.AgentID = agent1;
178 agent.firstname = firstName;
179 agent.lastname = "testlastname";
180 agent.SessionID = UUID.Zero;
181 agent.SecureSessionID = UUID.Zero;
182 agent.circuitcode = 123;
183 agent.BaseFolder = UUID.Zero;
184 agent.InventoryFolder = UUID.Zero;
185 agent.startpos = Vector3.Zero;
186 agent.CapsPath = GetRandomCapsObjectPath();
187
188 acd1 = agent;
189 }
165 190
166 [Test] 191 [Test]
167 public void T013_TestRemoveNeighbourRegion() 192 public void T013_TestRemoveNeighbourRegion()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index ed2d317..23eab90 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -38,6 +38,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion;
38using OpenSim.Tests.Common; 38using OpenSim.Tests.Common;
39using OpenSim.Tests.Common.Mock; 39using OpenSim.Tests.Common.Mock;
40using OpenSim.Tests.Common.Setup; 40using OpenSim.Tests.Common.Setup;
41using System.Threading;
41 42
42namespace OpenSim.Region.Framework.Scenes.Tests 43namespace OpenSim.Region.Framework.Scenes.Tests
43{ 44{
@@ -55,56 +56,130 @@ namespace OpenSim.Region.Framework.Scenes.Tests
55 public void TestSimpleNotNeighboursTeleport() 56 public void TestSimpleNotNeighboursTeleport()
56 { 57 {
57 TestHelper.InMethod(); 58 TestHelper.InMethod();
59 ThreadRunResults results = new ThreadRunResults();
60 results.Result = false;
61 results.Message = "Test did not run";
62 TestRunning testClass = new TestRunning(results);
58 63
64 Thread testThread = new Thread(testClass.run);
65
66 try
67 {
68 // Seems kind of redundant to start a thread and then join it, however.. We need to protect against
69 // A thread abort exception in the simulator code.
70 testThread.Start();
71 testThread.Join();
72 }
73 catch (ThreadAbortException)
74 {
75
76 }
77 Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message);
59 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 78 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
79 }
80
81 }
82
83 public class ThreadRunResults
84 {
85 public bool Result = false;
86 public string Message = string.Empty;
87 }
88
89 public class TestRunning
90 {
91 public ThreadRunResults results;
92 public TestRunning(ThreadRunResults t)
93 {
94 results = t;
95 }
96 public void run(object o)
97 {
60 98
99 //results.Result = true;
61 log4net.Config.XmlConfigurator.Configure(); 100 log4net.Config.XmlConfigurator.Configure();
62 101
63 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); 102 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
64 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); 103 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
65 TestCommunicationsManager cm = new TestCommunicationsManager(); 104 TestCommunicationsManager cm = new TestCommunicationsManager();
66 105
67 // shared module 106 // shared module
68 ISharedRegionModule interregionComms = new RESTInterregionComms(); 107 ISharedRegionModule interregionComms = new RESTInterregionComms();
69 108
70 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); 109 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
71 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); 110 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
72 sceneA.RegisterRegionWithGrid(); 111 sceneA.RegisterRegionWithGrid();
73 112
74 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); 113 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);
75 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 114 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
76 sceneB.RegisterRegionWithGrid(); 115 sceneB.RegisterRegionWithGrid();
77 116
78 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 117 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
79 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); 118 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId);
80 119
81 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>(); 120 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
121
122 results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl);
82 123
124 if (!results.Result)
125 {
126 results.Message = "Incorrect caps object path set up in sceneA";
127 return;
128 }
129
130 /*
83 Assert.That( 131 Assert.That(
84 sceneACapsModule.GetCapsPath(agentId), 132 sceneACapsModule.GetCapsPath(agentId),
85 Is.EqualTo(client.CapsSeedUrl), 133 Is.EqualTo(client.CapsSeedUrl),
86 "Incorrect caps object path set up in sceneA"); 134 "Incorrect caps object path set up in sceneA");
87 135 */
88 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. 136 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
89 client.TeleportTargetScene = sceneB;
90 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
91 137
92 Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); 138
93 Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); 139 client.TeleportTargetScene = sceneB;
140 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
141
142 results.Result = (sceneB.GetScenePresence(agentId) != null);
143 if (!results.Result)
144 {
145 results.Message = "Client does not have an agent in sceneB";
146 return;
147 }
148
149 //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
94 150
151 //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
152
153 results.Result = (sceneA.GetScenePresence(agentId) == null);
154 if (!results.Result)
155 {
156 results.Message = "Client still had an agent in sceneA";
157 return;
158 }
159
95 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>(); 160 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>();
96 161
162
163 results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort +
164 "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl);
165 if (!results.Result)
166 {
167 results.Message = "Incorrect caps object path set up in sceneB";
168 return;
169 }
170
97 // Temporary assertion - caps url construction should at least be doable through a method. 171 // Temporary assertion - caps url construction should at least be doable through a method.
172 /*
98 Assert.That( 173 Assert.That(
99 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", 174 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
100 Is.EqualTo(client.CapsSeedUrl), 175 Is.EqualTo(client.CapsSeedUrl),
101 "Incorrect caps object path set up in sceneB"); 176 "Incorrect caps object path set up in sceneB");
102 177 */
103 // This assertion will currently fail since we don't remove the caps paths when no longer needed 178 // This assertion will currently fail since we don't remove the caps paths when no longer needed
104 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); 179 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
105 180
106 // TODO: Check that more of everything is as it should be 181 // TODO: Check that more of everything is as it should be
107 182
108 // TODO: test what happens if we try to teleport to a region that doesn't exist 183 // TODO: test what happens if we try to teleport to a region that doesn't exist
109 } 184 }
110 } 185 }
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 81f200a..00163f6 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -304,12 +304,10 @@ namespace OpenSim.Region.Physics.OdePlugin
304 public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); 304 public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f);
305 public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); 305 public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f);
306 306
307 private uint heightmapWidth = m_regionWidth + 1; 307 // TODO: unused: private uint heightmapWidth = m_regionWidth + 1;
308 private uint heightmapHeight = m_regionHeight + 1; 308 // TODO: unused: private uint heightmapHeight = m_regionHeight + 1;
309 309 // TODO: unused: private uint heightmapWidthSamples;
310 private uint heightmapWidthSamples; 310 // TODO: unused: private uint heightmapHeightSamples;
311
312 private uint heightmapHeightSamples;
313 311
314 private volatile int m_global_contactcount = 0; 312 private volatile int m_global_contactcount = 0;
315 313
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ff85b96..691732a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
125 125
126 if (lease.CurrentState == LeaseState.Initial) 126 if (lease.CurrentState == LeaseState.Initial)
127 { 127 {
128 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 128 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
129 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 129// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
130 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 130// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
131 } 131 }
132 return lease; 132 return lease;
133 } 133 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 6539bda..6e3a3ab 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -166,9 +166,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
166 166
167 if (lease.CurrentState == LeaseState.Initial) 167 if (lease.CurrentState == LeaseState.Initial)
168 { 168 {
169 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 169 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
170 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 170// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
171 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 171// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
172 } 172 }
173 return lease; 173 return lease;
174 } 174 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
index d119a77..838cafb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
@@ -42,16 +42,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
42 public partial class ScriptBaseClass : MarshalByRefObject, IScript 42 public partial class ScriptBaseClass : MarshalByRefObject, IScript
43 { 43 {
44 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); 44 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>();
45 private ScriptSponsor m_sponser; 45// private ScriptSponsor m_sponser;
46 46
47 public override Object InitializeLifetimeService() 47 public override Object InitializeLifetimeService()
48 { 48 {
49 ILease lease = (ILease)base.InitializeLifetimeService(); 49 ILease lease = (ILease)base.InitializeLifetimeService();
50 if (lease.CurrentState == LeaseState.Initial) 50 if (lease.CurrentState == LeaseState.Initial)
51 { 51 {
52 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 52 // Infinite
53 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 53 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
54 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 54// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
55// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
55 } 56 }
56 return lease; 57 return lease;
57 } 58 }
@@ -79,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
79 } 80 }
80 } 81 }
81 82
82 m_sponser = new ScriptSponsor(); 83// m_sponser = new ScriptSponsor();
83 } 84 }
84 85
85 private Executor m_Executor = null; 86 private Executor m_Executor = null;
@@ -112,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
112 return; 113 return;
113 114
114 ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); 115 ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject);
115 lease.Register(m_sponser); 116// lease.Register(m_sponser);
116 117
117 MethodInfo mi = inits[api]; 118 MethodInfo mi = inits[api];
118 119
@@ -126,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
126 127
127 public void Close() 128 public void Close()
128 { 129 {
129 m_sponser.Close(); 130// m_sponser.Close();
130 } 131 }
131 132
132 public Dictionary<string, object> GetVars() 133 public Dictionary<string, object> GetVars()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 4211ced..225126d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
53 53
54namespace OpenSim.Region.ScriptEngine.Shared.Instance 54namespace OpenSim.Region.ScriptEngine.Shared.Instance
55{ 55{
56 public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor 56 public class ScriptInstance : MarshalByRefObject, IScriptInstance
57 { 57 {
58 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 59
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
261 "SecondLife.Script"); 261 "SecondLife.Script");
262 262
263 ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); 263 ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
264 lease.Register(this); 264// lease.Register(this);
265 } 265 }
266 catch (Exception) 266 catch (Exception)
267 { 267 {
@@ -1006,10 +1006,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1006 { 1006 {
1007 return true; 1007 return true;
1008 } 1008 }
1009
1010 public TimeSpan Renewal(ILease lease)
1011 {
1012 return lease.InitialLeaseTime;
1013 }
1014 } 1009 }
1015} 1010}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index aac52a4..045abb4 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
40 /// <summary> 40 /// <summary>
41 /// Scene presence tests 41 /// Scene presence tests
42 /// </summary> 42 /// </summary>
43 /// Commented out XEngineTests that don't do anything
44 /*
43 [TestFixture] 45 [TestFixture]
44 public class XEngineTest 46 public class XEngineTest
45 { 47 {
@@ -65,4 +67,5 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
65 xengine.RegionLoaded(scene); 67 xengine.RegionLoaded(scene);
66 } 68 }
67 } 69 }
70 */
68} 71}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 3ef5ae8..76218c8 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -729,8 +729,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
729 item.Name, startParam, postOnRez, 729 item.Name, startParam, postOnRez,
730 stateSource, m_MaxScriptQueue); 730 stateSource, m_MaxScriptQueue);
731 731
732 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}", 732 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
733 part.ParentGroup.RootPart.Name, item.Name); 733 part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
734 734
735 instance.AppDomain = appDomain; 735 instance.AppDomain = appDomain;
736 instance.LineMap = linemap; 736 instance.LineMap = linemap;
diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs
index ec8a71b..6dfe78d 100644
--- a/OpenSim/Services/Interfaces/IAssetService.cs
+++ b/OpenSim/Services/Interfaces/IAssetService.cs
@@ -34,25 +34,53 @@ namespace OpenSim.Services.Interfaces
34 34
35 public interface IAssetService 35 public interface IAssetService
36 { 36 {
37 // Three different ways to retrieve an asset 37 /// <summary>
38 // 38 /// Get an asset synchronously.
39 /// </summary>
40 /// <param name="id"></param>
41 /// <returns></returns>
39 AssetBase Get(string id); 42 AssetBase Get(string id);
43
44 /// <summary>
45 /// Get an asset's metadata
46 /// </summary>
47 /// <param name="id"></param>
48 /// <returns></returns>
40 AssetMetadata GetMetadata(string id); 49 AssetMetadata GetMetadata(string id);
50
41 byte[] GetData(string id); 51 byte[] GetData(string id);
42 52
53 /// <summary>
54 /// Get an asset asynchronously
55 /// </summary>
56 /// <param name="id">The asset id</param>
57 /// <param name="sender">Represents the requester. Passed back via the handler</param>
58 /// <param name="handler">The handler to call back once the asset has been retrieved</param>
59 /// <returns>True if the id was parseable, false otherwise</returns>
43 bool Get(string id, Object sender, AssetRetrieved handler); 60 bool Get(string id, Object sender, AssetRetrieved handler);
44 61
45 // Creates a new asset 62 /// <summary>
46 // Returns a random ID if none is passed into it 63 /// Creates a new asset
47 // 64 /// </summary>
65 /// Returns a random ID if none is passed into it
66 /// <param name="asset"></param>
67 /// <returns></returns>
48 string Store(AssetBase asset); 68 string Store(AssetBase asset);
49 69
50 // Attachments and bare scripts need this!! 70 /// <summary>
51 // 71 /// Update an asset's content
72 /// </summary>
73 /// Attachments and bare scripts need this!!
74 /// <param name="id"> </param>
75 /// <param name="data"></param>
76 /// <returns></returns>
52 bool UpdateContent(string id, byte[] data); 77 bool UpdateContent(string id, byte[] data);
53 78
54 // Kill an asset 79 /// <summary>
55 // 80 /// Delete an asset
81 /// </summary>
82 /// <param name="id"></param>
83 /// <returns></returns>
56 bool Delete(string id); 84 bool Delete(string id);
57 } 85 }
58} 86}
diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs
index 5f1184b..81f123a 100644
--- a/OpenSim/Tests/Common/Mock/TestAssetService.cs
+++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs
@@ -45,7 +45,13 @@ namespace OpenSim.Tests.Common.Mock
45 45
46 public AssetBase Get(string id) 46 public AssetBase Get(string id)
47 { 47 {
48 return Assets[ id ]; 48 AssetBase asset;
49 if (Assets.ContainsKey(id))
50 asset = Assets[id];
51 else
52 asset = null;
53
54 return asset;
49 } 55 }
50 56
51 public AssetMetadata GetMetadata(string id) 57 public AssetMetadata GetMetadata(string id)
@@ -59,8 +65,10 @@ namespace OpenSim.Tests.Common.Mock
59 } 65 }
60 66
61 public bool Get(string id, object sender, AssetRetrieved handler) 67 public bool Get(string id, object sender, AssetRetrieved handler)
62 { 68 {
63 throw new NotImplementedException(); 69 handler(id, sender, Get(id));
70
71 return true;
64 } 72 }
65 73
66 public string Store(AssetBase asset) 74 public string Store(AssetBase asset)
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs
index 0c19164..6635700 100644
--- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs
+++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs
@@ -1,4 +1,31 @@
1using System; 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;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Text; 30using System.Text;
4using OpenSim.Framework; 31using OpenSim.Framework;