Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

prebuild-update
Diva Canto 2010-06-25 05:15:54 -07:00
commit 7488f61289
9 changed files with 96 additions and 29 deletions

View File

@ -114,7 +114,7 @@ namespace OpenSim.Framework
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Warn("GET from URL " + url + " failed: " + ex.Message); m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
errorMessage = ex.Message; errorMessage = ex.Message;
} }

View File

@ -367,13 +367,13 @@ namespace OpenSim
Environment.Exit(1); Environment.Exit(1);
} }
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
// We need to do this after we've initialized the // We need to do this after we've initialized the
// scripting engines. // scripting engines.
scene.CreateScriptInstances(); scene.CreateScriptInstances();
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
m_sceneManager.Add(scene); m_sceneManager.Add(scene);
if (m_autoCreateClientStack) if (m_autoCreateClientStack)

View File

@ -131,6 +131,12 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
if (texture != null) if (texture != null)
{ {
if (texture.Type != (sbyte)AssetType.Texture)
{
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
httpResponse.Send();
return null;
}
SendTexture(httpRequest, httpResponse, texture); SendTexture(httpRequest, httpResponse, texture);
} }
else else
@ -147,6 +153,12 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
if (texture != null) if (texture != null)
{ {
if (texture.Type != (sbyte)AssetType.Texture)
{
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
httpResponse.Send();
return null;
}
SendTexture(httpRequest, httpResponse, texture); SendTexture(httpRequest, httpResponse, texture);
} }
else else

View File

@ -53,6 +53,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
double priority = 0; double priority = 0;
if (entity == null)
return 100000;
switch (m_scene.UpdatePrioritizationScheme) switch (m_scene.UpdatePrioritizationScheme)
{ {
case UpdatePrioritizationSchemes.Time: case UpdatePrioritizationSchemes.Time:

View File

@ -31,6 +31,7 @@ using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections; using System.Collections;
using System.Reflection; using System.Reflection;
using System.Threading;
using OpenMetaverse; using OpenMetaverse;
using log4net; using log4net;
using OpenSim.Framework; using OpenSim.Framework;
@ -200,6 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((int)InventoryType.LSL == item.InvType) if ((int)InventoryType.LSL == item.InvType)
{ {
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
} }
} }
} }
@ -257,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.InfoFormat( // m_log.InfoFormat(
// "[PRIM INVENTORY]: " + // "[PRIM INVENTORY]: " +
// "Starting script {0}, {1} in prim {2}, {3}", // "Starting script {0}, {1} in prim {2}, {3}",
// item.Name, item.ItemID, Name, UUID); // item.Name, item.ItemID, m_part.Name, m_part.UUID);
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
return; return;
@ -292,15 +294,14 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID);
} }
else else
{
lock (m_items)
{ {
if (m_part.ParentGroup.m_savedScriptState != null) if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID); RestoreSavedScriptState(item.OldItemID, item.ItemID);
lock (m_items)
{
m_items[item.ItemID].PermsMask = 0; m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero; m_items[item.ItemID].PermsGranter = UUID.Zero;
}
string script = Utils.BytesToString(asset.Data); string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript( m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
@ -310,6 +311,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
}
private void RestoreSavedScriptState(UUID oldID, UUID newID) private void RestoreSavedScriptState(UUID oldID, UUID newID)
{ {

View File

@ -371,19 +371,34 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <returns></returns> /// <returns></returns>
public bool Delete(string id) public bool Delete(string id)
{ {
string errorMessage = String.Empty;
string url = m_serverUrl + id;
if (m_cache != null) if (m_cache != null)
m_cache.Expire(id); m_cache.Expire(id);
string url = m_serverUrl + id; try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "DELETE";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
if (response.StatusCode != HttpStatusCode.NoContent)
{
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " +
response.StatusCode + " (" + response.StatusDescription + ")");
}
}
OSDMap response = WebUtil.ServiceRequest(url, "DELETE");
if (response["Success"].AsBoolean())
return true; return true;
else }
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service"); catch (Exception ex)
{
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message);
return false; return false;
} }
}
#endregion IAssetService #endregion IAssetService

View File

@ -198,6 +198,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(identifier)) if (!String.IsNullOrEmpty(identifier))
{ {
// Add/update the md5hash identity // Add/update the md5hash identity
// TODO: Support salts when AddIdentity does
// TODO: Create an a1hash too for WebDAV logins
requestArgs = new NameValueCollection requestArgs = new NameValueCollection
{ {
{ "RequestMethod", "AddIdentity" }, { "RequestMethod", "AddIdentity" },

View File

@ -59,18 +59,35 @@ namespace OpenSim.Services.Connectors.SimianGrid
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty; private string m_serverUrl = String.Empty;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
#region ISharedRegionModule #region ISharedRegionModule
public Type ReplaceableInterface { get { return null; } } public Type ReplaceableInterface { get { return null; } }
public void RegionLoaded(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { UploadMapTile(scene); } } public void RegionLoaded(Scene scene) { }
public void PostInitialise() { } public void PostInitialise() { }
public void Close() { } public void Close() { }
public SimianGridServiceConnector() { } public SimianGridServiceConnector() { }
public string Name { get { return "SimianGridServiceConnector"; } } public string Name { get { return "SimianGridServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IGridService>(this); } } public void AddRegion(Scene scene)
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IGridService>(this); } } {
// Every shared region module has to maintain an indepedent list of
// currently running regions
lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene;
if (!String.IsNullOrEmpty(m_serverUrl))
scene.RegisterModuleInterface<IGridService>(this);
}
public void RemoveRegion(Scene scene)
{
lock (m_scenes)
m_scenes.Remove(scene.RegionInfo.RegionID);
if (!String.IsNullOrEmpty(m_serverUrl))
scene.UnregisterModuleInterface<IGridService>(this);
}
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -105,6 +122,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
public string RegisterRegion(UUID scopeID, GridRegion regionInfo) public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
{ {
// Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
Scene scene;
if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
UploadMapTile(scene);
else
m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
@ -430,7 +454,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(errorMessage)) if (!String.IsNullOrEmpty(errorMessage))
{ {
m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}", m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
pngData.Length, scene.RegionInfo.RegionName, errorMessage); pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' '));
} }
} }

View File

@ -597,21 +597,19 @@
; Set this to a nonzero value to have remote admin use a different port ; Set this to a nonzero value to have remote admin use a different port
port = 0 port = 0
; This password is required to make any XMLRPC call (should be set as the "password" parameter)
access_password = unknown access_password = unknown
; set this variable to true if you want the create_region XmlRpc ; set this variable to true if you want the create_region XmlRpc
; call to unconditionally enable voice on all parcels for a newly ; call to unconditionally enable voice on all parcels for a newly
; created region [default: false] ; created region [default: false]
create_region_enable_voice = false create_region_enable_voice = false
; set this variable to false if you want the create_region XmlRpc ; set this variable to false if you want the create_region XmlRpc
; call to create all regions as private per default (can be ; call to create all regions as private per default (can be
; overridden in the XmlRpc call) [default: true] ; overridden in the XmlRpc call) [default: true]
create_region_public = false create_region_public = false
; the create_region XmlRpc call uses region_file_template to generate ; the create_region XmlRpc call uses region_file_template to generate
; the file name of newly create regions (if they are created ; the file name of newly create regions (if they are created
; persistent). the parameter available are: ; persistent). the parameter available are:
@ -620,7 +618,6 @@
; {2} - region UUID ; {2} - region UUID
; {3} - region port ; {3} - region port
; {4} - region name with " ", ":", "/" mapped to "_" ; {4} - region name with " ", ":", "/" mapped to "_"
region_file_template = "{0}x{1}-{2}.xml" region_file_template = "{0}x{1}-{2}.xml"
; we can limit the number of regions that XmlRpcCreateRegion will ; we can limit the number of regions that XmlRpcCreateRegion will
@ -635,6 +632,18 @@
; if this parameter is not specified but enabled = true, all methods will be available ; if this parameter is not specified but enabled = true, all methods will be available
enabled_methods = all enabled_methods = all
; specify the default appearance for an avatar created through the remote admin interface
; This will only take effect is the file specified by the default_appearance setting below exists
;default_male = Default Male
;default_female = Default Female
; update appearance copies inventory items and wearables of default avatars. if this value is false
; (default), just worn assets are copied to the Clothes folder; if true, all Clothes and Bodyparts
; subfolders are copied. the receiver will wear the same items the default avatar did wear.
;copy_folders = false
; path to default appearance XML file that specifies the look of the default avatars
;default_appearance = default_appearance.xml
[RestPlugins] [RestPlugins]
; Change this to true to enable REST Plugins. This must be true if you wish to use ; Change this to true to enable REST Plugins. This must be true if you wish to use