aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
diff options
context:
space:
mode:
authorubit2012-09-17 14:35:01 +0200
committerubit2012-09-17 14:35:01 +0200
commit434704fa99326dbba799d2c6f40d71a0e7402467 (patch)
tree2c81caf4d3523d729a2bed63f35e1d96ff2d20d0 /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parent add suport funtions for mesh upload costs (diff)
downloadopensim-SC_OLD-434704fa99326dbba799d2c6f40d71a0e7402467.zip
opensim-SC_OLD-434704fa99326dbba799d2c6f40d71a0e7402467.tar.gz
opensim-SC_OLD-434704fa99326dbba799d2c6f40d71a0e7402467.tar.bz2
opensim-SC_OLD-434704fa99326dbba799d2c6f40d71a0e7402467.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 9982556..580c005 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Timers;
29using System.Collections; 30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.IO; 32using System.IO;
@@ -466,6 +467,8 @@ namespace OpenSim.Region.ClientStack.Linden
466 467
467 if (llsdRequest.asset_type == "mesh") 468 if (llsdRequest.asset_type == "mesh")
468 { 469 {
470 cost += 20; // Constant for now to test showing a price
471
469 if (llsdRequest.asset_resources == null) 472 if (llsdRequest.asset_resources == null)
470 { 473 {
471 client.SendAgentAlertMessage("Unable to upload asset. missing information.", false); 474 client.SendAgentAlertMessage("Unable to upload asset. missing information.", false);
@@ -479,7 +482,7 @@ namespace OpenSim.Region.ClientStack.Linden
479 uint textures_cost = (uint)llsdRequest.asset_resources.texture_list.Array.Count; 482 uint textures_cost = (uint)llsdRequest.asset_resources.texture_list.Array.Count;
480 textures_cost *= (uint)mm.UploadCharge; 483 textures_cost *= (uint)mm.UploadCharge;
481 484
482 cost = textures_cost; 485 cost += textures_cost;
483 } 486 }
484 else 487 else
485 { 488 {
@@ -1092,6 +1095,9 @@ namespace OpenSim.Region.ClientStack.Linden
1092 1095
1093 public class AssetUploader 1096 public class AssetUploader
1094 { 1097 {
1098 private static readonly ILog m_log =
1099 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
1100
1095 public event UpLoadedAsset OnUpLoad; 1101 public event UpLoadedAsset OnUpLoad;
1096 private UpLoadedAsset handlerUpLoad = null; 1102 private UpLoadedAsset handlerUpLoad = null;
1097 1103
@@ -1106,6 +1112,7 @@ namespace OpenSim.Region.ClientStack.Linden
1106 1112
1107 private string m_invType = String.Empty; 1113 private string m_invType = String.Empty;
1108 private string m_assetType = String.Empty; 1114 private string m_assetType = String.Empty;
1115 private Timer m_timeoutTimer = new Timer();
1109 1116
1110 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, 1117 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem,
1111 UUID parentFolderID, string invType, string assetType, string path, 1118 UUID parentFolderID, string invType, string assetType, string path,
@@ -1121,6 +1128,11 @@ namespace OpenSim.Region.ClientStack.Linden
1121 m_assetType = assetType; 1128 m_assetType = assetType;
1122 m_invType = invType; 1129 m_invType = invType;
1123 m_dumpAssetsToFile = dumpAssetsToFile; 1130 m_dumpAssetsToFile = dumpAssetsToFile;
1131
1132 m_timeoutTimer.Elapsed += TimedOut;
1133 m_timeoutTimer.Interval = 120000;
1134 m_timeoutTimer.AutoReset = false;
1135 m_timeoutTimer.Start();
1124 } 1136 }
1125 1137
1126 /// <summary> 1138 /// <summary>
@@ -1142,6 +1154,7 @@ namespace OpenSim.Region.ClientStack.Linden
1142 res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); 1154 res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
1143 1155
1144 httpListener.RemoveStreamHandler("POST", uploaderPath); 1156 httpListener.RemoveStreamHandler("POST", uploaderPath);
1157 m_timeoutTimer.Stop();
1145 1158
1146 // TODO: probably make this a better set of extensions here 1159 // TODO: probably make this a better set of extensions here
1147 string extension = ".jp2"; 1160 string extension = ".jp2";
@@ -1163,6 +1176,12 @@ namespace OpenSim.Region.ClientStack.Linden
1163 return res; 1176 return res;
1164 } 1177 }
1165 1178
1179 private void TimedOut(object sender, ElapsedEventArgs args)
1180 {
1181 m_log.InfoFormat("[CAPS]: Removing URL and handler for timed out mesh upload");
1182 httpListener.RemoveStreamHandler("POST", uploaderPath);
1183 }
1184
1166 ///Left this in and commented in case there are unforseen issues 1185 ///Left this in and commented in case there are unforseen issues
1167 //private void SaveAssetToFile(string filename, byte[] data) 1186 //private void SaveAssetToFile(string filename, byte[] data)
1168 //{ 1187 //{