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

mysql-performance
Melanie 2010-01-23 15:19:05 +00:00
commit 1254a5e50c
5 changed files with 154 additions and 5 deletions

View File

@ -9091,8 +9091,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private bool HandleSendPostcard(IClientAPI client, Packet packet) private bool HandleSendPostcard(IClientAPI client, Packet packet)
{ {
SendPostcardPacket SendPostcard = // SendPostcardPacket SendPostcard =
(SendPostcardPacket)packet; // (SendPostcardPacket)packet;
SendPostcard handlerSendPostcard = OnSendPostcard; SendPostcard handlerSendPostcard = OnSendPostcard;
if (handlerSendPostcard != null) if (handlerSendPostcard != null)
{ {

View File

@ -425,6 +425,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
if (estateModule != null)
estateModule.sendRegionHandshakeToAll(); estateModule.sendRegionHandshakeToAll();
return true; return true;

View File

@ -36,6 +36,7 @@ using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Serialization; using OpenSim.Framework.Serialization;
using OpenSim.Framework.Serialization.External;
using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.World.Serialiser;
using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
@ -234,6 +235,45 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition);
part1.Name = part1Name; part1.Name = part1Name;
SceneObjectGroup object1 = new SceneObjectGroup(part1); SceneObjectGroup object1 = new SceneObjectGroup(part1);
// Let's put some inventory items into our object
UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002");
Type type = GetType();
Assembly assembly = type.Assembly;
string soundDataResourceName = null;
string[] names = assembly.GetManifestResourceNames();
foreach (string name in names)
{
if (name.EndsWith(".Resources.test-sound.wav"))
soundDataResourceName = name;
}
Assert.That(soundDataResourceName, Is.Not.Null);
byte[] soundData;
Console.WriteLine("Loading " + soundDataResourceName);
using (Stream resource = assembly.GetManifestResourceStream(soundDataResourceName))
{
using (BinaryReader br = new BinaryReader(resource))
{
// FIXME: Use the inspector insteadthere are so many forums and lists already, though admittedly none of them are suitable for cross virtual-enivornemnt discussion
soundData = br.ReadBytes(99999999);
UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001");
string soundAssetFileName
= ArchiveConstants.ASSETS_PATH + soundUuid
+ ArchiveConstants.ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV];
tar.WriteFile(soundAssetFileName, soundData);
/*
AssetBase soundAsset = AssetHelpers.CreateAsset(soundUuid, soundData);
scene.AssetService.Store(soundAsset);
asset1FileName = ArchiveConstants.ASSETS_PATH + soundUuid + ".wav";
*/
TaskInventoryItem item1 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid };
part1.Inventory.AddInventoryItem(item1, true);
}
}
scene.AddNewSceneObject(object1, false); scene.AddNewSceneObject(object1, false);
string object1FileName = string.Format( string object1FileName = string.Format(
@ -265,10 +305,116 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Assert.That( Assert.That(
object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal");
// Need to implement a method to get the task inventory item by name (since the uuid will have changed on load)
/*
TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItem(soundItemUuid);
Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null");
AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString());
Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null");
Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match");
*/
// Temporary // Temporary
Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod());
} }
/// <summary>
/// Test loading the region settings of a V0.2 OpenSim Region Archive.
/// </summary>
[Test]
public void TestLoadOarV0_2RegionSettings()
{
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
SerialiserModule serialiserModule = new SerialiserModule();
ArchiverModule archiverModule = new ArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
MemoryStream archiveWriteStream = new MemoryStream();
TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
RegionSettings rs = new RegionSettings();
rs.AgentLimit = 17;
rs.AllowDamage = true;
rs.AllowLandJoinDivide = true;
rs.AllowLandResell = true;
rs.BlockFly = true;
rs.BlockShowInSearch = true;
rs.BlockTerraform = true;
rs.DisableCollisions = true;
rs.DisablePhysics = true;
rs.DisableScripts = true;
rs.Elevation1NW = 15.9;
rs.Elevation1NE = 45.3;
rs.Elevation1SE = 49;
rs.Elevation1SW = 1.9;
rs.Elevation2NW = 4.5;
rs.Elevation2NE = 19.2;
rs.Elevation2SE = 9.2;
rs.Elevation2SW = 2.1;
rs.FixedSun = true;
rs.ObjectBonus = 1.4;
rs.RestrictPushing = true;
rs.TerrainLowerLimit = 0.4;
rs.TerrainRaiseLimit = 17.9;
rs.TerrainTexture1 = UUID.Parse("00000000-0000-0000-0000-000000000020");
rs.TerrainTexture2 = UUID.Parse("00000000-0000-0000-0000-000000000040");
rs.TerrainTexture3 = UUID.Parse("00000000-0000-0000-0000-000000000060");
rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080");
rs.UseEstateSun = true;
rs.WaterHeight = 23;
tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs));
tar.Close();
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
lock (this)
{
scene.EventManager.OnOarFileLoaded += LoadCompleted;
archiverModule.DearchiveRegion(archiveReadStream);
}
Assert.That(m_lastErrorMessage, Is.Null);
RegionSettings loadedRs = scene.RegionInfo.RegionSettings;
Assert.That(loadedRs.AgentLimit, Is.EqualTo(17));
Assert.That(loadedRs.AllowDamage, Is.True);
Assert.That(loadedRs.AllowLandJoinDivide, Is.True);
Assert.That(loadedRs.AllowLandResell, Is.True);
Assert.That(loadedRs.BlockFly, Is.True);
Assert.That(loadedRs.BlockShowInSearch, Is.True);
Assert.That(loadedRs.BlockTerraform, Is.True);
Assert.That(loadedRs.DisableCollisions, Is.True);
Assert.That(loadedRs.DisablePhysics, Is.True);
Assert.That(loadedRs.DisableScripts, Is.True);
Assert.That(loadedRs.Elevation1NW, Is.EqualTo(15.9));
Assert.That(loadedRs.Elevation1NE, Is.EqualTo(45.3));
Assert.That(loadedRs.Elevation1SE, Is.EqualTo(49));
Assert.That(loadedRs.Elevation1SW, Is.EqualTo(1.9));
Assert.That(loadedRs.Elevation2NW, Is.EqualTo(4.5));
Assert.That(loadedRs.Elevation2NE, Is.EqualTo(19.2));
Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2));
Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1));
Assert.That(loadedRs.FixedSun, Is.True);
Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4));
Assert.That(loadedRs.RestrictPushing, Is.True);
Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4));
Assert.That(loadedRs.TerrainRaiseLimit, Is.EqualTo(17.9));
Assert.That(loadedRs.TerrainTexture1, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000020")));
Assert.That(loadedRs.TerrainTexture2, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000040")));
Assert.That(loadedRs.TerrainTexture3, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000060")));
Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080")));
Assert.That(loadedRs.UseEstateSun, Is.True);
Assert.That(loadedRs.WaterHeight, Is.EqualTo(23));
}
/// <summary> /// <summary>
/// Test merging a V0.2 OpenSim Region Archive into an existing scene /// Test merging a V0.2 OpenSim Region Archive into an existing scene
/// </summary> /// </summary>

View File

@ -3271,6 +3271,7 @@
<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="World/Archiver/Tests" pattern="*.cs" recurse="true" /> <Match path="World/Archiver/Tests" pattern="*.cs" recurse="true" />
<Match path="World/Archiver/Tests/Resources" pattern="*" buildAction="EmbeddedResource"/>
<Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" /> <Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" />
<Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" /> <Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" />
<Match path="ServiceConnectorsOut/Grid/Tests" pattern="*.cs" recurse="true" /> <Match path="ServiceConnectorsOut/Grid/Tests" pattern="*.cs" recurse="true" />