diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 8e1f63a..f57d857 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -57,6 +57,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
57 | private IAssetService m_AssetService; | 57 | private IAssetService m_AssetService; |
58 | private bool m_Enabled = true; | 58 | private bool m_Enabled = true; |
59 | private string m_URL; | 59 | private string m_URL; |
60 | private string m_URL2; | ||
61 | private string m_RedirectURL = null; | ||
62 | private string m_RedirectURL2 = null; | ||
60 | 63 | ||
61 | #region Region Module interfaceBase Members | 64 | #region Region Module interfaceBase Members |
62 | 65 | ||
@@ -74,7 +77,18 @@ namespace OpenSim.Region.ClientStack.Linden | |||
74 | m_URL = config.GetString("Cap_GetMesh", string.Empty); | 77 | m_URL = config.GetString("Cap_GetMesh", string.Empty); |
75 | // Cap doesn't exist | 78 | // Cap doesn't exist |
76 | if (m_URL != string.Empty) | 79 | if (m_URL != string.Empty) |
80 | { | ||
81 | m_Enabled = true; | ||
82 | m_RedirectURL = config.GetString("GetMeshRedirectURL"); | ||
83 | } | ||
84 | |||
85 | m_URL2 = config.GetString("Cap_GetMesh2", string.Empty); | ||
86 | // Cap doesn't exist | ||
87 | if (m_URL2 != string.Empty) | ||
88 | { | ||
77 | m_Enabled = true; | 89 | m_Enabled = true; |
90 | m_RedirectURL2 = config.GetString("GetMesh2RedirectURL"); | ||
91 | } | ||
78 | } | 92 | } |
79 | 93 | ||
80 | public void AddRegion(Scene pScene) | 94 | public void AddRegion(Scene pScene) |
@@ -113,28 +127,42 @@ namespace OpenSim.Region.ClientStack.Linden | |||
113 | 127 | ||
114 | public void RegisterCaps(UUID agentID, Caps caps) | 128 | public void RegisterCaps(UUID agentID, Caps caps) |
115 | { | 129 | { |
116 | // UUID capID = UUID.Random(); | 130 | UUID capID = UUID.Random(); |
131 | bool getMeshRegistered = false; | ||
117 | 132 | ||
118 | //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); | 133 | if (m_URL == string.Empty) |
119 | if (m_URL == "localhost") | 134 | { |
135 | |||
136 | } | ||
137 | else if (m_URL == "localhost") | ||
120 | { | 138 | { |
121 | // m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); | 139 | getMeshRegistered = true; |
122 | GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); | 140 | caps.RegisterHandler( |
123 | IRequestHandler reqHandler | 141 | "GetMesh", |
124 | = new RestHTTPHandler( | 142 | new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh", agentID.ToString(), m_RedirectURL)); |
125 | "GET", | ||
126 | "/CAPS/" + UUID.Random(), | ||
127 | httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null), | ||
128 | "GetMesh", | ||
129 | agentID.ToString()); | ||
130 | |||
131 | caps.RegisterHandler("GetMesh", reqHandler); | ||
132 | } | 143 | } |
133 | else | 144 | else |
134 | { | 145 | { |
135 | // m_log.DebugFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); | ||
136 | caps.RegisterHandler("GetMesh", m_URL); | 146 | caps.RegisterHandler("GetMesh", m_URL); |
137 | } | 147 | } |
148 | |||
149 | if(m_URL2 == string.Empty) | ||
150 | { | ||
151 | |||
152 | } | ||
153 | else if (m_URL2 == "localhost") | ||
154 | { | ||
155 | if (!getMeshRegistered) | ||
156 | { | ||
157 | caps.RegisterHandler( | ||
158 | "GetMesh2", | ||
159 | new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh2", agentID.ToString(), m_RedirectURL2)); | ||
160 | } | ||
161 | } | ||
162 | else | ||
163 | { | ||
164 | caps.RegisterHandler("GetMesh2", m_URL2); | ||
165 | } | ||
138 | } | 166 | } |
139 | 167 | ||
140 | } | 168 | } |