From 4ec4e16c809cf86a63b736d2b7b6ad7291595a5f Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Wed, 4 Jun 2008 09:59:27 +0000
Subject: Formatting cleanup, minor refactoring, svn properties.
---
OpenSim/Region/Application/OpenSimBackground.cs | 16 +-
.../Region/Communications/OGS1/OGS1GridServices.cs | 8 +-
.../Region/Communications/OGS1/OGS1UserServices.cs | 12 +-
.../Modules/Avatar/Chat/IRCBridgeModule.cs | 4 +-
.../Avatar/InstantMessage/InstantMessageModule.cs | 38 +-
.../Modules/World/Archiver/ArchiveReadRequest.cs | 48 +--
.../Modules/World/Archiver/ArchiveWriteRequest.cs | 20 +-
.../Modules/World/Archiver/TarArchiveReader.cs | 68 ++--
.../Modules/World/Serialiser/IRegionSerialiser.cs | 18 +-
.../Modules/World/Serialiser/SceneXmlLoader.cs | 16 +-
.../Modules/World/Serialiser/SerialiserModule.cs | 18 +-
OpenSim/Region/Environment/Scenes/InnerScene.cs | 2 +-
OpenSim/Region/Environment/Scenes/Scene.cs | 12 +-
OpenSim/Region/Environment/Scenes/SceneManager.cs | 6 +-
.../Region/Environment/Scenes/SceneObjectPart.cs | 2 +-
OpenSim/Region/Physics/Meshing/Extruder.cs | 27 +-
.../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 2 +-
.../DotNetEngine/Compiler/LSL/Compiler.cs | 10 +-
.../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 2 +-
.../DotNetEngine/Compiler/YieldProlog/Atom.cs | 22 +-
.../Compiler/YieldProlog/BagofAnswers.cs | 28 +-
.../Compiler/YieldProlog/FindallAnswers.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Functor.cs | 24 +-
.../DotNetEngine/Compiler/YieldProlog/Functor1.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Functor2.cs | 22 +-
.../DotNetEngine/Compiler/YieldProlog/Functor3.cs | 22 +-
.../Compiler/YieldProlog/IndexedAnswers.cs | 22 +-
.../DotNetEngine/Compiler/YieldProlog/ListPair.cs | 26 +-
.../DotNetEngine/Compiler/YieldProlog/Parser.cs | 20 +-
.../Compiler/YieldProlog/PrologException.cs | 20 +-
.../YieldProlog/UndefinedPredicateException.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/Variable.cs | 20 +-
.../DotNetEngine/Compiler/YieldProlog/YP.cs | 34 +-
.../Compiler/YieldProlog/YPCompiler.cs | 20 +-
.../ScriptEngine/XEngine/AsyncCommandManager.cs | 22 +-
.../XEngine/AsyncCommandPlugins/Dataserver.cs | 20 +-
.../XEngine/AsyncCommandPlugins/Eventstream.cs | 7 +-
.../XEngine/AsyncCommandPlugins/HttpRequest.cs | 2 +-
.../XEngine/AsyncCommandPlugins/SensorRepeat.cs | 20 +-
.../XEngine/AsyncCommandPlugins/Timer.cs | 8 +-
.../XEngine/AsyncCommandPlugins/XmlRequest.cs | 12 +-
OpenSim/Region/ScriptEngine/XEngine/Compiler.cs | 43 +--
.../Region/ScriptEngine/XEngine/EventManager.cs | 6 +-
OpenSim/Region/ScriptEngine/XEngine/Executor.cs | 3 +-
.../ScriptEngine/XEngine/LSL_ScriptCommands.cs | 300 ++++++++-------
.../XEngine/Script/AssemblyResolver.cs | 14 +-
.../XEngine/Script/BuiltIn_Commands_BaseClass.cs | 2 +-
.../ScriptEngine/XEngine/Script/LSL_Types.cs | 8 +-
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 420 ++++++++++-----------
49 files changed, 786 insertions(+), 770 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs
index 51a5b67..bfecf3b 100644
--- a/OpenSim/Region/Application/OpenSimBackground.cs
+++ b/OpenSim/Region/Application/OpenSimBackground.cs
@@ -31,20 +31,20 @@ using log4net;
using Nini.Config;
namespace OpenSim
-{
+{
///
/// Consoleless OpenSim region server
- ///
+ ///
public class OpenSimBackground : OpenSimBase
- {
+ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false);
-
+
public OpenSimBackground(IConfigSource configSource) : base(configSource)
{
}
-
+
///
/// Performs initialisation of the scene, such as loading configuration from disk.
///
@@ -65,8 +65,8 @@ namespace OpenSim
m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
WorldHasComeToAnEnd.WaitOne();
- }
-
+ }
+
///
/// Performs any last-minute sanity checking and shuts down the region server
///
@@ -75,6 +75,6 @@ namespace OpenSim
WorldHasComeToAnEnd.Set();
base.Shutdown();
- }
+ }
}
}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 0daabc5..85ab99c 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -624,14 +624,14 @@ namespace OpenSim.Region.Communications.OGS1
LLUUID agentID = LLUUID.Zero;
LLUUID RegionSecret = LLUUID.Zero;
Helpers.TryParse((string)requestData["agent_id"], out agentID);
- Helpers.TryParse((string)requestData["region_secret"], out RegionSecret);
+ Helpers.TryParse((string)requestData["region_secret"], out RegionSecret);
ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
-
+
m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret,message);
-
+
return new XmlRpcResponse();
}
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Communications.OGS1
try
{
ch = new TcpChannel((int)NetworkServersInfo.RemotingListenerPort);
- ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this.
+ ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesn't support this.
}
catch (Exception ex)
{
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index d486c40..a31570e 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -85,8 +85,8 @@ namespace OpenSim.Region.Communications.OGS1
(float) Convert.ToDecimal((string) data["home_look_z"]));
return userData;
- }
-
+ }
+
///
/// Get a user agent from the user server
///
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Communications.OGS1
{
userAgent.AgentOnline = false;
}
-
+
return userAgent;
}
catch (Exception e)
@@ -259,7 +259,7 @@ namespace OpenSim.Region.Communications.OGS1
XmlRpcRequest req = new XmlRpcRequest("update_user_current_region", parameters);
XmlRpcResponse resp;
-
+
try
{
resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
@@ -278,8 +278,8 @@ namespace OpenSim.Region.Communications.OGS1
return;
}
}
-
- if( resp == null )
+
+ if (resp == null)
{
m_log.Warn("[OSG1 USER SERVICES]: Got no response, Grid server may not be updated.");
return;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
index 7ee7eda..16fd753 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
@@ -644,7 +644,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (IOException)
{
- if (m_enabled)
+ if (m_enabled)
{
m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
Reconnect();
@@ -848,7 +848,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
public void Close()
{
- m_writer.WriteLine(String.Format("QUIT :{0} to {1} wormhole to {2} closing",
+ m_writer.WriteLine(String.Format("QUIT :{0} to {1} wormhole to {2} closing",
m_nick, m_channel, m_server));
m_writer.Flush();
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
index 36184d2..b22ca79 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
#region IRegionModule Members
private bool gridmode = false;
-
+
public void Initialise(Scene scene, IConfigSource config)
{
@@ -183,13 +183,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
}
}
-
+
}
// Trusty OSG1 called method. This method also gets called from the FriendsModule
// Turns out the sim has to send an instant message to the user to get it to show an accepted friend.
///
- ///
+ ///
///
///
private void OnGridInstantMessage(GridInstantMessage msg)
@@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
/// Process a XMLRPC Grid Instant Message
///
/// XMLRPC parameters from_agent_id from_agent_session to_agent_id im_session_id timestamp
- /// from_agent_name message dialog from_group offline parent_estate_id position_x position_y position_z region_id
+ /// from_agent_name message dialog from_group offline parent_estate_id position_x position_y position_z region_id
/// binary_bucket region_handle
/// Nothing much
protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request)
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
uint timestamp = 0;
string fromAgentName = "";
string message = "";
- byte dialog = (byte)0;
+ byte dialog = (byte)0;
bool fromGroup = false;
byte offline = (byte)0;
uint ParentEstateID=0;
@@ -237,14 +237,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
Hashtable requestData = (Hashtable)request.Params[0];
// Check if it's got all the data
- if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session")
- && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id")
- && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name")
- && requestData.ContainsKey("message") && requestData.ContainsKey("dialog")
- && requestData.ContainsKey("from_group")
- && requestData.ContainsKey("offline") && requestData.ContainsKey("parent_estate_id")
- && requestData.ContainsKey("position_x") && requestData.ContainsKey("position_y")
- && requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id")
+ if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session")
+ && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id")
+ && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name")
+ && requestData.ContainsKey("message") && requestData.ContainsKey("dialog")
+ && requestData.ContainsKey("from_group")
+ && requestData.ContainsKey("offline") && requestData.ContainsKey("parent_estate_id")
+ && requestData.ContainsKey("position_x") && requestData.ContainsKey("position_y")
+ && requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id")
&& requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle"))
{
// Do the easy way of validating the UUIDs
@@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
// Bytes don't transfer well over XMLRPC, so, we Base64 Encode them.
byte[] dialogdata = Convert.FromBase64String((string)requestData["dialog"]);
dialog = dialogdata[0];
-
+
if ((string)requestData["from_group"] == "TRUE")
fromGroup = true;
@@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
gim.Position = new sLLVector3(Position);
gim.binaryBucket = binaryBucket;
-
+
// Trigger the Instant message in the scene.
foreach (Scene scene in m_scenes)
{
@@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
}
}
//OnGridInstantMessage(gim);
-
+
}
//Send response back to region calling if it was successful
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
else
{
lookupAgent = true;
-
+
}
}
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
else
{
// try again, but lookup user this time.
- // Warning, this must call the Async version
+ // Warning, this must call the Async version
// of this method or we'll be making thousands of threads
// The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync
// The version that spawns the thread is SendGridInstantMessageViaXMLRPC
@@ -686,7 +686,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
if (msg.fromGroup)
gim["from_group"] = "TRUE";
- else
+ else
gim["from_group"] = "FALSE";
byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline;
gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None);
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 0c5edaa..6a3b519 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -41,10 +41,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
///
public class ArchiveReadRequest
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
-
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
+ protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
+
private Scene m_scene;
private string m_loadPath;
@@ -55,22 +55,22 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
DearchiveRegion();
}
-
+
protected void DearchiveRegion()
- {
+ {
TarArchiveReader archive = new TarArchiveReader(m_loadPath);
-
+
string serializedPrims = string.Empty;
-
+
// Just test for now by reading first file
string filePath = "ERROR";
-
+
byte[] data;
while ((data = archive.ReadEntry(out filePath)) != null)
- {
+ {
m_log.DebugFormat(
"[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath);
-
+
if (filePath.Equals(ArchiveConstants.PRIMS_PATH))
{
serializedPrims = m_asciiEncoding.GetString(data);
@@ -78,37 +78,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
else if (filePath.StartsWith(ArchiveConstants.TEXTURES_PATH))
{
// Right now we're nastily obtaining the lluuid from the filename
- string rawId = filePath.Remove(0, ArchiveConstants.TEXTURES_PATH.Length);
+ string rawId = filePath.Remove(0, ArchiveConstants.TEXTURES_PATH.Length);
rawId = rawId.Remove(rawId.Length - ArchiveConstants.TEXTURE_EXTENSION.Length);
-
+
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId);
-
+
// Not preserving asset name or description as of yet
AssetBase asset = new AssetBase(new LLUUID(rawId), "imported name");
asset.Description = "imported description";
-
+
asset.Type = (sbyte)AssetType.Texture;
asset.InvType = (sbyte)InventoryType.Texture;
-
+
asset.Data = data;
-
- m_scene.AssetCache.AddAsset(asset);
+
+ m_scene.AssetCache.AddAsset(asset);
}
}
-
- m_log.DebugFormat("[ARCHIVER]: Reached end of archive");
-
+
+ m_log.DebugFormat("[ARCHIVER]: Reached end of archive");
+
archive.Close();
-
+
if (serializedPrims.Equals(string.Empty))
{
m_log.ErrorFormat("[ARCHIVER]: Archive did not contain a {0} file", ArchiveConstants.PRIMS_PATH);
return;
}
-
+
// Reload serialized prims
m_log.InfoFormat("[ARCHIVER]: Loading prim data");
-
+
IRegionSerialiser serialiser = m_scene.RequestModuleInterface();
serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
index 1cc8877..6c341c6 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequest.cs
@@ -80,16 +80,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{
// XXX: Not a great way to iterate through face textures, but there's no
// other way to tell how many faces there actually are
- //int i = 0;
- foreach (LLObject.TextureEntryFace texture in part.Shape.Textures.FaceTextures)
- {
+ //int i = 0;
+ foreach (LLObject.TextureEntryFace texture in part.Shape.Textures.FaceTextures)
+ {
if (texture != null)
{
- //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
+ //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
textureUuids[texture.TextureID] = 1;
}
}
-
+
foreach (TaskInventoryItem tit in part.TaskInventory.Values)
{
if (tit.Type == (int)InventoryType.Texture)
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
TarArchiveWriter archive = new TarArchiveWriter();
archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities);
-
+
// It appears that gtar, at least, doesn't need the intermediate directory entries in the tar
//archive.AddDir("assets");
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
if (assets[uuid] != null)
{
archive.AddFile(
- ArchiveConstants.TEXTURES_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION,
+ ArchiveConstants.TEXTURES_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION,
assets[uuid].Data);
}
else
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
}
archive.WriteTar(m_savePath);
-
+
m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath);
}
@@ -232,11 +232,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
newThread.Start();
}
}
-
+
///
/// Perform the callback on the original requester of the assets
///
- protected void PerformAssetsRequestCallback()
+ protected void PerformAssetsRequestCallback()
{
m_assetsRequestCallback(m_assets);
}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
index b199d5f..463e172 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
@@ -39,24 +39,24 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public class TarArchiveReader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
-
+
+ protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
+
///
/// Binary reader for the underlying stream
///
protected BinaryReader m_br;
-
+
///
/// Used to trim off null chars
///
protected char[] m_nullCharArray = new char[] { '\0' };
-
+
public TarArchiveReader(string archivePath)
{
m_br = new BinaryReader(new FileStream(archivePath, FileMode.Open));
}
-
+
///
/// Are we at the end of the archive?
///
@@ -64,13 +64,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public bool AtEof()
{
// If we've reached the end of the archive we'll be in null block territory, which means
- // the next byte will be 0
+ // the next byte will be 0
if (m_br.PeekChar() == 0)
return true;
-
+
return false;
}
-
+
///
/// Read the next entry in the tar file.
///
@@ -79,27 +79,27 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public byte[] ReadEntry(out string filePath)
{
filePath = String.Empty;
-
+
if (AtEof())
return null;
-
- TarHeader header = ReadHeader();
-
+
+ TarHeader header = ReadHeader();
+
filePath = header.FilePath;
byte[] data = m_br.ReadBytes(header.FileSize);
-
- m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
-
- // Read the rest of the empty padding in the 512 byte block
+
+ m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
+
+ // Read the rest of the empty padding in the 512 byte block
if (header.FileSize % 512 != 0)
{
int paddingLeft = 512 - (header.FileSize % 512);
-
+
m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft);
m_br.ReadBytes(paddingLeft);
- }
-
+ }
+
return data;
}
@@ -109,44 +109,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
///
/// A tar header struct.
protected TarHeader ReadHeader()
- {
+ {
TarHeader tarHeader = new TarHeader();
-
+
byte[] header = m_br.ReadBytes(512);
-
+
tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100);
tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray);
tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11);
-
+
return tarHeader;
}
-
+
public void Close()
{
m_br.Close();
}
-
+
///
/// Convert octal bytes to a decimal representation
///
///
///
public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count)
- {
- string oString = m_asciiEncoding.GetString(bytes, startIndex, count);
-
+ {
+ string oString = m_asciiEncoding.GetString(bytes, startIndex, count);
+
int d = 0;
-
+
foreach (char c in oString)
{
- d <<= 3;
- d |= c - '0';
+ d <<= 3;
+ d |= c - '0';
}
return d;
- }
+ }
}
-
+
public struct TarHeader
{
public string FilePath;
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
index b7ed9f9..e0d2add 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/IRegionSerialiser.cs
@@ -34,30 +34,30 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
{
public interface IRegionSerialiser
{
- List SerialiseRegion(Scene scene, string saveDir);
-
+ List SerialiseRegion(Scene scene, string saveDir);
+
void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset);
-
+
void SavePrimsToXml(Scene scene, string fileName);
///
/// Load prims from the xml2 format
///
///
- ///
+ ///
void LoadPrimsFromXml2(Scene scene, string fileName);
-
+
///
/// Load prims from the xml2 format
///
///
- ///
+ ///
void LoadPrimsFromXml2(Scene scene, TextReader reader);
-
+
void SavePrimsToXml2(Scene scene, string fileName);
-
+
void LoadGroupFromXml2String(Scene scene, string xmlString);
-
+
string SavePrimGroupToXML2String(SceneObjectGroup grp);
}
}
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index 2ac0754..5ec8026 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -56,14 +56,14 @@ namespace OpenSim.Region.Environment.Scenes
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{
SceneObjectGroup obj = new SceneObjectGroup(scene, scene.RegionInfo.RegionHandle, aPrimNode.OuterXml);
-
+
if (newIDS)
{
obj.ResetIDs();
}
//if we want this to be a import method then we need new uuids for the object to avoid any clashes
//obj.RegenerateFullIDs();
-
+
scene.AddSceneObject(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Scenes
{
LoadPrimsFromXml2(scene, new XmlTextReader(fileName));
}
-
+
///
/// Load prims from the xml2 format
///
@@ -173,24 +173,24 @@ namespace OpenSim.Region.Environment.Scenes
///
///
protected static void LoadPrimsFromXml2(Scene scene, XmlTextReader reader)
- {
- XmlDocument doc = new XmlDocument();
+ {
+ XmlDocument doc = new XmlDocument();
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
reader.Close();
XmlNode rootNode = doc.FirstChild;
-
+
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{
CreatePrimFromXml(scene, aPrimNode.OuterXml);
- }
+ }
}
public static void CreatePrimFromXml(Scene scene, string xmlData)
{
SceneObjectGroup obj = new SceneObjectGroup(xmlData);
LLVector3 receivedVelocity = obj.RootPart.Velocity;
- //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
+ //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
scene.AddSceneObjectFromStorage(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index b181fe8..c7c8e39 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -86,42 +86,42 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
#endregion
#region IRegionSerialiser Members
-
+
public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset)
{
SceneXmlLoader.LoadPrimsFromXml(scene, fileName, newIDS, loadOffset);
}
-
+
public void SavePrimsToXml(Scene scene, string fileName)
{
SceneXmlLoader.SavePrimsToXml(scene, fileName);
}
-
+
public void LoadPrimsFromXml2(Scene scene, string fileName)
{
SceneXmlLoader.LoadPrimsFromXml2(scene, fileName);
}
-
+
public void LoadPrimsFromXml2(Scene scene, TextReader reader)
{
SceneXmlLoader.LoadPrimsFromXml2(scene, reader);
- }
-
+ }
+
public void SavePrimsToXml2(Scene scene, string fileName)
{
SceneXmlLoader.SavePrimsToXml2(scene, fileName);
}
-
+
public void LoadGroupFromXml2String(Scene scene, string xmlString)
{
SceneXmlLoader.LoadGroupFromXml2String(scene, xmlString);
}
-
+
public string SavePrimGroupToXML2String(SceneObjectGroup grp)
{
return SceneXmlLoader.SavePrimGroupToXML2String(grp);
}
-
+
public List SerialiseRegion(Scene scene, string saveDir)
{
List results = new List();
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 3ed4eb2..4c9257d 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -627,7 +627,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Get Methods
///
- /// Request a List of all scene presences in this scene. This is a new list, so no
+ /// Request a List of all scene presences in this scene. This is a new list, so no
/// locking is required to iterate over it.
///
///
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index c74dca4..e4fdc31 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1506,18 +1506,18 @@ namespace OpenSim.Region.Environment.Scenes
CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
}
-
+
public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
{
int primcrossingXMLmethod = 0;
if (newRegionHandle != 0)
{
bool successYN = false;
-
- successYN
+
+ successYN
= m_sceneGridService.PrimCrossToNeighboringRegion(
newRegionHandle, grp.UUID, m_serialiser.SavePrimGroupToXML2String(grp), primcrossingXMLmethod);
-
+
if (successYN)
{
// We remove the object here
@@ -1550,7 +1550,7 @@ namespace OpenSim.Region.Environment.Scenes
if (XMLMethod == 0)
{
m_serialiser.LoadGroupFromXml2String(this, objXMLData);
-
+
SceneObjectPart RootPrim = GetSceneObjectPart(primID);
if (RootPrim != null)
{
@@ -2091,7 +2091,7 @@ namespace OpenSim.Region.Environment.Scenes
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
}
}
-
+
}
///
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index dc9ac37..8fee27f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -83,8 +83,8 @@ namespace OpenSim.Region.Environment.Scenes
Dictionary sharedModules = new Dictionary();
for (int i = 0; i < m_localScenes.Count; i++)
{
- // extract known shared modules from scene
- foreach(string k in m_localScenes[i].Modules.Keys)
+ // extract known shared modules from scene
+ foreach (string k in m_localScenes[i].Modules.Keys)
{
if (m_localScenes[i].Modules[k].IsSharedModule &&
!sharedModules.ContainsKey(k))
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes
// all regions/scenes are now closed, we can now safely
// close all shared modules
- foreach(IRegionModule mod in sharedModules.Values)
+ foreach (IRegionModule mod in sharedModules.Values)
{
mod.Close();
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index de5da40..ce7497d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes
Vector3 normalpart = ipoint - vAbsolutePosition;
returnresult.normal = normalpart / normalpart.Length;
- // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesnt.
+ // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesn't.
// I can write a function to do it.. but I like the fact that this one is Static.
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z);
diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs
index 7203aaf..3941107 100644
--- a/OpenSim/Region/Physics/Meshing/Extruder.cs
+++ b/OpenSim/Region/Physics/Meshing/Extruder.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Physics.Meshing
v.X *= (size.X * taperTopFactorX);
v.Y *= (size.Y * taperTopFactorY);
v.Z *= size.Z;
-
+
//Push the top of the object over by the Top Shear amount
v.X += pushX * size.X;
v.Y += pushY * size.Y;
@@ -165,7 +165,7 @@ namespace OpenSim.Region.Physics.Meshing
for (int i = 0; i < workingMiddle.vertices.Count; i++)
{
- int iNext = (i + 1);
+ int iNext = i + 1;
if (workingMiddle.vertices[i] == null) // Can't make a simplex here
{
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Physics.Meshing
iLastNull = 0;
for (int i = 0; i < workingPlus.vertices.Count; i++)
{
- int iNext = (i + 1);
+ int iNext = i + 1;
if (workingPlus.vertices[i] == null) // Can't make a simplex here
{
@@ -261,7 +261,7 @@ namespace OpenSim.Region.Physics.Meshing
float twistTotal = twistTop - twistBot;
// if the profile has a lot of twist, add more layers otherwise the layers may overlap
- // and the resulting mesh may be quite inaccurate. This method is arbitrary and doesnt
+ // and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't
// accurately match the viewer
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 1.5f) steps *= 2;
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 3.0f) steps *= 2;
@@ -291,7 +291,6 @@ namespace OpenSim.Region.Physics.Meshing
+ " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString());
System.Console.WriteLine("Extruder: PathScaleX: " + pathScaleX.ToString() + " pathScaleY: " + pathScaleY.ToString());
#endif
-
bool done = false;
do // loop through the length of the path and add the layers
@@ -319,12 +318,16 @@ namespace OpenSim.Region.Physics.Meshing
// apply the taper to the profile before any rotations
if (xProfileScale != 1.0f || yProfileScale != 1.0f)
+ {
foreach (Vertex v in newLayer.vertices)
- if ( v != null )
+ {
+ if (v != null)
{
v.X *= xProfileScale;
v.Y *= yProfileScale;
}
+ }
+ }
float radiusScale;
@@ -332,8 +335,8 @@ namespace OpenSim.Region.Physics.Meshing
radiusScale = 1.0f - radius * percentOfPath;
else if (radius < 0.001f)
radiusScale = 1.0f + radius * (1.0f - percentOfPath);
- else radiusScale = 1.0f;
-
+ else
+ radiusScale = 1.0f;
#if SPAM
System.Console.WriteLine("Extruder: angle: " + angle.ToString() + " percentOfPath: " + percentOfPath.ToString()
@@ -379,10 +382,12 @@ namespace OpenSim.Region.Physics.Meshing
}
if (angle == startAngle) // the first layer, invert normals
+ {
foreach (Triangle t in newLayer.triangles)
{
t.invertNormal();
}
+ }
result.Append(newLayer);
@@ -397,7 +402,9 @@ namespace OpenSim.Region.Physics.Meshing
int iNext = (i + 1);
if (lastLayer.vertices[i] == null) // cant make a simplex here
+ {
iLastNull = i + 1;
+ }
else
{
if (i == count - 1) // End of list
@@ -413,17 +420,17 @@ namespace OpenSim.Region.Physics.Meshing
}
lastLayer = newLayer;
-
// calc the angle for the next interation of the loop
if (angle >= endAngle)
+ {
done = true;
+ }
else
{
angle = stepSize * ++step;
if (angle > endAngle)
angle = endAngle;
}
-
} while (!done); // loop until all the layers in the path are completed
// scale the mesh to the desired size
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index e5167aa..6a3f464 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.ScriptEngine.Common
///
- /// accepts a valid LLUUID, -or- a name of an inventory item.
+ /// accepts a valid LLUUID, -or- a name of an inventory item.
/// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found
/// in prim inventory.
///
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index abad59c..7113f1a 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -39,9 +39,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
public class Compiler
{
- private static readonly log4net.ILog m_log
+ private static readonly log4net.ILog m_log
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
+
// * Uses "LSL2Converter" to convert LSL to C# if necessary.
// * Compiles C#-code into an assembly
// * Returns assembly name ready for AppDomain load.
@@ -291,8 +291,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (enableCommanderLSL == true && l == enumCompileType.cs)
{
- foreach (KeyValuePair com
+ foreach (KeyValuePair com
in m_scriptEngine.World.GetCommanders())
{
compileScript = com.Value.GenerateRuntimeAPI() + compileScript;
@@ -318,7 +318,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code");
m_log.Debug("");
m_log.Debug(compileScript);
-
+
return CompileFromDotNetText(compileScript, l);
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
index 557c1c9..0bd3b0c 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
ListPair VFC = new ListPair(FunctionCode, new Variable());
//Console.WriteLine("-------------------------")
- //Console.WriteLine( FunctionCode.ToString())
+ //Console.WriteLine(FunctionCode.ToString())
//Console.WriteLine("-------------------------")
YPCompiler.convertFunctionCSharp(FunctionCode);
//YPCompiler.convertStringCodesCSharp(VFC);
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
index 7387ef4..0537f7d 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Atom.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * 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
+ *
+ * * 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
+ * * 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 copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -167,7 +167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
return _name.GetHashCode();
}
- public string toQuotedString()
+ public string toQuotedString()
{
if (_name.Length == 0)
return "''";
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
index 88ffdb7..250ad59 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2007-2008, Jeff Thompson
- *
+ *
* All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
+ *
+ * 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
+ *
+ * * 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
+ * * 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 copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
+ * * Neither the name of the copyright holder 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
new TermArrayEqualityComparer();
///
- /// To get the free variables, split off any existential qualifiers from Goal such as the X in
+ /// To get the free variables, split off any existential qualifiers from Goal such as the X in
/// "X ^ f(Y)", get the set of unbound variables in Goal that are not qualifiers, then remove
/// the unbound variables that are qualifiers as well as the unbound variables in Template.
///
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
UnqualifiedGoal = YP.getValue(((Functor2)UnqualifiedGoal)._arg2);
}
- // Remember how many non-free variables there are so we can find the unique free variables
+ // Remember how many non-free variables there are so we can find the unique free variables
// that are added.
int nNonFreeVariables = variableSet.Count;
YP.addUniqueVariables(UnqualifiedGoal, variableSet);
@@ -116,8 +116,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
///
/// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag.
///
- /// this is unified with the List