cosmetics

This commit is contained in:
UbitUmarov
2022-02-07 18:57:56 +00:00
parent 771bb0a1a0
commit 16b106821d

View File

@@ -325,6 +325,7 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps)
{
/*
string hostName = m_scene.RegionInfo.ExternalHostName;
uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
string protocol = "http";
@@ -334,25 +335,22 @@ namespace OpenSim.Region.ClientStack.Linden
port = MainServer.Instance.SSLPort;
protocol = "https";
}
string baseURL = String.Format("{0}://{1}:{2}", protocol, hostName, port);
*/
string hgassets = null;
if(m_UserManagement != null)
hgassets = m_UserManagement.GetUserServerURL(agentID, "AssetServerURI");
IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
string baseURL = String.Format("{0}://{1}:{2}", protocol, hostName, port);
if (m_GetTextureURL == "localhost")
if (m_GetTextureURL.Equals("localhost"))
{
string capUrl = "/" + UUID.Random();
// Register this as a poll service
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets);
if (handler != null)
handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl);
else
caps.RegisterPollHandler("GetTexture", args);
caps.RegisterPollHandler("GetTexture", new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets));
}
else
{
@@ -360,48 +358,42 @@ namespace OpenSim.Region.ClientStack.Linden
}
//GetMesh
if (m_GetMeshURL == "localhost")
if (m_GetMeshURL.Equals("localhost"))
{
string capUrl = "/" + UUID.Random();
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets);
if (handler != null)
handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh", capUrl);
else
caps.RegisterPollHandler("GetMesh", args);
caps.RegisterPollHandler("GetMesh", new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets));
}
else if (m_GetMeshURL != string.Empty)
else if (!string.IsNullOrEmpty(m_GetMeshURL))
caps.RegisterHandler("GetMesh", m_GetMeshURL);
//GetMesh2
if (m_GetMesh2URL == "localhost")
if (m_GetMesh2URL.Equals("localhost"))
{
string capUrl = "/" + UUID.Random();
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets);
if (handler != null)
handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh2", capUrl);
else
caps.RegisterPollHandler("GetMesh2", args);
caps.RegisterPollHandler("GetMesh2", new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets));
}
else if (m_GetMesh2URL != string.Empty)
else if (!string.IsNullOrEmpty(m_GetMesh2URL))
caps.RegisterHandler("GetMesh2", m_GetMesh2URL);
//ViewerAsset
if (m_GetAssetURL == "localhost")
if (m_GetAssetURL.Equals("localhost"))
{
string capUrl = "/" + UUID.Random();
PollServiceAssetEventArgs args = new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets);
if (handler != null)
handler.RegisterExternalUserCapsHandler(agentID, caps, "ViewerAsset", capUrl);
else
caps.RegisterPollHandler("ViewerAsset", args);
caps.RegisterPollHandler("ViewerAsset", new PollServiceAssetEventArgs(capUrl, agentID, m_scene, hgassets));
}
else if (m_GetAssetURL != string.Empty)
else if (string.IsNullOrEmpty(m_GetAssetURL))
caps.RegisterHandler("ViewerAsset", m_GetAssetURL);
}
}