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)
{
m_log.Warn("GET from URL " + url + " failed: " + ex.Message);
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
errorMessage = ex.Message;
}

View File

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

View File

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

View File

@ -52,6 +52,9 @@ namespace OpenSim.Region.Framework.Scenes
public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
{
double priority = 0;
if (entity == null)
return 100000;
switch (m_scene.UpdatePrioritizationScheme)
{

View File

@ -31,6 +31,7 @@ using System.IO;
using System.Collections.Generic;
using System.Collections;
using System.Reflection;
using System.Threading;
using OpenMetaverse;
using log4net;
using OpenSim.Framework;
@ -200,6 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((int)InventoryType.LSL == item.InvType)
{
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(
// "[PRIM INVENTORY]: " +
// "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))
return;
@ -293,20 +295,20 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
lock (m_items)
{
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
}
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
}
}
}

View File

@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid
/// <returns></returns>
public bool Delete(string id)
{
string errorMessage = String.Empty;
string url = m_serverUrl + id;
if (m_cache != null)
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;
else
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service");
return false;
}
catch (Exception ex)
{
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message);
return false;
}
}
#endregion IAssetService

View File

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

View File

@ -59,18 +59,35 @@ namespace OpenSim.Services.Connectors.SimianGrid
MethodBase.GetCurrentMethod().DeclaringType);
private string m_serverUrl = String.Empty;
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
#region ISharedRegionModule
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 Close() { }
public SimianGridServiceConnector() { }
public string Name { get { return "SimianGridServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IGridService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IGridService>(this); } }
public void AddRegion(Scene scene)
{
// 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
@ -105,6 +122,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
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 maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
@ -430,7 +454,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(errorMessage))
{
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
port = 0
; This password is required to make any XMLRPC call (should be set as the "password" parameter)
access_password = unknown
; set this variable to true if you want the create_region XmlRpc
; call to unconditionally enable voice on all parcels for a newly
; created region [default: false]
create_region_enable_voice = false
; set this variable to false if you want the create_region XmlRpc
; call to create all regions as private per default (can be
; overridden in the XmlRpc call) [default: true]
create_region_public = false
; the create_region XmlRpc call uses region_file_template to generate
; the file name of newly create regions (if they are created
; persistent). the parameter available are:
@ -620,7 +618,6 @@
; {2} - region UUID
; {3} - region port
; {4} - region name with " ", ":", "/" mapped to "_"
region_file_template = "{0}x{1}-{2}.xml"
; 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
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]
; Change this to true to enable REST Plugins. This must be true if you wish to use