Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Melanie 2011-04-17 18:42:06 +02:00
commit c02e0e930d
74 changed files with 1426 additions and 1079 deletions

View File

@ -94,7 +94,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public void Initialise() public void Initialise()
{ {
m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!"); m_log.Error("[RADMIN]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException(Name); throw new PluginNotInitialisedException(Name);
} }
@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
else else
{ {
m_config = m_configSource.Configs["RemoteAdmin"]; m_config = m_configSource.Configs["RemoteAdmin"];
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); m_log.Debug("[RADMIN]: Remote Admin Plugin Enabled");
m_requiredPassword = m_config.GetString("access_password", String.Empty); m_requiredPassword = m_config.GetString("access_password", String.Empty);
int port = m_config.GetInt("port", 0); int port = m_config.GetInt("port", 0);
@ -266,8 +266,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN]: Restart region: failed: {0}", e.ToString());
responseData["accepted"] = false; responseData["accepted"] = false;
responseData["success"] = false; responseData["success"] = false;
responseData["rebooting"] = false; responseData["rebooting"] = false;
@ -313,8 +312,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
responseData["accepted"] = false; responseData["accepted"] = false;
responseData["success"] = false; responseData["success"] = false;
@ -384,7 +382,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request.ToString()); m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request);
// foreach (string k in requestData.Keys) // foreach (string k in requestData.Keys)
// { // {
// m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}", // m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}",
@ -431,8 +429,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN]: Terrain Loading: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Terrain Loading: failed: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN]: Terrain Loading: failed: {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -520,14 +517,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] Shutdown: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Shutdown: failed: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] Shutdown: failed: {0}", e.ToString());
responseData["accepted"] = false; responseData["accepted"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
response.Value = responseData; response.Value = responseData;
} }
m_log.Info("[RADMIN]: Shutdown Administrator Request complete"); m_log.Info("[RADMIN]: Shutdown Administrator Request complete");
return response; return response;
} }
@ -828,8 +825,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] CreateRegion: failed {0}", e.Message); m_log.ErrorFormat("[RADMIN] CreateRegion: failed {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] CreateRegion: failed {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -895,8 +891,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] DeleteRegion: failed {0}", e.Message); m_log.ErrorFormat("[RADMIN] DeleteRegion: failed {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] DeleteRegion: failed {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -987,8 +982,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] CloseRegion: failed {0}", e.Message); m_log.ErrorFormat("[RADMIN]: CloseRegion: failed {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] CloseRegion: failed {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -1085,8 +1079,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] ModifyRegion: failed {0}", e.Message); m_log.ErrorFormat("[RADMIN] ModifyRegion: failed {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] ModifyRegion: failed {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -1209,8 +1202,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] CreateUser: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: CreateUser: failed: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] CreateUser: failed: {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["avatar_uuid"] = UUID.Zero.ToString(); responseData["avatar_uuid"] = UUID.Zero.ToString();
@ -1301,8 +1293,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] UserExists: failed: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: UserExists: failed: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] UserExists: failed: {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -1475,9 +1466,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0} {1}", e.Message, e.StackTrace);
m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.Message);
m_log.DebugFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.ToString());
responseData["success"] = false; responseData["success"] = false;
responseData["avatar_uuid"] = UUID.Zero.ToString(); responseData["avatar_uuid"] = UUID.Zero.ToString();
@ -1485,6 +1474,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData; response.Value = responseData;
} }
m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
return response; return response;
} }
@ -1500,7 +1490,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid)
{ {
m_log.DebugFormat("[RADMIN] updateUserAppearance"); m_log.DebugFormat("[RADMIN]: updateUserAppearance");
string defaultMale = m_config.GetString("default_male", "Default Male"); string defaultMale = m_config.GetString("default_male", "Default Male");
string defaultFemale = m_config.GetString("default_female", "Default Female"); string defaultFemale = m_config.GetString("default_female", "Default Female");
@ -1540,16 +1530,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (String.IsNullOrEmpty(model)) if (String.IsNullOrEmpty(model))
{ {
m_log.DebugFormat("[RADMIN] Appearance update not requested"); m_log.DebugFormat("[RADMIN]: Appearance update not requested");
return; return;
} }
m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); m_log.DebugFormat("[RADMIN]: Setting appearance for avatar {0}, using model <{1}>", userid, model);
string[] modelSpecifiers = model.Split(); string[] modelSpecifiers = model.Split();
if (modelSpecifiers.Length != 2) if (modelSpecifiers.Length != 2)
{ {
m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); m_log.WarnFormat("[RADMIN]: User appearance not set for {0}. Invalid model name : <{1}>", userid, model);
// modelSpecifiers = dmodel.Split(); // modelSpecifiers = dmodel.Split();
return; return;
} }
@ -1560,7 +1550,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (modelProfile == null) if (modelProfile == null)
{ {
m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); m_log.WarnFormat("[RADMIN]: Requested model ({0}) not found. Appearance unchanged", model);
return; return;
} }
@ -1570,7 +1560,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
EstablishAppearance(userid, modelProfile.PrincipalID); EstablishAppearance(userid, modelProfile.PrincipalID);
m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", m_log.DebugFormat("[RADMIN]: Finished setting appearance for avatar {0}, using model {1}",
userid, model); userid, model);
} }
@ -1582,7 +1572,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private void EstablishAppearance(UUID destination, UUID source) private void EstablishAppearance(UUID destination, UUID source)
{ {
m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); m_log.DebugFormat("[RADMIN]: Initializing inventory for {0} from {1}", destination, source);
Scene scene = m_application.SceneManager.CurrentOrFirstScene; Scene scene = m_application.SceneManager.CurrentOrFirstScene;
// If the model has no associated appearance we're done. // If the model has no associated appearance we're done.
@ -1604,7 +1594,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", m_log.WarnFormat("[RADMIN]: Error transferring appearance for {0} : {1}",
destination, e.Message); destination, e.Message);
} }
@ -1635,7 +1625,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", m_log.WarnFormat("[RADMIN]: Error transferring appearance for {0} : {1}",
destination, e.Message); destination, e.Message);
} }
@ -1670,7 +1660,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
destinationFolder.Version = 1; destinationFolder.Version = 1;
inventoryService.AddFolder(destinationFolder); // store base record inventoryService.AddFolder(destinationFolder); // store base record
m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); m_log.ErrorFormat("[RADMIN]: Created folder for destination {0}", source);
} }
// Wearables // Wearables
@ -1690,6 +1680,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
destinationItem.Name = item.Name; destinationItem.Name = item.Name;
destinationItem.Owner = destination;
destinationItem.Description = item.Description; destinationItem.Description = item.Description;
destinationItem.InvType = item.InvType; destinationItem.InvType = item.InvType;
destinationItem.CreatorId = item.CreatorId; destinationItem.CreatorId = item.CreatorId;
@ -1709,6 +1700,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
destinationItem.Flags = item.Flags; destinationItem.Flags = item.Flags;
destinationItem.CreationDate = item.CreationDate; destinationItem.CreationDate = item.CreationDate;
destinationItem.Folder = destinationFolder.ID; destinationItem.Folder = destinationFolder.ID;
ApplyNextOwnerPermissions(destinationItem);
m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
@ -1743,6 +1735,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
destinationItem.Name = item.Name; destinationItem.Name = item.Name;
destinationItem.Owner = destination;
destinationItem.Description = item.Description; destinationItem.Description = item.Description;
destinationItem.InvType = item.InvType; destinationItem.InvType = item.InvType;
destinationItem.CreatorId = item.CreatorId; destinationItem.CreatorId = item.CreatorId;
@ -1762,6 +1755,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
destinationItem.Flags = item.Flags; destinationItem.Flags = item.Flags;
destinationItem.CreationDate = item.CreationDate; destinationItem.CreationDate = item.CreationDate;
destinationItem.Folder = destinationFolder.ID; destinationItem.Folder = destinationFolder.ID;
ApplyNextOwnerPermissions(destinationItem);
m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
@ -1819,13 +1813,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
destinationFolder = new InventoryFolderBase(); destinationFolder = new InventoryFolderBase();
destinationFolder.ID = UUID.Random(); destinationFolder.ID = UUID.Random();
destinationFolder.Name = assetType.ToString(); if (assetType == AssetType.Clothing) {
destinationFolder.Name = "Clothing";
} else {
destinationFolder.Name = "Body Parts";
}
destinationFolder.Owner = destination; destinationFolder.Owner = destination;
destinationFolder.Type = (short)assetType; destinationFolder.Type = (short)assetType;
destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
destinationFolder.Version = 1; destinationFolder.Version = 1;
inventoryService.AddFolder(destinationFolder); // store base record inventoryService.AddFolder(destinationFolder); // store base record
m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); m_log.ErrorFormat("[RADMIN]: Created folder for destination {0}", source);
} }
InventoryFolderBase extraFolder; InventoryFolderBase extraFolder;
@ -1843,7 +1841,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
extraFolder.ParentID = destinationFolder.ID; extraFolder.ParentID = destinationFolder.ID;
inventoryService.AddFolder(extraFolder); inventoryService.AddFolder(extraFolder);
m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID); m_log.DebugFormat("[RADMIN]: Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID);
List<InventoryItemBase> items = inventoryService.GetFolderContent(source, folder.ID).Items; List<InventoryItemBase> items = inventoryService.GetFolderContent(source, folder.ID).Items;
@ -1851,6 +1849,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
destinationItem.Name = item.Name; destinationItem.Name = item.Name;
destinationItem.Owner = destination;
destinationItem.Description = item.Description; destinationItem.Description = item.Description;
destinationItem.InvType = item.InvType; destinationItem.InvType = item.InvType;
destinationItem.CreatorId = item.CreatorId; destinationItem.CreatorId = item.CreatorId;
@ -1870,6 +1869,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
destinationItem.Flags = item.Flags; destinationItem.Flags = item.Flags;
destinationItem.CreationDate = item.CreationDate; destinationItem.CreationDate = item.CreationDate;
destinationItem.Folder = extraFolder.ID; destinationItem.Folder = extraFolder.ID;
ApplyNextOwnerPermissions(destinationItem);
m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
inventoryMap.Add(item.ID, destinationItem.ID); inventoryMap.Add(item.ID, destinationItem.ID);
@ -1886,6 +1886,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
} }
/// <summary>
/// Apply next owner permissions.
/// </summary>
private void ApplyNextOwnerPermissions(InventoryItemBase item)
{
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
{
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
}
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryOnePermissions &= item.NextPermissions;
// item.OwnerChanged = true;
// item.PermsMask = 0;
// item.PermsGranter = UUID.Zero;
}
/// <summary> /// <summary>
/// This method is called if a given model avatar name can not be found. If the external /// This method is called if a given model avatar name can not be found. If the external
/// file has already been loaded once, then control returns immediately. If not, then it /// file has already been loaded once, then control returns immediately. If not, then it
@ -1895,7 +1918,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// indicate which outfit is the default, and this outfit will be automatically worn. The /// indicate which outfit is the default, and this outfit will be automatically worn. The
/// other outfits are provided to allow "real" avatars a way to easily change their outfits. /// other outfits are provided to allow "real" avatars a way to easily change their outfits.
/// </summary> /// </summary>
private bool CreateDefaultAvatars() private bool CreateDefaultAvatars()
{ {
// Only load once // Only load once
@ -1904,7 +1926,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
return false; return false;
} }
m_log.DebugFormat("[RADMIN] Creating default avatar entries"); m_log.DebugFormat("[RADMIN]: Creating default avatar entries");
m_defaultAvatarsLoaded = true; m_defaultAvatarsLoaded = true;
@ -1960,7 +1982,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
foreach (XmlElement avatar in avatars) foreach (XmlElement avatar in avatars)
{ {
m_log.DebugFormat("[RADMIN] Loading appearance for {0}, gender = {1}", m_log.DebugFormat("[RADMIN]: Loading appearance for {0}, gender = {1}",
GetStringAttribute(avatar,"name","?"), GetStringAttribute(avatar,"gender","?")); GetStringAttribute(avatar,"name","?"), GetStringAttribute(avatar,"gender","?"));
// Create the user identified by the avatar entry // Create the user identified by the avatar entry
@ -1982,7 +2004,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
account = CreateUser(scopeID, names[0], names[1], password, email); account = CreateUser(scopeID, names[0], names[1], password, email);
if (null == account) if (null == account)
{ {
m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", names[0], names[1]); m_log.ErrorFormat("[RADMIN]: Avatar {0} {1} was not created", names[0], names[1]);
return false; return false;
} }
} }
@ -2000,12 +2022,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
ID = account.PrincipalID; ID = account.PrincipalID;
m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID); m_log.DebugFormat("[RADMIN]: User {0}[{1}] created or retrieved", name, ID);
include = true; include = true;
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[RADMIN] Error creating user {0} : {1}", name, e.Message); m_log.DebugFormat("[RADMIN]: Error creating user {0} : {1}", name, e.Message);
include = false; include = false;
} }
@ -2045,7 +2067,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID;
clothingFolder.Version = 1; clothingFolder.Version = 1;
inventoryService.AddFolder(clothingFolder); // store base record inventoryService.AddFolder(clothingFolder); // store base record
m_log.ErrorFormat("[RADMIN] Created clothing folder for {0}/{1}", name, ID); m_log.ErrorFormat("[RADMIN]: Created clothing folder for {0}/{1}", name, ID);
} }
// OK, now we have an inventory for the user, read in the outfits from the // OK, now we have an inventory for the user, read in the outfits from the
@ -2058,7 +2080,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
foreach (XmlElement outfit in outfits) foreach (XmlElement outfit in outfits)
{ {
m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}", m_log.DebugFormat("[RADMIN]: Loading outfit {0} for {1}",
GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?")); GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?"));
outfitName = GetStringAttribute(outfit,"name",""); outfitName = GetStringAttribute(outfit,"name","");
@ -2082,7 +2104,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// Otherwise, we must create the folder. // Otherwise, we must create the folder.
if (extraFolder == null) if (extraFolder == null)
{ {
m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", outfitName, name); m_log.DebugFormat("[RADMIN]: Creating outfit folder {0} for {1}", outfitName, name);
extraFolder = new InventoryFolderBase(); extraFolder = new InventoryFolderBase();
extraFolder.ID = UUID.Random(); extraFolder.ID = UUID.Random();
extraFolder.Name = outfitName; extraFolder.Name = outfitName;
@ -2091,7 +2113,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
extraFolder.Version = 1; extraFolder.Version = 1;
extraFolder.ParentID = clothingFolder.ID; extraFolder.ParentID = clothingFolder.ID;
inventoryService.AddFolder(extraFolder); inventoryService.AddFolder(extraFolder);
m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID); m_log.DebugFormat("[RADMIN]: Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID);
} }
// Now get the pieces that make up the outfit // Now get the pieces that make up the outfit
@ -2106,7 +2128,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
switch (child.Name) switch (child.Name)
{ {
case "Permissions" : case "Permissions" :
m_log.DebugFormat("[RADMIN] Permissions specified"); m_log.DebugFormat("[RADMIN]: Permissions specified");
perms = child; perms = child;
break; break;
case "Asset" : case "Asset" :
@ -2156,7 +2178,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
inventoryItem.Folder = extraFolder.ID; // Parent folder inventoryItem.Folder = extraFolder.ID; // Parent folder
m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem); m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem);
m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID);
} }
// Attach item, if attachpoint is specified // Attach item, if attachpoint is specified
@ -2164,7 +2186,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (attachpoint != 0) if (attachpoint != 0)
{ {
avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID); avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID);
m_log.DebugFormat("[RADMIN] Attached {0}", inventoryItem.ID); m_log.DebugFormat("[RADMIN]: Attached {0}", inventoryItem.ID);
} }
// Record whether or not the item is to be initially worn // Record whether or not the item is to be initially worn
@ -2177,32 +2199,32 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", inventoryItem.ID, e.Message); m_log.WarnFormat("[RADMIN]: Error wearing item {0} : {1}", inventoryItem.ID, e.Message);
} }
} // foreach item in outfit } // foreach item in outfit
m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); m_log.DebugFormat("[RADMIN]: Outfit {0} load completed", outfitName);
} // foreach outfit } // foreach outfit
m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); m_log.DebugFormat("[RADMIN]: Inventory update complete for {0}", name);
scene.AvatarService.SetAppearance(ID, avatarAppearance); scene.AvatarService.SetAppearance(ID, avatarAppearance);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[RADMIN] Inventory processing incomplete for user {0} : {1}", m_log.WarnFormat("[RADMIN]: Inventory processing incomplete for user {0} : {1}",
name, e.Message); name, e.Message);
} }
} // End of include } // End of include
} }
m_log.DebugFormat("[RADMIN] Default avatar loading complete"); m_log.DebugFormat("[RADMIN]: Default avatar loading complete");
} }
else else
{ {
m_log.DebugFormat("[RADMIN] No default avatar information available"); m_log.DebugFormat("[RADMIN]: No default avatar information available");
return false; return false;
} }
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[RADMIN] Exception whilst loading default avatars ; {0}", e.Message); m_log.WarnFormat("[RADMIN]: Exception whilst loading default avatars ; {0}", e.Message);
return false; return false;
} }
@ -2297,8 +2319,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] LoadOAR: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: LoadOAR: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] LoadOAR: {0}", e.ToString());
responseData["loaded"] = false; responseData["loaded"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2403,8 +2424,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] SaveOAR: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: SaveOAR: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] SaveOAR: {0}", e.ToString());
responseData["saved"] = false; responseData["saved"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2418,7 +2438,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private void RemoteAdminOarSaveCompleted(Guid uuid, string name) private void RemoteAdminOarSaveCompleted(Guid uuid, string name)
{ {
m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); m_log.DebugFormat("[RADMIN]: File processing complete for {0}", name);
lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock); lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock);
} }
@ -2456,14 +2476,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2494,8 +2514,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] LoadXml: {0}", e.Message); m_log.ErrorFormat("[RADMIN] LoadXml: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] LoadXml: {0}", e.ToString());
responseData["loaded"] = false; responseData["loaded"] = false;
responseData["switched"] = false; responseData["switched"] = false;
@ -2541,14 +2560,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2580,8 +2599,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] SaveXml: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: SaveXml: {0} {1}", e.Message, e.StackTrace);
m_log.DebugFormat("[RADMIN] SaveXml: {0}", e.ToString());
responseData["saved"] = false; responseData["saved"] = false;
responseData["switched"] = false; responseData["switched"] = false;
@ -2620,14 +2638,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2643,7 +2661,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] RegionQuery: {0}", e.Message); m_log.InfoFormat("[RADMIN]: RegionQuery: {0}", e.Message);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2684,7 +2702,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] ConsoleCommand: {0}", e.Message); m_log.InfoFormat("[RADMIN]: ConsoleCommand: {0}", e.Message);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2721,14 +2739,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2739,7 +2757,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] Access List Clear Request: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Access List Clear Request: {0} {1}", e.Message, e.StackTrace);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2778,14 +2796,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2805,7 +2823,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (account != null) if (account != null)
{ {
uuids.Add(account.PrincipalID); uuids.Add(account.PrincipalID);
m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName); m_log.DebugFormat("[RADMIN]: adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName);
} }
} }
List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess); List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess);
@ -2826,7 +2844,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] Access List Add Request: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Access List Add Request: {0} {1}", e.Message, e.StackTrace);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2865,14 +2883,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2913,7 +2931,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] Access List Remove Request: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Access List Remove Request: {0} {1}", e.Message, e.StackTrace);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;
@ -2952,14 +2970,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
UUID region_uuid = (UUID) (string) requestData["region_uuid"]; UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
} }
else if (requestData.Contains("region_name")) else if (requestData.Contains("region_name"))
{ {
string region_name = (string) requestData["region_name"]; string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name)) if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name)); throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
} }
else throw new Exception("neither region_name nor region_uuid given"); else throw new Exception("neither region_name nor region_uuid given");
@ -2981,7 +2999,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
} }
catch (Exception e) catch (Exception e)
{ {
m_log.InfoFormat("[RADMIN] Acces List List: {0}", e.Message); m_log.ErrorFormat("[RADMIN]: Access List List: {0} {1}", e.Message, e.StackTrace);
responseData["success"] = false; responseData["success"] = false;
responseData["error"] = e.Message; responseData["error"] = e.Message;

View File

@ -38,9 +38,9 @@ namespace OpenSim.Data.Null
{ {
public class NullEstateStore : IEstateDataStore public class NullEstateStore : IEstateDataStore
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_connectionString; // private string m_connectionString;
protected virtual Assembly Assembly protected virtual Assembly Assembly
{ {
@ -58,7 +58,7 @@ namespace OpenSim.Data.Null
public void Initialise(string connectionString) public void Initialise(string connectionString)
{ {
m_connectionString = connectionString; // m_connectionString = connectionString;
} }
private string[] FieldList private string[] FieldList

View File

@ -1,192 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using log4net;
namespace OpenSim.Framework.Servers.HttpServer
{
public class AsynchronousRestObjectRequester
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Perform an asynchronous REST request.
/// </summary>
/// <param name="verb">GET or POST</param>
/// <param name="requestUrl"></param>
/// <param name="obj"></param>
/// <param name="action"></param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a
/// network issue while posting the request. You'll want to make
/// sure you deal with this as they're not uncommon</exception>
//
public static void MakeRequest<TRequest, TResponse>(string verb,
string requestUrl, TRequest obj, Action<TResponse> action)
{
// m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
Type type = typeof (TRequest);
WebRequest request = WebRequest.Create(requestUrl);
WebResponse response = null;
TResponse deserial = default(TResponse);
XmlSerializer deserializer = new XmlSerializer(typeof (TResponse));
request.Method = verb;
if (verb == "POST")
{
request.ContentType = "text/xml";
MemoryStream buffer = new MemoryStream();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
}
int length = (int) buffer.Length;
request.ContentLength = length;
request.BeginGetRequestStream(delegate(IAsyncResult res)
{
Stream requestStream = request.EndGetRequestStream(res);
requestStream.Write(buffer.ToArray(), 0, length);
requestStream.Close();
request.BeginGetResponse(delegate(IAsyncResult ar)
{
response = request.EndGetResponse(ar);
Stream respStream = null;
try
{
respStream = response.GetResponseStream();
deserial = (TResponse)deserializer.Deserialize(
respStream);
}
catch (System.InvalidOperationException)
{
}
finally
{
// Let's not close this
//buffer.Close();
respStream.Close();
response.Close();
}
action(deserial);
}, null);
}, null);
return;
}
request.BeginGetResponse(delegate(IAsyncResult res2)
{
try
{
// If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
// documented in MSDN
response = request.EndGetResponse(res2);
Stream respStream = null;
try
{
respStream = response.GetResponseStream();
deserial = (TResponse)deserializer.Deserialize(respStream);
}
catch (System.InvalidOperationException)
{
}
finally
{
respStream.Close();
response.Close();
}
}
catch (WebException e)
{
if (e.Status == WebExceptionStatus.ProtocolError)
{
if (e.Response is HttpWebResponse)
{
HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
if (httpResponse.StatusCode != HttpStatusCode.NotFound)
{
// We don't appear to be handling any other status codes, so log these feailures to that
// people don't spend unnecessary hours hunting phantom bugs.
m_log.DebugFormat(
"[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
verb, requestUrl, httpResponse.StatusCode);
}
}
}
else
{
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
}
}
catch (Exception e)
{
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
}
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
try
{
action(deserial);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
}
}, null);
}
}
}

View File

@ -1,131 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using log4net;
namespace OpenSim.Framework.Servers.HttpServer
{
public class SynchronousRestFormsRequester
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static string MakeRequest(string verb, string requestUrl, string obj)
{
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
string respstring = String.Empty;
using (MemoryStream buffer = new MemoryStream())
{
if ((verb == "POST") || (verb == "PUT"))
{
request.ContentType = "text/www-form-urlencoded";
int length = 0;
using (StreamWriter writer = new StreamWriter(buffer))
{
writer.Write(obj);
writer.Flush();
}
length = (int)obj.Length;
request.ContentLength = length;
Stream requestStream = null;
try
{
requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length);
}
catch (Exception e)
{
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: with {1} " + e.ToString(), requestUrl,obj);
}
finally
{
if (requestStream != null)
requestStream.Close();
}
}
try
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength != 0)
{
Stream respStream = null;
try
{
respStream = resp.GetResponseStream();
using (StreamReader reader = new StreamReader(respStream))
{
respstring = reader.ReadToEnd();
}
}
catch (Exception e)
{
m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
}
finally
{
if (respStream != null)
respStream.Close();
}
}
}
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
}
}
return respstring;
}
}
}

View File

@ -1,137 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
namespace OpenSim.Framework.Servers.HttpServer
{
public class SynchronousRestObjectPoster
{
[Obsolete]
public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
{
return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj);
}
}
public class SynchronousRestObjectRequester
{
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
{
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100);
}
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <param name="timeout"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
{
Type type = typeof (TRequest);
TResponse deserial = default(TResponse);
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Timeout = pTimeout * 1000;
if ((verb == "POST") || (verb == "PUT"))
{
request.ContentType = "text/xml";
MemoryStream buffer = new MemoryStream();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
}
int length = (int) buffer.Length;
request.ContentLength = length;
Stream requestStream = null;
try
{
requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length);
}
catch (Exception)
{
return deserial;
}
finally
{
if (requestStream != null)
requestStream.Close();
}
}
try
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength != 0)
{
Stream respStream = resp.GetResponseStream();
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
deserial = (TResponse)deserializer.Deserialize(respStream);
respStream.Close();
}
}
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
}
return deserial;
}
}
}

View File

@ -36,6 +36,9 @@ using System.Net.Security;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Web; using System.Web;
using System.Xml;
using System.Xml.Serialization;
using log4net; using log4net;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
@ -225,7 +228,7 @@ namespace OpenSim.Framework
reqnum,url,method,tickdiff,tickdata); reqnum,url,method,tickdiff,tickdata);
} }
m_log.WarnFormat("[WEB UTIL] <{0}> osd request failed: {1}",reqnum,errorMessage); m_log.WarnFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
return ErrorResponseMap(errorMessage); return ErrorResponseMap(errorMessage);
} }
@ -630,4 +633,343 @@ namespace OpenSim.Framework
} }
public static class AsynchronousRestObjectRequester
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Perform an asynchronous REST request.
/// </summary>
/// <param name="verb">GET or POST</param>
/// <param name="requestUrl"></param>
/// <param name="obj"></param>
/// <param name="action"></param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a
/// network issue while posting the request. You'll want to make
/// sure you deal with this as they're not uncommon</exception>
//
public static void MakeRequest<TRequest, TResponse>(string verb,
string requestUrl, TRequest obj, Action<TResponse> action)
{
// m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
Type type = typeof(TRequest);
WebRequest request = WebRequest.Create(requestUrl);
WebResponse response = null;
TResponse deserial = default(TResponse);
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
request.Method = verb;
if (verb == "POST")
{
request.ContentType = "text/xml";
MemoryStream buffer = new MemoryStream();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
}
int length = (int)buffer.Length;
request.ContentLength = length;
request.BeginGetRequestStream(delegate(IAsyncResult res)
{
Stream requestStream = request.EndGetRequestStream(res);
requestStream.Write(buffer.ToArray(), 0, length);
requestStream.Close();
request.BeginGetResponse(delegate(IAsyncResult ar)
{
response = request.EndGetResponse(ar);
Stream respStream = null;
try
{
respStream = response.GetResponseStream();
deserial = (TResponse)deserializer.Deserialize(
respStream);
}
catch (System.InvalidOperationException)
{
}
finally
{
// Let's not close this
//buffer.Close();
respStream.Close();
response.Close();
}
action(deserial);
}, null);
}, null);
return;
}
request.BeginGetResponse(delegate(IAsyncResult res2)
{
try
{
// If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
// documented in MSDN
response = request.EndGetResponse(res2);
Stream respStream = null;
try
{
respStream = response.GetResponseStream();
deserial = (TResponse)deserializer.Deserialize(respStream);
}
catch (System.InvalidOperationException)
{
}
finally
{
respStream.Close();
response.Close();
}
}
catch (WebException e)
{
if (e.Status == WebExceptionStatus.ProtocolError)
{
if (e.Response is HttpWebResponse)
{
HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
if (httpResponse.StatusCode != HttpStatusCode.NotFound)
{
// We don't appear to be handling any other status codes, so log these feailures to that
// people don't spend unnecessary hours hunting phantom bugs.
m_log.DebugFormat(
"[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
verb, requestUrl, httpResponse.StatusCode);
}
}
}
else
{
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
}
}
catch (Exception e)
{
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
}
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
try
{
action(deserial);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
}
}, null);
}
}
public static class SynchronousRestFormsRequester
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static string MakeRequest(string verb, string requestUrl, string obj)
{
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
string respstring = String.Empty;
using (MemoryStream buffer = new MemoryStream())
{
if ((verb == "POST") || (verb == "PUT"))
{
request.ContentType = "text/www-form-urlencoded";
int length = 0;
using (StreamWriter writer = new StreamWriter(buffer))
{
writer.Write(obj);
writer.Flush();
}
length = (int)obj.Length;
request.ContentLength = length;
Stream requestStream = null;
try
{
requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length);
}
catch (Exception e)
{
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
}
finally
{
if (requestStream != null)
requestStream.Close();
}
}
try
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength != 0)
{
Stream respStream = null;
try
{
respStream = resp.GetResponseStream();
using (StreamReader reader = new StreamReader(respStream))
{
respstring = reader.ReadToEnd();
}
}
catch (Exception e)
{
m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
}
finally
{
if (respStream != null)
respStream.Close();
}
}
}
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
}
}
return respstring;
}
}
public class SynchronousRestObjectPoster
{
[Obsolete]
public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
{
return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj);
}
}
public class SynchronousRestObjectRequester
{
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
{
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0);
}
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
{
Type type = typeof(TRequest);
TResponse deserial = default(TResponse);
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
if (pTimeout != 0)
request.Timeout = pTimeout * 1000;
if ((verb == "POST") || (verb == "PUT"))
{
request.ContentType = "text/xml";
MemoryStream buffer = new MemoryStream();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
}
int length = (int)buffer.Length;
request.ContentLength = length;
Stream requestStream = null;
try
{
requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length);
}
catch (Exception)
{
return deserial;
}
finally
{
if (requestStream != null)
requestStream.Close();
}
}
try
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength > 0)
{
Stream respStream = resp.GetResponseStream();
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
deserial = (TResponse)deserializer.Deserialize(respStream);
respStream.Close();
}
}
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
}
return deserial;
}
}
} }

View File

@ -4351,6 +4351,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendEstateCovenantInformation(UUID covenant) public void SendEstateCovenantInformation(UUID covenant)
{ {
// m_log.DebugFormat("[LLCLIENTVIEW]: Sending estate covenant asset id of {0} to {1}", covenant, Name);
EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
edata.CovenantID = covenant; edata.CovenantID = covenant;
@ -4361,8 +4363,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(einfopack, ThrottleOutPacketType.Task); OutPacket(einfopack, ThrottleOutPacketType.Task);
} }
public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) public void SendDetailedEstateData(
UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition,
UUID covenant, string abuseEmail, UUID estateOwner)
{ {
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant);
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
packet.MethodData.Invoice = invoice; packet.MethodData.Invoice = invoice;
packet.AgentData.TransactionID = UUID.Random(); packet.AgentData.TransactionID = UUID.Random();

View File

@ -54,6 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
private Scene m_scene; private Scene m_scene;
private IAssetService m_assetService; private IAssetService m_assetService;
private bool m_enabled = true;
#region IRegionModuleBase Members #region IRegionModuleBase Members
@ -65,7 +66,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig startupConfig = source.Configs["Startup"];
if (startupConfig == null)
return;
if (!startupConfig.GetBoolean("ColladaMesh",true))
m_enabled = false;
} }
public void AddRegion(Scene pScene) public void AddRegion(Scene pScene)
@ -101,16 +107,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
if(!m_enabled)
return;
UUID capID = UUID.Random(); UUID capID = UUID.Random();
// m_log.Info("[GETMESH]: /CAPS/" + capID); // m_log.Info("[GETMESH]: /CAPS/" + capID);
caps.RegisterHandler("GetMesh", caps.RegisterHandler("GetMesh",
new RestHTTPHandler("GET", "/CAPS/" + capID, new RestHTTPHandler("GET", "/CAPS/" + capID,
delegate(Hashtable m_dhttpMethod) delegate(Hashtable m_dhttpMethod)
{ {
return ProcessGetMesh(m_dhttpMethod, agentID, caps); return ProcessGetMesh(m_dhttpMethod, agentID, caps);
})); }));
} }
#endregion #endregion

View File

@ -56,6 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
private Scene m_scene; private Scene m_scene;
// private IAssetService m_assetService; // private IAssetService m_assetService;
private bool m_dumpAssetsToFile = false; private bool m_dumpAssetsToFile = false;
private bool m_enabled = true;
#region IRegionModuleBase Members #region IRegionModuleBase Members
@ -67,7 +68,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig startupConfig = source.Configs["Startup"];
if (startupConfig == null)
return;
if (!startupConfig.GetBoolean("ColladaMesh",true))
m_enabled = false;
} }
public void AddRegion(Scene pScene) public void AddRegion(Scene pScene)
@ -103,6 +109,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
if(!m_enabled)
return;
UUID capID = UUID.Random(); UUID capID = UUID.Random();
// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID); // m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);

View File

@ -34,13 +34,13 @@ using Nini.Config;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Friends; using OpenSim.Services.Connectors.Friends;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Framework.Servers.HttpServer;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;

View File

@ -33,7 +33,6 @@ using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Framework.Client; using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;

View File

@ -466,16 +466,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (m_creatorIdForAssetId.ContainsKey(assetId)) if (m_creatorIdForAssetId.ContainsKey(assetId))
{ {
string xmlData = Utils.BytesToString(data); string xmlData = Utils.BytesToString(data);
SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
foreach (SceneObjectPart sop in sog.Parts)
CoalescedSceneObjects coa = null;
if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa))
{ {
if (sop.CreatorData == null || sop.CreatorData == "") // m_log.DebugFormat(
{ // "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count);
sop.CreatorID = m_creatorIdForAssetId[assetId];
} sceneObjects.AddRange(coa.Objects);
}
else
{
sceneObjects.Add(SceneObjectSerializer.FromOriginalXmlFormat(xmlData));
} }
data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)); foreach (SceneObjectGroup sog in sceneObjects)
foreach (SceneObjectPart sop in sog.Parts)
if (sop.CreatorData == null || sop.CreatorData == "")
sop.CreatorID = m_creatorIdForAssetId[assetId];
if (coa != null)
data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa));
else
data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0]));
} }
} }

View File

@ -68,17 +68,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"),
FirstName = "Mr", FirstName = "Mr",
LastName = "Tiddles" }; LastName = "Tiddles" };
protected UserAccount m_uaLL1 protected UserAccount m_uaLL1
= new UserAccount { = new UserAccount {
PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"),
FirstName = "Lord", FirstName = "Lord",
LastName = "Lucan" }; LastName = "Lucan" };
protected UserAccount m_uaLL2 protected UserAccount m_uaLL2
= new UserAccount { = new UserAccount {
PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"),
FirstName = "Lord", FirstName = "Lord",
LastName = "Lucan" }; LastName = "Lucan" };
protected string m_item1Name = "Ray Gun Item"; protected string m_item1Name = "Ray Gun Item";
protected string m_coaItemName = "Coalesced Item";
[SetUp] [SetUp]
public virtual void SetUp() public virtual void SetUp()
@ -97,38 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
MemoryStream archiveWriteStream = new MemoryStream(); MemoryStream archiveWriteStream = new MemoryStream();
// Create asset // Create scene object asset
SceneObjectGroup object1; UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
SceneObjectPart part1; SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
{
string partName = "Ray Gun Object";
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
Vector3 groupPosition = new Vector3(10, 20, 30);
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
Vector3 offsetPosition = new Vector3(5, 10, 15);
part1
= new SceneObjectPart(
ownerId, shape, groupPosition, rotationOffset, offsetPosition);
part1.Name = partName;
object1 = new SceneObjectGroup(part1);
scene.AddNewSceneObject(object1, false);
}
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
scene.AssetService.Store(asset1); scene.AssetService.Store(asset1);
// Create item // Create scene object item
InventoryItemBase item1 = new InventoryItemBase(); InventoryItemBase item1 = new InventoryItemBase();
item1.Name = m_item1Name; item1.Name = m_item1Name;
item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
@ -139,8 +127,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
scene.AddInventoryItem(item1); scene.AddInventoryItem(item1);
// Create coalesced objects asset
SceneObjectGroup cobj1 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
cobj1.AbsolutePosition = new Vector3(15, 30, 45);
SceneObjectGroup cobj2 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
cobj2.AbsolutePosition = new Vector3(25, 50, 75);
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa);
scene.AssetService.Store(coaAsset);
// Create coalesced objects inventory item
InventoryItemBase coaItem = new InventoryItemBase();
coaItem.Name = m_coaItemName;
coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180");
coaItem.AssetID = coaAsset.FullID;
coaItem.GroupID = UUID.Random();
coaItem.CreatorIdAsUuid = m_uaLL1.PrincipalID;
coaItem.Owner = m_uaLL1.PrincipalID;
coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
scene.AddInventoryItem(coaItem);
archiverModule.ArchiveInventory( archiverModule.ArchiveInventory(
Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, m_item1Name, "hampshire", archiveWriteStream); Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
m_iarStreamBytes = archiveWriteStream.ToArray(); m_iarStreamBytes = archiveWriteStream.ToArray();
} }

View File

@ -62,10 +62,40 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
m_archiverModule = new InventoryArchiverModule(); m_archiverModule = new InventoryArchiverModule();
m_scene = SceneSetupHelpers.SetupScene("Inventory"); m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
} }
[Test]
public void TestLoadCoalesecedItem()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "password");
m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
InventoryItemBase coaItem
= InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName);
Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1");
string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID);
CoalescedSceneObjects coa;
bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa);
Assert.That(readResult, Is.True);
Assert.That(coa.Count, Is.EqualTo(2));
List<SceneObjectGroup> coaObjects = coa.Objects;
Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120")));
Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45)));
Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140")));
Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75)));
}
/// <summary> /// <summary>
/// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
/// (subject to change since there is no fixed format yet). /// (subject to change since there is no fixed format yet).
@ -84,24 +114,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
// Create asset // Create asset
SceneObjectGroup object1; UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
SceneObjectPart part1; SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
{
string partName = "My Little Dog Object";
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
Vector3 groupPosition = new Vector3(10, 20, 30);
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
Vector3 offsetPosition = new Vector3(5, 10, 15);
part1
= new SceneObjectPart(
ownerId, shape, groupPosition, rotationOffset, offsetPosition);
part1.Name = partName;
object1 = new SceneObjectGroup(part1);
m_scene.AddNewSceneObject(object1, false);
}
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user // Create user
@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password"); UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password");
@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
// Create user // Create user
@ -327,7 +327,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@ -394,7 +394,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure(); //log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
string folder1ExistingName = "a"; string folder1ExistingName = "a";
@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
string folder1ExistingName = "a"; string folder1ExistingName = "a";

View File

@ -129,35 +129,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
/// ///
/// DeleteToInventory /// Used in DeleteToInventory
/// ///
public override UUID DeleteToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) protected override void ExportAsset(UUID agentID, UUID assetID)
{ {
UUID ret = UUID.Zero;
// HACK: Only works for lists of length one.
// Intermediate version, just to make things compile
foreach (SceneObjectGroup g in objectGroups)
ret = DeleteToInventory(action, folderID, g, remoteClient);
return ret;
}
// DO NOT OVERRIDE THE BASE METHOD
public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
SceneObjectGroup objectGroup, IClientAPI remoteClient)
{
UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
if (!assetID.Equals(UUID.Zero)) if (!assetID.Equals(UUID.Zero))
{ UploadInventoryItem(agentID, assetID, "", 0);
if (remoteClient != null)
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
}
else else
m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
return assetID;
} }
/// ///

View File

@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
float minX, minY, minZ; float minX, minY, minZ;
float maxX, maxY, maxZ; float maxX, maxY, maxZ;
Vector3[] offsets = m_Scene.GetCombinedBoundingBox(objlist, Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist,
out minX, out maxX, out minY, out maxY, out minX, out maxX, out minY, out maxY,
out minZ, out maxZ); out minZ, out maxZ);
@ -785,8 +785,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// affect the name stored in the serialization, transfer // affect the name stored in the serialization, transfer
// the correct name from the inventory to the // the correct name from the inventory to the
// object itself before we rez. // object itself before we rez.
// On coalesced objects, this has no effect. // On coalesced objects, do the first one
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) if (((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) || i == 0)
{ {
rootPart.Name = item.Name; rootPart.Name = item.Name;
rootPart.Description = item.Description; rootPart.Description = item.Description;
@ -984,5 +984,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
#endregion #endregion
protected virtual void ExportAsset(UUID agentID, UUID assetID)
{
}
} }
} }

View File

@ -0,0 +1,174 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Serialization;
using OpenSim.Framework.Serialization.External;
using OpenSim.Framework.Communications;
using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
using OpenSim.Region.CoreModules.Framework.InventoryAccess;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
{
[TestFixture]
public class InventoryAccessModuleTests
{
protected TestScene m_scene;
protected BasicInventoryAccessModule m_iam;
protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
protected TestClient m_tc;
[SetUp]
public void SetUp()
{
m_iam = new BasicInventoryAccessModule();
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam);
// Create user
string userFirstName = "Jock";
string userLastName = "Stirrup";
string userPassword = "troll";
UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);
AgentCircuitData acd = new AgentCircuitData();
acd.AgentID = m_userId;
m_tc = new TestClient(acd, m_scene);
}
[Test]
public void TestRezCoalescedObject()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
// Create asset
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
object1.AbsolutePosition = new Vector3(15, 30, 45);
SceneObjectGroup object2 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
object2.AbsolutePosition = new Vector3(25, 50, 75);
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2);
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, coa);
m_scene.AssetService.Store(asset1);
// Create item
UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
string item1Name = "My Little Dog";
InventoryItemBase item1 = new InventoryItemBase();
item1.Name = item1Name;
item1.AssetID = asset1.FullID;
item1.ID = item1Id;
InventoryFolderBase objsFolder
= InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0];
item1.Folder = objsFolder.ID;
m_scene.AddInventoryItem(item1);
SceneObjectGroup so
= m_iam.RezObject(
m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
Assert.That(so, Is.Not.Null);
Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2));
SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name);
Assert.That(retrievedObj1Part, Is.Null);
retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name);
Assert.That(retrievedObj1Part, Is.Not.Null);
Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name));
// Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom
// object is unit square.
Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f)));
SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name);
Assert.That(retrievedObj2Part, Is.Not.Null);
Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name));
Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f)));
}
[Test]
public void TestRezObject()
{
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
// Create asset
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
m_scene.AssetService.Store(asset1);
// Create item
UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
string item1Name = "My Little Dog";
InventoryItemBase item1 = new InventoryItemBase();
item1.Name = item1Name;
item1.AssetID = asset1.FullID;
item1.ID = item1Id;
InventoryFolderBase objsFolder
= InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0];
item1.Folder = objsFolder.ID;
m_scene.AddInventoryItem(item1);
SceneObjectGroup so
= m_iam.RezObject(
m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
Assert.That(so, Is.Not.Null);
SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID);
Assert.That(retrievedPart, Is.Not.Null);
}
}
}

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,9 +31,8 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Server.Handlers.Base; using OpenSim.Server.Handlers.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -31,7 +31,6 @@ using System.Collections.Generic;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -195,6 +195,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public byte[] GetData(string id) public byte[] GetData(string id)
{ {
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Requesting data for asset {0}", id);
AssetBase asset = m_Cache.Get(id); AssetBase asset = m_Cache.Get(id);
if (asset != null) if (asset != null)

View File

@ -261,6 +261,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID)
{ {
// m_log.DebugFormat(
// "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}",
// remoteClient.Name, estateCovenantID);
Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
Scene.RegionInfo.RegionSettings.Save(); Scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange(); TriggerRegionInfoChange();

View File

@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
public void Init() public void Init()
{ {
m_serialiserModule = new SerialiserModule(); m_serialiserModule = new SerialiserModule();
m_scene = SceneSetupHelpers.SetupScene(""); m_scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
} }

View File

@ -124,6 +124,52 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
colours.Save(stream, ImageFormat.Png); colours.Save(stream, ImageFormat.Png);
} }
public virtual void SaveFile(ITerrainChannel m_channel, string filename,
int offsetX, int offsetY,
int fileWidth, int fileHeight,
int regionSizeX, int regionSizeY)
{
// We need to do this because:
// "Saving the image to the same file it was constructed from is not allowed and throws an exception."
string tempName = offsetX + "_ " + offsetY + "_" + filename;
Bitmap entireBitmap = null;
Bitmap thisBitmap = null;
if (File.Exists(filename))
{
File.Copy(filename, tempName);
entireBitmap = new Bitmap(tempName);
if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY)
{
// old file, let's overwrite it
entireBitmap = new Bitmap(fileWidth * regionSizeX, fileHeight * regionSizeY);
}
}
else
{
entireBitmap = new Bitmap(fileWidth * regionSizeX, fileHeight * regionSizeY);
}
thisBitmap = CreateGrayscaleBitmapFromMap(m_channel);
Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY);
for (int x = 0; x < regionSizeX; x++)
for (int y = 0; y < regionSizeY; y++)
entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y));
Save(entireBitmap, filename);
thisBitmap.Dispose();
entireBitmap.Dispose();
if (File.Exists(tempName))
File.Delete(tempName);
}
protected virtual void Save(Bitmap bmp, string filename)
{
bmp.Save(filename, ImageFormat.Png);
}
#endregion #endregion
public override string ToString() public override string ToString()

View File

@ -76,6 +76,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
colours.Save(stream, ImageFormat.Jpeg); colours.Save(stream, ImageFormat.Jpeg);
} }
public virtual void SaveFile(ITerrainChannel m_channel, string filename,
int offsetX, int offsetY,
int fileWidth, int fileHeight,
int regionSizeX, int regionSizeY)
{
throw new System.Exception("Not Implemented");
}
#endregion #endregion
public override string ToString() public override string ToString()

View File

@ -240,6 +240,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
get { return ".raw"; } get { return ".raw"; }
} }
public virtual void SaveFile(ITerrainChannel m_channel, string filename,
int offsetX, int offsetY,
int fileWidth, int fileHeight,
int regionSizeX, int regionSizeY)
{
throw new System.Exception("Not Implemented");
}
#endregion #endregion
public override string ToString() public override string ToString()

View File

@ -160,6 +160,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
bs.Close(); bs.Close();
} }
public virtual void SaveFile(ITerrainChannel m_channel, string filename,
int offsetX, int offsetY,
int fileWidth, int fileHeight,
int regionSizeX, int regionSizeY)
{
throw new System.Exception("Not Implemented");
}
#endregion #endregion
public override string ToString() public override string ToString()

View File

@ -308,6 +308,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
get { return ".ter"; } get { return ".ter"; }
} }
public virtual void SaveFile(ITerrainChannel m_channel, string filename,
int offsetX, int offsetY,
int fileWidth, int fileHeight,
int regionSizeX, int regionSizeY)
{
throw new System.Exception("Not Implemented");
}
#endregion #endregion
public override string ToString() public override string ToString()

View File

@ -38,5 +38,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
ITerrainChannel LoadStream(Stream stream); ITerrainChannel LoadStream(Stream stream);
void SaveFile(string filename, ITerrainChannel map); void SaveFile(string filename, ITerrainChannel map);
void SaveStream(Stream stream, ITerrainChannel map); void SaveStream(Stream stream, ITerrainChannel map);
void SaveFile(ITerrainChannel map, string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int regionSizeX, int regionSizeY);
} }
} }

View File

@ -540,6 +540,39 @@ namespace OpenSim.Region.CoreModules.World.Terrain
} }
} }
/// <summary>
/// Saves the terrain to a larger terrain file.
/// </summary>
/// <param name="filename">The terrain file to save</param>
/// <param name="fileWidth">The width of the file in units</param>
/// <param name="fileHeight">The height of the file in units</param>
/// <param name="fileStartX">Where to begin our slice</param>
/// <param name="fileStartY">Where to begin our slice</param>
public void SaveToFile(string filename, int fileWidth, int fileHeight, int fileStartX, int fileStartY)
{
int offsetX = (int)m_scene.RegionInfo.RegionLocX - fileStartX;
int offsetY = (int)m_scene.RegionInfo.RegionLocY - fileStartY;
if (offsetX >= 0 && offsetX < fileWidth && offsetY >= 0 && offsetY < fileHeight)
{
// this region is included in the tile request
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
{
if (filename.EndsWith(loader.Key))
{
lock (m_scene)
{
loader.Value.SaveFile(m_channel, filename, offsetX, offsetY,
fileWidth, fileHeight,
(int)Constants.RegionSize,
(int)Constants.RegionSize);
}
return;
}
}
}
}
/// <summary> /// <summary>
/// Performs updates to the region periodically, synchronising physics and other heightmap aware sections /// Performs updates to the region periodically, synchronising physics and other heightmap aware sections
/// </summary> /// </summary>
@ -862,6 +895,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain
SaveToFile((string) args[0]); SaveToFile((string) args[0]);
} }
private void InterfaceSaveTileFile(Object[] args)
{
SaveToFile((string)args[0],
(int)args[1],
(int)args[2],
(int)args[3],
(int)args[4]);
}
private void InterfaceBakeTerrain(Object[] args) private void InterfaceBakeTerrain(Object[] args)
{ {
UpdateRevertMap(); UpdateRevertMap();
@ -1117,6 +1159,17 @@ namespace OpenSim.Region.CoreModules.World.Terrain
loadFromTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file", loadFromTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
"Integer"); "Integer");
Command saveToTileCommand =
new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file.");
saveToTileCommand.AddArgument("filename",
"The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " +
supportedFileExtensions, "String");
saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
"Integer");
saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
"Integer");
// Terrain adjustments // Terrain adjustments
Command fillRegionCommand = Command fillRegionCommand =
new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value."); new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value.");
@ -1168,6 +1221,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_commander.RegisterCommand("load", loadFromFileCommand); m_commander.RegisterCommand("load", loadFromFileCommand);
m_commander.RegisterCommand("load-tile", loadFromTileCommand); m_commander.RegisterCommand("load-tile", loadFromTileCommand);
m_commander.RegisterCommand("save", saveToFileCommand); m_commander.RegisterCommand("save", saveToFileCommand);
m_commander.RegisterCommand("save-tile", saveToTileCommand);
m_commander.RegisterCommand("fill", fillRegionCommand); m_commander.RegisterCommand("fill", fillRegionCommand);
m_commander.RegisterCommand("elevate", elevateCommand); m_commander.RegisterCommand("elevate", elevateCommand);
m_commander.RegisterCommand("lower", lowerCommand); m_commander.RegisterCommand("lower", lowerCommand);

View File

@ -0,0 +1,154 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using OpenMetaverse;
namespace OpenSim.Region.Framework.Scenes
{
/// <summary>
/// Represents a coalescene of scene objects. A coalescence occurs when objects that are not in the same linkset
/// are grouped together.
/// </summary>
public class CoalescedSceneObjects
{
/// <summary>
/// The creator of this coalesence, though not necessarily the objects within it.
/// </summary>
public UUID CreatorId { get; set; }
/// <summary>
/// The number of objects in this coalesence
/// </summary>
public int Count
{
get
{
lock (m_memberObjects)
return m_memberObjects.Count;
}
}
/// <summary>
/// Does this coalesence have any member objects?
/// </summary>
public bool HasObjects { get { return Count > 0; } }
/// <summary>
/// Get the objects currently in this coalescence
/// </summary>
public List<SceneObjectGroup> Objects
{
get
{
lock (m_memberObjects)
return new List<SceneObjectGroup>(m_memberObjects);
}
}
/// <summary>
/// Get the scene that contains the objects in this coalescence. If there are no objects then null is returned.
/// </summary>
public Scene Scene
{
get
{
if (!HasObjects)
return null;
else
return Objects[0].Scene;
}
}
/// <summary>
/// At this point, we need to preserve the order of objects added to the coalescence, since the first
/// one will end up matching the item name when rerezzed.
/// </summary>
protected List<SceneObjectGroup> m_memberObjects = new List<SceneObjectGroup>();
public CoalescedSceneObjects(UUID creatorId)
{
CreatorId = creatorId;
}
public CoalescedSceneObjects(UUID creatorId, params SceneObjectGroup[] objs) : this(creatorId)
{
foreach (SceneObjectGroup obj in objs)
Add(obj);
}
/// <summary>
/// Add an object to the coalescence.
/// </summary>
/// <param name="obj"></param>
/// <param name="offset">The offset of the object within the group</param>
public void Add(SceneObjectGroup obj)
{
lock (m_memberObjects)
m_memberObjects.Add(obj);
}
/// <summary>
/// Removes a scene object from the coalescene
/// </summary>
/// <param name="sceneObjectId"></param>
/// <returns>true if the object was there to be removed, false if not.</returns>
public bool Remove(SceneObjectGroup obj)
{
lock (m_memberObjects)
return m_memberObjects.Remove(obj);
}
/// <summary>
/// Get the total size of the coalescence (the size required to cover all the objects within it) and the
/// offsets of each of those objects.
/// </summary>
/// <param name="size"></param>
/// <returns>
/// An array of offsets. The order of objects is the same as returned from the Objects property
/// </returns>
public Vector3[] GetSizeAndOffsets(out Vector3 size)
{
float minX, minY, minZ;
float maxX, maxY, maxZ;
Vector3[] offsets
= Scene.GetCombinedBoundingBox(
Objects, out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
float sizeX = maxX - minX;
float sizeY = maxY - minY;
float sizeZ = maxZ - minZ;
size = new Vector3(sizeX, sizeY, sizeZ);
return offsets;
}
}
}

View File

@ -174,7 +174,11 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence presence = m_scene.GetScenePresence(client.AgentId); ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
if (presence == null) if (presence == null)
{ {
m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId); // this shouldn't happen, it basically means that we are prioritizing
// updates to send to a client that doesn't have a presence in the scene
// seems like there's race condition here...
// m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId);
// throw new InvalidOperationException("Prioritization agent not defined"); // throw new InvalidOperationException("Prioritization agent not defined");
return Int32.MaxValue; return Int32.MaxValue;
} }

View File

@ -2005,11 +2005,49 @@ namespace OpenSim.Region.Framework.Scenes
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID) bool RezSelected, bool RemoveItem, UUID fromTaskID)
{ {
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); // m_log.DebugFormat(
if (invAccess != null) // "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}",
invAccess.RezObject( // remoteClient.Name, itemID, fromTaskID);
remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, false); if (fromTaskID == UUID.Zero)
{
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null)
invAccess.RezObject(
remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, false);
}
else
{
SceneObjectPart part = GetSceneObjectPart(fromTaskID);
if (part == null)
{
m_log.ErrorFormat(
"[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object",
remoteClient.Name, itemID, fromTaskID);
return;
}
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
if (item == null)
{
m_log.ErrorFormat(
"[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
remoteClient.Name, itemID, fromTaskID);
return;
}
byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
Vector3 pos
= GetNewRezLocation(
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
BypassRayCast, bRayEndIsIntersection, true, scale, false);
RezObject(part, item, pos, null, Vector3.Zero, 0);
}
} }
/// <summary> /// <summary>
@ -2017,14 +2055,14 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
/// <param name="sourcePart"></param> /// <param name="sourcePart"></param>
/// <param name="item"></param> /// <param name="item"></param>
/// <param name="pos"></param> /// <param name="pos">The position of the rezzed object.</param>
/// <param name="rot"></param> /// <param name="rot">The rotation of the rezzed object. If null, then the rotation stored with the object
/// <param name="vel"></param> /// will be used if it exists.</param>
/// <param name="vel">The velocity of the rezzed object.</param>
/// <param name="param"></param> /// <param name="param"></param>
/// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns>
public virtual SceneObjectGroup RezObject( public virtual SceneObjectGroup RezObject(
SceneObjectPart sourcePart, TaskInventoryItem item, SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param)
Vector3 pos, Quaternion rot, Vector3 vel, int param)
{ {
if (null == item) if (null == item)
return null; return null;
@ -2043,7 +2081,13 @@ namespace OpenSim.Region.Framework.Scenes
sourcePart.Inventory.RemoveInventoryItem(item.ItemID); sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
} }
AddNewSceneObject(group, true, pos, rot, vel); AddNewSceneObject(group, true);
group.AbsolutePosition = pos;
group.Velocity = vel;
if (rot != null)
group.UpdateGroupRotationR((Quaternion)rot);
// We can only call this after adding the scene object, since the scene object references the scene // We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all. // to find out if scripts should be activated at all.

View File

@ -5038,7 +5038,20 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public Vector3[] GetCombinedBoundingBox(List<SceneObjectGroup> objects, out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ) /// <summary>
/// Get the volume of space that will encompass all the given objects.
/// </summary>
/// <param name="objects"></param>
/// <param name="minX"></param>
/// <param name="maxX"></param>
/// <param name="minY"></param>
/// <param name="maxY"></param>
/// <param name="minZ"></param>
/// <param name="maxZ"></param>
/// <returns></returns>
public static Vector3[] GetCombinedBoundingBox(
List<SceneObjectGroup> objects,
out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
{ {
minX = 256; minX = 256;
maxX = -256; maxX = -256;
@ -5057,6 +5070,10 @@ namespace OpenSim.Region.Framework.Scenes
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
// m_log.DebugFormat(
// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
ominX += vec.X; ominX += vec.X;
omaxX += vec.X; omaxX += vec.X;
ominY += vec.Y; ominY += vec.Y;

View File

@ -1077,6 +1077,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts) foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts)
{ {
// m_log.DebugFormat("[SCENE GRAPH]: Part {0} has name {1}", p.UUID, p.Name);
if (p.Name == name) if (p.Name == name)
{ {
sop = p; sop = p;

View File

@ -365,11 +365,14 @@ namespace OpenSim.Region.Framework.Scenes
{ {
Vector3 val = value; Vector3 val = value;
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) if (Scene != null)
|| m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
{ {
m_scene.CrossPrimGroupIntoNewRegion(val, this, true); if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
|| Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
} }
foreach (SceneObjectPart part in m_parts.GetArray()) foreach (SceneObjectPart part in m_parts.GetArray())
@ -381,8 +384,11 @@ namespace OpenSim.Region.Framework.Scenes
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{ {
RootPart.ScriptSetPhysicsStatus(false); RootPart.ScriptSetPhysicsStatus(false);
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); if (Scene != null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
return; return;
} }
} }
@ -420,7 +426,8 @@ namespace OpenSim.Region.Framework.Scenes
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
//} //}
m_scene.EventManager.TriggerParcelPrimCountTainted(); if (Scene != null)
Scene.EventManager.TriggerParcelPrimCountTainted();
} }
} }

View File

@ -0,0 +1,149 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Xml;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Scenes.Serialization
{
/// <summary>
/// Serialize and deserialize coalesced scene objects.
/// </summary>
/// <remarks>
/// Deserialization not yet here.
/// </remarks>
public class CoalescedSceneObjectsSerializer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Serialize coalesced objects to Xml
/// </summary>
/// <param name="coa"></param>
/// <returns></returns>
public static string ToXml(CoalescedSceneObjects coa)
{
using (StringWriter sw = new StringWriter())
{
using (XmlTextWriter writer = new XmlTextWriter(sw))
{
Vector3 size;
List<SceneObjectGroup> coaObjects = coa.Objects;
// m_log.DebugFormat(
// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object",
// coaObjects.Count);
// This is weak - we're relying on the set of coalesced objects still being identical
Vector3[] offsets = coa.GetSizeAndOffsets(out size);
writer.WriteStartElement("CoalescedObject");
writer.WriteAttributeString("x", size.X.ToString());
writer.WriteAttributeString("y", size.Y.ToString());
writer.WriteAttributeString("z", size.Z.ToString());
// Embed the offsets into the group XML
for (int i = 0; i < coaObjects.Count; i++)
{
SceneObjectGroup obj = coaObjects[i];
// m_log.DebugFormat(
// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}",
// i, obj.Name);
writer.WriteStartElement("SceneObjectGroup");
writer.WriteAttributeString("offsetx", offsets[i].X.ToString());
writer.WriteAttributeString("offsety", offsets[i].Y.ToString());
writer.WriteAttributeString("offsetz", offsets[i].Z.ToString());
SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, true);
writer.WriteEndElement(); // SceneObjectGroup
}
writer.WriteEndElement(); // CoalescedObject
}
string output = sw.ToString();
// Console.WriteLine(output);
return output;
}
}
public static bool TryFromXml(string xml, out CoalescedSceneObjects coa)
{
// m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml);
coa = null;
using (StringReader sr = new StringReader(xml))
{
using (XmlTextReader reader = new XmlTextReader(sr))
{
reader.Read();
if (reader.Name != "CoalescedObject")
{
// m_log.DebugFormat(
// "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false",
// reader.Name);
return false;
}
coa = new CoalescedSceneObjects(UUID.Zero);
reader.Read();
while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject")
{
if (reader.Name == "SceneObjectGroup")
{
string soXml = reader.ReadOuterXml();
coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml));
}
}
reader.ReadEndElement(); // CoalescedObject
}
}
return true;
}
}
}

View File

@ -140,17 +140,32 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
} }
} }
/// <summary> /// <summary>
/// Serialize a scene object to the original xml format /// Serialize a scene object to the original xml format
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
/// <returns></returns> /// <returns></returns>
public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer) public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer)
{
ToOriginalXmlFormat(sceneObject, writer, false);
}
/// <summary>
/// Serialize a scene object to the original xml format
/// </summary>
/// <param name="sceneObject"></param>
/// <param name="writer"></param>
/// <param name="noRootElement">If false, don't write the enclosing SceneObjectGroup element</param>
/// <returns></returns>
public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer, bool noRootElement)
{ {
//m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name); //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name);
//int time = System.Environment.TickCount; //int time = System.Environment.TickCount;
writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); if (!noRootElement)
writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
writer.WriteStartElement(String.Empty, "RootPart", String.Empty); writer.WriteStartElement(String.Empty, "RootPart", String.Empty);
ToXmlFormat(sceneObject.RootPart, writer); ToXmlFormat(sceneObject.RootPart, writer);
writer.WriteEndElement(); writer.WriteEndElement();
@ -170,7 +185,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteEndElement(); // OtherParts writer.WriteEndElement(); // OtherParts
sceneObject.SaveScriptedState(writer); sceneObject.SaveScriptedState(writer);
writer.WriteEndElement(); // SceneObjectGroup
if (!noRootElement)
writer.WriteEndElement(); // SceneObjectGroup
//m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time); //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
} }
@ -1318,7 +1335,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteStartElement("SculptData"); writer.WriteStartElement("SculptData");
byte[] sd; byte[] sd;
if (shp.SculptData != null) if (shp.SculptData != null)
sd = shp.ExtraParams; sd = shp.SculptData;
else else
sd = Utils.EmptyBytes; sd = Utils.EmptyBytes;
writer.WriteBase64(sd, 0, sd.Length); writer.WriteBase64(sd, 0, sd.Length);

View File

@ -117,11 +117,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid"); Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
sceneB.RegisterRegionWithGrid(); sceneB.RegisterRegionWithGrid();
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid"); Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
sceneA.RegisterRegionWithGrid(); sceneA.RegisterRegionWithGrid();

View File

@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene); UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart; SceneObjectPart sop1 = sog1.RootPart;
@ -127,7 +127,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene();
UserAccount user1 = CreateUser(scene); UserAccount user1 = CreateUser(scene);
SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart; SceneObjectPart sop1 = sog1.RootPart;

View File

@ -47,7 +47,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp] [SetUp]
public void Init() public void Init()
{ {
m_assetService = new MockAssetService(); // FIXME: We don't need a full scene here - it would be enough to set up the asset service.
Scene scene = SceneSetupHelpers.SetupScene();
m_assetService = scene.AssetService;
m_uuidGatherer = new UuidGatherer(m_assetService); m_uuidGatherer = new UuidGatherer(m_assetService);
} }

View File

@ -648,6 +648,9 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
if (pbs.ProfileHollow != 0) if (pbs.ProfileHollow != 0)
iPropertiesNotSupportedDefault++; iPropertiesNotSupportedDefault++;
if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
iPropertiesNotSupportedDefault++;
if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0)) if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0))
iPropertiesNotSupportedDefault++; iPropertiesNotSupportedDefault++;

View File

@ -2528,6 +2528,9 @@ namespace OpenSim.Region.Physics.OdePlugin
if (pbs.ProfileHollow != 0) if (pbs.ProfileHollow != 0)
iPropertiesNotSupportedDefault++; iPropertiesNotSupportedDefault++;
if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
iPropertiesNotSupportedDefault++;
if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0)) if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0))
iPropertiesNotSupportedDefault++; iPropertiesNotSupportedDefault++;

View File

@ -8052,7 +8052,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// This BBox is in sim coordinates, with the offset being // This BBox is in sim coordinates, with the offset being
// a contained point. // a contained point.
Vector3[] offsets = World.GetCombinedBoundingBox(new List<SceneObjectGroup> { part.ParentGroup }, Vector3[] offsets = Scene.GetCombinedBoundingBox(new List<SceneObjectGroup> { part.ParentGroup },
out minX, out maxX, out minY, out maxY, out minZ, out maxZ); out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
minX -= offsets[0].X; minX -= offsets[0].X;

View File

@ -89,6 +89,8 @@ namespace OpenSim.Services.AssetService
public virtual AssetBase Get(string id) public virtual AssetBase Get(string id)
{ {
// m_log.DebugFormat("[ASSET SERVICE]: Get asset for {0}", id);
UUID assetID; UUID assetID;
if (!UUID.TryParse(id, out assetID)) if (!UUID.TryParse(id, out assetID))
@ -107,6 +109,8 @@ namespace OpenSim.Services.AssetService
public virtual AssetMetadata GetMetadata(string id) public virtual AssetMetadata GetMetadata(string id)
{ {
// m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id);
UUID assetID; UUID assetID;
if (!UUID.TryParse(id, out assetID)) if (!UUID.TryParse(id, out assetID))
@ -121,6 +125,8 @@ namespace OpenSim.Services.AssetService
public virtual byte[] GetData(string id) public virtual byte[] GetData(string id)
{ {
// m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id);
UUID assetID; UUID assetID;
if (!UUID.TryParse(id, out assetID)) if (!UUID.TryParse(id, out assetID))

View File

@ -35,7 +35,6 @@ using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenMetaverse; using OpenMetaverse;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using IAvatarService = OpenSim.Services.Interfaces.IAvatarService; using IAvatarService = OpenSim.Services.Interfaces.IAvatarService;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenMetaverse; using OpenMetaverse;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -32,7 +32,7 @@ using System.Reflection;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework;
using OpenMetaverse; using OpenMetaverse;
using log4net; using log4net;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -34,7 +34,6 @@ using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenMetaverse; using OpenMetaverse;

View File

@ -34,7 +34,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;
using Nwc.XmlRpc; using Nwc.XmlRpc;

View File

@ -36,7 +36,6 @@ using System.Text;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Server.Base; using OpenSim.Server.Base;

View File

@ -33,7 +33,6 @@ using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Base; using OpenSim.Server.Base;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenMetaverse; using OpenMetaverse;

View File

@ -48,6 +48,11 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns> /// <returns></returns>
AssetMetadata GetMetadata(string id); AssetMetadata GetMetadata(string id);
/// <summary>
/// Get an asset's data, ignoring the metadata.
/// </summary>
/// <param name="id"></param>
/// <returns>null if there is no such asset</returns>
byte[] GetData(string id); byte[] GetData(string id);
/// <summary> /// <summary>

View File

@ -1,109 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
using OpenSim.Services.Interfaces;
using Nini.Config;
namespace OpenSim.Tests.Common.Mock
{
public class MockAssetService : IAssetService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
public MockAssetService() {}
/// <summary>
/// This constructor is required if the asset service is being created reflectively (which is the case in some
/// tests).
/// </summary>
/// <param name="config"></param>
public MockAssetService(IConfigSource config) {}
public AssetBase Get(string id)
{
m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id);
AssetBase asset;
if (Assets.ContainsKey(id))
asset = Assets[id];
else
asset = null;
return asset;
}
public AssetBase GetCached(string id)
{
return Get(id);
}
public AssetMetadata GetMetadata(string id)
{
throw new System.NotImplementedException();
}
public byte[] GetData(string id)
{
throw new System.NotImplementedException();
}
public bool Get(string id, object sender, AssetRetrieved handler)
{
handler(id, sender, Get(id));
return true;
}
public string Store(AssetBase asset)
{
m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID);
Assets[asset.ID] = asset;
return asset.ID;
}
public bool UpdateContent(string id, byte[] data)
{
throw new System.NotImplementedException();
}
public bool Delete(string id)
{
throw new System.NotImplementedException();
}
}
}

View File

@ -1,186 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework;
using OpenMetaverse;
using OpenSim.Services.Interfaces;
using Nini.Config;
namespace OpenSim.Tests.Common.Mock
{
public class MockInventoryService : IInventoryService
{
public MockInventoryService() {}
public MockInventoryService(IConfigSource config) {}
/// <summary>
/// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public bool CreateUserInventory(UUID userId)
{
return false;
}
/// <summary>
/// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
{
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
InventoryFolderBase folder = new InventoryFolderBase();
folder.ID = UUID.Random();
folder.Owner = userId;
folders.Add(folder);
return folders;
}
public InventoryFolderBase GetRootFolder(UUID userID)
{
return new InventoryFolderBase();
}
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
{
return null;
}
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
{
return null;
}
/// <summary>
/// Returns a list of all the active gestures in a user's inventory.
/// </summary>
/// <param name="userId">
/// The <see cref="UUID"/> of the user
/// </param>
/// <returns>
/// A flat list of the gesture items.
/// </returns>
public List<InventoryItemBase> GetActiveGestures(UUID userId)
{
return null;
}
public InventoryCollection GetUserInventory(UUID userID)
{
return null;
}
public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
{
}
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
{
return null;
}
public bool AddFolder(InventoryFolderBase folder)
{
return false;
}
public bool UpdateFolder(InventoryFolderBase folder)
{
return false;
}
public bool MoveFolder(InventoryFolderBase folder)
{
return false;
}
public bool DeleteFolders(UUID ownerID, List<UUID> ids)
{
return false;
}
public bool PurgeFolder(InventoryFolderBase folder)
{
return false;
}
public bool AddItem(InventoryItemBase item)
{
return true;
}
public bool UpdateItem(InventoryItemBase item)
{
return false;
}
public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
{
return false;
}
public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
{
return false;
}
public InventoryItemBase GetItem(InventoryItemBase item)
{
return null;
}
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
return null;
}
public bool HasInventoryForUser(UUID userID)
{
return false;
}
public InventoryFolderBase RequestRootFolder(UUID userID)
{
InventoryFolderBase root = new InventoryFolderBase();
root.ID = UUID.Random();
root.Owner = userID;
root.ParentID = UUID.Zero;
return root;
}
public int GetAssetPermissions(UUID userID, UUID assetID)
{
return 1;
}
}
}

View File

@ -30,6 +30,7 @@ using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
namespace OpenSim.Tests.Common namespace OpenSim.Tests.Common
{ {
@ -72,6 +73,35 @@ namespace OpenSim.Tests.Common
sog.OwnerID); sog.OwnerID);
} }
/// <summary>
/// Create an asset from the given scene object.
/// </summary>
/// <param name="assetUuidTailZ">
/// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
/// will be used.
/// </param>
/// <param name="coa"></param>
/// <returns></returns>
public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa)
{
return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa);
}
/// <summary>
/// Create an asset from the given scene object.
/// </summary>
/// <param name="assetUuid"></param>
/// <param name="coa"></param>
/// <returns></returns>
public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa)
{
return CreateAsset(
assetUuid,
AssetType.Object,
Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)),
coa.CreatorId);
}
/// <summary> /// <summary>
/// Create an asset from the given data. /// Create an asset from the given data.
/// </summary> /// </summary>
@ -89,5 +119,11 @@ namespace OpenSim.Tests.Common
asset.Data = data; asset.Data = data;
return asset; return asset;
} }
public static string ReadAssetAsString(IAssetService assetService, UUID uuid)
{
byte[] assetData = assetService.GetData(uuid.ToString());
return Encoding.ASCII.GetString(assetData);
}
} }
} }

View File

@ -66,32 +66,7 @@ namespace OpenSim.Tests.Common.Setup
/// <returns></returns> /// <returns></returns>
public static TestScene SetupScene() public static TestScene SetupScene()
{ {
return SetupScene(""); return SetupScene("Unit test region", UUID.Random(), 1000, 1000);
}
/// <summary>
/// Set up a test scene
/// </summary>
///
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
/// <returns></returns>
public static TestScene SetupScene(String realServices)
{
return SetupScene("Unit test region", UUID.Random(), 1000, 1000, realServices);
}
/// <summary>
/// Set up a test scene
/// </summary>
/// <param name="name">Name of the region</param>
/// <param name="id">ID of the region</param>
/// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param>
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
/// <returns></returns>
public static TestScene SetupScene(string name, UUID id, uint x, uint y)
{
return SetupScene(name, id, x, y, "");
} }
/// <summary> /// <summary>
@ -103,10 +78,8 @@ namespace OpenSim.Tests.Common.Setup
/// <param name="x">X co-ordinate of the region</param> /// <param name="x">X co-ordinate of the region</param>
/// <param name="y">Y co-ordinate of the region</param> /// <param name="y">Y co-ordinate of the region</param>
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param> /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
/// <returns></returns> /// <returns></returns>
public static TestScene SetupScene( public static TestScene SetupScene(string name, UUID id, uint x, uint y)
string name, UUID id, uint x, uint y, String realServices)
{ {
Console.WriteLine("Setting up test scene {0}", name); Console.WriteLine("Setting up test scene {0}", name);
@ -130,15 +103,11 @@ namespace OpenSim.Tests.Common.Setup
IRegionModule godsModule = new GodsModule(); IRegionModule godsModule = new GodsModule();
godsModule.Initialise(testScene, new IniConfigSource()); godsModule.Initialise(testScene, new IniConfigSource());
testScene.AddModule(godsModule.Name, godsModule); testScene.AddModule(godsModule.Name, godsModule);
realServices = realServices.ToLower();
LocalAssetServicesConnector assetService = StartAssetService(testScene, realServices.Contains("asset")); LocalAssetServicesConnector assetService = StartAssetService(testScene);
StartAuthenticationService(testScene);
// For now, always started a 'real' authentication service LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene);
StartAuthenticationService(testScene, true); StartGridService(testScene);
LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene, realServices.Contains("inventory"));
StartGridService(testScene, true);
LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); LocalPresenceServicesConnector presenceService = StartPresenceService(testScene);
@ -164,18 +133,17 @@ namespace OpenSim.Tests.Common.Setup
return testScene; return testScene;
} }
private static LocalAssetServicesConnector StartAssetService(Scene testScene, bool real) private static LocalAssetServicesConnector StartAssetService(Scene testScene)
{ {
LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Modules"); config.AddConfig("Modules");
config.AddConfig("AssetService");
config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
if (real) config.AddConfig("AssetService");
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
else
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
assetService.Initialise(config); assetService.Initialise(config);
assetService.AddRegion(testScene); assetService.AddRegion(testScene);
assetService.RegionLoaded(testScene); assetService.RegionLoaded(testScene);
@ -184,20 +152,18 @@ namespace OpenSim.Tests.Common.Setup
return assetService; return assetService;
} }
private static void StartAuthenticationService(Scene testScene, bool real) private static void StartAuthenticationService(Scene testScene)
{ {
ISharedRegionModule service = new LocalAuthenticationServicesConnector(); ISharedRegionModule service = new LocalAuthenticationServicesConnector();
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Modules"); config.AddConfig("Modules");
config.AddConfig("AuthenticationService"); config.AddConfig("AuthenticationService");
config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector");
if (real) config.Configs["AuthenticationService"].Set(
config.Configs["AuthenticationService"].Set( "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
"LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
else
config.Configs["AuthenticationService"].Set(
"LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService");
config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
service.Initialise(config); service.Initialise(config);
service.AddRegion(testScene); service.AddRegion(testScene);
service.RegionLoaded(testScene); service.RegionLoaded(testScene);
@ -205,24 +171,17 @@ namespace OpenSim.Tests.Common.Setup
//m_authenticationService = service; //m_authenticationService = service;
} }
private static LocalInventoryServicesConnector StartInventoryService(Scene testScene, bool real) private static LocalInventoryServicesConnector StartInventoryService(Scene testScene)
{ {
LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Modules"); config.AddConfig("Modules");
config.AddConfig("InventoryService"); config.AddConfig("InventoryService");
config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
if (real)
{
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
}
else
{
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
}
config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
inventoryService.Initialise(config); inventoryService.Initialise(config);
inventoryService.AddRegion(testScene); inventoryService.AddRegion(testScene);
inventoryService.RegionLoaded(testScene); inventoryService.RegionLoaded(testScene);
@ -231,24 +190,19 @@ namespace OpenSim.Tests.Common.Setup
return inventoryService; return inventoryService;
} }
private static LocalGridServicesConnector StartGridService(Scene testScene, bool real) private static LocalGridServicesConnector StartGridService(Scene testScene)
{ {
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Modules"); config.AddConfig("Modules");
config.AddConfig("GridService"); config.AddConfig("GridService");
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
if (real) config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
LocalGridServicesConnector gridService = new LocalGridServicesConnector(); LocalGridServicesConnector gridService = new LocalGridServicesConnector();
gridService.Initialise(config); gridService.Initialise(config);
//else
// config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
gridService.AddRegion(testScene); gridService.AddRegion(testScene);
gridService.RegionLoaded(testScene); gridService.RegionLoaded(testScene);
//testScene.AddRegionModule(m_gridService.Name, m_gridService);
return gridService; return gridService;
} }
@ -475,7 +429,7 @@ namespace OpenSim.Tests.Common.Setup
{ {
return new SceneObjectPart( return new SceneObjectPart(
ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = name, UUID = id }; { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) };
} }
/// <summary> /// <summary>

View File

@ -16,7 +16,7 @@
;; files are loaded then type "config show" on the region console command line. ;; files are loaded then type "config show" on the region console command line.
;; ;;
;; ;;
;; NOTES FOR DEVELOPERS REGARDING FORMAT OF TIHS FILE ;; NOTES FOR DEVELOPERS REGARDING THE FORMAT OF THIS FILE
;; ;;
;; All leading white space is ignored, but preserved. ;; All leading white space is ignored, but preserved.
;; ;;
@ -201,6 +201,14 @@
;; If not generating maptiles, use this static texture asset ID ;; If not generating maptiles, use this static texture asset ID
; MaptileStaticUUID = "00000000-0000-0000-0000-000000000000" ; MaptileStaticUUID = "00000000-0000-0000-0000-000000000000"
;; Http proxy setting for llHTTPRequest and dynamic texture loading, if required
; HttpProxy = "http://proxy.com:8080"
;; If you're using HttpProxy, then you can set HttpProxyExceptions to a list of regular expressions for URLs that you don't want to go through the proxy
;; For example, servers inside your firewall.
;; Separate patterns with a ';'
; HttpProxyExceptions = ".mydomain.com;localhost"
;# {emailmodule} {} {Provide llEmail and llGetNextEmail functionality? (requires SMTP server)} {true false} false ;# {emailmodule} {} {Provide llEmail and llGetNextEmail functionality? (requires SMTP server)} {true false} false
;; The email module requires some configuration. It needs an SMTP ;; The email module requires some configuration. It needs an SMTP
;; server to send mail through. ;; server to send mail through.

View File

@ -14,15 +14,6 @@
; Place to create a PID file ; Place to create a PID file
; PIDFile = "/tmp/my.pid" ; PIDFile = "/tmp/my.pid"
; Http proxy support for llHTTPRequest and dynamic texture loading
; Set HttpProxy to the URL for your proxy server if you would like
; to proxy llHTTPRequests through a firewall
; HttpProxy = "http://proxy.com"
; Set HttpProxyExceptions to a list of regular expressions for
; URLs that you don't want going through the proxy such as servers
; inside your firewall, separate patterns with a ';'
; HttpProxyExceptions = ".mydomain.com;localhost"
startup_console_commands_file = "startup_commands.txt" startup_console_commands_file = "startup_commands.txt"
shutdown_console_commands_file = "shutdown_commands.txt" shutdown_console_commands_file = "shutdown_commands.txt"
@ -164,6 +155,10 @@
; it may cause unexpected physics problems. ; it may cause unexpected physics problems.
;UseMeshiesPhysicsMesh = false ;UseMeshiesPhysicsMesh = false
; enable / disable Collada mesh support
; default is true
; ColladaMesh = true
; Choose one of the physics engines below ; Choose one of the physics engines below
; OpenDynamicsEngine is by some distance the most developed physics engine ; OpenDynamicsEngine is by some distance the most developed physics engine
; basicphysics effectively does not model physics at all, making all objects phantom ; basicphysics effectively does not model physics at all, making all objects phantom

View File

@ -961,7 +961,6 @@
<Reference name="OpenSim.Framework"/> <Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Communications"/> <Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Framework.Console"/> <Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Region.Framework"/> <Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Server.Base"/> <Reference name="OpenSim.Server.Base"/>
<Reference name="OpenSim.Services.Base"/> <Reference name="OpenSim.Services.Base"/>
@ -2921,6 +2920,7 @@
<!-- SADLY the way this works means you need to keep adding these paths --> <!-- SADLY the way this works means you need to keep adding these paths -->
<Match path="Agent/TextureSender/Tests" pattern="*.cs" recurse="true"/> <Match path="Agent/TextureSender/Tests" pattern="*.cs" recurse="true"/>
<Match path="Avatar/Inventory/Archiver/Tests" pattern="*.cs" recurse="true"/> <Match path="Avatar/Inventory/Archiver/Tests" pattern="*.cs" recurse="true"/>
<Match path="Framework/InventoryAccess/Tests" pattern="*.cs" recurse="true"/>
<Match path="World/Archiver/Tests" pattern="*.cs" recurse="true"/> <Match path="World/Archiver/Tests" pattern="*.cs" recurse="true"/>
<Match buildAction="EmbeddedResource" path="World/Archiver/Tests/Resources" pattern="*"/> <Match buildAction="EmbeddedResource" path="World/Archiver/Tests/Resources" pattern="*"/>
<Match path="World/Land/Tests" pattern="*.cs" recurse="true"/> <Match path="World/Land/Tests" pattern="*.cs" recurse="true"/>