aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs79
1 files changed, 54 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 254ad05..1575e50 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -95,7 +95,10 @@ namespace OpenSim.Region.Framework.Scenes
95 public bool m_strictAccessControl = true; 95 public bool m_strictAccessControl = true;
96 public bool m_seeIntoBannedRegion = false; 96 public bool m_seeIntoBannedRegion = false;
97 public int MaxUndoCount = 5; 97 public int MaxUndoCount = 5;
98 // Using this for RegionReady module to prevent LoginsDisabled from changing under our feet;
99 public bool LoginLock = false;
98 public bool LoginsDisabled = true; 100 public bool LoginsDisabled = true;
101 public bool StartDisabled = false;
99 public bool LoadingPrims; 102 public bool LoadingPrims;
100 public IXfer XferManager; 103 public IXfer XferManager;
101 104
@@ -1399,10 +1402,26 @@ namespace OpenSim.Region.Framework.Scenes
1399 IConfig startupConfig = m_config.Configs["Startup"]; 1402 IConfig startupConfig = m_config.Configs["Startup"];
1400 if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) 1403 if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false))
1401 { 1404 {
1405 // This handles a case of a region having no scripts for the RegionReady module
1406 if (m_sceneGraph.GetActiveScriptsCount() == 0)
1407 {
1408 // need to be able to tell these have changed in RegionReady
1409 LoginLock = false;
1410 EventManager.TriggerLoginsEnabled(RegionInfo.RegionName);
1411 }
1402 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); 1412 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
1403 LoginsDisabled = false; 1413 // For RegionReady lockouts
1414 if( LoginLock == false)
1415 {
1416 LoginsDisabled = false;
1417 }
1404 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); 1418 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1405 } 1419 }
1420 else
1421 {
1422 StartDisabled = true;
1423 LoginsDisabled = true;
1424 }
1406 } 1425 }
1407 } 1426 }
1408 catch (NotImplementedException) 1427 catch (NotImplementedException)
@@ -1765,6 +1784,7 @@ namespace OpenSim.Region.Framework.Scenes
1765 1784
1766 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 1785 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
1767 LoadingPrims = false; 1786 LoadingPrims = false;
1787 EventManager.TriggerPrimsLoaded(this);
1768 } 1788 }
1769 1789
1770 1790
@@ -1930,6 +1950,10 @@ namespace OpenSim.Region.Framework.Scenes
1930 sceneObject.SetGroup(groupID, null); 1950 sceneObject.SetGroup(groupID, null);
1931 } 1951 }
1932 1952
1953 IUserManagement uman = RequestModuleInterface<IUserManagement>();
1954 if (uman != null)
1955 sceneObject.RootPart.CreatorIdentification = uman.GetUserUUI(ownerID);
1956
1933 sceneObject.ScheduleGroupForFullUpdate(); 1957 sceneObject.ScheduleGroupForFullUpdate();
1934 1958
1935 return sceneObject; 1959 return sceneObject;
@@ -2658,6 +2682,10 @@ namespace OpenSim.Region.Framework.Scenes
2658 if (TryGetScenePresence(client.AgentId, out presence)) 2682 if (TryGetScenePresence(client.AgentId, out presence))
2659 { 2683 {
2660 m_LastLogin = Util.EnvironmentTickCount(); 2684 m_LastLogin = Util.EnvironmentTickCount();
2685
2686 // Cache the user's name
2687 CacheUserName(aCircuit);
2688
2661 EventManager.TriggerOnNewClient(client); 2689 EventManager.TriggerOnNewClient(client);
2662 if (vialogin) 2690 if (vialogin)
2663 { 2691 {
@@ -2671,6 +2699,28 @@ namespace OpenSim.Region.Framework.Scenes
2671 } 2699 }
2672 } 2700 }
2673 2701
2702 private void CacheUserName(AgentCircuitData aCircuit)
2703 {
2704 IUserManagement uMan = RequestModuleInterface<IUserManagement>();
2705 if (uMan != null)
2706 {
2707 string homeURL = string.Empty;
2708 string first = aCircuit.firstname, last = aCircuit.lastname;
2709 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
2710 homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
2711 if (aCircuit.lastname.StartsWith("@"))
2712 {
2713 string[] parts = aCircuit.firstname.Split('.');
2714 if (parts.Length >= 2)
2715 {
2716 first = parts[0];
2717 last = parts[1];
2718 }
2719 }
2720 uMan.AddUser(aCircuit.AgentID, first, last, homeURL);
2721 }
2722 }
2723
2674 private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin) 2724 private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin)
2675 { 2725 {
2676 vialogin = false; 2726 vialogin = false;
@@ -2813,7 +2863,7 @@ namespace OpenSim.Region.Framework.Scenes
2813 2863
2814 public virtual void SubscribeToClientInventoryEvents(IClientAPI client) 2864 public virtual void SubscribeToClientInventoryEvents(IClientAPI client)
2815 { 2865 {
2816 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 2866
2817 client.OnLinkInventoryItem += HandleLinkInventoryItem; 2867 client.OnLinkInventoryItem += HandleLinkInventoryItem;
2818 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; 2868 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
2819 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; 2869 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
@@ -2837,7 +2887,6 @@ namespace OpenSim.Region.Framework.Scenes
2837 public virtual void SubscribeToClientTeleportEvents(IClientAPI client) 2887 public virtual void SubscribeToClientTeleportEvents(IClientAPI client)
2838 { 2888 {
2839 client.OnTeleportLocationRequest += RequestTeleportLocation; 2889 client.OnTeleportLocationRequest += RequestTeleportLocation;
2840 client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
2841 } 2890 }
2842 2891
2843 public virtual void SubscribeToClientScriptEvents(IClientAPI client) 2892 public virtual void SubscribeToClientScriptEvents(IClientAPI client)
@@ -2941,7 +2990,7 @@ namespace OpenSim.Region.Framework.Scenes
2941 2990
2942 public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client) 2991 public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client)
2943 { 2992 {
2944 client.OnCreateNewInventoryItem -= CreateNewInventoryItem; 2993
2945 client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder; 2994 client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder;
2946 client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder; 2995 client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder;
2947 client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!! 2996 client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!!
@@ -2963,7 +3012,7 @@ namespace OpenSim.Region.Framework.Scenes
2963 public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) 3012 public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client)
2964 { 3013 {
2965 client.OnTeleportLocationRequest -= RequestTeleportLocation; 3014 client.OnTeleportLocationRequest -= RequestTeleportLocation;
2966 client.OnTeleportLandmarkRequest -= RequestTeleportLandmark; 3015 //client.OnTeleportLandmarkRequest -= RequestTeleportLandmark;
2967 //client.OnTeleportHomeRequest -= TeleportClientHome; 3016 //client.OnTeleportHomeRequest -= TeleportClientHome;
2968 } 3017 }
2969 3018
@@ -4064,26 +4113,6 @@ namespace OpenSim.Region.Framework.Scenes
4064 } 4113 }
4065 } 4114 }
4066 4115
4067 /// <summary>
4068 /// Tries to teleport agent to landmark.
4069 /// </summary>
4070 /// <param name="remoteClient"></param>
4071 /// <param name="regionHandle"></param>
4072 /// <param name="position"></param>
4073 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position)
4074 {
4075 GridRegion info = GridService.GetRegionByUUID(UUID.Zero, regionID);
4076
4077 if (info == null)
4078 {
4079 // can't find the region: Tell viewer and abort
4080 remoteClient.SendTeleportFailed("The teleport destination could not be found.");
4081 return;
4082 }
4083
4084 RequestTeleportLocation(remoteClient, info.RegionHandle, position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark));
4085 }
4086
4087 public bool CrossAgentToNewRegion(ScenePresence agent, bool isFlying) 4116 public bool CrossAgentToNewRegion(ScenePresence agent, bool isFlying)
4088 { 4117 {
4089 if (m_teleportModule != null) 4118 if (m_teleportModule != null)