diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 0db7bb970f..8a339fedc9 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Capabilities
string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
byte[] data, string inventoryType, string assetType);
+ public delegate void UploadedBakedTexture(UUID assetID, byte[] data);
+
public delegate UUID UpdateItem(UUID itemID, byte[] data);
public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors);
@@ -97,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
// private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
+ private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
//private string eventQueue = "0100/";
private IScene m_Scene;
@@ -185,6 +188,8 @@ namespace OpenSim.Framework.Capabilities
m_capsHandlers["UpdateScriptTaskInventory"] =
new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"];
+ m_capsHandlers["UploadBakedTexture"] =
+ new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture);
}
catch (Exception e)
@@ -742,6 +747,50 @@ namespace OpenSim.Framework.Capabilities
return null;
}
+ public string UploadBakedTexture(string request, string path,
+ string param, OSHttpRequest httpRequest,
+ OSHttpResponse httpResponse)
+ {
+ try
+ {
+ m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
+ m_regionName);
+
+ string capsBase = "/CAPS/" + m_capsObjectPath;
+ string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
+
+ BakedTextureUploader uploader =
+ new BakedTextureUploader( capsBase + uploaderPath,
+ m_httpListener);
+ uploader.OnUpLoad += BakedTextureUploaded;
+
+ m_httpListener.AddStreamHandler(
+ new BinaryStreamHandler("POST", capsBase + uploaderPath,
+ uploader.uploaderCaps));
+
+ string protocol = "http://";
+
+ if (m_httpListener.UseSSL)
+ protocol = "https://";
+
+ string uploaderURL = protocol + m_httpListenerHostName + ":" +
+ m_httpListenPort.ToString() + capsBase + uploaderPath;
+
+ LLSDAssetUploadResponse uploadResponse =
+ new LLSDAssetUploadResponse();
+ uploadResponse.uploader = uploaderURL;
+ uploadResponse.state = "upload";
+
+ return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
+ }
+ catch (Exception e)
+ {
+ m_log.Error("[CAPS]: " + e.ToString());
+ }
+
+ return null;
+ }
+
///
/// Called by the notecard update handler. Provides a URL to which the client can upload a new asset.
///
@@ -925,6 +974,17 @@ namespace OpenSim.Framework.Capabilities
}
}
+ public void BakedTextureUploaded(UUID assetID, byte[] data)
+ {
+ m_log.DebugFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
+ AssetBase asset;
+ asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_agentID.ToString());
+ asset.Data = data;
+ asset.Temporary = true;
+ asset.Local = true;
+ m_assetCache.Store(asset);
+ }
+
///
/// Called when new asset data for an agent inventory item update has been uploaded.
///
@@ -1243,5 +1303,50 @@ namespace OpenSim.Framework.Capabilities
fs.Close();
}
}
+
+ public class BakedTextureUploader
+ {
+ public event UploadedBakedTexture OnUpLoad;
+ private UploadedBakedTexture handlerUpLoad = null;
+
+ private string uploaderPath = String.Empty;
+ private UUID newAssetID;
+ private IHttpServer httpListener;
+
+ public BakedTextureUploader(string path, IHttpServer httpServer)
+ {
+ newAssetID = UUID.Random();
+ uploaderPath = path;
+ httpListener = httpServer;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public string uploaderCaps(byte[] data, string path, string param)
+ {
+ string res = String.Empty;
+ LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
+ uploadComplete.new_asset = newAssetID.ToString();
+ uploadComplete.new_inventory_item = UUID.Zero;
+ uploadComplete.state = "complete";
+
+ res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
+
+ httpListener.RemoveStreamHandler("POST", uploaderPath);
+
+ handlerUpLoad = OnUpLoad;
+ if (handlerUpLoad != null)
+ {
+ handlerUpLoad(newAssetID, data);
+ }
+
+ return res;
+ }
+ }
}
}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index fddb966f9b..3d4269fe11 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3408,6 +3408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
avp.Sender.IsTrial = false;
avp.Sender.ID = agentID;
+ m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
OutPacket(avp, ThrottleOutPacketType.Task);
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d7767bd644..ca089a1b94 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
{
- if (stateSource == 1 && // Prim crossing
+ if (stateSource == 2 && // Prim crossing
m_part.ParentGroup.Scene.m_trustBinaries)
{
lock (m_items)
@@ -1095,4 +1095,4 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 339d0c422f..cc9355e031 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2464,7 +2464,6 @@ namespace OpenSim.Region.Framework.Scenes
m_controllingClient.SendAvatarDataImmediate(this);
SendInitialFullUpdateToAllClients();
- SendAppearanceToAllOtherAgents();
}
///
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 024b42d433..f5b59823e6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,8 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
paramList.Add(hash);
XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
- string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
- //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
+ string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" );
+ m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
XmlRpcResponse response = null;
try
{
@@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
paramList.Add(hash);
XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
- string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/";
+ string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/");
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
XmlRpcResponse response = null;
try
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 45019373cf..7fa086ac68 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -51,15 +51,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
MethodBase.GetCurrentMethod().DeclaringType);
string m_ServerURL;
- Uri m_Uri;
public UserAgentServiceConnector(string url)
{
m_ServerURL = url;
+ // Doing this here, because XML-RPC or mono have some strong ideas about
+ // caching DNS translations.
try
{
- m_Uri = new Uri(m_ServerURL);
+ Uri m_Uri = new Uri(m_ServerURL);
IPAddress ip = Util.GetHostFromDNS(m_Uri.Host);
- m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port;
+ m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ;
}
catch (Exception e)
{
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 2b96b96e30..a5f748f0c4 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -104,17 +104,23 @@ namespace OpenSim.Services.Connectors.Simulation
return false;
}
- // Eventually, we want to use a caps url instead of the agentID
string uri = string.Empty;
- try
+
+ // HACK -- Simian grid make it work!!!
+ if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
+ uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
+ else
{
- uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
- }
- catch (Exception e)
- {
- m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
- reason = e.Message;
- return false;
+ try
+ {
+ uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
+ }
+ catch (Exception e)
+ {
+ m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
+ reason = e.Message;
+ return false;
+ }
}
//Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 3d722eca96..b86fb6f01c 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Services.GridService
string host = "127.0.0.1";
string portstr;
string regionName = "";
- uint port = 9000;
+ uint port = 0;
string[] parts = mapName.Split(new char[] { ':' });
if (parts.Length >= 1)
{
@@ -177,18 +177,16 @@ namespace OpenSim.Services.GridService
regionName = parts[2];
}
- // Sanity check.
- //IPAddress ipaddr = null;
- try
- {
- //ipaddr = Util.GetHostFromDNS(host);
- Util.GetHostFromDNS(host);
- }
- catch
- {
- reason = "Malformed hostname";
- return null;
- }
+ //// Sanity check.
+ //try
+ //{
+ // Util.GetHostFromDNS(host);
+ //}
+ //catch
+ //{
+ // reason = "Malformed hostname";
+ // return null;
+ //}
GridRegion regInfo;
bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason);
@@ -217,6 +215,11 @@ namespace OpenSim.Services.GridService
regInfo.RegionLocY = yloc;
regInfo.ScopeID = scopeID;
+ // Big HACK for Simian Grid !!!
+ // We need to clean up all URLs used in OpenSim !!!
+ if (externalHostName.Contains("/"))
+ regInfo.ServerURI = externalHostName;
+
try
{
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 84306e7296..fb395ec976 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -293,13 +293,35 @@ namespace OpenSim.Services.InventoryService
public virtual bool AddFolder(InventoryFolderBase folder)
{
+ InventoryFolderBase check = GetFolder(folder);
+ if (check != null)
+ return false;
+
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
return m_Database.StoreFolder(xFolder);
}
public virtual bool UpdateFolder(InventoryFolderBase folder)
{
- return AddFolder(folder);
+ XInventoryFolder xFolder = ConvertFromOpenSim(folder);
+ InventoryFolderBase check = GetFolder(folder);
+ if (check == null)
+ return AddFolder(folder);
+
+ if (check.Type != -1 || xFolder.type != -1)
+ {
+ if (xFolder.version > check.Version)
+ return false;
+ check.Version = (ushort)xFolder.version;
+ xFolder = ConvertFromOpenSim(check);
+ return m_Database.StoreFolder(xFolder);
+ }
+
+ if (xFolder.version < check.Version)
+ xFolder.version = check.Version;
+ xFolder.folderID = check.ID;
+
+ return m_Database.StoreFolder(xFolder);
}
public virtual bool MoveFolder(InventoryFolderBase folder)