diff options
author | UbitUmarov | 2016-08-18 07:48:46 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-18 07:48:46 +0100 |
commit | e58e6daf4a388aee1de80ef0ac36b286eb51d1c2 (patch) | |
tree | 5bb02b7b49bdb87db2c0d1347f546de2048093bf | |
parent | in GetUsersNames(string[] ids) why are empty names in cache? ignore them, cac... (diff) | |
download | opensim-SC_OLD-e58e6daf4a388aee1de80ef0ac36b286eb51d1c2.zip opensim-SC_OLD-e58e6daf4a388aee1de80ef0ac36b286eb51d1c2.tar.gz opensim-SC_OLD-e58e6daf4a388aee1de80ef0ac36b286eb51d1c2.tar.bz2 opensim-SC_OLD-e58e6daf4a388aee1de80ef0ac36b286eb51d1c2.tar.xz |
several changes on BunchOfCaps. Move some mesh cost initialization to its class it, change caps path to be plain random UUID (except SEED)
3 files changed, 78 insertions, 129 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 19619c1..c5164ca 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -89,23 +89,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
89 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 89 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
90 | 90 | ||
91 | private Scene m_Scene; | 91 | private Scene m_Scene; |
92 | private UUID m_AgentID; | ||
92 | private Caps m_HostCapsObj; | 93 | private Caps m_HostCapsObj; |
93 | private ModelCost m_ModelCost; | 94 | private ModelCost m_ModelCost; |
94 | 95 | ||
95 | private static readonly string m_requestPath = "0000/"; | ||
96 | // private static readonly string m_mapLayerPath = "0001/"; | ||
97 | private static readonly string m_newInventory = "0002/"; | ||
98 | //private static readonly string m_requestTexture = "0003/"; | ||
99 | private static readonly string m_notecardUpdatePath = "0004/"; | ||
100 | private static readonly string m_notecardTaskUpdatePath = "0005/"; | ||
101 | // private static readonly string m_fetchInventoryPath = "0006/"; | ||
102 | private static readonly string m_copyFromNotecardPath = "0007/"; | ||
103 | // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. | 96 | // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. |
104 | private static readonly string m_getObjectPhysicsDataPath = "0101/"; | ||
105 | private static readonly string m_getObjectCostPath = "0102/"; | ||
106 | private static readonly string m_ResourceCostSelectedPath = "0103/"; | ||
107 | private static readonly string m_UpdateAgentInformationPath = "0500/"; | ||
108 | private static readonly string m_animSetTaskUpdatePath = "0260/"; | ||
109 | 97 | ||
110 | // These are callbacks which will be setup by the scene so that we can update scene data when we | 98 | // These are callbacks which will be setup by the scene so that we can update scene data when we |
111 | // receive capability calls | 99 | // receive capability calls |
@@ -143,27 +131,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
143 | } | 131 | } |
144 | private FileAgentInventoryState m_FileAgentInventoryState = FileAgentInventoryState.idle; | 132 | private FileAgentInventoryState m_FileAgentInventoryState = FileAgentInventoryState.idle; |
145 | 133 | ||
146 | public BunchOfCaps(Scene scene, Caps caps) | 134 | public BunchOfCaps(Scene scene, UUID agentID, Caps caps) |
147 | { | 135 | { |
148 | m_Scene = scene; | 136 | m_Scene = scene; |
137 | m_AgentID = agentID; | ||
149 | m_HostCapsObj = caps; | 138 | m_HostCapsObj = caps; |
150 | 139 | ||
151 | // create a model upload cost provider | 140 | // create a model upload cost provider |
152 | m_ModelCost = new ModelCost(); | 141 | m_ModelCost = new ModelCost(scene); |
153 | // tell it about scene object limits | 142 | |
154 | m_ModelCost.NonPhysicalPrimScaleMax = m_Scene.m_maxNonphys; | ||
155 | m_ModelCost.PhysicalPrimScaleMax = m_Scene.m_maxPhys; | ||
156 | m_ModelCost.ObjectLinkedPartsMax = m_Scene.m_linksetCapacity; | ||
157 | |||
158 | // m_ModelCost.ObjectLinkedPartsMax = ?? | ||
159 | // m_ModelCost.PrimScaleMin = ?? | ||
160 | |||
161 | m_PrimScaleMin = m_ModelCost.PrimScaleMin; | 143 | m_PrimScaleMin = m_ModelCost.PrimScaleMin; |
162 | float modelTextureUploadFactor = m_ModelCost.ModelTextureCostFactor; | ||
163 | float modelUploadFactor = m_ModelCost.ModelMeshCostFactor; | ||
164 | float modelMinUploadCostFactor = m_ModelCost.ModelMinCostFactor; | ||
165 | float modelPrimCreationCost = m_ModelCost.primCreationCost; | ||
166 | float modelMeshByteCost = m_ModelCost.bytecost; | ||
167 | 144 | ||
168 | IConfigSource config = m_Scene.Config; | 145 | IConfigSource config = m_Scene.Config; |
169 | if (config != null) | 146 | if (config != null) |
@@ -183,12 +160,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
183 | IConfig EconomyConfig = config.Configs["Economy"]; | 160 | IConfig EconomyConfig = config.Configs["Economy"]; |
184 | if (EconomyConfig != null) | 161 | if (EconomyConfig != null) |
185 | { | 162 | { |
186 | modelUploadFactor = EconomyConfig.GetFloat("MeshModelUploadCostFactor", modelUploadFactor); | 163 | m_ModelCost.Econfig(EconomyConfig); |
187 | modelTextureUploadFactor = EconomyConfig.GetFloat("MeshModelUploadTextureCostFactor", modelTextureUploadFactor); | ||
188 | modelMinUploadCostFactor = EconomyConfig.GetFloat("MeshModelMinCostFactor", modelMinUploadCostFactor); | ||
189 | // next 2 are normalized so final cost is afected by modelUploadFactor above and normal cost | ||
190 | modelPrimCreationCost = EconomyConfig.GetFloat("ModelPrimCreationCost", modelPrimCreationCost); | ||
191 | modelMeshByteCost = EconomyConfig.GetFloat("ModelMeshByteCost", modelMeshByteCost); | ||
192 | 164 | ||
193 | m_enableModelUploadTextureToInventory = EconomyConfig.GetBoolean("MeshModelAllowTextureToInventory", m_enableModelUploadTextureToInventory); | 165 | m_enableModelUploadTextureToInventory = EconomyConfig.GetBoolean("MeshModelAllowTextureToInventory", m_enableModelUploadTextureToInventory); |
194 | 166 | ||
@@ -203,12 +175,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
203 | if (id != null) | 175 | if (id != null) |
204 | m_testAssetsCreatorID = id; | 176 | m_testAssetsCreatorID = id; |
205 | } | 177 | } |
206 | |||
207 | m_ModelCost.ModelMeshCostFactor = modelUploadFactor; | ||
208 | m_ModelCost.ModelTextureCostFactor = modelTextureUploadFactor; | ||
209 | m_ModelCost.ModelMinCostFactor = modelMinUploadCostFactor; | ||
210 | m_ModelCost.primCreationCost = modelPrimCreationCost; | ||
211 | m_ModelCost.bytecost = modelMeshByteCost; | ||
212 | } | 178 | } |
213 | } | 179 | } |
214 | 180 | ||
@@ -225,48 +191,54 @@ namespace OpenSim.Region.ClientStack.Linden | |||
225 | m_FileAgentInventoryState = FileAgentInventoryState.idle; | 191 | m_FileAgentInventoryState = FileAgentInventoryState.idle; |
226 | } | 192 | } |
227 | 193 | ||
194 | public string GetNewCapPath() | ||
195 | { | ||
196 | UUID tmpid = UUID.Random(); | ||
197 | return "/CAPS/" + tmpid.ToString(); | ||
198 | } | ||
199 | |||
228 | /// <summary> | 200 | /// <summary> |
229 | /// Register a bunch of CAPS http service handlers | 201 | /// Register a bunch of CAPS http service handlers |
230 | /// </summary> | 202 | /// </summary> |
231 | public void RegisterHandlers() | 203 | public void RegisterHandlers() |
232 | { | 204 | { |
233 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | 205 | // this path is also defined elsewhere so keeping it |
206 | string seedcapsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath +"0000/"; | ||
207 | |||
208 | // the root of all evil path needs to be capsBase + m_requestPath | ||
209 | m_HostCapsObj.RegisterHandler( | ||
210 | "SEED", new RestStreamHandler("POST", seedcapsBase, SeedCapRequest, "SEED", null)); | ||
211 | |||
212 | // m_log.DebugFormat( | ||
213 | // "[CAPS]: Registered seed capability {0} for {1}", seedcapsBase, m_HostCapsObj.AgentID); | ||
234 | 214 | ||
235 | RegisterRegionServiceHandlers(capsBase); | 215 | RegisterRegionServiceHandlers(); |
236 | RegisterInventoryServiceHandlers(capsBase); | 216 | RegisterInventoryServiceHandlers(); |
237 | } | 217 | } |
238 | 218 | ||
239 | public void RegisterRegionServiceHandlers(string capsBase) | 219 | public void RegisterRegionServiceHandlers() |
240 | { | 220 | { |
241 | try | 221 | try |
242 | { | 222 | { |
243 | // the root of all evil | ||
244 | m_HostCapsObj.RegisterHandler( | ||
245 | "SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null)); | ||
246 | |||
247 | // m_log.DebugFormat( | ||
248 | // "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID); | ||
249 | |||
250 | //m_capsHandlers["MapLayer"] = | 223 | //m_capsHandlers["MapLayer"] = |
251 | // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", | 224 | // new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST", |
252 | // capsBase + m_mapLayerPath, | 225 | // GetNewCapPath(), |
253 | // GetMapLayer); | 226 | // GetMapLayer); |
254 | 227 | ||
255 | IRequestHandler getObjectPhysicsDataHandler | 228 | IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler( |
256 | = new RestStreamHandler( | 229 | "POST", GetNewCapPath(), GetObjectPhysicsData, "GetObjectPhysicsData", null); |
257 | "POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData, "GetObjectPhysicsData", null); | ||
258 | m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); | 230 | m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); |
259 | 231 | ||
260 | IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost); | 232 | IRequestHandler getObjectCostHandler = new RestStreamHandler( |
233 | "POST", GetNewCapPath(), GetObjectCost, "GetObjectCost", null ); | ||
261 | m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler); | 234 | m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler); |
262 | IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected); | ||
263 | m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler); | ||
264 | |||
265 | 235 | ||
266 | IRequestHandler req | 236 | IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler( |
267 | = new RestStreamHandler( | 237 | "POST", GetNewCapPath(), ResourceCostSelected, "ResourceCostSelected", null); |
268 | "POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory, "UpdateScript", null); | 238 | m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler); |
269 | 239 | ||
240 | IRequestHandler req = new RestStreamHandler( | ||
241 | "POST", GetNewCapPath(), ScriptTaskInventory, "UpdateScript", null); | ||
270 | m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req); | 242 | m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req); |
271 | m_HostCapsObj.RegisterHandler("UpdateScriptTask", req); | 243 | m_HostCapsObj.RegisterHandler("UpdateScriptTask", req); |
272 | 244 | ||
@@ -282,65 +254,29 @@ namespace OpenSim.Region.ClientStack.Linden | |||
282 | } | 254 | } |
283 | } | 255 | } |
284 | 256 | ||
285 | public void RegisterInventoryServiceHandlers(string capsBase) | 257 | public void RegisterInventoryServiceHandlers() |
286 | { | 258 | { |
287 | try | 259 | try |
288 | { | 260 | { |
289 | m_HostCapsObj.RegisterHandler( | 261 | m_HostCapsObj.RegisterHandler("NewFileAgentInventory", |
290 | "NewFileAgentInventory", | ||
291 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>( | 262 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>( |
292 | "POST", | 263 | "POST", GetNewCapPath(), NewAgentInventoryRequest, "NewFileAgentInventory", null)); |
293 | capsBase + m_newInventory, | ||
294 | NewAgentInventoryRequest, | ||
295 | "NewFileAgentInventory", | ||
296 | null)); | ||
297 | |||
298 | IRequestHandler req | ||
299 | = new RestStreamHandler( | ||
300 | "POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory, "Update*", null); | ||
301 | 264 | ||
265 | IRequestHandler req = new RestStreamHandler( | ||
266 | "POST", GetNewCapPath(), NoteCardAgentInventory, "Update*", null); | ||
302 | m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); | 267 | m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); |
303 | m_HostCapsObj.RegisterHandler("UpdateAnimSetAgentInventory", req); | 268 | m_HostCapsObj.RegisterHandler("UpdateAnimSetAgentInventory", req); |
304 | m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); | 269 | m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); |
305 | m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); | 270 | m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); |
306 | 271 | ||
307 | 272 | IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler( | |
308 | 273 | "POST", GetNewCapPath(), UpdateAgentInformation, "UpdateAgentInformation", null); | |
309 | IRequestHandler UpdateAgentInformationHandler | ||
310 | = new RestStreamHandler( | ||
311 | "POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation, "UpdateAgentInformation", null); | ||
312 | m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); | 274 | m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); |
313 | 275 | ||
314 | m_HostCapsObj.RegisterHandler( | 276 | IRequestHandler CopyInventoryFromNotecardHandler = new RestStreamHandler( |
315 | "CopyInventoryFromNotecard", | 277 | "POST", GetNewCapPath(), CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null); |
316 | new RestStreamHandler( | 278 | m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", CopyInventoryFromNotecardHandler); |
317 | "POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null)); | ||
318 | 279 | ||
319 | // As of RC 1.22.9 of the Linden client this is | ||
320 | // supported | ||
321 | |||
322 | //m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); | ||
323 | |||
324 | // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and | ||
325 | // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires | ||
326 | // enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service, | ||
327 | // but when I went on the Linden grid, the | ||
328 | // simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead, | ||
329 | // the 1.19.1.4 client appeared to be happily flowing inventory data over UDP | ||
330 | // | ||
331 | // This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid | ||
332 | // we will be | ||
333 | // able to get the data we need to implement the necessary part of the protocol to fix the issue above. | ||
334 | // m_capsHandlers["FetchInventoryDescendents"] = | ||
335 | // new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest); | ||
336 | |||
337 | // m_capsHandlers["FetchInventoryDescendents"] = | ||
338 | // new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST", | ||
339 | // capsBase + m_fetchInventory, | ||
340 | // FetchInventory)); | ||
341 | // m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST", | ||
342 | // capsBase + m_requestTexture, | ||
343 | // RequestTexture); | ||
344 | } | 280 | } |
345 | catch (Exception e) | 281 | catch (Exception e) |
346 | { | 282 | { |
@@ -409,30 +345,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
409 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); | 345 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); |
410 | LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest); | 346 | LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest); |
411 | 347 | ||
412 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | 348 | string uploaderPath = GetNewCapPath(); |
413 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | ||
414 | 349 | ||
415 | TaskInventoryScriptUpdater uploader = | 350 | TaskInventoryScriptUpdater uploader = |
416 | new TaskInventoryScriptUpdater( | 351 | new TaskInventoryScriptUpdater( |
417 | llsdUpdateRequest.item_id, | 352 | llsdUpdateRequest.item_id, |
418 | llsdUpdateRequest.task_id, | 353 | llsdUpdateRequest.task_id, |
419 | llsdUpdateRequest.is_script_running, | 354 | llsdUpdateRequest.is_script_running, |
420 | capsBase + uploaderPath, | 355 | uploaderPath, |
421 | m_HostCapsObj.HttpListener, | 356 | m_HostCapsObj.HttpListener, |
422 | m_dumpAssetsToFile); | 357 | m_dumpAssetsToFile); |
423 | uploader.OnUpLoad += TaskScriptUpdated; | 358 | uploader.OnUpLoad += TaskScriptUpdated; |
424 | 359 | ||
425 | m_HostCapsObj.HttpListener.AddStreamHandler( | 360 | m_HostCapsObj.HttpListener.AddStreamHandler( |
426 | new BinaryStreamHandler( | 361 | new BinaryStreamHandler( |
427 | "POST", capsBase + uploaderPath, uploader.uploaderCaps, "TaskInventoryScriptUpdater", null)); | 362 | "POST", uploaderPath, uploader.uploaderCaps, "TaskInventoryScriptUpdater", null)); |
428 | 363 | ||
429 | string protocol = "http://"; | 364 | string protocol = "http://"; |
430 | 365 | ||
431 | if (m_HostCapsObj.SSLCaps) | 366 | if (m_HostCapsObj.SSLCaps) |
432 | protocol = "https://"; | 367 | protocol = "https://"; |
433 | 368 | ||
434 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase + | 369 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath; |
435 | uploaderPath; | ||
436 | 370 | ||
437 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 371 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
438 | uploadResponse.uploader = uploaderURL; | 372 | uploadResponse.uploader = uploaderURL; |
@@ -653,11 +587,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
653 | } | 587 | } |
654 | 588 | ||
655 | string assetDes = llsdRequest.description; | 589 | string assetDes = llsdRequest.description; |
656 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | ||
657 | UUID newAsset = UUID.Random(); | 590 | UUID newAsset = UUID.Random(); |
658 | UUID newInvItem = UUID.Random(); | 591 | UUID newInvItem = UUID.Random(); |
659 | UUID parentFolder = llsdRequest.folder_id; | 592 | UUID parentFolder = llsdRequest.folder_id; |
660 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 593 | string uploaderPath = GetNewCapPath(); |
661 | UUID texturesFolder = UUID.Zero; | 594 | UUID texturesFolder = UUID.Zero; |
662 | 595 | ||
663 | if(!IsAtestUpload && m_enableModelUploadTextureToInventory) | 596 | if(!IsAtestUpload && m_enableModelUploadTextureToInventory) |
@@ -665,26 +598,23 @@ namespace OpenSim.Region.ClientStack.Linden | |||
665 | 598 | ||
666 | AssetUploader uploader = | 599 | AssetUploader uploader = |
667 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, | 600 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, |
668 | llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost, | 601 | llsdRequest.asset_type, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost, |
669 | texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload, | 602 | texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload, |
670 | llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask); | 603 | llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask); |
671 | 604 | ||
672 | m_HostCapsObj.HttpListener.AddStreamHandler( | 605 | m_HostCapsObj.HttpListener.AddStreamHandler( |
673 | new BinaryStreamHandler( | 606 | new BinaryStreamHandler( |
674 | "POST", | 607 | "POST", |
675 | capsBase + uploaderPath, | 608 | uploaderPath, |
676 | uploader.uploaderCaps, | 609 | uploader.uploaderCaps, |
677 | "NewAgentInventoryRequest", | 610 | "NewAgentInventoryRequest", |
678 | m_HostCapsObj.AgentID.ToString())); | 611 | m_HostCapsObj.AgentID.ToString())); |
679 | 612 | ||
680 | string protocol = "http://"; | 613 | string protocol = "http://"; |
681 | |||
682 | if (m_HostCapsObj.SSLCaps) | 614 | if (m_HostCapsObj.SSLCaps) |
683 | protocol = "https://"; | 615 | protocol = "https://"; |
684 | 616 | ||
685 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase + | 617 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath; |
686 | uploaderPath; | ||
687 | |||
688 | 618 | ||
689 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 619 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
690 | uploadResponse.uploader = uploaderURL; | 620 | uploadResponse.uploader = uploaderURL; |
@@ -1313,24 +1243,22 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1313 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); | 1243 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); |
1314 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); | 1244 | LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); |
1315 | 1245 | ||
1316 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | 1246 | string uploaderPath = GetNewCapPath(); |
1317 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | ||
1318 | 1247 | ||
1319 | ItemUpdater uploader = | 1248 | ItemUpdater uploader = |
1320 | new ItemUpdater(llsdRequest.item_id, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile); | 1249 | new ItemUpdater(llsdRequest.item_id, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile); |
1321 | uploader.OnUpLoad += ItemUpdated; | 1250 | uploader.OnUpLoad += ItemUpdated; |
1322 | 1251 | ||
1323 | m_HostCapsObj.HttpListener.AddStreamHandler( | 1252 | m_HostCapsObj.HttpListener.AddStreamHandler( |
1324 | new BinaryStreamHandler( | 1253 | new BinaryStreamHandler( |
1325 | "POST", capsBase + uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null)); | 1254 | "POST", uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null)); |
1326 | 1255 | ||
1327 | string protocol = "http://"; | 1256 | string protocol = "http://"; |
1328 | 1257 | ||
1329 | if (m_HostCapsObj.SSLCaps) | 1258 | if (m_HostCapsObj.SSLCaps) |
1330 | protocol = "https://"; | 1259 | protocol = "https://"; |
1331 | 1260 | ||
1332 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase + | 1261 | string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + uploaderPath; |
1333 | uploaderPath; | ||
1334 | 1262 | ||
1335 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 1263 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
1336 | uploadResponse.uploader = uploaderURL; | 1264 | uploadResponse.uploader = uploaderURL; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs index c241075..5b4e0da 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
84 | 84 | ||
85 | private void OnRegisterCaps(UUID agentID, Caps caps) | 85 | private void OnRegisterCaps(UUID agentID, Caps caps) |
86 | { | 86 | { |
87 | new BunchOfCaps(m_Scene, caps); | 87 | new BunchOfCaps(m_Scene, agentID, caps); |
88 | } | 88 | } |
89 | 89 | ||
90 | } | 90 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs index 29bde6c..fb22694 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs | |||
@@ -45,6 +45,8 @@ using ComponentAce.Compression.Libs.zlib; | |||
45 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | 45 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; |
46 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 46 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; |
47 | 47 | ||
48 | using Nini.Config; | ||
49 | |||
48 | namespace OpenSim.Region.ClientStack.Linden | 50 | namespace OpenSim.Region.ClientStack.Linden |
49 | { | 51 | { |
50 | public struct ModelPrimLimits | 52 | public struct ModelPrimLimits |
@@ -100,6 +102,25 @@ namespace OpenSim.Region.ClientStack.Linden | |||
100 | public float PhysicalPrimScaleMax = 10f; | 102 | public float PhysicalPrimScaleMax = 10f; |
101 | public int ObjectLinkedPartsMax = 512; | 103 | public int ObjectLinkedPartsMax = 512; |
102 | 104 | ||
105 | |||
106 | public ModelCost(Scene scene) | ||
107 | { | ||
108 | PrimScaleMin = scene.m_minNonphys; | ||
109 | NonPhysicalPrimScaleMax = scene.m_maxNonphys; | ||
110 | PhysicalPrimScaleMax = scene.m_maxPhys; | ||
111 | ObjectLinkedPartsMax = scene.m_linksetCapacity; | ||
112 | } | ||
113 | |||
114 | public void Econfig(IConfig EconomyConfig) | ||
115 | { | ||
116 | ModelMeshCostFactor = EconomyConfig.GetFloat("MeshModelUploadCostFactor", ModelMeshCostFactor); | ||
117 | ModelTextureCostFactor = EconomyConfig.GetFloat("MeshModelUploadTextureCostFactor", ModelTextureCostFactor); | ||
118 | ModelMinCostFactor = EconomyConfig.GetFloat("MeshModelMinCostFactor", ModelMinCostFactor); | ||
119 | // next 2 are normalized so final cost is afected by modelUploadFactor above and normal cost | ||
120 | primCreationCost = EconomyConfig.GetFloat("ModelPrimCreationCost", primCreationCost); | ||
121 | bytecost = EconomyConfig.GetFloat("ModelMeshByteCost", bytecost); | ||
122 | } | ||
123 | |||
103 | // storage for a single mesh asset cost parameters | 124 | // storage for a single mesh asset cost parameters |
104 | private class ameshCostParam | 125 | private class ameshCostParam |
105 | { | 126 | { |