aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-19 00:45:22 +0100
committerJustin Clark-Casey (justincc)2011-08-19 00:45:22 +0100
commitc9e6b7bd10b2cdaa917e41259ae0d612f2171f7a (patch)
treeca0e224639979b65c36c0d169d900ed707a6f991 /OpenSim/Region/Framework/Scenes
parentDon't need to try both AssetService.Get and GetCached in GetMesh since Get al... (diff)
downloadopensim-SC_OLD-c9e6b7bd10b2cdaa917e41259ae0d612f2171f7a.zip
opensim-SC_OLD-c9e6b7bd10b2cdaa917e41259ae0d612f2171f7a.tar.gz
opensim-SC_OLD-c9e6b7bd10b2cdaa917e41259ae0d612f2171f7a.tar.bz2
opensim-SC_OLD-c9e6b7bd10b2cdaa917e41259ae0d612f2171f7a.tar.xz
Stop NPC's getting hypergrid like names in some circumstances.
This meant punching in another AddUser() method in IUserManagement to do a direct name to UUID associated without the account check (since NPCs don't have accounts). May address http://opensimulator.org/mantis/view.php?id=5645
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs42
1 files changed, 28 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ae88a87..513c0ea 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2582,12 +2582,13 @@ namespace OpenSim.Region.Framework.Scenes
2582 } 2582 }
2583 } 2583 }
2584 2584
2585 if (GetScenePresence(client.AgentId) != null) 2585 ScenePresence createdSp = GetScenePresence(client.AgentId);
2586 if (createdSp != null)
2586 { 2587 {
2587 m_LastLogin = Util.EnvironmentTickCount(); 2588 m_LastLogin = Util.EnvironmentTickCount();
2588 2589
2589 // Cache the user's name 2590 // Cache the user's name
2590 CacheUserName(aCircuit); 2591 CacheUserName(createdSp, aCircuit);
2591 2592
2592 EventManager.TriggerOnNewClient(client); 2593 EventManager.TriggerOnNewClient(client);
2593 if (vialogin) 2594 if (vialogin)
@@ -2595,28 +2596,41 @@ namespace OpenSim.Region.Framework.Scenes
2595 } 2596 }
2596 } 2597 }
2597 2598
2598 private void CacheUserName(AgentCircuitData aCircuit) 2599 /// <summary>
2600 /// Cache the user name for later use.
2601 /// </summary>
2602 /// <param name="sp"></param>
2603 /// <param name="aCircuit"></param>
2604 private void CacheUserName(ScenePresence sp, AgentCircuitData aCircuit)
2599 { 2605 {
2600 IUserManagement uMan = RequestModuleInterface<IUserManagement>(); 2606 IUserManagement uMan = RequestModuleInterface<IUserManagement>();
2601 if (uMan != null) 2607 if (uMan != null)
2602 { 2608 {
2603 string homeURL = string.Empty;
2604 string first = aCircuit.firstname, last = aCircuit.lastname; 2609 string first = aCircuit.firstname, last = aCircuit.lastname;
2605 2610
2606 if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) 2611 if (sp.PresenceType == PresenceType.Npc)
2607 homeURL = aCircuit.ServiceURLs["HomeURI"].ToString(); 2612 {
2608 2613 uMan.AddUser(aCircuit.AgentID, first, last);
2609 if (aCircuit.lastname.StartsWith("@")) 2614 }
2615 else
2610 { 2616 {
2611 string[] parts = aCircuit.firstname.Split('.'); 2617 string homeURL = string.Empty;
2612 if (parts.Length >= 2) 2618
2619 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
2620 homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
2621
2622 if (aCircuit.lastname.StartsWith("@"))
2613 { 2623 {
2614 first = parts[0]; 2624 string[] parts = aCircuit.firstname.Split('.');
2615 last = parts[1]; 2625 if (parts.Length >= 2)
2626 {
2627 first = parts[0];
2628 last = parts[1];
2629 }
2616 } 2630 }
2617 }
2618 2631
2619 uMan.AddUser(aCircuit.AgentID, first, last, homeURL); 2632 uMan.AddUser(aCircuit.AgentID, first, last, homeURL);
2633 }
2620 } 2634 }
2621 } 2635 }
2622 2636