Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
commit
e327e990f5
|
@ -264,9 +264,10 @@ namespace OpenSim
|
||||||
LoadOar);
|
LoadOar);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("region", false, "save oar",
|
m_console.Commands.AddCommand("region", false, "save oar",
|
||||||
"save oar [<OAR path>]",
|
"save oar [-v|version=N] [<OAR path>]",
|
||||||
"Save a region's data to an OAR archive.",
|
"Save a region's data to an OAR archive.",
|
||||||
"The OAR path must be a filesystem path."
|
"-v|version=N generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
|
||||||
|
+ "The OAR path must be a filesystem path."
|
||||||
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
||||||
SaveOar);
|
SaveOar);
|
||||||
|
|
||||||
|
|
|
@ -176,44 +176,44 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
||||||
stream = response.GetResponseStream();
|
stream = response.GetResponseStream();
|
||||||
if (stream != null)
|
if (stream != null)
|
||||||
{
|
{
|
||||||
Bitmap image = new Bitmap(stream);
|
|
||||||
Size newsize;
|
|
||||||
|
|
||||||
// TODO: make this a bit less hard coded
|
|
||||||
if ((image.Height < 64) && (image.Width < 64))
|
|
||||||
{
|
|
||||||
newsize = new Size(32, 32);
|
|
||||||
}
|
|
||||||
else if ((image.Height < 128) && (image.Width < 128))
|
|
||||||
{
|
|
||||||
newsize = new Size(64, 64);
|
|
||||||
}
|
|
||||||
else if ((image.Height < 256) && (image.Width < 256))
|
|
||||||
{
|
|
||||||
newsize = new Size(128, 128);
|
|
||||||
}
|
|
||||||
else if ((image.Height < 512 && image.Width < 512))
|
|
||||||
{
|
|
||||||
newsize = new Size(256, 256);
|
|
||||||
}
|
|
||||||
else if ((image.Height < 1024 && image.Width < 1024))
|
|
||||||
{
|
|
||||||
newsize = new Size(512, 512);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newsize = new Size(1024, 1024);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bitmap resize = new Bitmap(image, newsize);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Bitmap image = new Bitmap(stream);
|
||||||
|
Size newsize;
|
||||||
|
|
||||||
|
// TODO: make this a bit less hard coded
|
||||||
|
if ((image.Height < 64) && (image.Width < 64))
|
||||||
|
{
|
||||||
|
newsize = new Size(32, 32);
|
||||||
|
}
|
||||||
|
else if ((image.Height < 128) && (image.Width < 128))
|
||||||
|
{
|
||||||
|
newsize = new Size(64, 64);
|
||||||
|
}
|
||||||
|
else if ((image.Height < 256) && (image.Width < 256))
|
||||||
|
{
|
||||||
|
newsize = new Size(128, 128);
|
||||||
|
}
|
||||||
|
else if ((image.Height < 512 && image.Width < 512))
|
||||||
|
{
|
||||||
|
newsize = new Size(256, 256);
|
||||||
|
}
|
||||||
|
else if ((image.Height < 1024 && image.Width < 1024))
|
||||||
|
{
|
||||||
|
newsize = new Size(512, 512);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newsize = new Size(1024, 1024);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitmap resize = new Bitmap(image, newsize);
|
||||||
|
|
||||||
imageJ2000 = OpenJPEG.EncodeFromImage(resize, true);
|
imageJ2000 = OpenJPEG.EncodeFromImage(resize, true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!");
|
m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
|
|
||||||
public InventoryItemBase GetItem(InventoryItemBase item)
|
public InventoryItemBase GetItem(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
|
//m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
|
|
||||||
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID);
|
//m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID);
|
||||||
if (folder == null)
|
if (folder == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
|
@ -137,16 +137,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
|
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
|
||||||
|
|
||||||
Dictionary<string, object> serializationOptions = new Dictionary<string, object>();
|
|
||||||
// if (m_options.ContainsKey("version") && (string)m_options["version"] == "0")
|
|
||||||
// serializationOptions["old-guids"] = true;
|
|
||||||
|
|
||||||
// Write out scene object metadata
|
// Write out scene object metadata
|
||||||
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
|
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
|
//m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
|
||||||
|
|
||||||
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, serializationOptions);
|
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
|
||||||
m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
|
m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,20 +187,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string Create0p2ControlFile(Dictionary<string, object> options)
|
public static string Create0p2ControlFile(Dictionary<string, object> options)
|
||||||
{
|
{
|
||||||
int majorVersion = 0, minorVersion = 4;
|
int majorVersion = 0, minorVersion = 5;
|
||||||
|
|
||||||
/*
|
if (options.ContainsKey("version"))
|
||||||
if (options.ContainsKey("version") && (string)options["version"] == "0")
|
|
||||||
{
|
{
|
||||||
majorVersion = 0;
|
|
||||||
minorVersion = 3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
majorVersion = 1;
|
|
||||||
minorVersion = 0;
|
minorVersion = 0;
|
||||||
|
string[] parts = options["version"].ToString().Split('.');
|
||||||
|
if (parts.Length >= 1)
|
||||||
|
majorVersion = Int32.Parse(parts[0]);
|
||||||
|
if (parts.Length >= 2)
|
||||||
|
minorVersion = Int32.Parse(parts[1]);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
|
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
|
||||||
// if (majorVersion == 1)
|
// if (majorVersion == 1)
|
||||||
|
|
|
@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
|
writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
|
||||||
writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
|
writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
|
||||||
writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
|
writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
|
||||||
writer.WriteElementString("Flags", sop.Flags.ToString());
|
WriteFlags(writer, "Flags", sop.Flags.ToString(), options);
|
||||||
WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
|
WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
|
||||||
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
|
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
|
||||||
if (sop.MediaUrl != null)
|
if (sop.MediaUrl != null)
|
||||||
|
@ -1188,6 +1188,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary<string, object> options)
|
||||||
|
{
|
||||||
|
// Older versions of serialization can't cope with commas
|
||||||
|
if (options.ContainsKey("version"))
|
||||||
|
{
|
||||||
|
float version = 0.5F;
|
||||||
|
float.TryParse(options["version"].ToString(), out version);
|
||||||
|
if (version < 0.5)
|
||||||
|
flagsStr = flagsStr.Replace(",", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.WriteElementString(name, flagsStr);
|
||||||
|
}
|
||||||
|
|
||||||
static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options)
|
static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options)
|
||||||
{
|
{
|
||||||
if (tinv.Count > 0) // otherwise skip this
|
if (tinv.Count > 0) // otherwise skip this
|
||||||
|
@ -1275,8 +1289,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString());
|
writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString());
|
||||||
writer.WriteElementString("State", shp.State.ToString());
|
writer.WriteElementString("State", shp.State.ToString());
|
||||||
|
|
||||||
writer.WriteElementString("ProfileShape", shp.ProfileShape.ToString());
|
WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options);
|
||||||
writer.WriteElementString("HollowShape", shp.HollowShape.ToString());
|
WriteFlags(writer, "HollowShape", shp.HollowShape.ToString(), options);
|
||||||
|
|
||||||
WriteUUID(writer, "SculptTexture", shp.SculptTexture, options);
|
WriteUUID(writer, "SculptTexture", shp.SculptTexture, options);
|
||||||
writer.WriteElementString("SculptType", shp.SculptType.ToString());
|
writer.WriteElementString("SculptType", shp.SculptType.ToString());
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
int GetRegionFlags(UUID scopeID, UUID regionID);
|
int GetRegionFlags(UUID scopeID, UUID regionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GridRegion
|
public class GridRegion : Object
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -225,6 +225,33 @@ namespace OpenSim.Services.Interfaces
|
||||||
EstateOwner = ConvertFrom.EstateOwner;
|
EstateOwner = ConvertFrom.EstateOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# region Definition of equality
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Define equality as two regions having the same, non-zero UUID.
|
||||||
|
/// </summary>
|
||||||
|
public bool Equals(GridRegion region)
|
||||||
|
{
|
||||||
|
if ((object)region == null)
|
||||||
|
return false;
|
||||||
|
// Return true if the non-zero UUIDs are equal:
|
||||||
|
return (RegionID != UUID.Zero) && RegionID.Equals(region.RegionID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(Object obj)
|
||||||
|
{
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
return Equals(obj as GridRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return RegionID.GetHashCode() ^ TerrainImage.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <value>
|
/// <value>
|
||||||
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
|
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue