Minor formatting cleanup.

0.6.0-stable
Jeff Ames 2008-06-18 03:50:39 +00:00
parent 7a11f6f1e2
commit a728417eda
5 changed files with 55 additions and 72 deletions

View File

@ -183,7 +183,7 @@ namespace OpenSim.Framework.Servers
switch (ShowWhat) switch (ShowWhat)
{ {
case "info": case "info":
Notice("Version: " + m_version ); Notice("Version: " + m_version);
Notice("Startup directory: " + m_startupDirectory); Notice("Startup directory: " + m_startupDirectory);
break; break;

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -37,7 +37,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// Method called when all the necessary assets for an archive request have been received. /// Method called when all the necessary assets for an archive request have been received.
/// </summary> /// </summary>
public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets); public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets);
/// <summary> /// <summary>
/// Execute the write of an archive once we have received all the necessary data /// Execute the write of an archive once we have received all the necessary data
/// </summary> /// </summary>
@ -46,14 +46,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected string m_savePath; protected string m_savePath;
protected string m_serializedEntities; protected string m_serializedEntities;
public ArchiveWriteRequestExecution(string serializedEntities, string savePath) public ArchiveWriteRequestExecution(string serializedEntities, string savePath)
{ {
m_serializedEntities = serializedEntities; m_serializedEntities = serializedEntities;
m_savePath = savePath; m_savePath = savePath;
} }
protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets) protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets)
{ {
m_log.DebugFormat("[ARCHIVER]: Received all {0} assets required", assets.Count); m_log.DebugFormat("[ARCHIVER]: Received all {0} assets required", assets.Count);
@ -61,13 +61,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
TarArchiveWriter archive = new TarArchiveWriter(); TarArchiveWriter archive = new TarArchiveWriter();
archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities); archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities);
AssetsArchiver assetsArchiver = new AssetsArchiver(assets); AssetsArchiver assetsArchiver = new AssetsArchiver(assets);
assetsArchiver.Archive(archive); assetsArchiver.Archive(archive);
archive.WriteTar(m_savePath); archive.WriteTar(m_savePath);
m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath);
} }
} }
} }

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -47,14 +47,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene; protected Scene m_scene;
protected string m_savePath; protected string m_savePath;
/// <summary> /// <summary>
/// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
/// asset was found by the asset service. /// asset was found by the asset service.
/// </summary> /// </summary>
protected AssetBase m_requestedObjectAsset; protected AssetBase m_requestedObjectAsset;
/// <summary> /// <summary>
/// Signal whether we are currently waiting for the asset service to deliver an asset. /// Signal whether we are currently waiting for the asset service to deliver an asset.
/// </summary> /// </summary>
@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
m_scene = scene; m_scene = scene;
m_savePath = savePath; m_savePath = savePath;
} }
/// <summary> /// <summary>
/// The callback made when we request the asset for an object from the asset service. /// The callback made when we request the asset for an object from the asset service.
/// </summary> /// </summary>
@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
Monitor.Pulse(this); Monitor.Pulse(this);
} }
} }
/// <summary> /// <summary>
/// Get all the asset uuids associated with a given object. This includes both those directly associated with /// Get all the asset uuids associated with a given object. This includes both those directly associated with
/// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained
@ -93,17 +93,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{ {
m_log.DebugFormat( m_log.DebugFormat(
"[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.RootPart.Name, sceneObject.UUID); "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.RootPart.Name, sceneObject.UUID);
foreach (SceneObjectPart part in sceneObject.GetParts()) foreach (SceneObjectPart part in sceneObject.GetParts())
{ {
m_log.DebugFormat( m_log.DebugFormat(
"[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
LLObject.TextureEntry textureEntry = part.Shape.Textures; LLObject.TextureEntry textureEntry = part.Shape.Textures;
// Get the prim's default texture. This will be used for faces which don't have their own texture // Get the prim's default texture. This will be used for faces which don't have their own texture
assetUuids[textureEntry.DefaultTexture.TextureID] = 1; assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
// XXX: Not a great way to iterate through face textures, but there's no // XXX: Not a great way to iterate through face textures, but there's no
// other method available to tell how many faces there actually are // other method available to tell how many faces there actually are
int i = 0; int i = 0;
@ -114,26 +114,26 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
assetUuids[texture.TextureID] = 1; assetUuids[texture.TextureID] = 1;
} }
} }
foreach (TaskInventoryItem tii in part.TaskInventory.Values) foreach (TaskInventoryItem tii in part.TaskInventory.Values)
{ {
if (!assetUuids.ContainsKey(tii.AssetID)) if (!assetUuids.ContainsKey(tii.AssetID))
{ {
assetUuids[tii.AssetID] = 1; assetUuids[tii.AssetID] = 1;
if (tii.Type != (int)InventoryType.Object) if (tii.Type != (int)InventoryType.Object)
{ {
m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID); m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
} }
else else
{ {
m_waitingForObjectAsset = true; m_waitingForObjectAsset = true;
m_scene.AssetCache.GetAsset(tii.AssetID, AssetRequestCallback, true); m_scene.AssetCache.GetAsset(tii.AssetID, AssetRequestCallback, true);
// The asset cache callback can either // The asset cache callback can either
// //
// 1. Complete on the same thread (if the asset is already in the cache) or // 1. Complete on the same thread (if the asset is already in the cache) or
// 2. Come in via a different thread (if we need to go fetch it). // 2. Come in via a different thread (if we need to go fetch it).
// //
// The code below handles both these alternatives. // The code below handles both these alternatives.
@ -141,11 +141,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{ {
if (m_waitingForObjectAsset) if (m_waitingForObjectAsset)
{ {
Monitor.Wait(this); Monitor.Wait(this);
m_waitingForObjectAsset = false; m_waitingForObjectAsset = false;
} }
} }
if (null != m_requestedObjectAsset) if (null != m_requestedObjectAsset)
{ {
string xml = Helpers.FieldToUTF8String(m_requestedObjectAsset.Data); string xml = Helpers.FieldToUTF8String(m_requestedObjectAsset.Data);
@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
} }
} }
} }
} }
public void ArchiveRegion() public void ArchiveRegion()
{ {
@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count);
// Asynchronously request all the assets required to perform this archive operation // Asynchronously request all the assets required to perform this archive operation
ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution(serializedEntities, m_savePath); ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution(serializedEntities, m_savePath);
new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute();
} }
} }

View File

@ -79,12 +79,12 @@ namespace OpenSim.Region.Environment.Scenes
private int m_timePhase = 24; private int m_timePhase = 24;
private readonly Mutex updateLock; private readonly Mutex updateLock;
/// <summary> /// <summary>
/// Are we applying physics to any of the prims in this scene? /// Are we applying physics to any of the prims in this scene?
/// </summary> /// </summary>
public bool m_physicalPrim; public bool m_physicalPrim;
public bool m_seeIntoRegionFromNeighbor; public bool m_seeIntoRegionFromNeighbor;
public int MaxUndoCount = 5; public int MaxUndoCount = 5;
private int m_RestartTimerCounter; private int m_RestartTimerCounter;
@ -410,7 +410,6 @@ namespace OpenSim.Region.Environment.Scenes
if (!CheckNeighborRegion(region)) if (!CheckNeighborRegion(region))
{ {
m_neighbours.Add(region); m_neighbours.Add(region);
} }
} }
} }
@ -430,9 +429,8 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
return found; return found;
} }
public virtual void Restart(float seconds) public virtual void Restart(float seconds)
{ {
// notifications are done in 15 second increments // notifications are done in 15 second increments
@ -779,17 +777,14 @@ namespace OpenSim.Region.Environment.Scenes
catch (AccessViolationException e) catch (AccessViolationException e)
{ {
m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
} }
catch (NullReferenceException e) catch (NullReferenceException e)
{ {
m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
} }
catch (InvalidOperationException e) catch (InvalidOperationException e)
{ {
m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
} }
catch (Exception e) catch (Exception e)
{ {
@ -873,7 +868,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public void Backup() public void Backup()
{ {
EventManager.TriggerOnBackup(m_storageManager.DataStore); EventManager.TriggerOnBackup(m_storageManager.DataStore);
m_backingup = false; m_backingup = false;
//return true; //return true;
} }
@ -1188,12 +1183,8 @@ namespace OpenSim.Region.Environment.Scenes
continue; continue;
LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
// Not sure why some of these are null, oh well.
// Not sure why some of these are null, oh well.
int colorr = 255 - (int)(texcolor.R * 255f); int colorr = 255 - (int)(texcolor.R * 255f);
int colorg = 255 - (int)(texcolor.G * 255f); int colorg = 255 - (int)(texcolor.G * 255f);
@ -1314,8 +1305,6 @@ namespace OpenSim.Region.Environment.Scenes
return; return;
} }
LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID;
int lastMapRefresh = 0; int lastMapRefresh = 0;
@ -1325,23 +1314,25 @@ namespace OpenSim.Region.Environment.Scenes
try try
{ {
lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh);
} catch (ArgumentException) }
{} catch (ArgumentException)
{
}
catch (FormatException) catch (FormatException)
{} {
}
catch (OverflowException) catch (OverflowException)
{} {
}
LLUUID TerrainImageLLUUID = LLUUID.Random(); LLUUID TerrainImageLLUUID = LLUUID.Random();
if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch())
{ {
m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); m_regInfo.SaveLastMapUUID(TerrainImageLLUUID);
m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE"); m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE");
//Extra protection.. probably not needed. //Extra protection.. probably not needed.
} }
else else
{ {
@ -1349,16 +1340,14 @@ namespace OpenSim.Region.Environment.Scenes
m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID");
} }
m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
AssetBase asset = new AssetBase(); AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID; asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.Data = data; asset.Data = data;
asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
asset.Description = RegionInfo.RegionName; asset.Description = RegionInfo.RegionName;
asset.Type = 0; asset.Type = 0;
asset.Temporary = temporary; asset.Temporary = temporary;
AssetCache.AddAsset(asset); AssetCache.AddAsset(asset);
@ -1379,22 +1368,23 @@ namespace OpenSim.Region.Environment.Scenes
lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh);
} }
catch (ArgumentException) catch (ArgumentException)
{ } {
}
catch (FormatException) catch (FormatException)
{ } {
}
catch (OverflowException) catch (OverflowException)
{ } {
}
LLUUID TerrainImageLLUUID = LLUUID.Random(); LLUUID TerrainImageLLUUID = LLUUID.Random();
if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch())
{ {
m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); m_regInfo.SaveLastMapUUID(TerrainImageLLUUID);
//m_log.Warn(terrainImageID); //m_log.Warn(terrainImageID);
//Extra protection.. probably not needed. //Extra protection.. probably not needed.
} }
else else
{ {
@ -1402,7 +1392,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID;
AssetBase asset = new AssetBase(); AssetBase asset = new AssetBase();
asset.FullID = m_regInfo.EstateSettings.terrainImageID; asset.FullID = m_regInfo.EstateSettings.terrainImageID;
asset.Data = data; asset.Data = data;
@ -1579,10 +1569,10 @@ namespace OpenSim.Region.Environment.Scenes
{ {
//m_log.DebugFormat( //m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName);
SceneObjectGroup sceneOb = SceneObjectGroup sceneOb =
new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
// if grass or tree, make phantom // if grass or tree, make phantom
//rootPart.TrimPermissions(); //rootPart.TrimPermissions();
@ -2980,9 +2970,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (controller.AgentId != godID) if (controller.AgentId != godID)
controller.Kick(Helpers.FieldToUTF8String(reason)); controller.Kick(Helpers.FieldToUTF8String(reason));
} }
); );
@ -3261,13 +3248,11 @@ namespace OpenSim.Region.Environment.Scenes
public void TriggerObjectChanged(uint localID, uint change) public void TriggerObjectChanged(uint localID, uint change)
{ {
m_eventManager.TriggerOnScriptChangedEvent(localID, change); m_eventManager.TriggerOnScriptChangedEvent(localID, change);
} }
public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos)
{ {
m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos);
} }
@ -3331,6 +3316,7 @@ namespace OpenSim.Region.Environment.Scenes
return false; return false;
} }
} }
public bool scriptDanger(uint localID, LLVector3 pos) public bool scriptDanger(uint localID, LLVector3 pos)
{ {
SceneObjectPart part = GetSceneObjectPart(localID); SceneObjectPart part = GetSceneObjectPart(localID);
@ -3351,7 +3337,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
LLVector3 pos = part.GetWorldPosition(); LLVector3 pos = part.GetWorldPosition();
return scriptDanger(part, pos); return scriptDanger(part, pos);
} }
else else
{ {
@ -3589,8 +3574,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
return visualParams; return visualParams;
} }
#endregion #endregion
} }
} }

View File

@ -765,8 +765,7 @@ namespace OpenSim.Region.ScriptEngine.Common
return new LSL_Types.Vector3( return new LSL_Types.Vector3(
SensedObject.AbsolutePosition.X, SensedObject.AbsolutePosition.X,
SensedObject.AbsolutePosition.Y, SensedObject.AbsolutePosition.Y,
SensedObject.AbsolutePosition.Y ); SensedObject.AbsolutePosition.Y);
} }
public LSL_Types.Quaternion llDetectedRot(int number) public LSL_Types.Quaternion llDetectedRot(int number)