mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
This commit is contained in:
@@ -82,6 +82,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>();
|
||||
|
||||
private string m_URL;
|
||||
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
@@ -343,13 +345,13 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private void RegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
string capUrl = "/CAPS/" + UUID.Random() + "/";
|
||||
m_URL = "/CAPS/" + UUID.Random() + "/";
|
||||
|
||||
// Register this as a poll service
|
||||
PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);
|
||||
|
||||
args.Type = PollServiceEventArgs.EventType.Texture;
|
||||
MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
|
||||
MainServer.Instance.AddPollServiceHTTPHandler(m_URL, args);
|
||||
|
||||
string hostName = m_scene.RegionInfo.ExternalHostName;
|
||||
uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
|
||||
@@ -361,20 +363,23 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
port = MainServer.Instance.SSLPort;
|
||||
protocol = "https";
|
||||
}
|
||||
caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
|
||||
|
||||
IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
|
||||
if (handler != null)
|
||||
handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", m_URL);
|
||||
else
|
||||
caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, m_URL));
|
||||
m_pollservices[agentID] = args;
|
||||
m_capsDict[agentID] = capUrl;
|
||||
m_capsDict[agentID] = m_URL;
|
||||
}
|
||||
|
||||
private void DeregisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
string capUrl;
|
||||
PollServiceTextureEventArgs args;
|
||||
if (m_capsDict.TryGetValue(agentID, out capUrl))
|
||||
{
|
||||
MainServer.Instance.RemoveHTTPHandler("", capUrl);
|
||||
m_capsDict.Remove(agentID);
|
||||
}
|
||||
|
||||
MainServer.Instance.RemoveHTTPHandler("", m_URL);
|
||||
m_capsDict.Remove(agentID);
|
||||
|
||||
if (m_pollservices.TryGetValue(agentID, out args))
|
||||
{
|
||||
m_pollservices.Remove(agentID);
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
/// </summary>
|
||||
private OSDMap m_features = new OSDMap();
|
||||
|
||||
private string m_MapImageServerURL = string.Empty;
|
||||
private string m_SearchURL = string.Empty;
|
||||
private bool m_ExportSupported = false;
|
||||
|
||||
@@ -78,15 +77,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
IConfig config = source.Configs["SimulatorFeatures"];
|
||||
if (config != null)
|
||||
{
|
||||
m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty);
|
||||
if (m_MapImageServerURL != string.Empty)
|
||||
{
|
||||
m_MapImageServerURL = m_MapImageServerURL.Trim();
|
||||
if (!m_MapImageServerURL.EndsWith("/"))
|
||||
m_MapImageServerURL = m_MapImageServerURL + "/";
|
||||
}
|
||||
|
||||
{
|
||||
m_SearchURL = config.GetString("SearchServerURI", string.Empty);
|
||||
|
||||
m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported);
|
||||
@@ -149,15 +140,16 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_features["PhysicsShapeTypes"] = typesMap;
|
||||
|
||||
// Extra information for viewers that want to use it
|
||||
OSDMap gridServicesMap = new OSDMap();
|
||||
if (m_MapImageServerURL != string.Empty)
|
||||
gridServicesMap["map-server-url"] = m_MapImageServerURL;
|
||||
// TODO: Take these out of here into their respective modules, like map-server-url
|
||||
OSDMap extrasMap = new OSDMap();
|
||||
if (m_SearchURL != string.Empty)
|
||||
gridServicesMap["search"] = m_SearchURL;
|
||||
m_features["GridServices"] = gridServicesMap;
|
||||
|
||||
extrasMap["search-server-url"] = m_SearchURL;
|
||||
if (m_ExportSupported)
|
||||
m_features["ExportSupported"] = true;
|
||||
extrasMap["ExportSupported"] = true;
|
||||
|
||||
if (extrasMap.Count > 0)
|
||||
m_features["OpenSimExtras"] = extrasMap;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,11 +67,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_udpServer.AddScene(scene);
|
||||
|
||||
StatsManager.RegisterStat(
|
||||
new Stat(
|
||||
"ClientLogoutsDueToNoReceives",
|
||||
"Number of times a client has been logged out because no packets were received before the timeout.",
|
||||
"",
|
||||
"",
|
||||
"clientstack",
|
||||
scene.Name,
|
||||
StatType.Pull,
|
||||
MeasuresOfInterest.None,
|
||||
stat => stat.Value = m_udpServer.ClientLogoutsDueToNoReceives,
|
||||
StatVerbosity.Debug));
|
||||
|
||||
StatsManager.RegisterStat(
|
||||
new Stat(
|
||||
"IncomingUDPReceivesCount",
|
||||
"Number of UDP receives performed",
|
||||
"Number of UDP receives performed",
|
||||
"",
|
||||
"",
|
||||
"clientstack",
|
||||
scene.Name,
|
||||
@@ -84,7 +97,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
new Stat(
|
||||
"IncomingPacketsProcessedCount",
|
||||
"Number of inbound LL protocol packets processed",
|
||||
"Number of inbound LL protocol packets processed",
|
||||
"",
|
||||
"",
|
||||
"clientstack",
|
||||
scene.Name,
|
||||
@@ -97,7 +110,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
new Stat(
|
||||
"OutgoingUDPSendsCount",
|
||||
"Number of UDP sends performed",
|
||||
"Number of UDP sends performed",
|
||||
"",
|
||||
"",
|
||||
"clientstack",
|
||||
scene.Name,
|
||||
@@ -149,6 +162,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary>
|
||||
public const int MTU = 1400;
|
||||
|
||||
/// <summary>Number of forced client logouts due to no receipt of packets before timeout.</summary>
|
||||
public int ClientLogoutsDueToNoReceives { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default packet debug level given to new clients
|
||||
/// </summary>
|
||||
@@ -1058,7 +1074,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Fire this out on a different thread so that we don't hold up outgoing packet processing for
|
||||
// everybody else if this is being called due to an ack timeout.
|
||||
// This is the same as processing as the async process of a logout request.
|
||||
Util.FireAndForget(o => DeactivateClientDueToTimeout(client));
|
||||
Util.FireAndForget(o => DeactivateClientDueToTimeout(client, timeoutTicks));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1842,18 +1858,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// regular client pings.
|
||||
/// </remarks>
|
||||
/// <param name='client'></param>
|
||||
private void DeactivateClientDueToTimeout(LLClientView client)
|
||||
/// <param name='timeoutTicks'></param>
|
||||
private void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks)
|
||||
{
|
||||
lock (client.CloseSyncLock)
|
||||
{
|
||||
{
|
||||
ClientLogoutsDueToNoReceives++;
|
||||
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2}",
|
||||
client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.RegionInfo.RegionName);
|
||||
|
||||
StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
|
||||
"[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}. Disconnecting.",
|
||||
client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, m_scene.Name);
|
||||
|
||||
if (!client.SceneAgent.IsChildAgent)
|
||||
client.Kick("Simulator logged you out due to connection timeout");
|
||||
client.Kick("Simulator logged you out due to connection timeout.");
|
||||
|
||||
client.CloseWithoutChecks(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user