diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 42 |
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 | ||