From f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 29 Sep 2009 08:32:59 +0900 Subject: Add copyright header. Formatting cleanup. --- OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLUserAccountData.cs | 2 +- OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 2 +- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 2 +- OpenSim/Data/MySQL/MySQLUserAccountData.cs | 2 +- OpenSim/Data/Null/NullRegionData.cs | 6 +-- .../ServiceConnectorsOut/Grid/RegionCache.cs | 29 ++++++++++++- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- .../Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 12 +++--- .../XmlRpcGroupsServicesConnectorModule.cs | 2 +- OpenSim/Region/Physics/Meshing/Mesh.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 50 ++++++++++------------ OpenSim/Server/Base/ServerUtils.cs | 2 +- OpenSim/Tests/Clients/Grid/GridClient.cs | 29 ++++++++++++- OpenSim/Tools/Compiler/Program.cs | 36 +++++++--------- 16 files changed, 113 insertions(+), 69 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs index 78fc22c..099faea 100644 --- a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs @@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm); insertBuilder.Append(String.Join("', '", fields)); - insertBuilder.Append("') values ( @principalID, @"); + insertBuilder.Append("') values (@principalID, @"); insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(")"); diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs index 1520888..e0c0ed6 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs @@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL StringBuilder insertBuilder = new StringBuilder(); insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm); insertBuilder.Append(String.Join("', '", fields)); - insertBuilder.Append("') values ( @principalID, @scopeID, @"); + insertBuilder.Append("') values (@principalID, @scopeID, @"); insertBuilder.Append(String.Join(", @", fields)); insertBuilder.Append(")"); diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index afd59bd..e508b52 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs @@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL { string insert = "insert into `" + m_Realm + "` (`UUID`, `" + String.Join("`, `", fields) + - "`) values ( ?principalID, ?" + String.Join(", ?", fields) + ")"; + "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; cmd.CommandText = insert; diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index 4a16a70..ed62172 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -773,7 +773,7 @@ namespace OpenSim.Data.MySQL "use_estate_sun, fixed_sun, sun_position, " + "covenant, Sandbox, sunvectorx, sunvectory, " + "sunvectorz, loaded_creation_datetime, " + - "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + + "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + "?BlockFly, ?AllowDamage, ?RestrictPushing, " + "?AllowLandResell, ?AllowLandJoinDivide, " + "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 5352727..d48144d 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs @@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL { string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + String.Join("`, `", fields) + - "`) values ( ?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; + "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; cmd.CommandText = insert; diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index 218fcd0..e8263ea 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs @@ -47,7 +47,7 @@ namespace OpenSim.Data.Null { List ret = new List(); - foreach(RegionData r in m_regionData.Values) + foreach (RegionData r in m_regionData.Values) { if (regionName.Contains("%")) { @@ -71,7 +71,7 @@ namespace OpenSim.Data.Null { List ret = new List(); - foreach(RegionData r in m_regionData.Values) + foreach (RegionData r in m_regionData.Values) { if (r.posX == posX && r.posY == posY) ret.Add(r); @@ -95,7 +95,7 @@ namespace OpenSim.Data.Null { List ret = new List(); - foreach(RegionData r in m_regionData.Values) + foreach (RegionData r in m_regionData.Values) { if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) ret.Add(r); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs index ea205a2..2b336bb 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs @@ -1,4 +1,31 @@ -using System; +/* + * 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; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 51bb114..ec262b0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3517,7 +3517,7 @@ if (m_shape != null) { } else { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like - // (mumbles, well, at least if you have infinte CPU powers :-) ) + // (mumbles, well, at least if you have infinte CPU powers :-)) PhysicsActor pa = this.PhysActor; if (pa != null) { diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 6b30959..c7bb56a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -260,12 +260,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice public void PostInitialise() { - if(m_pluginEnabled) + if (m_pluginEnabled) { - m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); - - // register the voice interface for this module, so the script engine can call us - m_scene.RegisterModuleInterface(this); + m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); + + // register the voice interface for this module, so the script engine can call us + m_scene.RegisterModuleInterface(this); } } @@ -811,7 +811,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice lock (m_ParcelAddress) { - if (m_ParcelAddress.ContainsKey( land.GlobalID.ToString() )) + if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString())) { m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}", land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 805c3d4..964d0bb 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -871,7 +871,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); - foreach( string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) + foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) { m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); } diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 7567556..aae8871 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs @@ -149,7 +149,7 @@ namespace OpenSim.Region.Physics.Meshing public float[] getVertexListAsFloatLocked() { - if( pinnedVirtexes.IsAllocated ) + if (pinnedVirtexes.IsAllocated) return (float[])(pinnedVirtexes.Target); float[] result; diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 0873035..56eb359 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -171,7 +171,7 @@ namespace OpenSim.Region.Physics.Meshing } - private ulong GetMeshKey( PrimitiveBaseShape pbs, PhysicsVector size, float lod ) + private ulong GetMeshKey(PrimitiveBaseShape pbs, PhysicsVector size, float lod) { ulong hash = 5381; diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 5a94957..fe26429 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -546,11 +546,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools bool retried = false; do { - lock (CScodeProvider) - { - results = CScodeProvider.CompileAssemblyFromSource( - parameters, Script); - } + lock (CScodeProvider) + { + results = CScodeProvider.CompileAssemblyFromSource( + parameters, Script); + } // Deal with an occasional segv in the compiler. // Rarely, if ever, occurs twice in succession. // Line # == 0 and no file name are indications that @@ -573,20 +573,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { complete = true; } - } - while(!complete); + } while (!complete); break; case enumCompileType.js: results = JScodeProvider.CompileAssemblyFromSource( - parameters, Script); + parameters, Script); break; case enumCompileType.yp: results = YPcodeProvider.CompileAssemblyFromSource( - parameters, Script); + parameters, Script); break; default: throw new Exception("Compiler is not able to recongnize "+ - "language type \"" + lang.ToString() + "\""); + "language type \"" + lang.ToString() + "\""); } // Check result @@ -602,12 +601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { foreach (CompilerError CompErr in results.Errors) { - - string severity = "Error"; - if (CompErr.IsWarning) - { - severity = "Warning"; - } + string severity = CompErr.IsWarning ? "Warning" : "Error"; KeyValuePair lslPos; @@ -615,18 +609,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools if (severity == "Error") { - lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); - string text = CompErr.ErrorText; - - // Use LSL type names - if (lang == enumCompileType.lsl) - text = ReplaceTypes(CompErr.ErrorText); - - // The Second Life viewer's script editor begins - // countingn lines and columns at 0, so we subtract 1. - errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", - lslPos.Key - 1, lslPos.Value - 1, - CompErr.ErrorNumber, text, severity); + lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); + string text = CompErr.ErrorText; + + // Use LSL type names + if (lang == enumCompileType.lsl) + text = ReplaceTypes(CompErr.ErrorText); + + // The Second Life viewer's script editor begins + // countingn lines and columns at 0, so we subtract 1. + errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", + lslPos.Key - 1, lslPos.Value - 1, + CompErr.ErrorNumber, text, severity); hadErrors = true; } } diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 656fcf5..db3a4ce 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -188,7 +188,7 @@ namespace OpenSim.Server.Base { string qstring = String.Empty; - foreach(KeyValuePair kvp in data) + foreach (KeyValuePair kvp in data) { string part; if (kvp.Value != String.Empty) diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs index ccda661..8798c5e 100644 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs @@ -1,4 +1,31 @@ -using System; +/* + * 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 System.Reflection; diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs index 9cd6bc8..b18e029 100644 --- a/OpenSim/Tools/Compiler/Program.cs +++ b/OpenSim/Tools/Compiler/Program.cs @@ -37,19 +37,19 @@ namespace OpenSim.Tools.LSL.Compiler class Program { private static Dictionary, KeyValuePair> m_positionMap; - private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); + private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); static void Main(string[] args) { - string source = null; + string source = null; - if(args.Length == 0) + if (args.Length == 0) { Console.WriteLine("No input file specified"); Environment.Exit(1); } - if(!File.Exists(args[0])) + if (!File.Exists(args[0])) { Console.WriteLine("Input file does not exist"); Environment.Exit(1); @@ -136,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler string errtext = String.Empty; foreach (CompilerError CompErr in results.Errors) { - string severity = "Error"; - if ( CompErr.IsWarning ) - { - severity = "Warning"; - } + string severity = CompErr.IsWarning ? "Warning" : "Error"; KeyValuePair lslPos; @@ -153,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler // The Second Life viewer's script editor begins // countingn lines and columns at 0, so we subtract 1. errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", - lslPos.Key - 1, lslPos.Value - 1, - CompErr.ErrorNumber, text, severity); + lslPos.Key - 1, lslPos.Value - 1, + CompErr.ErrorNumber, text, severity); } disp = "Completed with errors"; @@ -237,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler private static string ReplaceTypes(string message) { message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", - "string"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", + "string"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", - "integer"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", + "integer"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", - "float"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", + "float"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", - "list"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", + "list"); return message; } @@ -263,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler private class kvpSorter : IComparer> { public int Compare(KeyValuePair a, - KeyValuePair b) + KeyValuePair b) { return a.Key.CompareTo(b.Key); } -- cgit v1.1