aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2013-06-30 18:27:30 +0100
committerMelanie2013-06-30 18:27:30 +0100
commitffcee82b1d62150b772464841023a29acc334c84 (patch)
tree957d562be1f9e567daabb9bfdd25e779ec2c11a4 /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentGroups V2: charge for group creation only after the group has been successful... (diff)
downloadopensim-SC-ffcee82b1d62150b772464841023a29acc334c84.zip
opensim-SC-ffcee82b1d62150b772464841023a29acc334c84.tar.gz
opensim-SC-ffcee82b1d62150b772464841023a29acc334c84.tar.bz2
opensim-SC-ffcee82b1d62150b772464841023a29acc334c84.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs OpenSim/Region/Framework/Scenes/EventManager.cs OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs41
-rw-r--r--OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs3
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs44
7 files changed, 77 insertions, 41 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index b3e3aa2..ae45b99 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -183,6 +183,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
183 if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp)) 183 if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp))
184 { 184 {
185 IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>(); 185 IUserManagement uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
186 m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend);
186 uMan.AddUser(id, url + ";" + first + " " + last); 187 uMan.AddUser(id, url + ";" + first + " " + last);
187 } 188 }
188 } 189 }
@@ -347,31 +348,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
347 return null; 348 return null;
348 } 349 }
349 350
350 public override FriendInfo[] GetFriendsFromService(IClientAPI client) 351// public override FriendInfo[] GetFriendsFromService(IClientAPI client)
351 { 352// {
352// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); 353//// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
353 Boolean agentIsLocal = true; 354// Boolean agentIsLocal = true;
354 if (UserManagementModule != null) 355// if (UserManagementModule != null)
355 agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId); 356// agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
356 357
357 if (agentIsLocal) 358// if (agentIsLocal)
358 return base.GetFriendsFromService(client); 359// return base.GetFriendsFromService(client);
359 360
360 FriendInfo[] finfos = new FriendInfo[0]; 361// FriendInfo[] finfos = new FriendInfo[0];
361 // Foreigner 362// // Foreigner
362 AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode); 363// AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
363 if (agentClientCircuit != null) 364// if (agentClientCircuit != null)
364 { 365// {
365 //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); 366// //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
366 367
367 finfos = FriendsService.GetFriends(client.AgentId.ToString()); 368// finfos = FriendsService.GetFriends(client.AgentId.ToString());
368 m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString()); 369// m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
369 } 370// }
370 371
371// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name); 372//// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);
372 373
373 return finfos; 374// return finfos;
374 } 375// }
375 376
376 protected override bool StoreRights(UUID agentID, UUID friendID, int rights) 377 protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
377 { 378 {
diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs
index 1f1568f..0c632b1 100644
--- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs
@@ -44,11 +44,12 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule
44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DAExampleModule")] 44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DAExampleModule")]
45 public class DAExampleModule : INonSharedRegionModule 45 public class DAExampleModule : INonSharedRegionModule
46 { 46 {
47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private static readonly bool ENABLED = false; // enable for testing 49 private readonly bool ENABLED = false; // enable for testing
50 50
51 public const string DANamespace = "DAExample Module"; 51 public const string Namespace = "Example";
52 public const string StoreName = "DA";
52 53
53 protected Scene m_scene; 54 protected Scene m_scene;
54 protected IDialogModule m_dialogMod; 55 protected IDialogModule m_dialogMod;
@@ -65,6 +66,8 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule
65 m_scene = scene; 66 m_scene = scene;
66 m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove; 67 m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove;
67 m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>(); 68 m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>();
69
70 m_log.DebugFormat("[DA EXAMPLE MODULE]: Added region {0}", m_scene.Name);
68 } 71 }
69 } 72 }
70 73
@@ -91,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule
91 if (sop == null) 94 if (sop == null)
92 return true; 95 return true;
93 96
94 if (!sop.DynAttrs.TryGetValue(DANamespace, out attrs)) 97 if (!sop.DynAttrs.TryGetStore(Namespace, StoreName, out attrs))
95 attrs = new OSDMap(); 98 attrs = new OSDMap();
96 99
97 OSDInteger newValue; 100 OSDInteger newValue;
@@ -106,12 +109,14 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule
106 109
107 attrs["moves"] = newValue; 110 attrs["moves"] = newValue;
108 111
109 sop.DynAttrs[DANamespace] = attrs; 112 sop.DynAttrs.SetStore(Namespace, StoreName, attrs);
110 } 113 }
111 114
112 sop.ParentGroup.HasGroupChanged = true; 115 sop.ParentGroup.HasGroupChanged = true;
113 116
114 m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue)); 117 string msg = string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue);
118 m_log.DebugFormat("[DA EXAMPLE MODULE]: {0}", msg);
119 m_dialogMod.SendGeneralAlert(msg);
115 120
116 return true; 121 return true;
117 } 122 }
diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs
index 650aa35..166a994 100644
--- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs
@@ -64,8 +64,8 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
64 64
65 private Scene m_scene; 65 private Scene m_scene;
66 private IDialogModule m_dialogMod; 66 private IDialogModule m_dialogMod;
67 67
68 public string Name { get { return "DOExample Module"; } } 68 public string Name { get { return "DO"; } }
69 public Type ReplaceableInterface { get { return null; } } 69 public Type ReplaceableInterface { get { return null; } }
70 70
71 public void Initialise(IConfigSource source) {} 71 public void Initialise(IConfigSource source) {}
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
106 106
107// Console.WriteLine("Here for {0}", so.Name); 107// Console.WriteLine("Here for {0}", so.Name);
108 108
109 if (rootPart.DynAttrs.TryGetValue(DAExampleModule.DANamespace, out attrs)) 109 if (rootPart.DynAttrs.TryGetStore(DAExampleModule.Namespace, DAExampleModule.StoreName, out attrs))
110 { 110 {
111 movesSoFar = attrs["moves"].AsInteger(); 111 movesSoFar = attrs["moves"].AsInteger();
112 112
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
114 "[DO EXAMPLE MODULE]: Found saved moves {0} for {1} in {2}", movesSoFar, so.Name, m_scene.Name); 114 "[DO EXAMPLE MODULE]: Found saved moves {0} for {1} in {2}", movesSoFar, so.Name, m_scene.Name);
115 } 115 }
116 116
117 rootPart.DynObjs.Add(Name, new MyObject(movesSoFar)); 117 rootPart.DynObjs.Add(DAExampleModule.Namespace, Name, new MyObject(movesSoFar));
118 } 118 }
119 119
120 private bool OnSceneGroupMove(UUID groupId, Vector3 delta) 120 private bool OnSceneGroupMove(UUID groupId, Vector3 delta)
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 864e181..194b591 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -320,7 +320,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
320 else 320 else
321 { 321 {
322 names[0] = "Unknown"; 322 names[0] = "Unknown";
323 names[1] = "UserUMMTGUN2"; 323 names[1] = "UserUMMTGUN3";
324 324
325 return false; 325 return false;
326 } 326 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index ec5751d..99913a9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -196,7 +196,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
196 Util.FireAndForget(delegate 196 Util.FireAndForget(delegate
197 { 197 {
198 foreach (InventoryItemBase item in items) 198 foreach (InventoryItemBase item in items)
199 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); 199 if (!string.IsNullOrEmpty(item.CreatorData))
200 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
200 }); 201 });
201 } 202 }
202 203
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 2d3ba82..70ba944 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -204,7 +204,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
204 Util.FireAndForget(delegate 204 Util.FireAndForget(delegate
205 { 205 {
206 foreach (InventoryItemBase item in items) 206 foreach (InventoryItemBase item in items)
207 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); 207 if (!string.IsNullOrEmpty(item.CreatorData))
208 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
208 }); 209 });
209 } 210 }
210 211
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index b4348c9..66059fb 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -144,7 +144,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
144 <Flags>None</Flags> 144 <Flags>None</Flags>
145 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> 145 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
146 <CollisionSoundVolume>0</CollisionSoundVolume> 146 <CollisionSoundVolume>0</CollisionSoundVolume>
147 <DynAttrs><llsd><map><key>MyStore</key><map><key>the answer</key><integer>42</integer></map></map></llsd></DynAttrs> 147 <DynAttrs>
148 <llsd>
149 <map>
150 <key>MyNamespace</key>
151 <map>
152 <key>MyStore</key>
153 <map>
154 <key>the answer</key>
155 <integer>42</integer>
156 </map>
157 </map>
158 </map>
159 </llsd>
160 </DynAttrs>
148 </SceneObjectPart> 161 </SceneObjectPart>
149 </RootPart> 162 </RootPart>
150 <OtherParts /> 163 <OtherParts />
@@ -333,7 +346,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
333 <EveryoneMask>0</EveryoneMask> 346 <EveryoneMask>0</EveryoneMask>
334 <NextOwnerMask>2147483647</NextOwnerMask> 347 <NextOwnerMask>2147483647</NextOwnerMask>
335 <Flags>None</Flags> 348 <Flags>None</Flags>
336 <DynAttrs><llsd><map><key>MyStore</key><map><key>last words</key><string>Rosebud</string></map></map></llsd></DynAttrs> 349 <DynAttrs>
350 <llsd>
351 <map>
352 <key>MyNamespace</key>
353 <map>
354 <key>MyStore</key>
355 <map>
356 <key>last words</key>
357 <string>Rosebud</string>
358 </map>
359 </map>
360 </map>
361 </llsd>
362 </DynAttrs>
337 <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar> 363 <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar>
338 </SceneObjectPart> 364 </SceneObjectPart>
339 <OtherParts /> 365 <OtherParts />
@@ -362,7 +388,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
362 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); 388 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
363 Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); 389 Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
364 Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); 390 Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide"));
365 OSDMap store = rootPart.DynAttrs["MyStore"]; 391 OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore");
366 Assert.AreEqual(42, store["the answer"].AsInteger()); 392 Assert.AreEqual(42, store["the answer"].AsInteger());
367 393
368 // TODO: Check other properties 394 // TODO: Check other properties
@@ -414,13 +440,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
414 rp.CreatorID = rpCreatorId; 440 rp.CreatorID = rpCreatorId;
415 rp.Shape = shape; 441 rp.Shape = shape;
416 442
443 string daNamespace = "MyNamespace";
417 string daStoreName = "MyStore"; 444 string daStoreName = "MyStore";
418 string daKey = "foo"; 445 string daKey = "foo";
419 string daValue = "bar"; 446 string daValue = "bar";
420 OSDMap myStore = new OSDMap(); 447 OSDMap myStore = new OSDMap();
421 myStore.Add(daKey, daValue); 448 myStore.Add(daKey, daValue);
422 rp.DynAttrs = new DAMap(); 449 rp.DynAttrs = new DAMap();
423 rp.DynAttrs[daStoreName] = myStore; 450 rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore);
424 451
425 SceneObjectGroup so = new SceneObjectGroup(rp); 452 SceneObjectGroup so = new SceneObjectGroup(rp);
426 453
@@ -481,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
481 Assert.That(name, Is.EqualTo(rpName)); 508 Assert.That(name, Is.EqualTo(rpName));
482 Assert.That(creatorId, Is.EqualTo(rpCreatorId)); 509 Assert.That(creatorId, Is.EqualTo(rpCreatorId));
483 Assert.NotNull(daMap); 510 Assert.NotNull(daMap);
484 Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); 511 Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString());
485 } 512 }
486 513
487 [Test] 514 [Test]
@@ -496,7 +523,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
496 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); 523 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946")));
497 Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); 524 Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef")));
498 Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); 525 Assert.That(rootPart.Name, Is.EqualTo("PrimFun"));
499 OSDMap store = rootPart.DynAttrs["MyStore"]; 526 OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore");
500 Assert.AreEqual("Rosebud", store["last words"].AsString()); 527 Assert.AreEqual("Rosebud", store["last words"].AsString());
501 528
502 // TODO: Check other properties 529 // TODO: Check other properties
@@ -522,13 +549,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
522 rp.CreatorID = rpCreatorId; 549 rp.CreatorID = rpCreatorId;
523 rp.Shape = shape; 550 rp.Shape = shape;
524 551
552 string daNamespace = "MyNamespace";
525 string daStoreName = "MyStore"; 553 string daStoreName = "MyStore";
526 string daKey = "foo"; 554 string daKey = "foo";
527 string daValue = "bar"; 555 string daValue = "bar";
528 OSDMap myStore = new OSDMap(); 556 OSDMap myStore = new OSDMap();
529 myStore.Add(daKey, daValue); 557 myStore.Add(daKey, daValue);
530 rp.DynAttrs = new DAMap(); 558 rp.DynAttrs = new DAMap();
531 rp.DynAttrs[daStoreName] = myStore; 559 rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore);
532 560
533 SceneObjectGroup so = new SceneObjectGroup(rp); 561 SceneObjectGroup so = new SceneObjectGroup(rp);
534 562
@@ -585,7 +613,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
585 Assert.That(name, Is.EqualTo(rpName)); 613 Assert.That(name, Is.EqualTo(rpName));
586 Assert.That(creatorId, Is.EqualTo(rpCreatorId)); 614 Assert.That(creatorId, Is.EqualTo(rpCreatorId));
587 Assert.NotNull(daMap); 615 Assert.NotNull(daMap);
588 Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); 616 Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString());
589 } 617 }
590 } 618 }
591} \ No newline at end of file 619} \ No newline at end of file