aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGUserServices.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs35
5 files changed, 39 insertions, 10 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
index aaa1c78..f1a56ef 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGUserServices.cs
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Communications.Hypergrid
313 313
314 public bool IsForeignUser(UUID userID, out string userServerURL) 314 public bool IsForeignUser(UUID userID, out string userServerURL)
315 { 315 {
316 userServerURL = string.Empty; 316 userServerURL = m_commsManager.NetworkServersInfo.UserURL;
317 CachedUserInfo uinfo = m_commsManager.UserProfileCacheService.GetUserDetails(userID); 317 CachedUserInfo uinfo = m_commsManager.UserProfileCacheService.GetUserDetails(userID);
318 if (uinfo != null) 318 if (uinfo != null)
319 { 319 {
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
index 92e6ae3..ec8512a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserDataPlugin.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Communications.OGS1
112 parameters.Add(param); 112 parameters.Add(param);
113 XmlRpcRequest req = new XmlRpcRequest("get_agent_by_uuid", parameters); 113 XmlRpcRequest req = new XmlRpcRequest("get_agent_by_uuid", parameters);
114 114
115 XmlRpcResponse resp = req.Send(GetUserServerURL(userId), 6000); 115 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 6000);
116 Hashtable respData = (Hashtable)resp.Value; 116 Hashtable respData = (Hashtable)resp.Value;
117 if (respData.Contains("error_type")) 117 if (respData.Contains("error_type"))
118 { 118 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs
index fcd0304..cca5bb4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
42 LogManager.GetLogger( 42 LogManager.GetLogger(
43 MethodBase.GetCurrentMethod().DeclaringType); 43 MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private IUserAccountDataService m_UserService; 45 private IUserAccountService m_UserService;
46 46
47 private bool m_Enabled = false; 47 private bool m_Enabled = false;
48 48
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
82 82
83 Object[] args = new Object[] { source }; 83 Object[] args = new Object[] { source };
84 m_UserService = 84 m_UserService =
85 ServerUtils.LoadPlugin<IUserAccountDataService>(serviceDll, 85 ServerUtils.LoadPlugin<IUserAccountService>(serviceDll,
86 args); 86 args);
87 87
88 if (m_UserService == null) 88 if (m_UserService == null)
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
113 if (!m_Enabled) 113 if (!m_Enabled)
114 return; 114 return;
115 115
116 scene.RegisterModuleInterface<IUserAccountDataService>(m_UserService); 116 scene.RegisterModuleInterface<IUserAccountService>(m_UserService);
117 } 117 }
118 118
119 public void RemoveRegion(Scene scene) 119 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs
index a2b854b..cef9129 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs
@@ -37,7 +37,7 @@ using OpenSim.Services.Connectors;
37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User 37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
38{ 38{
39 public class RemoteUserServicesConnector : UserServicesConnector, 39 public class RemoteUserServicesConnector : UserServicesConnector,
40 ISharedRegionModule, IUserAccountDataService 40 ISharedRegionModule, IUserAccountService
41 { 41 {
42 private static readonly ILog m_log = 42 private static readonly ILog m_log =
43 LogManager.GetLogger( 43 LogManager.GetLogger(
@@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
96 if (!m_Enabled) 96 if (!m_Enabled)
97 return; 97 return;
98 98
99 scene.RegisterModuleInterface<IUserAccountDataService>(this); 99 scene.RegisterModuleInterface<IUserAccountService>(this);
100 } 100 }
101 101
102 public void RemoveRegion(Scene scene) 102 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 278091f..3b91dd0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -220,11 +220,12 @@ namespace OpenSim.Region.Framework.Scenes
220 private bool m_scripts_enabled = true; 220 private bool m_scripts_enabled = true;
221 private string m_defaultScriptEngine; 221 private string m_defaultScriptEngine;
222 private int m_LastLogin = 0; 222 private int m_LastLogin = 0;
223 private Thread HeartbeatThread; 223 private Thread HeartbeatThread = null;
224 private volatile bool shuttingdown = false; 224 private volatile bool shuttingdown = false;
225 225
226 private int m_lastUpdate = Environment.TickCount; 226 private int m_lastUpdate = Environment.TickCount;
227 private int m_maxPrimsPerFrame = 200; 227 private int m_maxPrimsPerFrame = 200;
228 private bool m_firstHeartbeat = true;
228 229
229 private object m_deleting_scene_object = new object(); 230 private object m_deleting_scene_object = new object();
230 231
@@ -876,6 +877,13 @@ namespace OpenSim.Region.Framework.Scenes
876 //m_heartbeatTimer.Enabled = true; 877 //m_heartbeatTimer.Enabled = true;
877 //m_heartbeatTimer.Interval = (int)(m_timespan * 1000); 878 //m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
878 //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); 879 //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
880 if (HeartbeatThread != null)
881 {
882 ThreadTracker.Remove(HeartbeatThread);
883 HeartbeatThread.Abort();
884 HeartbeatThread = null;
885 }
886 m_lastUpdate = Environment.TickCount;
879 HeartbeatThread = new Thread(new ParameterizedThreadStart(Heartbeat)); 887 HeartbeatThread = new Thread(new ParameterizedThreadStart(Heartbeat));
880 HeartbeatThread.SetApartmentState(ApartmentState.MTA); 888 HeartbeatThread.SetApartmentState(ApartmentState.MTA);
881 HeartbeatThread.Name = string.Format("Heartbeat for region {0}", RegionInfo.RegionName); 889 HeartbeatThread.Name = string.Format("Heartbeat for region {0}", RegionInfo.RegionName);
@@ -912,9 +920,16 @@ namespace OpenSim.Region.Framework.Scenes
912 /// <param name="e"></param> 920 /// <param name="e"></param>
913 private void Heartbeat(object sender) 921 private void Heartbeat(object sender)
914 { 922 {
915 Update(); 923 try
924 {
925 Update();
916 926
917 m_lastUpdate = Environment.TickCount; 927 m_lastUpdate = Environment.TickCount;
928 m_firstHeartbeat = false;
929 }
930 catch (ThreadAbortException)
931 {
932 }
918 } 933 }
919 934
920 /// <summary> 935 /// <summary>
@@ -2307,6 +2322,7 @@ namespace OpenSim.Region.Framework.Scenes
2307 /// <param name="client"></param> 2322 /// <param name="client"></param>
2308 public override void AddNewClient(IClientAPI client) 2323 public override void AddNewClient(IClientAPI client)
2309 { 2324 {
2325 CheckHeartbeat();
2310 SubscribeToClientEvents(client); 2326 SubscribeToClientEvents(client);
2311 ScenePresence presence; 2327 ScenePresence presence;
2312 2328
@@ -2831,6 +2847,7 @@ namespace OpenSim.Region.Framework.Scenes
2831 /// <returns></returns> 2847 /// <returns></returns>
2832 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client) 2848 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client)
2833 { 2849 {
2850 CheckHeartbeat();
2834 AvatarAppearance appearance = null; 2851 AvatarAppearance appearance = null;
2835 GetAvatarAppearance(client, out appearance); 2852 GetAvatarAppearance(client, out appearance);
2836 2853
@@ -2873,6 +2890,7 @@ namespace OpenSim.Region.Framework.Scenes
2873 /// <param name="agentID"></param> 2890 /// <param name="agentID"></param>
2874 public override void RemoveClient(UUID agentID) 2891 public override void RemoveClient(UUID agentID)
2875 { 2892 {
2893 CheckHeartbeat();
2876 bool childagentYN = false; 2894 bool childagentYN = false;
2877 ScenePresence avatar = GetScenePresence(agentID); 2895 ScenePresence avatar = GetScenePresence(agentID);
2878 if (avatar != null) 2896 if (avatar != null)
@@ -4380,6 +4398,8 @@ namespace OpenSim.Region.Framework.Scenes
4380 else 4398 else
4381 return health; 4399 return health;
4382 4400
4401 CheckHeartbeat();
4402
4383 return health; 4403 return health;
4384 } 4404 }
4385 4405
@@ -4565,5 +4585,14 @@ namespace OpenSim.Region.Framework.Scenes
4565 4585
4566 return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z; 4586 return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z;
4567 } 4587 }
4588
4589 private void CheckHeartbeat()
4590 {
4591 if (m_firstHeartbeat)
4592 return;
4593
4594 if (System.Environment.TickCount - m_lastUpdate > 2000)
4595 StartTimer();
4596 }
4568 } 4597 }
4569} 4598}