mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
Merge branch 'master' of ssh://MyConnection/var/git/opensim
This commit is contained in:
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||
|
||||
public bool IsForeignUser(UUID userID, out string userServerURL)
|
||||
{
|
||||
userServerURL = string.Empty;
|
||||
userServerURL = m_commsManager.NetworkServersInfo.UserURL;
|
||||
CachedUserInfo uinfo = m_commsManager.UserProfileCacheService.GetUserDetails(userID);
|
||||
if (uinfo != null)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Communications.OGS1
|
||||
parameters.Add(param);
|
||||
XmlRpcRequest req = new XmlRpcRequest("get_agent_by_uuid", parameters);
|
||||
|
||||
XmlRpcResponse resp = req.Send(GetUserServerURL(userId), 6000);
|
||||
XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 6000);
|
||||
Hashtable respData = (Hashtable)resp.Value;
|
||||
if (respData.Contains("error_type"))
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IUserAccountDataService m_UserService;
|
||||
private IUserAccountService m_UserService;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_UserService =
|
||||
ServerUtils.LoadPlugin<IUserAccountDataService>(serviceDll,
|
||||
ServerUtils.LoadPlugin<IUserAccountService>(serviceDll,
|
||||
args);
|
||||
|
||||
if (m_UserService == null)
|
||||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IUserAccountDataService>(m_UserService);
|
||||
scene.RegisterModuleInterface<IUserAccountService>(m_UserService);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
||||
@@ -37,7 +37,7 @@ using OpenSim.Services.Connectors;
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
|
||||
{
|
||||
public class RemoteUserServicesConnector : UserServicesConnector,
|
||||
ISharedRegionModule, IUserAccountDataService
|
||||
ISharedRegionModule, IUserAccountService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
@@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IUserAccountDataService>(this);
|
||||
scene.RegisterModuleInterface<IUserAccountService>(this);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
||||
@@ -220,11 +220,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private bool m_scripts_enabled = true;
|
||||
private string m_defaultScriptEngine;
|
||||
private int m_LastLogin = 0;
|
||||
private Thread HeartbeatThread;
|
||||
private Thread HeartbeatThread = null;
|
||||
private volatile bool shuttingdown = false;
|
||||
|
||||
private int m_lastUpdate = Environment.TickCount;
|
||||
private int m_maxPrimsPerFrame = 200;
|
||||
private bool m_firstHeartbeat = true;
|
||||
|
||||
private object m_deleting_scene_object = new object();
|
||||
|
||||
@@ -876,6 +877,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//m_heartbeatTimer.Enabled = true;
|
||||
//m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
|
||||
//m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
|
||||
if (HeartbeatThread != null)
|
||||
{
|
||||
ThreadTracker.Remove(HeartbeatThread);
|
||||
HeartbeatThread.Abort();
|
||||
HeartbeatThread = null;
|
||||
}
|
||||
m_lastUpdate = Environment.TickCount;
|
||||
HeartbeatThread = new Thread(new ParameterizedThreadStart(Heartbeat));
|
||||
HeartbeatThread.SetApartmentState(ApartmentState.MTA);
|
||||
HeartbeatThread.Name = string.Format("Heartbeat for region {0}", RegionInfo.RegionName);
|
||||
@@ -912,9 +920,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="e"></param>
|
||||
private void Heartbeat(object sender)
|
||||
{
|
||||
Update();
|
||||
try
|
||||
{
|
||||
Update();
|
||||
|
||||
m_lastUpdate = Environment.TickCount;
|
||||
m_lastUpdate = Environment.TickCount;
|
||||
m_firstHeartbeat = false;
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2307,6 +2322,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="client"></param>
|
||||
public override void AddNewClient(IClientAPI client)
|
||||
{
|
||||
CheckHeartbeat();
|
||||
SubscribeToClientEvents(client);
|
||||
ScenePresence presence;
|
||||
|
||||
@@ -2831,6 +2847,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client)
|
||||
{
|
||||
CheckHeartbeat();
|
||||
AvatarAppearance appearance = null;
|
||||
GetAvatarAppearance(client, out appearance);
|
||||
|
||||
@@ -2873,6 +2890,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="agentID"></param>
|
||||
public override void RemoveClient(UUID agentID)
|
||||
{
|
||||
CheckHeartbeat();
|
||||
bool childagentYN = false;
|
||||
ScenePresence avatar = GetScenePresence(agentID);
|
||||
if (avatar != null)
|
||||
@@ -4380,6 +4398,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
return health;
|
||||
|
||||
CheckHeartbeat();
|
||||
|
||||
return health;
|
||||
}
|
||||
|
||||
@@ -4565,5 +4585,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z;
|
||||
}
|
||||
|
||||
private void CheckHeartbeat()
|
||||
{
|
||||
if (m_firstHeartbeat)
|
||||
return;
|
||||
|
||||
if (System.Environment.TickCount - m_lastUpdate > 2000)
|
||||
StartTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user