aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs105
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs1
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs7
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs24
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs29
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs24
9 files changed, 169 insertions, 32 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 0db7bb9..8a339fe 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Capabilities
44 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, 44 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
45 byte[] data, string inventoryType, string assetType); 45 byte[] data, string inventoryType, string assetType);
46 46
47 public delegate void UploadedBakedTexture(UUID assetID, byte[] data);
48
47 public delegate UUID UpdateItem(UUID itemID, byte[] data); 49 public delegate UUID UpdateItem(UUID itemID, byte[] data);
48 50
49 public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors); 51 public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors);
@@ -97,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
97 // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. 99 // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
98 100
99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 101 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
102 private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
100 103
101 //private string eventQueue = "0100/"; 104 //private string eventQueue = "0100/";
102 private IScene m_Scene; 105 private IScene m_Scene;
@@ -185,6 +188,8 @@ namespace OpenSim.Framework.Capabilities
185 m_capsHandlers["UpdateScriptTaskInventory"] = 188 m_capsHandlers["UpdateScriptTaskInventory"] =
186 new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); 189 new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
187 m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; 190 m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"];
191 m_capsHandlers["UploadBakedTexture"] =
192 new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture);
188 193
189 } 194 }
190 catch (Exception e) 195 catch (Exception e)
@@ -742,6 +747,50 @@ namespace OpenSim.Framework.Capabilities
742 return null; 747 return null;
743 } 748 }
744 749
750 public string UploadBakedTexture(string request, string path,
751 string param, OSHttpRequest httpRequest,
752 OSHttpResponse httpResponse)
753 {
754 try
755 {
756 m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
757 m_regionName);
758
759 string capsBase = "/CAPS/" + m_capsObjectPath;
760 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
761
762 BakedTextureUploader uploader =
763 new BakedTextureUploader( capsBase + uploaderPath,
764 m_httpListener);
765 uploader.OnUpLoad += BakedTextureUploaded;
766
767 m_httpListener.AddStreamHandler(
768 new BinaryStreamHandler("POST", capsBase + uploaderPath,
769 uploader.uploaderCaps));
770
771 string protocol = "http://";
772
773 if (m_httpListener.UseSSL)
774 protocol = "https://";
775
776 string uploaderURL = protocol + m_httpListenerHostName + ":" +
777 m_httpListenPort.ToString() + capsBase + uploaderPath;
778
779 LLSDAssetUploadResponse uploadResponse =
780 new LLSDAssetUploadResponse();
781 uploadResponse.uploader = uploaderURL;
782 uploadResponse.state = "upload";
783
784 return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
785 }
786 catch (Exception e)
787 {
788 m_log.Error("[CAPS]: " + e.ToString());
789 }
790
791 return null;
792 }
793
745 /// <summary> 794 /// <summary>
746 /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. 795 /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset.
747 /// </summary> 796 /// </summary>
@@ -925,6 +974,17 @@ namespace OpenSim.Framework.Capabilities
925 } 974 }
926 } 975 }
927 976
977 public void BakedTextureUploaded(UUID assetID, byte[] data)
978 {
979 m_log.DebugFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
980 AssetBase asset;
981 asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_agentID.ToString());
982 asset.Data = data;
983 asset.Temporary = true;
984 asset.Local = true;
985 m_assetCache.Store(asset);
986 }
987
928 /// <summary> 988 /// <summary>
929 /// Called when new asset data for an agent inventory item update has been uploaded. 989 /// Called when new asset data for an agent inventory item update has been uploaded.
930 /// </summary> 990 /// </summary>
@@ -1243,5 +1303,50 @@ namespace OpenSim.Framework.Capabilities
1243 fs.Close(); 1303 fs.Close();
1244 } 1304 }
1245 } 1305 }
1306
1307 public class BakedTextureUploader
1308 {
1309 public event UploadedBakedTexture OnUpLoad;
1310 private UploadedBakedTexture handlerUpLoad = null;
1311
1312 private string uploaderPath = String.Empty;
1313 private UUID newAssetID;
1314 private IHttpServer httpListener;
1315
1316 public BakedTextureUploader(string path, IHttpServer httpServer)
1317 {
1318 newAssetID = UUID.Random();
1319 uploaderPath = path;
1320 httpListener = httpServer;
1321 }
1322
1323 /// <summary>
1324 ///
1325 /// </summary>
1326 /// <param name="data"></param>
1327 /// <param name="path"></param>
1328 /// <param name="param"></param>
1329 /// <returns></returns>
1330 public string uploaderCaps(byte[] data, string path, string param)
1331 {
1332 string res = String.Empty;
1333 LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
1334 uploadComplete.new_asset = newAssetID.ToString();
1335 uploadComplete.new_inventory_item = UUID.Zero;
1336 uploadComplete.state = "complete";
1337
1338 res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
1339
1340 httpListener.RemoveStreamHandler("POST", uploaderPath);
1341
1342 handlerUpLoad = OnUpLoad;
1343 if (handlerUpLoad != null)
1344 {
1345 handlerUpLoad(newAssetID, data);
1346 }
1347
1348 return res;
1349 }
1350 }
1246 } 1351 }
1247} 1352}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index fddb966..3d4269f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3408,6 +3408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3408 3408
3409 avp.Sender.IsTrial = false; 3409 avp.Sender.IsTrial = false;
3410 avp.Sender.ID = agentID; 3410 avp.Sender.ID = agentID;
3411 m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
3411 OutPacket(avp, ThrottleOutPacketType.Task); 3412 OutPacket(avp, ThrottleOutPacketType.Task);
3412 } 3413 }
3413 3414
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d7767bd..ca089a1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Framework.Scenes
252 252
253 if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) 253 if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
254 { 254 {
255 if (stateSource == 1 && // Prim crossing 255 if (stateSource == 2 && // Prim crossing
256 m_part.ParentGroup.Scene.m_trustBinaries) 256 m_part.ParentGroup.Scene.m_trustBinaries)
257 { 257 {
258 lock (m_items) 258 lock (m_items)
@@ -1095,4 +1095,4 @@ namespace OpenSim.Region.Framework.Scenes
1095 } 1095 }
1096 } 1096 }
1097 } 1097 }
1098} \ No newline at end of file 1098}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 339d0c4..cc9355e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2464,7 +2464,6 @@ namespace OpenSim.Region.Framework.Scenes
2464 m_controllingClient.SendAvatarDataImmediate(this); 2464 m_controllingClient.SendAvatarDataImmediate(this);
2465 2465
2466 SendInitialFullUpdateToAllClients(); 2466 SendInitialFullUpdateToAllClients();
2467 SendAppearanceToAllOtherAgents();
2468 } 2467 }
2469 2468
2470 /// <summary> 2469 /// <summary>
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 024b42d..f5b5982 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,8 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
86 paramList.Add(hash); 86 paramList.Add(hash);
87 87
88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); 88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
89 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; 89 string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" );
90 //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); 90 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
91 XmlRpcResponse response = null; 91 XmlRpcResponse response = null;
92 try 92 try
93 { 93 {
@@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
188 paramList.Add(hash); 188 paramList.Add(hash);
189 189
190 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); 190 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
191 string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"; 191 string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/");
192 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); 192 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
193 XmlRpcResponse response = null; 193 XmlRpcResponse response = null;
194 try 194 try
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 4501937..7fa086a 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -51,15 +51,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 string m_ServerURL; 53 string m_ServerURL;
54 Uri m_Uri;
55 public UserAgentServiceConnector(string url) 54 public UserAgentServiceConnector(string url)
56 { 55 {
57 m_ServerURL = url; 56 m_ServerURL = url;
57 // Doing this here, because XML-RPC or mono have some strong ideas about
58 // caching DNS translations.
58 try 59 try
59 { 60 {
60 m_Uri = new Uri(m_ServerURL); 61 Uri m_Uri = new Uri(m_ServerURL);
61 IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); 62 IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
62 m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port; 63 m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ;
63 } 64 }
64 catch (Exception e) 65 catch (Exception e)
65 { 66 {
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 2b96b96..a5f748f 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -104,17 +104,23 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 // Eventually, we want to use a caps url instead of the agentID
108 string uri = string.Empty; 107 string uri = string.Empty;
109 try 108
110 { 109 // HACK -- Simian grid make it work!!!
111 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; 110 if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
112 } 111 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
113 catch (Exception e) 112 else
114 { 113 {
115 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); 114 try
116 reason = e.Message; 115 {
117 return false; 116 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
117 }
118 catch (Exception e)
119 {
120 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
118 } 124 }
119 125
120 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); 126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 3d722ec..b86fb6f 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Services.GridService
158 string host = "127.0.0.1"; 158 string host = "127.0.0.1";
159 string portstr; 159 string portstr;
160 string regionName = ""; 160 string regionName = "";
161 uint port = 9000; 161 uint port = 0;
162 string[] parts = mapName.Split(new char[] { ':' }); 162 string[] parts = mapName.Split(new char[] { ':' });
163 if (parts.Length >= 1) 163 if (parts.Length >= 1)
164 { 164 {
@@ -177,18 +177,16 @@ namespace OpenSim.Services.GridService
177 regionName = parts[2]; 177 regionName = parts[2];
178 } 178 }
179 179
180 // Sanity check. 180 //// Sanity check.
181 //IPAddress ipaddr = null; 181 //try
182 try 182 //{
183 { 183 // Util.GetHostFromDNS(host);
184 //ipaddr = Util.GetHostFromDNS(host); 184 //}
185 Util.GetHostFromDNS(host); 185 //catch
186 } 186 //{
187 catch 187 // reason = "Malformed hostname";
188 { 188 // return null;
189 reason = "Malformed hostname"; 189 //}
190 return null;
191 }
192 190
193 GridRegion regInfo; 191 GridRegion regInfo;
194 bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason); 192 bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason);
@@ -217,6 +215,11 @@ namespace OpenSim.Services.GridService
217 regInfo.RegionLocY = yloc; 215 regInfo.RegionLocY = yloc;
218 regInfo.ScopeID = scopeID; 216 regInfo.ScopeID = scopeID;
219 217
218 // Big HACK for Simian Grid !!!
219 // We need to clean up all URLs used in OpenSim !!!
220 if (externalHostName.Contains("/"))
221 regInfo.ServerURI = externalHostName;
222
220 try 223 try
221 { 224 {
222 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); 225 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 84306e7..fb395ec 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService
293 293
294 public virtual bool AddFolder(InventoryFolderBase folder) 294 public virtual bool AddFolder(InventoryFolderBase folder)
295 { 295 {
296 InventoryFolderBase check = GetFolder(folder);
297 if (check != null)
298 return false;
299
296 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 300 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
297 return m_Database.StoreFolder(xFolder); 301 return m_Database.StoreFolder(xFolder);
298 } 302 }
299 303
300 public virtual bool UpdateFolder(InventoryFolderBase folder) 304 public virtual bool UpdateFolder(InventoryFolderBase folder)
301 { 305 {
302 return AddFolder(folder); 306 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
307 InventoryFolderBase check = GetFolder(folder);
308 if (check == null)
309 return AddFolder(folder);
310
311 if (check.Type != -1 || xFolder.type != -1)
312 {
313 if (xFolder.version > check.Version)
314 return false;
315 check.Version = (ushort)xFolder.version;
316 xFolder = ConvertFromOpenSim(check);
317 return m_Database.StoreFolder(xFolder);
318 }
319
320 if (xFolder.version < check.Version)
321 xFolder.version = check.Version;
322 xFolder.folderID = check.ID;
323
324 return m_Database.StoreFolder(xFolder);
303 } 325 }
304 326
305 public virtual bool MoveFolder(InventoryFolderBase folder) 327 public virtual bool MoveFolder(InventoryFolderBase folder)