From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- .../RemoteController/RemoteAdminPlugin.cs | 14 +- .../Rest/Inventory/RequestData.cs | 119 +- OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs | 24 +- .../Rest/Inventory/RestAssetServices.cs | 36 +- .../Rest/Inventory/RestHandler.cs | 65 +- .../Rest/Inventory/RestInventoryServices.cs | 300 ++-- .../Rest/Regions/RestRegionPlugin.cs | 4 +- OpenSim/Data/GridDataBase.cs | 2 +- OpenSim/Data/IGridData.cs | 4 +- OpenSim/Data/ILogData.cs | 2 +- OpenSim/Data/MSSQL/MSSQLAssetData.cs | 6 +- OpenSim/Data/MSSQL/MSSQLGridData.cs | 12 +- OpenSim/Data/MSSQL/MSSQLLogData.cs | 6 +- OpenSim/Data/MSSQL/MSSQLManager.cs | 8 +- OpenSim/Data/MSSQL/MSSQLUserData.cs | 18 +- OpenSim/Data/Migration.cs | 32 +- OpenSim/Data/MySQL/MySQLAssetData.cs | 8 +- OpenSim/Data/MySQL/MySQLEstateData.cs | 62 +- OpenSim/Data/MySQL/MySQLGridData.cs | 6 +- OpenSim/Data/MySQL/MySQLInventoryData.cs | 18 +- OpenSim/Data/MySQL/MySQLLogData.cs | 8 +- OpenSim/Data/MySQL/MySQLManager.cs | 18 +- OpenSim/Data/MySQL/MySQLRegionData.cs | 119 +- OpenSim/Data/NHibernate/LLQuaternionUserType.cs | 10 +- OpenSim/Data/NHibernate/LLVector3UserType.cs | 2 +- OpenSim/Data/NHibernate/NHibernateAssetData.cs | 6 +- OpenSim/Data/NHibernate/NHibernateManager.cs | 2 +- OpenSim/Data/NHibernate/NHibernateRegionData.cs | 36 +- OpenSim/Data/NHibernate/NHibernateUserData.cs | 26 +- OpenSim/Data/NHibernate/Terrain.cs | 20 +- OpenSim/Data/SQLite/SQLiteAssetData.cs | 18 +- OpenSim/Data/SQLite/SQLiteEstateData.cs | 22 +- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 52 +- OpenSim/Data/SQLite/SQLiteRegionData.cs | 50 +- OpenSim/Data/SQLite/SQLiteUserData.cs | 28 +- OpenSim/Data/UserDataBase.cs | 2 +- OpenSim/Framework/AvatarAppearance.cs | 2 +- OpenSim/Framework/Cache.cs | 4 +- .../Framework/Communications/Cache/AssetCache.cs | 14 +- .../Communications/Cache/AssetServerBase.cs | 10 +- .../Communications/Cache/CachedUserInfo.cs | 6 +- .../Communications/Cache/GridAssetClient.cs | 2 +- .../Communications/Cache/InventoryFolderImpl.cs | 34 +- .../Cache/UserProfileCacheService.cs | 2 +- .../Framework/Communications/Capabilities/Caps.cs | 4 +- .../Capabilities/LLSDRemoteParcelResponse.cs | 2 +- .../Communications/CommunicationsManager.cs | 32 +- OpenSim/Framework/Communications/IGridServices.cs | 6 +- .../IInterServiceInventoryServices.cs | 8 +- .../Framework/Communications/IInventoryServices.cs | 4 +- .../Communications/ISecureInventoryService.cs | 8 +- .../Communications/InventoryServiceBase.cs | 6 +- OpenSim/Framework/Communications/LoginService.cs | 9 +- .../Framework/Communications/UserManagerBase.cs | 4 +- .../Configuration/XML/XmlConfiguration.cs | 4 +- OpenSim/Framework/Console/ConsoleBase.cs | 4 +- OpenSim/Framework/Console/ConsolePluginCommand.cs | 20 +- OpenSim/Framework/Console/OpenSimAppender.cs | 4 +- OpenSim/Framework/IAssetProvider.cs | 2 +- OpenSim/Framework/IClientAPI.cs | 14 +- OpenSim/Framework/IInventoryData.cs | 2 +- OpenSim/Framework/IPlugin.cs | 8 +- OpenSim/Framework/IUserData.cs | 2 +- OpenSim/Framework/LandData.cs | 6 +- OpenSim/Framework/LandStatReportItem.cs | 2 +- OpenSim/Framework/PluginLoader.cs | 98 +- OpenSim/Framework/PrimitiveBaseShape.cs | 28 +- OpenSim/Framework/RegionCommsListener.cs | 6 +- OpenSim/Framework/RegionInfo.cs | 21 +- OpenSim/Framework/RegionSettings.cs | 68 +- OpenSim/Framework/Servers/BaseHttpServer.cs | 4 +- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 46 +- OpenSim/Framework/Servers/OSHttpHandler.cs | 16 +- OpenSim/Framework/Servers/OSHttpHttpHandler.cs | 10 +- OpenSim/Framework/Servers/OSHttpRequest.cs | 22 - OpenSim/Framework/Servers/OSHttpRequestPump.cs | 39 +- OpenSim/Framework/Servers/OSHttpRequestQueue.cs | 6 +- OpenSim/Framework/Servers/OSHttpResponse.cs | 74 +- OpenSim/Framework/Servers/OSHttpServer.cs | 8 +- OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs | 28 +- OpenSim/Framework/Servers/RestSessionService.cs | 4 +- OpenSim/Framework/Statistics/BaseStatsCollector.cs | 6 +- .../Framework/Statistics/SimExtraStatsCollector.cs | 46 +- OpenSim/Framework/TaskInventoryItem.cs | 4 +- OpenSim/Framework/Util.cs | 4 +- OpenSim/Grid/AssetServer/Main.cs | 8 +- .../OGS1/OGS1InterServiceInventoryService.cs | 6 +- OpenSim/Grid/GridServer/GridManager.cs | 12 +- OpenSim/Grid/GridServer/IGridPlugin.cs | 2 +- .../Grid/InventoryServer/GridInventoryService.cs | 14 +- OpenSim/Grid/InventoryServer/Main.cs | 2 +- .../ConnectToGridServerDialog.cs | 6 +- .../GridServerConnectionManager.cs | 16 +- .../Grid/Manager/OpenGridServices.Manager/Main.cs | 10 +- OpenSim/Grid/MessagingServer/Main.cs | 7 +- .../MessagingServer/PresenceBackreferenceEntry.cs | 2 +- OpenSim/Grid/ScriptServer/FakeScene.cs | 1 - OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 3 +- OpenSim/Grid/UserServer/Main.cs | 21 +- OpenSim/Grid/UserServer/UserLoginService.cs | 18 +- OpenSim/Grid/UserServer/UserManager.cs | 2 +- OpenSim/Region/Application/Application.cs | 2 +- OpenSim/Region/Application/IApplicationPlugin.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 92 +- OpenSim/Region/Application/OpenSimBase.cs | 50 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 66 +- .../ClientStack/LindenUDP/LLPacketHandler.cs | 14 +- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 18 +- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- .../Communications/Local/LocalBackEndServices.cs | 4 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 10 +- .../Region/Communications/OGS1/OGS1UserServices.cs | 10 +- .../Region/Environment/Interfaces/ICommander.cs | 2 - .../Environment/Interfaces/IRegionDataStore.cs | 4 +- .../Environment/Interfaces/ITerrainChannel.cs | 2 +- OpenSim/Region/Environment/ModuleLoader.cs | 2 +- .../TextureDownload/UserTextureDownloadService.cs | 8 +- .../Modules/Avatar/Friends/FriendsModule.cs | 6 +- .../Modules/Avatar/Groups/GroupsModule.cs | 10 +- .../DynamicTexture/DynamicTextureModule.cs | 8 +- .../Modules/Scripting/EMailModules/EmailModule.cs | 52 +- .../Modules/World/Archiver/ArchiveConstants.cs | 22 +- .../Modules/World/Archiver/ArchiveReadRequest.cs | 86 +- .../World/Archiver/ArchiveWriteRequestExecution.cs | 38 +- .../Archiver/ArchiveWriteRequestPreparation.cs | 54 +- .../Modules/World/Archiver/AssetsArchiver.cs | 42 +- .../Modules/World/Archiver/AssetsDearchiver.cs | 46 +- .../Modules/World/Archiver/AssetsRequest.cs | 10 +- .../Modules/World/Archiver/TarArchiveReader.cs | 12 +- .../Modules/World/Archiver/TarArchiveWriter.cs | 6 +- .../Modules/World/Estate/EstateManagementModule.cs | 18 +- .../Modules/World/Land/LandManagementModule.cs | 85 +- .../Environment/Modules/World/Land/LandObject.cs | 4 +- .../Environment/Modules/World/NPC/NPCAvatar.cs | 8 +- .../Modules/World/Permissions/PermissionsModule.cs | 2 +- .../Modules/World/Serialiser/SceneXmlLoader.cs | 14 +- .../Environment/Modules/World/Sun/SunModule.cs | 10 +- .../Modules/World/Terrain/FileLoaders/BMP.cs | 6 +- .../Modules/World/Terrain/FileLoaders/GIF.cs | 6 +- .../Terrain/FileLoaders/GenericSystemDrawing.cs | 12 +- .../Modules/World/Terrain/FileLoaders/JPEG.cs | 10 +- .../Modules/World/Terrain/FileLoaders/LLRAW.cs | 20 +- .../Modules/World/Terrain/FileLoaders/PNG.cs | 6 +- .../Modules/World/Terrain/FileLoaders/RAW32.cs | 14 +- .../Modules/World/Terrain/FileLoaders/TIFF.cs | 6 +- .../Modules/World/Terrain/FileLoaders/Terragen.cs | 10 +- .../Modules/World/Terrain/ITerrainModule.cs | 6 +- .../Modules/World/Terrain/TerrainModule.cs | 16 +- .../Modules/World/WorldMap/MapImageModule.cs | 12 +- .../Modules/World/WorldMap/WorldMapModule.cs | 35 +- OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 +- OpenSim/Region/Environment/Scenes/EventManager.cs | 32 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 42 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 73 +- OpenSim/Region/Environment/Scenes/Scene.cs | 82 +- .../Scenes/SceneCommunicationService.cs | 8 +- .../Environment/Scenes/SceneExternalChecks.cs | 1571 ++++++++++---------- .../Scenes/SceneObjectGroup.Inventory.cs | 8 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 78 +- .../Scenes/SceneObjectPart.Inventory.cs | 24 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 98 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 26 +- .../Region/Environment/Scenes/SimStatsReporter.cs | 2 +- OpenSim/Region/Environment/Scenes/UndoState.cs | 8 +- .../Region/Examples/SimpleModule/ComplexObject.cs | 2 - .../Examples/SimpleModule/CpuCounterObject.cs | 2 +- .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 2 +- OpenSim/Region/Physics/Manager/IMesher.cs | 1 - OpenSim/Region/Physics/Manager/PhysicsActor.cs | 2 - OpenSim/Region/Physics/Meshing/Extruder.cs | 26 +- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 +- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 12 +- OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 6 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 164 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 204 +-- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 24 +- .../AsyncCommandPlugins/Dataserver.cs | 2 +- .../Common/ScriptEngineBase/EventQueueManager.cs | 8 +- .../ScriptEngineBase/EventQueueThreadClass.cs | 2 +- .../ScriptEngine/Common/ScriptServerInterfaces.cs | 2 +- .../DotNetEngine/Compiler/LSL/Compiler.cs | 2 - .../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 2 +- .../Compiler/YieldProlog/IndexedAnswers.cs | 2 +- .../Compiler/YieldProlog/PrologException.cs | 28 +- .../DotNetEngine/Compiler/YieldProlog/YP.cs | 74 +- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 12 +- .../ScriptEngine/RemoteServer/EventManager.cs | 4 +- .../Shared/Api/Implementation/LSL_Api.cs | 226 +-- .../Api/Implementation/Plugins/Dataserver.cs | 2 +- .../Api/Implementation/Plugins/XmlRequest.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 2 +- .../Api/Runtime/YieldProlog/IndexedAnswers.cs | 2 +- .../Api/Runtime/YieldProlog/PrologException.cs | 28 +- .../Shared/Api/Runtime/YieldProlog/YP.cs | 74 +- .../Region/ScriptEngine/Shared/AssemblyResolver.cs | 4 +- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 2 - .../Shared/CodeTools/LSL2CSConverter.cs | 6 +- .../Shared/CodeTools/YP2CSConverter.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 22 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 6 +- OpenSim/TestSuite/BotManager.cs | 10 +- OpenSim/TestSuite/Main.cs | 10 +- OpenSim/Tests/Inventory/TestInventory.cs | 2 +- .../Tools/LaunchSLClient/LaunchSLClient/Form1.cs | 2 +- OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs | 2 +- OpenSim/Tools/pCampBot/BotManager.cs | 10 +- OpenSim/Tools/pCampBot/pCampBot.cs | 10 +- 208 files changed, 2966 insertions(+), 3149 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 256e862..c79122c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -56,8 +56,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController public string Version { get { return m_version; } } public string Name { get { return m_name; } } - public void Initialise() - { + public void Initialise() + { m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -512,7 +512,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController try { Hashtable requestData = (Hashtable) request.Params[0]; - + // check completeness checkStringParameters(request, new string[] { "password", "user_firstname", "user_lastname", "user_password" }); @@ -603,7 +603,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController try { Hashtable requestData = (Hashtable) request.Params[0]; - + // check completeness checkStringParameters(request, new string[] { "password", "user_firstname", "user_lastname" }); @@ -616,7 +616,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController string firstname = (string) requestData["user_firstname"]; string lastname = (string) requestData["user_lastname"]; - + string passwd = String.Empty; uint? regX = null; uint? regY = null; @@ -632,7 +632,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (null == userProfile) throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); - if (null != passwd) + if (null != passwd) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(passwd) + ":" + String.Empty); userProfile.PasswordHash = md5PasswdHash; @@ -648,7 +648,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController response.Value = responseData; - m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname, + m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname, userProfile.ID); } catch (Exception e) diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs index 94aecbd..6fc3ea3 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs @@ -23,7 +23,6 @@ * 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; @@ -44,14 +43,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// This class represents the current REST request. It - /// encapsulates the request/response state and takes care + /// encapsulates the request/response state and takes care /// of response generation without exposing the REST handler /// to the actual mechanisms involved. /// /// This structure is created on entry to the Handler /// method and is disposed of upon return. It is part of /// the plug-in infrastructure, rather than the functionally - /// specific REST handler, and fundamental changes to + /// specific REST handler, and fundamental changes to /// this should be reflected in the Rest HandlerVersion. The /// object is instantiated, and may be extended by, any /// given handler. See the inventory handler for an example @@ -100,7 +99,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal bool chunked = false; // Authentication related state - + internal bool authenticated = false; // internal string scheme = Rest.AS_DIGEST; // internal string scheme = Rest.AS_BASIC; @@ -132,7 +131,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private static readonly string[] EmptyPath = { String.Empty }; // Session related tables. These are only needed if QOP is set to "auth-sess" - // and for now at least, it is not. Session related authentication is of + // and for now at least, it is not. Session related authentication is of // questionable merit in the context of REST anyway, but it is, arguably, more // secure. @@ -148,27 +147,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private static Regex schema = new Regex("^\\s*(?\\w+)\\s*.*", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + private static Regex basicParms = new Regex("^\\s*(?:\\w+)\\s+(?\\S+)\\s*", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + private static Regex digestParm1 = new Regex("\\s*(?\\w+)\\s*=\\s*\"(?[^\"]+)\"", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + private static Regex digestParm2 = new Regex("\\s*(?\\w+)\\s*=\\s*(?[^\\p{P}\\s]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + private static Regex reuserPass = new Regex("(?[^:]+):(?[\\S\\s]*)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + // For efficiency, we create static instances of these objects private static MD5 md5hash = MD5.Create(); - + private static StringComparer sc = StringComparer.OrdinalIgnoreCase; // Constructor - + internal RequestData(OSHttpRequest p_request, OSHttpResponse p_response, string p_qprefix) { @@ -203,7 +202,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal bool IsAuthenticated { get - { + { if (Rest.Authenticate) { if (!authenticated) @@ -223,7 +222,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// Realm, domain, etc. /// /// This method checks to see if the current request is already - /// authenticated for this domain. If it is, then it returns + /// authenticated for this domain. If it is, then it returns /// true. If it is not, then it issues a challenge to the client /// and responds negatively to the request. /// @@ -243,7 +242,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.DebugFormat("{0} Challenge reason: No authorization data", MsgId); DoChallenge(); } - + // So, we have authentication data, now we have to check to // see what we got and whether or not it is valid for the // current domain. To do this we need to interpret the data @@ -327,7 +326,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory foreach (Match m in matches) { authparms.Add("response",m.Groups["pval"].Value); - Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}", + Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}", MsgId, "response", m.Groups["pval"].Value); } @@ -369,7 +368,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory foreach (Match m in matches) { authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); - Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}", + Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}", MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); } @@ -380,7 +379,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory foreach (Match m in matches) { authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value); - Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}", + Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}", MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value); } @@ -417,7 +416,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!authparms.TryGetValue("nonce", out nonce) || nonce == null) { - Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId); break; } @@ -428,7 +427,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { if (temp != opaque) { - Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId); break; } } @@ -440,7 +439,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { if (temp != algorithm) { - Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId); break; } } @@ -457,7 +456,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!authparms.ContainsKey("cnonce")) { - Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId); break; } @@ -465,7 +464,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!authparms.TryGetValue("nc", out nck) || nck == null) { - Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId); break; } @@ -477,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck)) { - Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId); break; } cntable[nonce] = nck; @@ -497,12 +496,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // these MUST NOT be present. if (authparms.ContainsKey("cnonce")) { - Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId); break; } if (authparms.ContainsKey("nc")) { - Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId); + Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId); break; } } @@ -511,7 +510,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory authenticated = ValidateDigest(userName, nonce, cnonce, nck, authPrefix, response); - } + } while (false); } @@ -608,7 +607,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } // We don;t know the userid that will be used - // so we cannot make any authentication domain + // so we cannot make any authentication domain // assumptions. So the prefix will determine // this. @@ -624,7 +623,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } /// - /// This method provides validation in support of the BASIC + /// This method provides validation in support of the BASIC /// authentication method. This is not normaly expected to be /// used, but is included for completeness (and because I tried /// it first). @@ -650,11 +649,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// This mechanism is used by the digest authetnication mechanism /// to return the user's password. In fact, because the OpenSim - /// user's passwords are already hashed, and the HTTP mechanism - /// does not supply an open password, the hashed passwords cannot + /// user's passwords are already hashed, and the HTTP mechanism + /// does not supply an open password, the hashed passwords cannot /// be used unless the cliemt has used the same salting mechanism - /// to has the password before using it in the authentication - /// algorithn. This is not inconceivable... + /// to has the password before using it in the authentication + /// algorithm. This is not inconceivable... /// private string getPassword(string user) @@ -665,12 +664,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory string last; // Distinguish the parts, if necessary - + if ((x=user.IndexOf(Rest.C_SPACE)) != -1) { first = user.Substring(0,x); last = user.Substring(x+1); - } + } else { first = user; @@ -712,12 +711,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory string last; // Distinguish the parts, if necessary - + if ((x=user.IndexOf(Rest.C_SPACE)) != -1) { first = user.Substring(0,x); last = user.Substring(x+1); - } + } else { first = user; @@ -733,9 +732,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory HA1 = HashToString(pass); HA1 = HashToString(String.Format("{0}:{1}",HA1,udata.PasswordSalt)); - + return (0 == sc.Compare(HA1, udata.PasswordHash)); - + } // Validate the request-digest @@ -784,7 +783,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory HA2 = HashToString(patt); // Generate Digest - + if (qop != String.Empty) { patt = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, nonce, nck, cnonce, qop, HA2); @@ -856,7 +855,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Fail(code, message, true); } - // More adventurous. This failure also includes a + // More adventurous. This failure also includes a // specified entity. internal void Fail(int code, string message, string data) @@ -899,7 +898,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory fail = true; Respond("Failure response"); - + RestException re = new RestException(message+" <"+code+">"); re.statusCode = code; @@ -918,7 +917,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Fail(Rest.HttpStatusCodeNotImplemented, Rest.HttpStatusDescNotImplemented); } - // This MUST be called by an agent handler before it returns + // This MUST be called by an agent handler before it returns // control to Handle, otherwise the request will be ignored. // This is called implciitly for the REST stream handlers and // is harmless if it is called twice. @@ -962,7 +961,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.DebugFormat("{0} XML Response handler extension EXIT", MsgId); } - // If buffer != null, then we assume that + // If buffer != null, then we assume that // this has already been done some other // way. For example, transfer encoding might // have been done. @@ -997,7 +996,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } - // Set the status code & description. If nothing has been stored, + // Set the status code & description. If nothing has been stored, // we consider that a success. if (statusCode == 0) @@ -1011,7 +1010,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // For a redirect we need to set the relocation header accordingly - if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect || + if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect || response.StatusCode == (int) Rest.HttpStatusCodePermanentRedirect) { Rest.Log.DebugFormat("{0} Re-direct location is {1}", MsgId, redirectLocation); @@ -1031,7 +1030,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // We've left the setting of handled' until the // last minute because the header settings included // above are pretty harmless. But everything from - // here on down probably leaves the response + // here on down probably leaves the response // element unusable by anyone else. handled = true; @@ -1046,7 +1045,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (buffer != null && buffer.Length != 0) { - Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>", + Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>", MsgId, buffer.Length, encoding.GetString(buffer)); response.OutputStream.Write(buffer, 0, buffer.Length); } @@ -1066,17 +1065,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Add a header to the table. We need to allow // multiple instances of many of the headers. - // If the + // If the internal void AddHeader(string hdr, string data) { if (Rest.DEBUG) { - Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>", + Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>", MsgId, hdr, data); if (response.Headers.Get(hdr) != null) { - Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>", + Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>", MsgId, hdr); } } @@ -1093,7 +1092,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.DebugFormat("{0} Removing header: <{1}>", MsgId, hdr); if (response.Headers.Get(hdr) == null) { - Rest.Log.DebugFormat("{0} No such header existed", + Rest.Log.DebugFormat("{0} No such header existed", MsgId, hdr); } } @@ -1110,7 +1109,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { for (int i=0;i - + // REST AGENT 1.0 interpretations public const string GET = "get"; // information retrieval - server state unchanged public const string HEAD = "head"; // same as get except only the headers are returned. @@ -138,7 +138,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public static readonly char C_PERIOD = '.'; public static readonly char C_COMMA = ','; public static readonly char C_DQUOTE = '"'; - + public static readonly string CS_SPACE = " "; public static readonly string CS_SLASH = "/"; public static readonly string CS_PATHSEP = "/"; @@ -147,7 +147,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public static readonly string CS_PERIOD = "."; public static readonly string CS_COMMA = ","; public static readonly string CS_DQUOTE = "\""; - + public static readonly char[] CA_SPACE = { C_SPACE }; public static readonly char[] CA_SLASH = { C_SLASH }; public static readonly char[] CA_PATHSEP = { C_PATHSEP }; @@ -311,7 +311,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public const string AS_DIGEST = "Digest"; /// Supported Digest algorithms - + public const string Digest_MD5 = "MD5"; // assumedd efault if omitted public const string Digest_MD5Sess = "MD5-sess"; @@ -359,7 +359,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory int val = 0; int sum = 0; string tmp = null; - + if (hex != null) { tmp = hex.ToLower(); @@ -446,20 +446,20 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { if (i % 4 == 0) Console.Write(" "); // if (i%16 == 0) Console.Write(" "); - Console.Write(" "); + Console.Write(" "); buffer[i % Rest.DumpLineSize] = ' '; } Console.WriteLine(" |"+(new String(buffer))+"|"); } else { - Console.Write("\n"); + Console.Write("\n"); } } } - + // Local exception type public class RestException : Exception @@ -470,8 +470,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal string httpmethod; internal string httppath; - public RestException(string msg) : base(msg) - { + public RestException(string msg) : base(msg) + { } } diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index b4eb7db..95b0ee3 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -23,7 +23,6 @@ * 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 libsecondlife; @@ -40,10 +39,8 @@ using OpenSim.Framework.Communications.Cache; namespace OpenSim.ApplicationPlugins.Rest.Inventory { - public class RestAssetServices : IRest { - private bool enabled = false; private string qPrefix = "assets"; @@ -52,7 +49,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public RestAssetServices() { - Rest.Log.InfoFormat("{0} Asset services initializing", MsgId); Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); @@ -73,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory enabled = true; Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId); - } // Post-construction, pre-enabled initialization opportunity @@ -84,7 +79,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } // Called by the plug-in to halt REST processing. Local processing is - // disabled, and control blocks until all current processing has + // disabled, and control blocks until all current processing has // completed. No new processing will be started public void Close() @@ -111,14 +106,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void DoAsset(RequestData rparm) { - - if (!enabled) return; + if (!enabled) + return; AssetRequestData rdata = (AssetRequestData) rparm; Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId); - // Now that we know this is a serious attempt to + // Now that we know this is a serious attempt to // access inventory data, we should find out who // is asking, and make sure they are authorized // to do so. We need to validate the caller's @@ -129,9 +124,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // With the present HTTP server we can't use the // builtin authentication mechanisms because they // would be enforced for all in-bound requests. - // Instead we look at the headers ourselves and + // Instead we look at the headers ourselves and // handle authentication directly. - + try { if (!rdata.IsAuthenticated) @@ -144,13 +139,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (e.statusCode == Rest.HttpStatusCodeNotAuthorized) { Rest.Log.WarnFormat("{0} User not authenticated", MsgId); - Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, + Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, rdata.request.Headers.Get("Authorization")); } else { Rest.Log.ErrorFormat("{0} User authentication failed", MsgId); - Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, + Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId, rdata.request.Headers.Get("Authorization")); } throw (e); @@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory case "post" : case "delete" : default : - Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}", + Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}", MsgId, rdata.method); rdata.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest); @@ -194,7 +189,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void DoGet(AssetRequestData rdata) { - bool istexture = false; Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method); @@ -204,13 +198,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (rdata.parameters.Length == 1) { - LLUUID uuid = new LLUUID(rdata.parameters[0]); AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture); if (asset != null) { - Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.parameters[0]); rdata.initXmlWriter(); @@ -227,19 +219,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); rdata.writer.WriteFullEndElement(); - } else { Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); - rdata.Fail(Rest.HttpStatusCodeNotFound, + rdata.Fail(Rest.HttpStatusCodeNotFound, Rest.HttpStatusDescNotFound); } } rdata.Complete(); rdata.Respond("Asset " + rdata.method + ": Normal completion"); - } private void DoPut(AssetRequestData rdata) @@ -257,7 +247,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!xml.ReadToFollowing("Asset")) { Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path); - rdata.Fail(Rest.HttpStatusCodeBadRequest, + rdata.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest); } @@ -275,13 +265,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory else { Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path); - rdata.Fail(Rest.HttpStatusCodeNotFound, + rdata.Fail(Rest.HttpStatusCodeNotFound, Rest.HttpStatusDescNotFound); } rdata.Complete(); rdata.Respond("Asset " + rdata.method + ": Normal completion"); - } internal class AssetRequestData : RequestData @@ -291,6 +280,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { } } - } } diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index 7bd83c1..7f4157c 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs @@ -23,7 +23,6 @@ * 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; @@ -37,7 +36,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { public class RestHandler : RestPlugin, IHttpAgentHandler { - /// /// The handler delegates are not noteworthy. The allocator allows /// a given handler to optionally subclass the base RequestData @@ -66,10 +64,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// This static initializer scans the ASSEMBLY for classes that /// export the IRest interface and builds a list of them. These - /// are later activated by the handler. To add a new handler it + /// are later activated by the handler. To add a new handler it /// is only necessary to create a new services class that implements /// the IRest interface, and recompile the handler. This gives - /// all of the build-time flexibility of a modular approach + /// all of the build-time flexibility of a modular approach /// while not introducing yet-another module loader. Note that /// multiple assembles can still be built, each with its own set /// of handlers. Examples of services classes are RestInventoryServices @@ -78,13 +76,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory static RestHandler() { - Module[] mods = Assembly.GetExecutingAssembly().GetModules(); foreach (Module m in mods) { Type[] types = m.GetTypes(); - foreach (Type t in types) + foreach (Type t in types) { try { @@ -100,7 +97,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } } } - } #endregion local static state @@ -109,13 +105,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// This routine loads all of the handlers discovered during - /// instance initialization. + /// instance initialization. /// A table of all loaded and successfully constructed handlers /// is built, and this table is then used by the constructor to /// initialize each of the handlers in turn. /// NOTE: The loading process does not automatically imply that - /// the handler has registered any kind of an interface, that - /// may be (optionally) done by the handler either during + /// the handler has registered any kind of an interface, that + /// may be (optionally) done by the handler either during /// construction, or during initialization. /// /// I was not able to make this code work within a constructor @@ -128,7 +124,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { if (!handlersLoaded) { - ConstructorInfo ci; Object ht; @@ -159,8 +154,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Name is used to differentiate the message header. - public override string Name - { + public override string Name + { get { return "HANDLER"; } } @@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // We have to rename these because we want // to be able to share the values with other - // classes in our assembly and the base + // classes in our assembly and the base // names are protected. internal string MsgId @@ -203,7 +198,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { try { - // This plugin will only be enabled if the broader // REST plugin mechanism is enabled. @@ -214,7 +208,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // IsEnabled is implemented by the base class and // reflects an overall RestPlugin status - if (!IsEnabled) + if (!IsEnabled) { Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId); return; @@ -263,15 +257,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.DumpLineSize); } - // Load all of the handlers present in the + // Load all of the handlers present in the // assembly // In principle, as we're an application plug-in, // most of what needs to be done could be done using - // static resources, however the Open Sim plug-in - // model makes this an instance, so that's what we + // static resources, however the Open Sim plug-in + // model makes this an instance, so that's what we // need to be. - // There is only one Communications manager per + // There is only one Communications manager per // server, and by inference, only one each of the // user, asset, and inventory servers. So we can cache // those using a static initializer. @@ -314,13 +308,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message); } - } /// /// In the interests of efficiency, and because we cannot determine whether /// or not this instance will actually be harvested, we clobber the only - /// anchoring reference to the working state for this plug-in. What the + /// anchoring reference to the working state for this plug-in. What the /// call to close does is irrelevant to this class beyond knowing that it /// can nullify the reference when it returns. /// To make sure everything is copacetic we make sure the primary interface @@ -329,7 +322,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public override void Close() { - Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId); try @@ -337,12 +329,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory RemoveAgentHandler(Rest.Name, this); } catch (KeyNotFoundException){} - + foreach (IRest handler in handlers) { handler.Close(); } - } #endregion overriding methods @@ -380,7 +371,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory return true; } } - } catch (Exception e) { @@ -414,7 +404,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory for (int i = 0; i < request.Headers.Count; i++) { - Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>", + Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>", MsgId, i, request.Headers.GetKey(i), request.Headers.Get(i)); } Rest.Log.DebugFormat("{0} URI: {1}", MsgId, request.RawUrl); @@ -425,8 +415,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory try { - handled = ( FindPathHandler(request, response) || - FindStreamHandler(request, response) ); + handled = FindPathHandler(request, response) || + FindStreamHandler(request, response); } catch (Exception e) { @@ -440,7 +430,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.DebugFormat("{0} EXIT", MsgId); return handled; - } #endregion interface methods @@ -488,7 +477,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } return rdata.handled; - } /// @@ -501,13 +489,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public void AddStreamHandler(string httpMethod, string path, RestMethod method) { - if (!IsEnabled) { return; } - if (!path.StartsWith(Rest.Prefix)) + if (!path.StartsWith(Rest.Prefix)) { path = String.Format("{0}{1}", Rest.Prefix, path); } @@ -525,7 +512,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path); } - } /// @@ -540,10 +526,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response) { - RequestData rdata = null; string bestMatch = null; - + if (!IsEnabled) { return false; @@ -566,7 +551,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!String.IsNullOrEmpty(bestMatch)) { - rdata = pathAllocators[bestMatch](request, response); Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch); @@ -575,7 +559,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { pathHandlers[bestMatch](rdata); } - + // A plugin generated error indicates a request-related error // that has been handled by the plugin. @@ -583,11 +567,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message); } - } return (rdata == null) ? false : rdata.handled; - } /// @@ -597,7 +579,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra) { - if (!IsEnabled) { return; @@ -619,8 +600,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory pathHandlers.Add(path, mh); pathAllocators.Add(path, ra); - } } - } diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 61c3ac4..0c107d5 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -23,7 +23,6 @@ * 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; @@ -42,10 +41,8 @@ using Nini.Config; namespace OpenSim.ApplicationPlugins.Rest.Inventory { - public class RestInventoryServices : IRest { - private bool enabled = false; private string qPrefix = "inventory"; @@ -56,11 +53,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public RestInventoryServices() { - Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId); Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version); - // If a relative path was specified for the handler's domain, + // If a relative path was specified for the handler's domain, // add the standard prefix to make it absolute, e.g. /admin if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) @@ -77,7 +73,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory enabled = true; Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId); - } /// @@ -91,7 +86,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// Called by the plug-in to halt REST processing. Local processing is - /// disabled, and control blocks until all current processing has + /// disabled, and control blocks until all current processing has /// completed. No new processing will be started /// @@ -134,7 +129,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void DoInventory(RequestData hdata) { - InventoryRequestData rdata = (InventoryRequestData) hdata; Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId); @@ -146,7 +140,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory return; } - // Now that we know this is a serious attempt to + // Now that we know this is a serious attempt to // access inventory data, we should find out who // is asking, and make sure they are authorized // to do so. We need to validate the caller's @@ -157,9 +151,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // With the present HTTP server we can't use the // builtin authentication mechanisms because they // would be enforced for all in-bound requests. - // Instead we look at the headers ourselves and + // Instead we look at the headers ourselves and // handle authentication directly. - + try { if (!rdata.IsAuthenticated) @@ -197,7 +191,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// Indicating that this is an inventory request for /// an avatar named Arthur Dent. This is ALl that is - /// required to designate a GET for an entire + /// required to designate a GET for an entire /// inventory. /// @@ -238,7 +232,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (rdata.userProfile != null) { - Rest.Log.DebugFormat("{0} Profile obtained for agent {1} {2}", + Rest.Log.DebugFormat("{0} Profile obtained for agent {1} {2}", MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); } else @@ -260,18 +254,18 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // response is not recieved in a timely fashion. rdata.uuid = rdata.userProfile.ID; - + if (Rest.InventoryServices.HasInventoryForUser(rdata.uuid)) { rdata.root = Rest.InventoryServices.RequestRootFolder(rdata.uuid); - Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}", + Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}", MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); Rest.InventoryServices.RequestInventoryForUser(rdata.uuid, rdata.GetUserInventory); - Rest.Log.DebugFormat("{0} Inventory catalog requested for {1} {2}", + Rest.Log.DebugFormat("{0} Inventory catalog requested for {1} {2}", MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); lock (rdata) @@ -284,15 +278,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (rdata.root == null) { - Rest.Log.DebugFormat("{0} Inventory is not available [1] for agent {1} {2}", + Rest.Log.DebugFormat("{0} Inventory is not available [1] for agent {1} {2}", MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); rdata.Fail(Rest.HttpStatusCodeServerError,Rest.HttpStatusDescServerError+": inventory retrieval failed"); } - } else { - Rest.Log.DebugFormat("{0} Inventory is not available for agent [3] {1} {2}", + Rest.Log.DebugFormat("{0} Inventory is not available for agent [3] {1} {2}", MsgId, rdata.userProfile.FirstName, rdata.userProfile.SurName); rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no inventory for user"); } @@ -302,7 +295,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory switch (rdata.method) { - case Rest.HEAD : // Do the processing, set the status code, suppress entity DoGet(rdata); rdata.buffer = null; @@ -325,13 +317,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory break; default : - Rest.Log.DebugFormat("{0} Method {1} not supported for {2}", + Rest.Log.DebugFormat("{0} Method {1} not supported for {2}", MsgId, rdata.method, rdata.path); rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, Rest.HttpStatusDescMethodNotAllowed+": "+rdata.method+" not supported"); - break; + break; } - } #endregion Interface @@ -346,12 +337,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void DoGet(InventoryRequestData rdata) { - rdata.initXmlWriter(); rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty); - // If there was only one parameter, then the entire + // If there was only one parameter, then the entire // inventory is being requested. if (rdata.parameters.Length == 1) @@ -361,7 +351,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // If there are additional parameters, then these represent // a path relative to the root of the inventory. This path - // must be traversed before we format the sub-tree thus + // must be traversed before we format the sub-tree thus // identified. else @@ -373,9 +363,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.Complete(); rdata.Respond("Inventory " + rdata.method + ": Normal completion"); - } - + /// /// In the case of the inventory, and probably in general, /// the distinction between PUT and POST is not always @@ -389,29 +378,28 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// The best way to exaplain the distinction is to /// consider the relationship between the URI and the /// entity in question. For POST, the URI identifies the - /// entity to be modified or replaced. - /// If the operation is PUT,then the URI describes the + /// entity to be modified or replaced. + /// If the operation is PUT,then the URI describes the /// context into which the new entity will be added. /// /// As an example, suppose the URI contains: /// /admin/inventory/Clothing /// /// A POST request will result in some modification of - /// the folder or item named "Clothing". Whereas a PUT - /// request will add some new information into the + /// the folder or item named "Clothing". Whereas a PUT + /// request will add some new information into the /// content identified by Clothing. It follows from this /// that for PUT, the element identified by the URI must /// be a folder. /// /// - /// PUT adds new information to the inventory in the + /// PUT adds new information to the inventory in the /// context identified by the URI. /// private void DoPut(InventoryRequestData rdata) { - // Resolve the context node specified in the URI. Entity // data will be ADDED beneath this node. @@ -419,11 +407,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Processing depends upon the type of inventory node // identified in the URI. This is the CONTEXT for the - // change. We either got a context or we threw an + // change. We either got a context or we threw an // exception. // It follows that we can only add information if the URI - // has identified a folder. So only a type of folder is supported + // has identified a folder. So only a type of folder is supported // in this case. if (typeof(InventoryFolderBase) == InventoryNode.GetType() || @@ -448,12 +436,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory XmlInventoryCollection entity = ReconstituteEntity(rdata); // Inlined assets can be included in entity. These must be incorporated into - // the asset database before we attempt to update the inventory. If anything + // the asset database before we attempt to update the inventory. If anything // fails, return a failure to requestor. if (entity.Assets.Count > 0) { - Rest.Log.DebugFormat("{0} Adding {1} assets to server", MsgId, entity.Assets.Count); @@ -467,9 +454,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Dump(asset.Data); } - } - } // Modify the context using the collection of folders and items @@ -477,7 +462,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory foreach (InventoryFolderBase folder in entity.Folders) { - InventoryFolderBase found; // If the parentID is zero, then this folder is going @@ -519,7 +503,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.DebugFormat("{0} Adding new folder", MsgId); Rest.InventoryServices.AddFolder(folder); } - } // Now we repeat a similar process for the items included @@ -527,7 +510,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory foreach (InventoryItemBase item in entity.Items) { - InventoryItemBase found = null; // If the parentID is zero, then this is going @@ -538,7 +520,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory item.Folder = context.ID; } - // Determine whether this is a new item or a + // Determine whether this is a new item or a // replacement definition. foreach (InventoryItemBase xi in rdata.items) @@ -563,9 +545,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory MsgId, item.ID, item.AssetID, item.InvType, item.AssetType, item.Name); Rest.InventoryServices.AddItem(item); } - } - } else { @@ -577,34 +557,32 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.Complete(); rdata.Respond("Inventory " + rdata.method + ": Normal completion"); - } /// /// POST updates the URI-identified element in the inventory. This /// is actually far more flexible than it might at first sound. For /// POST the URI serves two purposes: - /// [1] It identifies the user whose inventory is to be + /// [1] It identifies the user whose inventory is to be /// processed. /// [2] It optionally specifies a subtree of the inventory - /// that is to be used to resolve any relative subtree + /// that is to be used to resolve any relative subtree /// specifications in the entity. If nothing is specified /// then the whole inventory is implied. /// Please note that the subtree specified by the URI is only relevant /// to an entity containing a URI relative specification, i.e. one or - /// more elements do not specify parent folder information. These + /// more elements do not specify parent folder information. These /// elements will be implicitly referenced within the context identified /// by the URI. /// If an element in the entity specifies an explicit parent folder, then /// that parent is effective, regardless of any value specified in the /// URI. If the parent does not exist, then the element, and any dependent - /// elements, are ignored. This case is actually detected and handled + /// elements, are ignored. This case is actually detected and handled /// during the reconstitution process. /// private void DoPost(InventoryRequestData rdata) { - int count = 0; // Resolve the inventory node that is to be modified. @@ -612,8 +590,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); // As long as we have a node, then we have something - // meaningful to do, unlike PUT. So we reconstitute the - // subtree before doing anything else. Note that we + // meaningful to do, unlike PUT. So we reconstitute the + // subtree before doing anything else. Note that we // etiher got a valid node or we threw an exception. XmlInventoryCollection entity = ReconstituteEntity(rdata); @@ -639,7 +617,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Dump(asset.Data); } - } } @@ -648,15 +625,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// /// The root node in the entity will replace the node identified - /// by the URI. This means the parent will remain the same, but + /// by the URI. This means the parent will remain the same, but /// any or all attributes associated with the named element /// will change. /// /// If the inventory collection contains an element with a zero - /// parent ID, then this is taken to be the replacement for the - /// named node. The collection MAY also specify an explicit + /// parent ID, then this is taken to be the replacement for the + /// named node. The collection MAY also specify an explicit /// parent ID, in this case it MAY identify the same parent as - /// the current node, or it MAY specify a different parent, + /// the current node, or it MAY specify a different parent, /// indicating that the folder is being moved in addition to any /// other modifications being made. /// @@ -664,10 +641,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (typeof(InventoryFolderBase) == InventoryNode.GetType() || typeof(InventoryFolderImpl) == InventoryNode.GetType()) { - InventoryFolderBase uri = (InventoryFolderBase) InventoryNode; InventoryFolderBase xml = null; - + // Scan the set of folders in the entity collection for an // entry that matches the context folder. It is assumed that // the only reliable indicator of this is a zero UUID ( using @@ -676,7 +652,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // ambiguity in this case because this is POST and we are // supposed to be modifying a specific node. // We assign any element IDs required as an economy; we don't - // want to iterate over the fodler set again if it can be + // want to iterate over the fodler set again if it can be // helped. foreach (InventoryFolderBase folder in entity.Folders) @@ -701,29 +677,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.DebugFormat("{0} {1}: Request for <{2}> is ambiguous", MsgId, rdata.method, rdata.path); - rdata.Fail(Rest.HttpStatusCodeBadRequest, + rdata.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": context is ambiguous"); } // Exactly one entry means we ARE replacing the node // identified by the URI. So we delete the old folder // by moving it to the trash and then purging it. - // We then add all of the folders and items we + // We then add all of the folders and items we // included in the entity. The subtree has been // modified. if (count == 1) { - InventoryFolderBase TrashCan = GetTrashCan(rdata); uri.ParentID = TrashCan.ID; Rest.InventoryServices.MoveFolder(uri); Rest.InventoryServices.PurgeFolder(TrashCan); - } - // Now, regardelss of what they represent, we + // Now, regardelss of what they represent, we // integrate all of the elements in the entity. foreach (InventoryFolderBase f in entity.Folders) @@ -735,7 +709,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.InventoryServices.AddItem(it); } - } /// @@ -748,7 +721,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory else { - InventoryItemBase uri = (InventoryItemBase) InventoryNode; InventoryItemBase xml = null; @@ -756,7 +728,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.DebugFormat("{0} {1}: Request should not contain any folders <{2}>", MsgId, rdata.method, rdata.path); - rdata.Fail(Rest.HttpStatusCodeBadRequest, + rdata.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": folder is not allowed"); } @@ -764,12 +736,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.DebugFormat("{0} {1}: Entity contains too many items <{2}>", MsgId, rdata.method, rdata.path); - rdata.Fail(Rest.HttpStatusCodeBadRequest, + rdata.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": too may items"); } xml = entity.Items[0]; - + if (xml.ID == LLUUID.Zero) { xml.ID = LLUUID.Random(); @@ -786,12 +758,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Add the new item to the inventory Rest.InventoryServices.AddItem(xml); - } rdata.Complete(); rdata.Respond("Inventory " + rdata.method + ": Normal completion"); - } /// @@ -804,7 +774,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// /// Folders are deleted by moving them to another folder and then /// purging that folder. We'll do that by creating a temporary - /// sub-folder in the TrashCan and purging that folder's + /// sub-folder in the TrashCan and purging that folder's /// contents. If we can't can it, we don't delete it... /// So, if no trashcan is available, the request does nothing. /// Items are summarily deleted. @@ -816,13 +786,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void DoDelete(InventoryRequestData rdata) { - Object InventoryNode = getInventoryNode(rdata, rdata.root, 1); if (typeof(InventoryFolderBase) == InventoryNode.GetType() || typeof(InventoryFolderImpl) == InventoryNode.GetType()) { - InventoryFolderBase TrashCan = GetTrashCan(rdata); InventoryFolderBase folder = (InventoryFolderBase) InventoryNode; @@ -831,7 +799,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory folder.ParentID = TrashCan.ID; Rest.InventoryServices.MoveFolder(folder); Rest.InventoryServices.PurgeFolder(TrashCan); - } // Deleting items is much more straight forward. @@ -846,18 +813,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.Complete(); rdata.Respond("Inventory " + rdata.method + ": Normal completion"); - } -#endregion method-specific processing + #endregion method-specific processing /// /// This method is called to obtain the OpenSim inventory object identified /// by the supplied URI. This may be either an Item or a Folder, so a suitably - /// ambiguous return type is employed (Object). This method recurses as + /// ambiguous return type is employed (Object). This method recurses as /// necessary to process the designated hierarchy. - /// - /// If we reach the end of the URI then we return the contextural folder to + /// + /// If we reach the end of the URI then we return the contextural folder to /// our caller. /// /// If we are not yet at the end of the URI we attempt to find a child folder @@ -869,8 +835,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// Otherwise we fail the request on the ground of an invalid URI. /// /// - /// This mechanism cannot detect the case where duplicate subtrees satisfy a - /// request. In such a case the 1st element gets processed. If this is a + /// This mechanism cannot detect the case where duplicate subtrees satisfy a + /// request. In such a case the 1st element gets processed. If this is a /// problem, then UUID should be used to identify the end-node. This is basic /// premise of normal inventory processing. The name is an informational, and /// not a defining, attribute. @@ -880,7 +846,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private Object getInventoryNode(InventoryRequestData rdata, InventoryFolderBase folder, int pi) { - Rest.Log.DebugFormat("{0} Searching folder {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); // We have just run off the end of the parameter sequence @@ -894,17 +859,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // get us there. if (rdata.folders != null) + { foreach (InventoryFolderBase f in rdata.folders) { // Look for the present node in the directory list - if (f.ParentID == folder.ID && + if (f.ParentID == folder.ID && (f.Name == rdata.parameters[pi] || f.ID.ToString() == rdata.parameters[pi])) { return getInventoryNode(rdata, f, pi+1); } } - + } + // No folders that match. Perhaps this parameter identifies an item? If // it does, then it MUST also be the last name in the sequence. @@ -916,7 +883,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory InventoryItemBase li = null; foreach (InventoryItemBase i in rdata.items) { - if (i.Folder == folder.ID && + if (i.Folder == folder.ID && (i.Name == rdata.parameters[pi] || i.ID.ToString() == rdata.parameters[pi])) { @@ -944,11 +911,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.Fail(Rest.HttpStatusCodeNotFound, Rest.HttpStatusDescNotFound+": resource "+rdata.path+" not found"); return null; /* Never reached */ - } /// - /// This routine traverse the inventory's structure until the end-point identified + /// This routine traverse the inventory's structure until the end-point identified /// in the URI is reached, the remainder of the inventory (if any) is then formatted /// and returned to the requestor. /// @@ -961,14 +927,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void traverseInventory(InventoryRequestData rdata, InventoryFolderBase folder, int pi) { - Rest.Log.DebugFormat("{0} Folder : {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi); if (rdata.folders != null) { foreach (InventoryFolderBase f in rdata.folders) { - if (f.ParentID == folder.ID && + if (f.ParentID == folder.ID && (f.Name == rdata.parameters[pi] || f.ID.ToString() == rdata.parameters[pi])) { @@ -991,13 +956,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { foreach (InventoryItemBase i in rdata.items) { - if (i.Folder == folder.ID && + if (i.Folder == folder.ID && (i.Name == rdata.parameters[pi] || i.ID.ToString() == rdata.parameters[pi])) { // Fetching an Item has a special significance. In this // case we also want to fetch the associated asset. - // To make it interesting, we'll d this via redirection. + // To make it interesting, we'll d this via redirection. string asseturl = "http://" + rdata.hostname + ":" + rdata.port + "/admin/assets" + Rest.UrlPathSeparator + i.AssetID.ToString(); rdata.Redirect(asseturl,Rest.PERMANENT); @@ -1007,10 +972,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } } - Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>", + Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>", MsgId, rdata.path); rdata.Fail(Rest.HttpStatusCodeNotFound,Rest.HttpStatusDescNotFound+": no such item/folder"); - } /// @@ -1023,7 +987,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void formatInventory(InventoryRequestData rdata, InventoryFolderBase folder, string indent) { - if (Rest.DEBUG) { Rest.Log.DebugFormat("{0} Folder : {1} {2} {3}", MsgId, folder.ID, indent, folder.Name); @@ -1064,7 +1027,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // End folder item rdata.writer.WriteEndElement(); - } /// @@ -1073,7 +1035,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent) { - Rest.Log.DebugFormat("{0} Item : {1} {2} {3}", MsgId, i.ID, indent, i.Name); rdata.writer.WriteStartElement(String.Empty,"Item",String.Empty); @@ -1102,11 +1063,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.writer.WriteElementString("Asset",i.AssetID.ToString()); rdata.writer.WriteEndElement(); - } /// - /// This method creates a "trashcan" folder to support folder and item + /// This method creates a "trashcan" folder to support folder and item /// deletions by this interface. The xisting trash folder is found and /// this folder is created within it. It is called "tmp" to indicate to /// the client that it is OK to delete this folder. The REST interface @@ -1117,7 +1077,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private InventoryFolderBase GetTrashCan(InventoryRequestData rdata) { - InventoryFolderBase TrashCan = null; foreach (InventoryFolderBase f in rdata.folders) @@ -1144,16 +1103,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } } } - + if (TrashCan == null) { Rest.Log.DebugFormat("{0} No Trash Can available", MsgId); - rdata.Fail(Rest.HttpStatusCodeServerError, + rdata.Fail(Rest.HttpStatusCodeServerError, Rest.HttpStatusDescServerError+": unable to create trash can"); } return TrashCan; - } /// @@ -1163,11 +1121,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private bool FolderHasChanged(InventoryFolderBase newf, InventoryFolderBase oldf) { - return ( newf.Name != oldf.Name - || newf.ParentID != oldf.ParentID - || newf.Owner != oldf.Owner - || newf.Type != oldf.Type - || newf.Version != oldf.Version + return (newf.Name != oldf.Name + || newf.ParentID != oldf.ParentID + || newf.Owner != oldf.Owner + || newf.Type != oldf.Type + || newf.Version != oldf.Version ); } @@ -1178,24 +1136,24 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf) { - return ( newf.Name != oldf.Name - || newf.Folder != oldf.Description - || newf.Description != oldf.Description - || newf.Owner != oldf.Owner - || newf.Creator != oldf.Creator - || newf.AssetID != oldf.AssetID - || newf.GroupID != oldf.GroupID - || newf.GroupOwned != oldf.GroupOwned - || newf.InvType != oldf.InvType - || newf.AssetType != oldf.AssetType + return (newf.Name != oldf.Name + || newf.Folder != oldf.Description + || newf.Description != oldf.Description + || newf.Owner != oldf.Owner + || newf.Creator != oldf.Creator + || newf.AssetID != oldf.AssetID + || newf.GroupID != oldf.GroupID + || newf.GroupOwned != oldf.GroupOwned + || newf.InvType != oldf.InvType + || newf.AssetType != oldf.AssetType ); } /// /// This method is called by PUT and POST to create an XmlInventoryCollection /// instance that reflects the content of the entity supplied on the request. - /// Any elements in the completed collection whose UUID is zero, are - /// considered to be located relative to the end-point identified int he + /// Any elements in the completed collection whose UUID is zero, are + /// considered to be located relative to the end-point identified int he /// URI. In this way, an entire sub-tree can be conveyed in a single REST /// PUT or POST request. /// @@ -1203,26 +1161,24 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory /// has an entity, it is more completely initialized. thus, if no entity was /// provided the collection is valid, but empty. /// - /// The entity is then scanned and each tag is processed to produce the + /// The entity is then scanned and each tag is processed to produce the /// appropriate inventory elements. At the end f the scan, teh XmlInventoryCollection /// will reflect the subtree described by the entity. /// /// This is a very flexible mechanism, the entity may contain arbitrary, /// discontiguous tree fragments, or may contain single element. The caller is - /// responsible for integrating this collection (and ensuring that any + /// responsible for integrating this collection (and ensuring that any /// missing parent IDs are resolved). /// internal XmlInventoryCollection ReconstituteEntity(InventoryRequestData rdata) { - Rest.Log.DebugFormat("{0} Reconstituting entity", MsgId); XmlInventoryCollection ic = new XmlInventoryCollection(); if (rdata.request.HasEntityBody) { - Rest.Log.DebugFormat("{0} Entity present", MsgId); ic.init(rdata); @@ -1318,7 +1274,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Rest.Log.WarnFormat("{0} Unexpected XML parsing error: {1}", MsgId, e.Message); throw e; } - } else { @@ -1334,14 +1289,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } return ic; - } /// /// This method creates an inventory Folder from the /// information supplied in the request's entity. - /// A folder instance is created and initialized to reflect - /// default values. These values are then overridden + /// A folder instance is created and initialized to reflect + /// default values. These values are then overridden /// by information supplied in the entity. /// If context was not explicitly provided, then the /// appropriate ID values are determined. @@ -1349,7 +1303,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void CollectFolder(XmlInventoryCollection ic) { - Rest.Log.DebugFormat("{0} Interpret folder element", MsgId); InventoryFolderBase result = new InventoryFolderBase(); @@ -1389,7 +1342,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory result.Version = UInt16.Parse(ic.xml.Value); break; default : - Rest.Log.DebugFormat("{0} Folder: unrecognized attribute: {1}:{2}", + Rest.Log.DebugFormat("{0} Folder: unrecognized attribute: {1}:{2}", MsgId, ic.xml.Name, ic.xml.Value); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": unrecognized attribute"); @@ -1411,7 +1364,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } else { - bool found = false; foreach (InventoryFolderBase parent in ic.rdata.folders) @@ -1425,7 +1377,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!found) { - Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in folder {2}", + Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in folder {2}", MsgId, ic.Item.Folder, result.ID); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": invalid parent"); @@ -1445,15 +1397,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // obsolete as a consequence. ic.Push(result); - } /// /// This method is called to handle the construction of an Item - /// instance from the supplied request entity. It is called + /// instance from the supplied request entity. It is called /// whenever an Item start tag is detected. /// An instance of an Item is created and initialized to default - /// values. These values are then overridden from values supplied + /// values. These values are then overridden from values supplied /// as attributes to the Item element. /// This item is then stored in the XmlInventoryCollection and /// will be verified by Validate. @@ -1463,7 +1414,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void CollectItem(XmlInventoryCollection ic) { - Rest.Log.DebugFormat("{0} Interpret item element", MsgId); InventoryItemBase result = new InventoryItemBase(); @@ -1484,7 +1434,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { for (int i = 0; i < ic.xml.AttributeCount; i++) { - ic.xml.MoveToAttribute(i); switch (ic.xml.Name) @@ -1533,37 +1482,36 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory break; default : - Rest.Log.DebugFormat("{0} Item: Unrecognized attribute: {1}:{2}", + Rest.Log.DebugFormat("{0} Item: Unrecognized attribute: {1}:{2}", MsgId, ic.xml.Name, ic.xml.Value); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": unrecognized attribute"); break; } } - } - + } + ic.xml.MoveToElement(); ic.Push(result); - } /// - /// This method assembles an asset instance from the - /// information supplied in the request's entity. It is - /// called as a result of detecting a start tag for a + /// This method assembles an asset instance from the + /// information supplied in the request's entity. It is + /// called as a result of detecting a start tag for a /// type of Asset. /// The information is collected locally, and an asset /// instance is created only if the basic XML parsing /// completes successfully. - /// Default values for all parts of the asset are + /// Default values for all parts of the asset are /// established before overriding them from the supplied /// XML. /// If an asset has inline=true as an attribute, then /// the element contains the data representing the /// asset. This is saved as the data component. /// inline=false means that the element's payload is - /// simply the UUID of the asset referenced by the + /// simply the UUID of the asset referenced by the /// item being constructed. /// An asset, if created is stored in the /// XmlInventoryCollection @@ -1624,7 +1572,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory break; default : - Rest.Log.DebugFormat("{0} Asset: Unrecognized attribute: {1}:{2}", + Rest.Log.DebugFormat("{0} Asset: Unrecognized attribute: {1}:{2}", MsgId, ic.xml.Name, ic.xml.Value); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest); @@ -1637,7 +1585,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // If this is a reference to an existing asset, just store the // asset ID into the item. - + if (!inline) { if (ic.Item != null) @@ -1653,13 +1601,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } } - // Otherwise, generate an asset ID, store that into the item, and + // Otherwise, generate an asset ID, store that into the item, and // create an entry in the asset list for the inlined asset. But // only if the size is non-zero. else { - string b64string = null; // Generate a UUID of none were given, and generally none should @@ -1672,17 +1619,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Create AssetBase entity to hold the inlined asset - asset = new AssetBase(uuid, name); + asset = new AssetBase(uuid, name); asset.Description = desc; asset.Type = type; // type == 0 == texture asset.Local = local; asset.Temporary = temp; - + b64string = ic.xml.ReadElementContentAsString(); Rest.Log.DebugFormat("{0} Data length is {1}", MsgId, b64string.Length); - Rest.Log.DebugFormat("{0} Data content starts with: \n\t<{1}>", MsgId, + Rest.Log.DebugFormat("{0} Data content starts with: \n\t<{1}>", MsgId, b64string.Substring(0, b64string.Length > 132 ? 132 : b64string.Length)); asset.Data = Convert.FromBase64String(b64string); @@ -1701,22 +1648,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { ic.Item.AssetID = uuid; } - } ic.Push(asset); - } /// /// Store any permissions information provided by the request. - /// This overrides the default permissions set when the + /// This overrides the default permissions set when the /// XmlInventoryCollection object was created. /// private void CollectPermissions(XmlInventoryCollection ic) { - if (ic.xml.HasAttributes) { for (int i = 0; i < ic.xml.AttributeCount; i++) @@ -1747,7 +1691,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } ic.xml.MoveToElement(); - } /// @@ -1762,7 +1705,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void Validate(XmlInventoryCollection ic) { - // There really should be an item present if we've // called validate. So fail if there is not. @@ -1772,7 +1714,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": request parse error"); } - + // Every item is required to have a name (via REST anyway) if (ic.Item.Name == String.Empty) @@ -1781,19 +1723,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": item name required"); } - - // An item MUST have an asset ID. AssetID should never be zero + + // An item MUST have an asset ID. AssetID should never be zero // here. It should always get set from the information stored // when the Asset element was processed. if (ic.Item.AssetID == LLUUID.Zero) { - Rest.Log.ErrorFormat("{0} Unable to complete request", MsgId); Rest.Log.InfoFormat("{0} Asset information is missing", MsgId); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": asset information required"); - } // If the item is new, then assign it an ID @@ -1806,19 +1746,18 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // If the context is being implied, obtain the current // folder item's ID. If it was specified explicitly, make // sure that theparent folder exists. - + if (ic.Item.Folder == LLUUID.Zero) { ic.Item.Folder = ic.Parent(); } else { - bool found = false; foreach (InventoryFolderBase parent in ic.rdata.folders) { - if ( parent.ID == ic.Item.Folder ) + if (parent.ID == ic.Item.Folder) { found = true; break; @@ -1827,12 +1766,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (!found) { - Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in item {2}", + Rest.Log.ErrorFormat("{0} Invalid parent ID ({1}) in item {2}", MsgId, ic.Item.Folder, ic.Item.ID); ic.Fail(Rest.HttpStatusCodeBadRequest, Rest.HttpStatusDescBadRequest+": parent information required"); } - } // If this is an inline asset being constructed in the context @@ -1854,13 +1792,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory ic.Item.NextPermissions = ic.NextPermissions; // If no type was specified for this item, we can attempt to - // infer something from the file type maybe. This is NOT as + // infer something from the file type maybe. This is NOT as // good as having type be specified in the XML. if (ic.Item.AssetType == (int) AssetType.Unknown || ic.Item.InvType == (int) AssetType.Unknown) { - Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId); string[] parts = ic.Item.Name.Split(Rest.CA_PERIOD); @@ -1880,7 +1817,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory if (parts.Length > 1) { - Rest.Log.DebugFormat("{0} File type is {1}", + Rest.Log.DebugFormat("{0} File type is {1}", MsgId, parts[parts.Length - 1]); switch (parts[parts.Length - 1]) { @@ -1888,7 +1825,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory case "jpeg-2000" : case "jpg2000" : case "jpg-2000" : - Rest.Log.DebugFormat("{0} Type {1} inferred", + Rest.Log.DebugFormat("{0} Type {1} inferred", MsgId, parts[parts.Length-1]); if (ic.Item.AssetType == (int) AssetType.Unknown) ic.Item.AssetType = (int) AssetType.ImageJPEG; @@ -1897,7 +1834,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory break; case "jpg" : case "jpeg" : - Rest.Log.DebugFormat("{0} Type {1} inferred", + Rest.Log.DebugFormat("{0} Type {1} inferred", MsgId, parts[parts.Length - 1]); if (ic.Item.AssetType == (int) AssetType.Unknown) ic.Item.AssetType = (int) AssetType.ImageJPEG; @@ -1938,16 +1875,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory temp = OpenJPEGNet.LoadTGAClass.LoadTGA(tgadata); ic.Asset.Data = OpenJPEGNet.OpenJPEG.EncodeFromImage(temp, true); } - - ic.reset(); + ic.reset(); } #region Inventory RequestData extension internal class InventoryRequestData : RequestData { - /// /// These are the inventory specific request/response state /// extensions. @@ -1965,7 +1900,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory } /// - /// This is the callback method required by inventory services. The + /// This is the callback method required by inventory services. The /// requestor issues an inventory request and then blocks until this /// method signals the monitor. /// @@ -1981,7 +1916,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory Monitor.Pulse(this); } } - } #endregion Inventory RequestData extension @@ -1994,7 +1928,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory internal class XmlInventoryCollection : InventoryCollection { - internal InventoryRequestData rdata; private Stack stk; @@ -2087,7 +2020,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { rdata.Fail(code, desc); } - } } } diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs index 5ec2526..1f68d2b 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/RestRegionPlugin.cs @@ -57,7 +57,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions _xmlNs = new XmlSerializerNamespaces(); _xmlNs.Add(String.Empty, String.Empty); } - + #region overriding properties public override string Name { @@ -90,7 +90,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions return; } m_log.InfoFormat("{0} REST region plugin enabled", MsgID); - + // add REST method handlers AddRestStreamHandler("GET", "/regions/", GetHandler); AddRestStreamHandler("POST", "/regions/", PostHandler); diff --git a/OpenSim/Data/GridDataBase.cs b/OpenSim/Data/GridDataBase.cs index 6480f84..0b56d07 100644 --- a/OpenSim/Data/GridDataBase.cs +++ b/OpenSim/Data/GridDataBase.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data public abstract DataResponse AddProfile(RegionProfileData profile); public abstract ReservationData GetReservationAtPoint(uint x, uint y); public abstract DataResponse UpdateProfile(RegionProfileData profile); - + public abstract void Initialise(); public abstract void Initialise(string connect); public abstract void Dispose(); diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs index 146288f..c77bbb7 100644 --- a/OpenSim/Data/IGridData.cs +++ b/OpenSim/Data/IGridData.cs @@ -47,7 +47,7 @@ namespace OpenSim.Data /// Initialises the interface /// void Initialise(string connect); - + /// /// Returns a sim profile from a regionHandle /// @@ -100,7 +100,7 @@ namespace OpenSim.Data ReservationData GetReservationAtPoint(uint x, uint y); } - + public class GridDataInitialiser : PluginInitialiserBase { private string connect; diff --git a/OpenSim/Data/ILogData.cs b/OpenSim/Data/ILogData.cs index cfbee88..e22fe06 100644 --- a/OpenSim/Data/ILogData.cs +++ b/OpenSim/Data/ILogData.cs @@ -73,7 +73,7 @@ namespace OpenSim.Data /// void Initialise(string connect); } - + public class LogDataInitialiser : PluginInitialiserBase { private string connect; diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 443907f..e10e3aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -63,7 +63,7 @@ namespace OpenSim.Data.MSSQL database.ExecuteResourceSql("CreateAssetsTable.sql"); return; } - + } /// @@ -230,7 +230,7 @@ namespace OpenSim.Data.MSSQL } /// - /// Database provider version. + /// Database provider version. /// override public string Version { @@ -238,7 +238,7 @@ namespace OpenSim.Data.MSSQL } /// - /// The name of this DB provider. + /// The name of this DB provider. /// override public string Name { diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index e1de297..423d4aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs @@ -51,8 +51,8 @@ namespace OpenSim.Data.MSSQL private string m_regionsTableName; - override public void Initialise() - { + override public void Initialise() + { m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -87,7 +87,7 @@ namespace OpenSim.Data.MSSQL } /// - /// + /// /// private void TestTables() { @@ -114,7 +114,7 @@ namespace OpenSim.Data.MSSQL } /// - /// The name of this DB provider. + /// The name of this DB provider. /// /// A string containing the storage system name override public string Name @@ -123,7 +123,7 @@ namespace OpenSim.Data.MSSQL } /// - /// Database provider version. + /// Database provider version. /// /// A string containing the storage system version override public string Version @@ -209,7 +209,7 @@ namespace OpenSim.Data.MSSQL { return database.getRegionRow(reader); } - + } catch (Exception e) { diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index d260e8c..b284c02 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs @@ -40,14 +40,14 @@ namespace OpenSim.Data.MSSQL internal class MSSQLLogData : ILogDataPlugin { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// The database manager /// public MSSQLManager database; - public void Initialise() - { + public void Initialise() + { m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 9cd9eca..1a053d5 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -60,7 +60,7 @@ namespace OpenSim.Data.MSSQL builder.UserID = userId; builder.Password = password; builder.ApplicationName = Assembly.GetEntryAssembly().Location; - + connectionString = builder.ToString(); } @@ -117,7 +117,7 @@ namespace OpenSim.Data.MSSQL //} /// - /// + /// /// /// /// @@ -376,7 +376,7 @@ namespace OpenSim.Data.MSSQL } /// - /// + /// /// /// /// @@ -492,7 +492,7 @@ namespace OpenSim.Data.MSSQL } /// - /// + /// /// /// /// diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index e832414..e63a9fe 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -52,8 +52,8 @@ namespace OpenSim.Data.MSSQL private string m_usersTableName; private string m_userFriendsTableName; - public override void Initialise() - { + public override void Initialise() + { m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -99,11 +99,11 @@ namespace OpenSim.Data.MSSQL TestTables(); } - - public override void Dispose () {} + + public override void Dispose () {} /// - /// + /// /// /// private bool TestTables() @@ -205,7 +205,7 @@ namespace OpenSim.Data.MSSQL { adder.ExecuteNonQuery(); } - + using (IDbCommand adder = database.Query( "INSERT INTO " + m_userFriendsTableName + " " + @@ -351,7 +351,7 @@ namespace OpenSim.Data.MSSQL } /// - /// + /// /// /// /// @@ -379,7 +379,7 @@ namespace OpenSim.Data.MSSQL user.firstName = (string)reader["username"]; user.lastName = (string)reader["lastname"]; returnlist.Add(user); - } + } } } catch (Exception e) @@ -406,7 +406,7 @@ namespace OpenSim.Data.MSSQL returnlist.Add(user); } } - } + } catch (Exception e) { m_log.Error(e.ToString()); diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 6857c2c..ecd18ae 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -36,7 +36,7 @@ using log4net; namespace OpenSim.Data { - /// + /// /// /// The Migration theory is based on the ruby on rails concept. /// Each database driver is going to be allowed to have files in @@ -77,11 +77,11 @@ namespace OpenSim.Data // private string _subtype; private Assembly _assem; private Regex _match; - + private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; - + public Migration(DbConnection conn, Assembly assem, string type) { _type = type; @@ -105,7 +105,7 @@ namespace OpenSim.Data // clever, eh, we figure out which migrations version we are int migration_version = FindVersion("migrations"); - if (migration_version > 0) + if (migration_version > 0) return; // If not, create the migration tables @@ -130,14 +130,14 @@ namespace OpenSim.Data m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); DbCommand cmd = _conn.CreateCommand(); - foreach (KeyValuePair kvp in migrations) + foreach (KeyValuePair kvp in migrations) { int newversion = kvp.Key; cmd.CommandText = kvp.Value; // we need to up the command timeout to infinite as we might be doing long migrations. cmd.CommandTimeout = 0; cmd.ExecuteNonQuery(); - + if (version == 0) { InsertVersion(_type, newversion); @@ -158,7 +158,7 @@ namespace OpenSim.Data // foreach (string s in names) // { // Match m = _match.Match(s); - // if (m.Success) + // if (m.Success) // { // int MigrationVersion = int.Parse(m.Groups[1].ToString()); // if (MigrationVersion > max) @@ -168,10 +168,10 @@ namespace OpenSim.Data // return max; // } - public int Version + public int Version { get { return FindVersion(_type); } - set { + set { if (Version < 1) { InsertVersion(_type, value); @@ -179,11 +179,11 @@ namespace OpenSim.Data else { UpdateVersion(_type, value); - } + } } } - private int FindVersion(string type) + private int FindVersion(string type) { int version = 0; DbCommand cmd = _conn.CreateCommand(); @@ -206,22 +206,22 @@ namespace OpenSim.Data return version; } - private void InsertVersion(string type, int version) + private void InsertVersion(string type, int version) { DbCommand cmd = _conn.CreateCommand(); cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version); cmd.ExecuteNonQuery(); } - - private void UpdateVersion(string type, int version) + + private void UpdateVersion(string type, int version) { DbCommand cmd = _conn.CreateCommand(); cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version); cmd.ExecuteNonQuery(); } - + // private SortedList GetAllMigrations() // { // return GetMigrationsAfter(0); @@ -261,4 +261,4 @@ namespace OpenSim.Data return migrations; } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index cec736a..bdb1571 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -144,11 +144,11 @@ namespace OpenSim.Data.MySQL _dbConnection.GetTableVersion(tableList); // if there is no table, return, migrations will handle it. - if (tableList["assets"] == null) + if (tableList["assets"] == null) return; // if there is a table, and we don't have a migration, set it to 1 - if (m.Version == 0) + if (m.Version == 0) m.Version = 1; } @@ -272,12 +272,12 @@ namespace OpenSim.Data.MySQL lock (_dbConnection) { _dbConnection.CheckConnection(); - + MySqlCommand cmd = new MySqlCommand( "SELECT id FROM assets WHERE id=?id", _dbConnection.Connection); - + cmd.Parameters.AddWithValue("?id", uuid.ToString()); try diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 8991e02..2ab7d40 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -51,7 +51,7 @@ namespace OpenSim.Data.MySQL private string m_connectionString; private long m_waitTimeout; private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; - private long m_lastConnectionUse; + private long m_lastConnectionUse; private FieldInfo[] m_Fields; private Dictionary m_FieldMap = @@ -83,13 +83,13 @@ namespace OpenSim.Data.MySQL } m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); - + //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); m_connection = new MySqlConnection(m_connectionString); m_connection.Open(); - - GetWaitTimeout(); + + GetWaitTimeout(); Assembly assem = GetType().Assembly; Migration m = new Migration(m_connection, assem, "EstateStore"); @@ -106,7 +106,7 @@ namespace OpenSim.Data.MySQL m_FieldMap[f.Name.Substring(2)] = f; } } - + private string[] FieldList { get { return new List(m_FieldMap.Keys).ToArray(); } @@ -116,28 +116,28 @@ namespace OpenSim.Data.MySQL { MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); - + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if (dbReader.Read()) { - m_waitTimeout + m_waitTimeout = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; - } - + } + dbReader.Close(); cmd.Dispose(); - } - + } + m_lastConnectionUse = System.DateTime.Now.Ticks; - + m_log.DebugFormat( "[REGION DB]: Connection wait timeout {0} seconds", - m_waitTimeout / TimeSpan.TicksPerSecond); + m_waitTimeout / TimeSpan.TicksPerSecond); } - + protected void CheckConnection() { long timeNow = System.DateTime.Now.Ticks; @@ -145,17 +145,17 @@ namespace OpenSim.Data.MySQL m_connection.State != ConnectionState.Open) { m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); - + lock (m_connection) { m_connection.Close(); m_connection = new MySqlConnection(m_connectionString); - m_connection.Open(); + m_connection.Open(); } } - - m_lastConnectionUse = timeNow; - } + + m_lastConnectionUse = timeNow; + } public EstateSettings LoadEstateSettings(LLUUID regionID) { @@ -210,7 +210,7 @@ namespace OpenSim.Data.MySQL names.Remove("EstateID"); sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")"; - + cmd.CommandText = sql; cmd.Parameters.Clear(); @@ -318,7 +318,7 @@ namespace OpenSim.Data.MySQL es.ClearBans(); CheckConnection(); - + MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; @@ -344,18 +344,18 @@ namespace OpenSim.Data.MySQL private void SaveBanList(EstateSettings es) { CheckConnection(); - + MySqlCommand cmd = m_connection.CreateCommand(); - + cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; - + foreach (EstateBan b in es.EstateBans) { cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); @@ -369,18 +369,18 @@ namespace OpenSim.Data.MySQL void SaveUUIDList(uint EstateID, string table, LLUUID[] data) { CheckConnection(); - + MySqlCommand cmd = m_connection.CreateCommand(); - + cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; - + foreach (LLUUID uuid in data) { cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); @@ -396,7 +396,7 @@ namespace OpenSim.Data.MySQL List uuids = new List(); CheckConnection(); - + MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; @@ -414,7 +414,7 @@ namespace OpenSim.Data.MySQL uuids.Add(uuid); } r.Close(); - + return uuids.ToArray(); } } diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 4cddbe5..fcbceb8 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs @@ -49,8 +49,8 @@ namespace OpenSim.Data.MySQL /// private MySQLManager database; - override public void Initialise() - { + override public void Initialise() + { m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -253,7 +253,7 @@ namespace OpenSim.Data.MySQL return null; } } - + /// /// Returns a sim profile from it's UUID /// diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index dd4d804..4e8200b 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -48,8 +48,8 @@ namespace OpenSim.Data.MySQL /// private MySQLManager database; - public void Initialise() - { + public void Initialise() + { m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -81,7 +81,7 @@ namespace OpenSim.Data.MySQL string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - + database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); @@ -147,7 +147,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// MySQL connection handler /// @@ -180,7 +180,7 @@ namespace OpenSim.Data.MySQL // ... and set the version if (m.Version == 0) m.Version = 1; - + } #endregion @@ -290,7 +290,7 @@ namespace OpenSim.Data.MySQL } } - + /// /// see /// @@ -708,10 +708,10 @@ namespace OpenSim.Data.MySQL * - We will only need to hit the database twice instead of n times. * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned * by the same person, each user only has 1 inventory heirarchy - * - The returned list is not ordered, instead of breadth-first ordered + * - The returned list is not ordered, instead of breadth-first ordered There are basically 2 usage cases for getFolderHeirarchy: 1) Getting the user's entire inventory heirarchy when they log in - 2) Finding a subfolder heirarchy to delete when emptying the trash. + 2) Finding a subfolder heirarchy to delete when emptying the trash. This implementation will pull all inventory folders from the database, and then prune away any folder that is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the database than to make n requests. This pays off only if requested heirarchy is large. @@ -774,7 +774,7 @@ namespace OpenSim.Data.MySQL while (reader.Read()) { InventoryFolderBase curFolder = readInventoryFolder(reader); - if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling + if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list else // else current folder has no known (yet) siblings { diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 456cfd2..c02016c 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs @@ -44,12 +44,12 @@ namespace OpenSim.Data.MySQL /// public MySQLManager database; - public void Initialise() - { + public void Initialise() + { m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } - + /// /// Artificial constructor called when the plugin is loaded /// Uses the obsolete mysql_connection.ini if connect string is empty. @@ -100,7 +100,7 @@ namespace OpenSim.Data.MySQL Dictionary tableList = new Dictionary(); tableList["logs"] = null; database.GetTableVersion(tableList); - + // migrations will handle it if (tableList["logs"] == null) return; diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 58599a8..6ad6609 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL private string connectionString; private const string m_waitTimeoutSelect = "select @@wait_timeout"; - + /// /// Wait timeout for our connection in ticks. /// @@ -70,7 +70,7 @@ namespace OpenSim.Data.MySQL /// /// Holds the last tick time that the connection was used. /// - private long m_lastConnectionUse; + private long m_lastConnectionUse; /// /// Initialises and creates a new MySQL connection and maintains it. @@ -172,7 +172,7 @@ namespace OpenSim.Data.MySQL // inaccuracy. m_lastConnectionUse = timeNow; } - + /// /// Get the connection being used /// @@ -287,14 +287,14 @@ namespace OpenSim.Data.MySQL { lock (dbcon) { - CheckConnection(); - + CheckConnection(); + MySqlCommand tablesCmd = new MySqlCommand( "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", dbcon); tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); - + using (MySqlDataReader tables = tablesCmd.ExecuteReader()) { while (tables.Read()) @@ -541,7 +541,7 @@ namespace OpenSim.Data.MySQL LLUUID regionID = LLUUID.Zero; LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero retval.HomeRegionID = regionID; - + retval.Created = Convert.ToInt32(reader["created"].ToString()); retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); @@ -1124,7 +1124,7 @@ namespace OpenSim.Data.MySQL sql += "?skirt_item, ?skirt_asset)"; bool returnval = false; - + // we want to send in byte data, which means we can't just pass down strings try { MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); @@ -1160,7 +1160,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); - + if (cmd.ExecuteNonQuery() > 0) returnval = true; diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 70b6d3c..85af5df 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -53,27 +53,27 @@ namespace OpenSim.Data.MySQL private const string m_terrainSelect = "select * from terrain limit 1"; private const string m_landSelect = "select * from land"; private const string m_landAccessListSelect = "select * from landaccesslist"; - private const string m_regionSettingsSelect = "select * from regionsettings"; + private const string m_regionSettingsSelect = "select * from regionsettings"; private const string m_waitTimeoutSelect = "select @@wait_timeout"; private MySqlConnection m_connection; private string m_connectionString; - + /// /// Wait timeout for our connection in ticks. /// private long m_waitTimeout; - + /// /// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long /// running database operations. /// private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; - + /// /// Holds the last tick time that the connection was used. /// - private long m_lastConnectionUse; + private long m_lastConnectionUse; private DataSet m_dataSet; private MySqlDataAdapter m_primDataAdapter; @@ -105,7 +105,7 @@ namespace OpenSim.Data.MySQL public void Initialise(string connectionString) { m_connectionString = connectionString; - + m_dataSet = new DataSet(); int passPosition = 0; @@ -132,8 +132,8 @@ namespace OpenSim.Data.MySQL m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); m_connection = new MySqlConnection(m_connectionString); m_connection.Open(); - - GetWaitTimeout(); + + GetWaitTimeout(); // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; @@ -177,12 +177,11 @@ namespace OpenSim.Data.MySQL m_dataSet.Tables.Add(m_shapeTable); SetupShapeCommands(m_shapeDataAdapter, m_connection); m_shapeDataAdapter.Fill(m_shapeTable); - - m_itemsTable = createItemsTable(); - m_dataSet.Tables.Add(m_itemsTable); - SetupItemsCommands(m_itemsDataAdapter, m_connection); - m_itemsDataAdapter.Fill(m_itemsTable); + m_itemsTable = createItemsTable(); + m_dataSet.Tables.Add(m_itemsTable); + SetupItemsCommands(m_itemsDataAdapter, m_connection); + m_itemsDataAdapter.Fill(m_itemsTable); m_terrainTable = createTerrainTable(); m_dataSet.Tables.Add(m_terrainTable); @@ -205,58 +204,58 @@ namespace OpenSim.Data.MySQL m_regionSettingsDataAdapter.Fill(m_regionSettingsTable); } } - + /// /// Get the wait_timeout value for our connection /// protected void GetWaitTimeout() { MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); - + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) { if (dbReader.Read()) { - m_waitTimeout + m_waitTimeout = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; - } - + } + dbReader.Close(); cmd.Dispose(); - } - + } + m_lastConnectionUse = System.DateTime.Now.Ticks; - + m_log.DebugFormat( - "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); + "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); } - + /// /// Should be called before any db operation. This checks to see if the connection has not timed out /// protected void CheckConnection() { //m_log.Debug("[REGION DB]: Checking connection"); - + long timeNow = System.DateTime.Now.Ticks; if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open) { m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); - + lock (m_connection) { m_connection.Close(); m_connection = new MySqlConnection(m_connectionString); - m_connection.Open(); + m_connection.Open(); } } - + // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather // than require the code to call another method - the timeout leeway should be large enough to cover the // inaccuracy. - m_lastConnectionUse = timeNow; - } - + m_lastConnectionUse = timeNow; + } + /// /// Given a list of tables, return the version of the tables, as seen in the database /// @@ -271,7 +270,7 @@ namespace OpenSim.Data.MySQL "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", dbcon); tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); - + CheckConnection(); using (MySqlDataReader tables = tablesCmd.ExecuteReader()) { @@ -465,7 +464,7 @@ namespace OpenSim.Data.MySQL lock (m_dataSet) { - CheckConnection(); + CheckConnection(); DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); m_log.Info("[REGION DB]: " + "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); @@ -587,10 +586,10 @@ namespace OpenSim.Data.MySQL using (cmd) { delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); - + CheckConnection(); delete.ExecuteNonQuery(); - + cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); @@ -774,7 +773,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -805,7 +804,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// public void Commit() { @@ -845,7 +844,7 @@ namespace OpenSim.Data.MySQL **********************************************************************/ /// - /// + /// /// /// /// @@ -1139,7 +1138,7 @@ namespace OpenSim.Data.MySQL **********************************************************************/ /// - /// + /// /// /// /// @@ -1315,7 +1314,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1374,14 +1373,14 @@ namespace OpenSim.Data.MySQL newData.UserLookAt = LLVector3.Zero; m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); } - + newData.ParcelAccessList = new List(); return newData; } /// - /// + /// /// /// /// @@ -1395,7 +1394,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1419,7 +1418,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1502,7 +1501,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1532,7 +1531,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) { @@ -1573,7 +1572,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1618,7 +1617,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1631,7 +1630,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1694,7 +1693,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1731,7 +1730,7 @@ namespace OpenSim.Data.MySQL row["ProfileHollow"] = s.ProfileHollow; row["Texture"] = s.TextureEntry; row["ExtraParams"] = s.ExtraParams; - + try { row["State"] = s.State; @@ -1754,7 +1753,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1911,7 +1910,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1973,7 +1972,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -1994,7 +1993,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -2027,7 +2026,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -2038,7 +2037,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -2052,7 +2051,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -2063,7 +2062,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// /// @@ -2082,7 +2081,7 @@ namespace OpenSim.Data.MySQL } /// - /// + /// /// /// MySQL connection handler // private static void InitDB(MySqlConnection conn) @@ -2174,7 +2173,7 @@ namespace OpenSim.Data.MySQL // } /// - /// + /// /// /// /// diff --git a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs index c4f3136..80fb9ff 100644 --- a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs +++ b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs @@ -72,7 +72,7 @@ namespace OpenSim.Data.NHibernate public object NullSafeGet(IDataReader rs, string[] names, object owner) { object quat = null; - + int x = rs.GetOrdinal(names[0]); int y = rs.GetOrdinal(names[1]); int z = rs.GetOrdinal(names[2]); @@ -105,10 +105,10 @@ namespace OpenSim.Data.NHibernate public SqlType[] SqlTypes { - get { return new SqlType [] { - NHibernateUtil.Single.SqlType, - NHibernateUtil.Single.SqlType, - NHibernateUtil.Single.SqlType, + get { return new SqlType [] { + NHibernateUtil.Single.SqlType, + NHibernateUtil.Single.SqlType, + NHibernateUtil.Single.SqlType, NHibernateUtil.Single.SqlType }; } } diff --git a/OpenSim/Data/NHibernate/LLVector3UserType.cs b/OpenSim/Data/NHibernate/LLVector3UserType.cs index b040ca7d..d2df2c4 100644 --- a/OpenSim/Data/NHibernate/LLVector3UserType.cs +++ b/OpenSim/Data/NHibernate/LLVector3UserType.cs @@ -70,7 +70,7 @@ namespace OpenSim.Data.NHibernate public object NullSafeGet(IDataReader rs, string[] names, object owner) { object vector = null; - + int x = rs.GetOrdinal(names[0]); int y = rs.GetOrdinal(names[1]); int z = rs.GetOrdinal(names[2]); diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 2e9e897..400451f 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs @@ -93,7 +93,7 @@ namespace OpenSim.Data.NHibernate factory = cfg.BuildSessionFactory(); session = factory.OpenSession(); - + // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore"); @@ -111,7 +111,7 @@ namespace OpenSim.Data.NHibernate { m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid); return null; - } + } catch (Exception e) { m_log.Error("[NHIBERNATE] unexpected exception: ", e); @@ -121,7 +121,7 @@ namespace OpenSim.Data.NHibernate private void Save(AssetBase asset) { - try + try { // a is not used anywhere? // AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase; diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 4c5ec01..161ec1d 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs @@ -51,7 +51,7 @@ namespace OpenSim.Data.NHibernate // "NHibernate.Driver.SqliteClientDriver"; // cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] = // "URI=file:opensim-nh.db,version=3"; - + // factory = cfg.BuildSessionFactory(); } diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 52db32d..9682d87 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs @@ -89,10 +89,10 @@ namespace OpenSim.Data.NHibernate using (MemoryStream stream = HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) cfg.AddInputStream(stream); - + factory = cfg.BuildSessionFactory(); session = factory.OpenSession(); - + // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); @@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate { return null; } - + // This looks inefficient, but it turns out that it isn't // based on trial runs with nhibernate 1.2 private void SaveOrUpdate(SceneObjectPart p) @@ -164,7 +164,7 @@ namespace OpenSim.Data.NHibernate /// the region UUID public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) { - try + try { foreach (SceneObjectPart part in obj.Children.Values) { @@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate } session.Flush(); } - catch (Exception e) + catch (Exception e) { m_log.Error("Can't save: ", e); } @@ -196,7 +196,7 @@ namespace OpenSim.Data.NHibernate group.AddPart(p); group.RootPart = p; } - else + else { group.AddPart(p); } @@ -232,7 +232,7 @@ namespace OpenSim.Data.NHibernate { Dictionary SOG = new Dictionary(); List ret = new List(); - + ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); criteria.Add(Expression.Eq("RegionID", regionUUID)); criteria.AddOrder( Order.Asc("ParentID") ); @@ -246,12 +246,12 @@ namespace OpenSim.Data.NHibernate group.RootPart = p; SOG.Add(p.ParentUUID, group); } - else + else { SOG[p.ParentUUID].AddPart(p); } // get the inventory - + ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); IList inventory = new List(); @@ -263,7 +263,7 @@ namespace OpenSim.Data.NHibernate if (inventory.Count > 0) p.RestoreInventoryItems(inventory); } - foreach (SceneObjectGroup g in SOG.Values) + foreach (SceneObjectGroup g in SOG.Values) { ret.Add(g); } @@ -304,7 +304,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// public void RemoveLandObject(LLUUID globalID) @@ -313,7 +313,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// public void StoreLandObject(ILandObject parcel) @@ -322,7 +322,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// /// @@ -341,7 +341,7 @@ namespace OpenSim.Data.NHibernate { session.Flush(); } - + /// /// Load a region banlist /// @@ -373,7 +373,7 @@ namespace OpenSim.Data.NHibernate } /// - /// + /// /// /// /// @@ -399,17 +399,17 @@ namespace OpenSim.Data.NHibernate { ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); criteria.Add(Expression.Eq("ParentPartID", primID)); - try + try { foreach (TaskInventoryItem i in criteria.List()) { session.Delete(i); } - + foreach (TaskInventoryItem i in items) { session.Save(i); - + } session.Flush(); } diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index bceae7c..c776474 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs @@ -53,8 +53,8 @@ namespace OpenSim.Data.NHibernate private ISessionFactory factory; private ISession session; - public override void Initialise() - { + public override void Initialise() + { m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -83,7 +83,7 @@ namespace OpenSim.Data.NHibernate factory = cfg.BuildSessionFactory(); session = factory.OpenSession(); - + // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore"); @@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate { user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; } - catch (ObjectNotFoundException) + catch (ObjectNotFoundException) { user = null; } @@ -109,12 +109,12 @@ namespace OpenSim.Data.NHibernate { UserProfileData user; // TODO: I'm sure I'll have to do something silly here - try + try { user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; user.CurrentAgent = GetAgentByUUID(uuid); - } - catch (ObjectNotFoundException) + } + catch (ObjectNotFoundException) { user = null; } @@ -144,12 +144,12 @@ namespace OpenSim.Data.NHibernate } else { - try + try { UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; session.Delete(old); } - catch (ObjectNotFoundException) + catch (ObjectNotFoundException) { } session.Save(agent); @@ -174,12 +174,12 @@ namespace OpenSim.Data.NHibernate override public void AddNewUserAgent(UserAgentData agent) { - try + try { UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; session.Delete(old); } - catch (ObjectNotFoundException) + catch (ObjectNotFoundException) { } session.Save(agent); @@ -287,9 +287,9 @@ namespace OpenSim.Data.NHibernate public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { - if (appearance == null) + if (appearance == null) return; - + appearance.Owner = user; bool exists = ExistsAppearance(user); diff --git a/OpenSim/Data/NHibernate/Terrain.cs b/OpenSim/Data/NHibernate/Terrain.cs index a95e45a..608f03e 100644 --- a/OpenSim/Data/NHibernate/Terrain.cs +++ b/OpenSim/Data/NHibernate/Terrain.cs @@ -32,21 +32,21 @@ using OpenSim.Framework; using log4net; using libsecondlife; -namespace OpenSim.Data.NHibernate +namespace OpenSim.Data.NHibernate { public class Terrain { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private double[,] map; private LLUUID regionID; - + public Terrain(LLUUID Region, double[,] array) { map = array; regionID = Region; } - + public Terrain() { map = new double[Constants.RegionSize, Constants.RegionSize]; @@ -65,7 +65,7 @@ namespace OpenSim.Data.NHibernate get { return serializeTerrain(map); } set { map = parseTerrain(value); } } - + public double[,] Doubles { get {return map;} @@ -76,7 +76,7 @@ namespace OpenSim.Data.NHibernate { double[,] terret = new double[256,256]; terret.Initialize(); - + MemoryStream str = new MemoryStream(data); BinaryReader br = new BinaryReader(str); try { @@ -87,7 +87,7 @@ namespace OpenSim.Data.NHibernate terret[x, y] = br.ReadDouble(); } } - } + } catch (Exception e) { m_log.Error("Issue parsing Map", e); @@ -99,7 +99,7 @@ namespace OpenSim.Data.NHibernate { MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); BinaryWriter bw = new BinaryWriter(str); - + // TODO: COMPATIBILITY - Add byte-order conversions for (int x = 0; x < 256; x++) { @@ -108,11 +108,11 @@ namespace OpenSim.Data.NHibernate double height = val[x, y]; if (height <= 0.0) height = double.Epsilon; - + bw.Write(height); } } return str.ToArray(); } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 99de5cd..9b274f4 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -141,7 +141,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); - + cmd.ExecuteNonQuery(); } } @@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite override public void UpdateAsset(AssetBase asset) { LogAssetLoad(asset); - + lock (this) { using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) @@ -167,7 +167,7 @@ namespace OpenSim.Data.SQLite cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); - + cmd.ExecuteNonQuery(); } } @@ -269,7 +269,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// // private static void InitDB(SqliteConnection conn) @@ -312,7 +312,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -331,10 +331,10 @@ namespace OpenSim.Data.SQLite m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); return false; } - + // if the tables are here, and we don't have a migration, // set it to 1, as we're migrating off of legacy bits - if (m.Version == 0) + if (m.Version == 0) m.Version = 1; return true; @@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite #region IPlugin interface /// - /// + /// /// override public string Version { diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index dc5ba5e..ffe7644 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -55,12 +55,12 @@ namespace OpenSim.Data.SQLite public void Initialise(string connectionString) { m_connectionString = connectionString; - + m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); m_connection = new SqliteConnection(m_connectionString); m_connection.Open(); - + Assembly assem = GetType().Assembly; Migration m = new Migration(m_connection, assem, "EstateStore"); m.Update(); @@ -77,7 +77,7 @@ namespace OpenSim.Data.SQLite if (f.Name.Substring(0, 2) == "m_") m_FieldMap[f.Name.Substring(2)] = f; } - + private string[] FieldList { get { return new List(m_FieldMap.Keys).ToArray(); } @@ -134,7 +134,7 @@ namespace OpenSim.Data.SQLite names.Remove("EstateID"); sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; - + cmd.CommandText = sql; cmd.Parameters.Clear(); @@ -272,16 +272,16 @@ namespace OpenSim.Data.SQLite private void SaveBanList(EstateSettings es) { SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); - + cmd.CommandText = "delete from estateban where EstateID = :EstateID"; cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; - + foreach (EstateBan b in es.EstateBans) { cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); @@ -295,16 +295,16 @@ namespace OpenSim.Data.SQLite void SaveUUIDList(uint EstateID, string table, LLUUID[] data) { SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); - + cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; cmd.Parameters.Add(":EstateID", EstateID.ToString()); cmd.ExecuteNonQuery(); - + cmd.Parameters.Clear(); cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; - + foreach (LLUUID uuid in data) { cmd.Parameters.Add(":EstateID", EstateID.ToString()); @@ -336,7 +336,7 @@ namespace OpenSim.Data.SQLite uuids.Add(uuid); } r.Close(); - + return uuids.ToArray(); } } diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index e29b99c..125b6e7 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite private SqliteDataAdapter invItemsDa; private SqliteDataAdapter invFoldersDa; - public void Initialise() - { + public void Initialise() + { m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -105,7 +105,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite /// A string containing the DB provider version public string Version { - get + get { Module module = GetType().Module; // string dllName = module.Assembly.ManifestModule.Name; @@ -419,10 +419,10 @@ namespace OpenSim.Data.SQLite * - We will only need to hit the database twice instead of n times. * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned * by the same person, each user only has 1 inventory heirarchy - * - The returned list is not ordered, instead of breadth-first ordered + * - The returned list is not ordered, instead of breadth-first ordered There are basically 2 usage cases for getFolderHeirarchy: 1) Getting the user's entire inventory heirarchy when they log in - 2) Finding a subfolder heirarchy to delete when emptying the trash. + 2) Finding a subfolder heirarchy to delete when emptying the trash. This implementation will pull all inventory folders from the database, and then prune away any folder that is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the database than to make n requests. This pays off only if requested heirarchy is large. @@ -449,17 +449,17 @@ namespace OpenSim.Data.SQLite folderRows = inventoryFolderTable.Select(selectExp); } - if ( folderRows!=null && folderRows.GetLength(0)>=1 ) // No result means parent folder does not exist + if (folderRows != null && folderRows.GetLength(0) >= 1) // No result means parent folder does not exist { // or has no children /* if we're querying the root folder, just return an unordered list of all folders in the user's * inventory */ if (parentFolder.ParentID == LLUUID.Zero) - { + { foreach (DataRow row in folderRows) { InventoryFolderBase curFolder = buildFolder(row); - if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy + if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy folders.Add(buildFolder(row)); } } // If requesting root folder @@ -481,16 +481,16 @@ namespace OpenSim.Data.SQLite InventoryFolderBase curFolder = buildFolder(row); if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed { - if ( hashtable.ContainsKey(curFolder.ParentID ) ) + if (hashtable.ContainsKey(curFolder.ParentID)) { // Current folder already has a sibling - append to sibling list - hashtable[curFolder.ParentID].Add( curFolder ); + hashtable[curFolder.ParentID].Add(curFolder); } else { List siblingList = new List(); - siblingList.Add( curFolder ); + siblingList.Add(curFolder); // Current folder has no known (yet) siblings - hashtable.Add( curFolder.ParentID, siblingList ); + hashtable.Add(curFolder.ParentID, siblingList); } } } // For all inventory folders @@ -498,12 +498,12 @@ namespace OpenSim.Data.SQLite // Note: Could release the ds lock here - we don't access folderRows or the database anymore. // This is somewhat of a moot point as the callers of this function usually lock db anyways. - if ( hashtable.ContainsKey( parentID ) ) // if requested folder does have children - folders.AddRange( hashtable[parentID] ); + if (hashtable.ContainsKey(parentID)) // if requested folder does have children + folders.AddRange(hashtable[parentID]); // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static - for ( int i = 0; i < folders.Count; i++ ) - if (hashtable.ContainsKey(folders[i].ID)) + for (int i = 0; i < folders.Count; i++) + if (hashtable.ContainsKey(folders[i].ID)) folders.AddRange(hashtable[folders[i].ID]); } // if requesting a subfolder heirarchy @@ -601,7 +601,7 @@ namespace OpenSim.Data.SQLite /// Delete all items in the specified folder /// /// id of the folder, whose item content should be deleted - /// this is horribly inefficient, but I don't want to ruin the overall structure of this implementation + /// this is horribly inefficient, but I don't want to ruin the overall structure of this implementation private void deleteItemsInFolder(LLUUID folderId) { List items = getInventoryInFolder(Util.ToRawUuidString(folderId)); @@ -743,7 +743,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -765,7 +765,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -787,7 +787,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -804,7 +804,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -819,7 +819,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -836,7 +836,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// // private static void InitDB(SqliteConnection conn) @@ -852,7 +852,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b937272..a44b892 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -501,7 +501,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// public void RemoveLandObject(LLUUID globalID) @@ -523,7 +523,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// public void StoreLandObject(ILandObject parcel) @@ -564,7 +564,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -594,7 +594,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// public void Commit() { @@ -629,7 +629,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -1071,7 +1071,7 @@ namespace OpenSim.Data.SQLite newData.UserLookAt = new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), Convert.ToSingle(row["UserLookAtZ"])); - + } catch (InvalidCastException) { @@ -1132,7 +1132,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1166,7 +1166,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -1233,7 +1233,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1321,7 +1321,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1376,7 +1376,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1574,7 +1574,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// Data Table /// @@ -1631,7 +1631,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1650,7 +1650,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1694,7 +1694,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1705,7 +1705,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1799,7 +1799,7 @@ namespace OpenSim.Data.SQLite // } /// - /// + /// /// /// /// @@ -1845,8 +1845,8 @@ namespace OpenSim.Data.SQLite // if we've gotten this far, and our version is still 0, // it's because the migration was never done, so // initialize to 1 just to sync up to where we should be. - - if (m.Version == 0) + + if (m.Version == 0) m.Version = 1; // pDa.Fill(tmpDS, "prims"); diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 910d313..08a97f09 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -65,8 +65,8 @@ namespace OpenSim.Data.SQLite private SqliteDataAdapter daf; SqliteConnection g_conn; - public override void Initialise() - { + public override void Initialise() + { m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); throw new PluginNotInitialisedException (Name); } @@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite Assembly assem = GetType().Assembly; Migration m = new Migration(g_conn, assem, "UserStore"); - + // TODO: remove this after rev 6000 TestTables(conn, m); @@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite return; } - public override void Dispose () {} + public override void Dispose () {} /// /// see IUserDataPlugin, @@ -308,7 +308,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -570,7 +570,7 @@ namespace OpenSim.Data.SQLite } return aa; } - + /// /// Update a user appearence /// @@ -802,7 +802,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -853,7 +853,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -881,7 +881,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -914,7 +914,7 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// + /// /// /// /// @@ -933,7 +933,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -954,7 +954,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// private static void InitDB(SqliteConnection conn) @@ -990,7 +990,7 @@ namespace OpenSim.Data.SQLite } /// - /// + /// /// /// /// @@ -1016,7 +1016,7 @@ namespace OpenSim.Data.SQLite return false; } - if (m.Version == 0) + if (m.Version == 0) m.Version = 1; return true; diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index e604bfd..b984c10 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs @@ -75,7 +75,7 @@ namespace OpenSim.Data public abstract void AddAttachment(LLUUID user, LLUUID item); public abstract void RemoveAttachment(LLUUID user, LLUUID item); public abstract List GetAttachments(LLUUID user); - + public abstract string Version {get;} public abstract string Name {get;} public abstract void Initialise(string connect); diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 4456138..3133f83 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -371,7 +371,7 @@ namespace OpenSim.Framework VisualParams = (byte[])h["visual_params"]; Texture = new LLObject.TextureEntry((byte[])h["texture"], 0, ((byte[])h["texture"]).Length); AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]); - + m_wearables = new AvatarWearable[MAX_WEARABLES]; for (int i = 0; i < MAX_WEARABLES; i++) { diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index d002530..427072d 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs @@ -380,7 +380,7 @@ namespace Opensim.Framework default: return; } - + Store(index, data, container); } @@ -403,7 +403,7 @@ namespace Opensim.Framework if ((m_Flags & CacheFlags.AllowUpdate) != 0) { item = GetItem(index); - + item.hits++; item.lastUsed = DateTime.Now; if (m_DefaultTTL.Ticks != 0) diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 6eff690..e924b3f 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -143,10 +143,10 @@ namespace OpenSim.Framework.Communications.Cache public void Clear() { m_log.Info("[ASSET CACHE]: Clearing Asset cache"); - + if (StatsManager.SimExtraStats != null) StatsManager.SimExtraStats.ClearAssetCacheStatistics(); - + Initialize(); } @@ -365,9 +365,9 @@ namespace OpenSim.Framework.Communications.Cache } } else - { + { if (!Assets.ContainsKey(asset.FullID)) - { + { AssetInfo assetInf = new AssetInfo(asset); Assets.Add(assetInf.FullID, assetInf); @@ -382,7 +382,7 @@ namespace OpenSim.Framework.Communications.Cache } } - /// + /// /// Allows you to clear a specific asset by uuid out /// of the asset cache. This is needed because the osdynamic /// texture code grows the asset cache without bounds. The @@ -399,8 +399,8 @@ namespace OpenSim.Framework.Communications.Cache if (Textures.ContainsKey(uuid)) { Textures.Remove(uuid); - } - else if (Assets.ContainsKey(uuid)) + } + else if (Assets.ContainsKey(uuid)) { Assets.Remove(uuid); } diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index ed5b896..2c8e685 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// /// - /// Thrown if the request failed for some other reason than that the + /// Thrown if the request failed for some other reason than that the /// asset cannot be found. /// protected abstract AssetBase GetAsset(AssetRequest req); @@ -70,7 +70,7 @@ namespace OpenSim.Framework.Communications.Cache protected virtual void ProcessRequest(AssetRequest req) { AssetBase asset; - + try { asset = GetAsset(req); @@ -78,12 +78,12 @@ namespace OpenSim.Framework.Communications.Cache catch (Exception e) { m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e); - + if (StatsManager.SimExtraStats != null) StatsManager.SimExtraStats.AddAssetServiceRequestFailure(); - + m_receiver.AssetNotFound(req.AssetID, req.IsTexture); - + return; } diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 57f5e76..c337907 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -91,8 +91,8 @@ namespace OpenSim.Framework.Communications.Cache get { return m_session_id; } set { m_session_id = value; } } - private LLUUID m_session_id = LLUUID.Zero; - + private LLUUID m_session_id = LLUUID.Zero; + /// /// Constructor /// @@ -172,7 +172,7 @@ namespace OpenSim.Framework.Communications.Cache } } } - + /// /// Drop all cached inventory. /// diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 4206cae..9cccf66 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache rc.AddQueryParameter("texture"); rc.RequestMethod = "GET"; - + Stream s = rc.Request(); if (s.Length > 0) diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index d7de9d6..61cfc1a 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -37,19 +37,19 @@ namespace OpenSim.Framework.Communications.Cache public class InventoryFolderImpl : InventoryFolderBase { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public static readonly string PATH_DELIMITER = "/"; /// /// Items that are contained in this folder /// public Dictionary Items = new Dictionary(); - + /// /// Child folders that are contained in this folder /// public Dictionary SubFolders = new Dictionary(); - + // Constructors public InventoryFolderImpl(InventoryFolderBase folderbase) { @@ -195,15 +195,15 @@ namespace OpenSim.Framework.Communications.Cache return null; } - + /// /// Find a folder given a PATH_DELIMITOR delimited path starting from this folder - /// + /// /// This method does not handle paths that contain multiple delimitors - /// + /// /// FIXME: We do not yet handle situations where folders have the same name. We could handle this by some /// XPath like expression - /// + /// /// FIXME: Delimitors which occur in names themselves are not currently escapable. /// /// @@ -214,7 +214,7 @@ namespace OpenSim.Framework.Communications.Cache { if (path == string.Empty) return this; - + string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); lock (SubFolders) @@ -228,19 +228,19 @@ namespace OpenSim.Framework.Communications.Cache return folder; } } - + // We didn't find a folder with the given name return null; } - + /// /// Find an item given a PATH_DELIMITOR delimited path starting from this folder. - /// + /// /// This method does not handle paths that contain multiple delimitors - /// + /// /// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some /// XPath like expression - /// + /// /// FIXME: Delimitors which occur in names themselves are not currently escapable. /// /// @@ -248,7 +248,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// null if the item is not found public InventoryItemBase FindItemByPath(string path) - { + { string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); if (components.Length == 1) @@ -263,7 +263,7 @@ namespace OpenSim.Framework.Communications.Cache } } else - { + { lock (SubFolders) { foreach (InventoryFolderImpl folder in SubFolders.Values) @@ -273,10 +273,10 @@ namespace OpenSim.Framework.Communications.Cache } } } - + // We didn't find an item or intermediate folder with the given name return null; - } + } /// /// Return a copy of the list of child items in this folder diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 1360aa3..4e3840b 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications.Cache m_log.WarnFormat( "[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userId); - + return false; } diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 1aa8eb0..24fe0f4 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Capabilities mapLayer.Right = 5000; mapLayer.Top = 5000; mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); - + return mapLayer; } @@ -783,7 +783,7 @@ namespace OpenSim.Framework.Communications.Capabilities // TODO: probably make this a better set of extensions here string extension = ".jp2"; - if (m_invType != "image") + if (m_invType != "image") { extension = ".dat"; } diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs index 1c8f27f..b0e2b8f 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs @@ -34,7 +34,7 @@ namespace OpenSim.Framework.Communications.Capabilities public class LLSDRemoteParcelResponse { public LLUUID parcel_id; - + public LLSDRemoteParcelResponse() { } diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2bfe045..08dbc80 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -41,26 +41,26 @@ namespace OpenSim.Framework.Communications public class CommunicationsManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Dictionary m_nameRequestCache = new Dictionary(); public IUserService UserService { get { return m_userService; } } - protected IUserService m_userService; + protected IUserService m_userService; public IGridServices GridService { get { return m_gridService; } } - protected IGridServices m_gridService; - + protected IGridServices m_gridService; + public IInterRegionCommunications InterRegion { get { return m_interRegion; } } - protected IInterRegionCommunications m_interRegion; + protected IInterRegionCommunications m_interRegion; public UserProfileCacheService UserProfileCacheService { @@ -68,36 +68,36 @@ namespace OpenSim.Framework.Communications } protected UserProfileCacheService m_userProfileCacheService; - // protected AgentAssetTransactionsManager m_transactionsManager; + // protected AgentAssetTransactionsManager m_transactionsManager; - // public AgentAssetTransactionsManager TransactionsManager - // { - // get { return m_transactionsManager; } - // } + // public AgentAssetTransactionsManager TransactionsManager + // { + // get { return m_transactionsManager; } + // } public IAvatarService AvatarService { get { return m_avatarService; } } - protected IAvatarService m_avatarService; + protected IAvatarService m_avatarService; public AssetCache AssetCache { get { return m_assetCache; } } - protected AssetCache m_assetCache; - + protected AssetCache m_assetCache; + public IInterServiceInventoryServices InterServiceInventoryService { get { return m_interServiceInventoryService; } - } + } protected IInterServiceInventoryServices m_interServiceInventoryService; public NetworkServersInfo NetworkServersInfo { get { return m_networkServersInfo; } } - protected NetworkServersInfo m_networkServersInfo; + protected NetworkServersInfo m_networkServersInfo; /// /// Constructor @@ -138,7 +138,7 @@ namespace OpenSim.Framework.Communications return null; } } - + public IInventoryServices InventoryService { get diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index 509f408..fcc0db5 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs @@ -33,7 +33,7 @@ namespace OpenSim.Framework.Communications public interface IGridServices { string gdebugRegionName { get; set; } - + /// /// Register a region with the grid service. /// @@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications /// /// Thrown if region registration failed RegionCommsListener RegisterRegion(RegionInfo regionInfos); - + bool DeregisterRegion(RegionInfo regionInfo); /// @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications /// /// List RequestNeighbours(uint x, uint y); - + RegionInfo RequestNeighbourInfo(ulong regionHandle); RegionInfo RequestNeighbourInfo(LLUUID regionID); RegionInfo RequestClosestRegion(string regionName); diff --git a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs index 24213f2..a1f4c2e 100644 --- a/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInterServiceInventoryServices.cs @@ -32,22 +32,22 @@ namespace OpenSim.Framework.Communications { /// /// Inventory operations used between grid services. - /// + /// public interface IInterServiceInventoryServices - { + { /// /// Create a new inventory for the given user. /// /// /// true if the inventory was successfully created, false otherwise bool CreateNewUserInventory(LLUUID user); - + /// /// Returns a list of all the folders in a given user's inventory. /// /// /// A flat list of the user's inventory folder tree, /// null if there is no inventory for this user - List GetInventorySkeleton(LLUUID userId); + List GetInventorySkeleton(LLUUID userId); } } diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 08a2c5f..b00b1bf 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -41,12 +41,12 @@ namespace OpenSim.Framework.Communications /// Defines all the operations one can perform on a user's inventory. /// public interface IInventoryServices - { + { string Host { get; } - + /// /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the /// inventory has been received diff --git a/OpenSim/Framework/Communications/ISecureInventoryService.cs b/OpenSim/Framework/Communications/ISecureInventoryService.cs index 3608c56..bd962d1 100644 --- a/OpenSim/Framework/Communications/ISecureInventoryService.cs +++ b/OpenSim/Framework/Communications/ISecureInventoryService.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications { get; } - + /// /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the /// inventory has been received @@ -102,14 +102,14 @@ namespace OpenSim.Framework.Communications /// Does the given user have an inventory structure? /// /// - /// + /// bool HasInventoryForUser(LLUUID userID); - + /// /// Retrieve the root inventory folder for the given user. /// /// /// null if no root folder was found - InventoryFolderBase RequestRootFolder(LLUUID userID); + InventoryFolderBase RequestRootFolder(LLUUID userID); } } diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 40701f0..c76c078 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -53,14 +53,14 @@ namespace OpenSim.Framework.Communications /// The filename to the user server plugin DLL public void AddPlugin(string provider, string connect) { - PluginLoader loader = + PluginLoader loader = new PluginLoader (new InventoryDataInitialiser (connect)); - // loader will try to load all providers (MySQL, MSSQL, etc) + // loader will try to load all providers (MySQL, MSSQL, etc) // unless it is constrainted to the correct "Provider" entry in the addin.xml loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider)); loader.Load(); - + m_plugins = loader.Plugins; } diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index fd5f139..40064d3 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications /// The existing response /// The user profile public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); - + /// /// If the user is already logged in, try to notify the region that the user they've got is dead. /// @@ -206,12 +206,11 @@ namespace OpenSim.Framework.Communications userProfile.CurrentAgent.AgentOnline = false; m_userManager.CommitAgent(ref userProfile); - + // try to tell the region that their user is dead. LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location"); - + // Reject the login - m_log.InfoFormat( "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", @@ -293,7 +292,7 @@ namespace OpenSim.Framework.Communications //return logResponse.ToXmlRpcResponse(); } - userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; + userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; CommitAgent(ref userProfile); // If we reach this point, then the login has successfully logged onto the grid diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index f477df4..feeb666 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -57,11 +57,11 @@ namespace OpenSim.Framework.Communications PluginLoader loader = new PluginLoader (new UserDataInitialiser (connect)); - // loader will try to load all providers (MySQL, MSSQL, etc) + // loader will try to load all providers (MySQL, MSSQL, etc) // unless it is constrainted to the correct "Provider" entry in the addin.xml loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider)); loader.Load(); - + _plugins = loader.Plugins; } diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs index 2154e1e..89f52cf 100644 --- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs @@ -46,7 +46,7 @@ namespace OpenSim.Framework.Configuration.XML private void LoadDataToClass() { - rootNode = doc.SelectSingleNode("Root"); + rootNode = doc.SelectSingleNode("Root"); if (null == rootNode) throw new Exception("Error: Invalid .xml File. Missing "); @@ -135,4 +135,4 @@ namespace OpenSim.Framework.Configuration.XML doc = null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index f21127b..89fd77d 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -42,7 +42,7 @@ namespace OpenSim.Framework.Console private readonly object m_syncRoot = new object(); public conscmd_callback m_cmdParser; - + /// /// The default prompt text. /// @@ -249,7 +249,7 @@ namespace OpenSim.Framework.Console { line = System.Console.ReadLine(); } - + return line; } catch (Exception e) diff --git a/OpenSim/Framework/Console/ConsolePluginCommand.cs b/OpenSim/Framework/Console/ConsolePluginCommand.cs index b3f1c93..bf70645 100644 --- a/OpenSim/Framework/Console/ConsolePluginCommand.cs +++ b/OpenSim/Framework/Console/ConsolePluginCommand.cs @@ -30,10 +30,10 @@ using System; namespace OpenSim.Framework.Console { public delegate void ConsoleCommand(string[] comParams); - + /// /// Holder object for a new console plugin command - /// + /// /// Override the methods like Run and IsHelpfull (but the defaults might work ok.) /// public class ConsolePluginCommand @@ -52,10 +52,10 @@ namespace OpenSim.Framework.Console private string[] m_cmdText; /// - /// Construct a new ConsolePluginCommand - /// + /// Construct a new ConsolePluginCommand + /// /// for use with OpenSim.RegisterConsolePluginCommand(myCmd); - /// + /// /// /// in the form of "showme new commands" /// ommand delegate used in running @@ -68,13 +68,13 @@ namespace OpenSim.Framework.Console } /// - /// Returns the match length this command has upon the 'cmdWithParams' + /// Returns the match length this command has upon the 'cmdWithParams' /// At least a higher number for "show plugin status" then "show" would return /// This is used to have multi length command verbs - /// + /// /// @see OopenSim.RunPluginCommands /// It will only run the one with the highest number - /// + /// /// public int matchLength(string cmdWithParams) { @@ -106,8 +106,8 @@ namespace OpenSim.Framework.Console } currentParam++; } - - } + + } string[] sendCmdParams = cmdParams; if (skipParams > 0) { diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index 2527977..fa26d22 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework.Console { override protected void Append(LoggingEvent le) { - try + try { string loggingMessage = RenderLoggingEvent(le); @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Console Regex RE = new Regex(regex, RegexOptions.Multiline); MatchCollection matches = RE.Matches(loggingMessage); - + // Get some direct matches $1 $4 is a if (matches.Count == 1) { diff --git a/OpenSim/Framework/IAssetProvider.cs b/OpenSim/Framework/IAssetProvider.cs index 00d290e..ec70554 100644 --- a/OpenSim/Framework/IAssetProvider.cs +++ b/OpenSim/Framework/IAssetProvider.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework bool ExistsAsset(LLUUID uuid); void Initialise(string connect); } - + public class AssetDataInitialiser : PluginInitialiserBase { private string connect; diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 536050c..71b8eb0 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -62,7 +62,7 @@ namespace OpenSim.Framework public delegate void ModifyTerrain( float height, float seconds, byte size, byte action, float north, float west, float south, float east, IClientAPI remoteClient); - + public delegate void SetAppearance(byte[] texture, List visualParamList); public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID); @@ -295,7 +295,7 @@ namespace OpenSim.Framework public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); public delegate void RegionHandleRequest(IClientAPI remoteClient, LLUUID regionID); public delegate void ParcelInfoRequest(IClientAPI remoteClient, LLUUID parcelID); - + public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); @@ -322,9 +322,9 @@ namespace OpenSim.Framework ulong ActiveGroupPowers { get; } ulong GetGroupPowers(LLUUID groupID); - + string FirstName { get; } - + string LastName { get; } IScene Scene { get; } @@ -501,7 +501,7 @@ namespace OpenSim.Framework event EstateDebugRegionRequest OnEstateDebugRegionRequest; event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; event UUIDNameRequest OnUUIDGroupNameRequest; - + event RegionHandleRequest OnRegionHandleRequest; event ParcelInfoRequest OnParcelInfoRequest; @@ -724,10 +724,10 @@ namespace OpenSim.Framework ClientInfo GetClientInfo(); void SetClientInfo(ClientInfo info); void Terminate(); - + void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary parameters); void SendClearFollowCamProperties(LLUUID objectID); - + void SendRegionHandle(LLUUID regoinID, ulong handle); void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y); } diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index 0d4c555..1c62b0b 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs @@ -132,7 +132,7 @@ namespace OpenSim.Framework /// The id of the folder void deleteInventoryFolder(LLUUID folder); } - + public class InventoryDataInitialiser : PluginInitialiserBase { private string connect; diff --git a/OpenSim/Framework/IPlugin.cs b/OpenSim/Framework/IPlugin.cs index f739177..1eb1c06 100644 --- a/OpenSim/Framework/IPlugin.cs +++ b/OpenSim/Framework/IPlugin.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework public PluginNotInitialisedException (string msg) : base(msg) {} public PluginNotInitialisedException (string msg, Exception e) : base(msg, e) {} } - + /// /// This interface, describes a generic plugin /// @@ -63,17 +63,17 @@ namespace OpenSim.Framework } /// - /// Any plugins which need to pass parameters to their initialisers must + /// Any plugins which need to pass parameters to their initialisers must /// inherit this class and use it to set the PluginLoader Initialiser property /// public class PluginInitialiserBase { // this would be a lot simpler if C# supported currying or typedefs - + // default initialisation public virtual void Initialise (IPlugin plugin) { - plugin.Initialise(); + plugin.Initialise(); } } diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs index 5ecb482..f74c0db 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Framework/IUserData.cs @@ -170,7 +170,7 @@ namespace OpenSim.Framework void RemoveAttachment(LLUUID user, LLUUID item); List GetAttachments(LLUUID user); } - + public class UserDataInitialiser : PluginInitialiserBase { private string connect; diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 8c1e1a1..a875a50 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned private LLUUID _authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category - private int _claimDate = 0; + private int _claimDate = 0; private int _claimPrice = 0; //Unemplemented private LLUUID _globalID = LLUUID.Zero; private LLUUID _groupID = LLUUID.Zero; //Unemplemented @@ -77,7 +77,7 @@ namespace OpenSim.Framework private LLUUID _snapshotID = LLUUID.Zero; private LLVector3 _userLocation = new LLVector3(); private LLVector3 _userLookAt = new LLVector3(); - + public LLVector3 AABBMax { get { return _AABBMax; @@ -459,4 +459,4 @@ namespace OpenSim.Framework return landData; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/LandStatReportItem.cs b/OpenSim/Framework/LandStatReportItem.cs index 3a92253..8c7ee7b 100644 --- a/OpenSim/Framework/LandStatReportItem.cs +++ b/OpenSim/Framework/LandStatReportItem.cs @@ -49,6 +49,6 @@ namespace OpenSim.Framework { } - + } } diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 7ceb0b2..cabce1b 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework } /// - /// Classes wishing to impose constraints on plugin loading must implement + /// Classes wishing to impose constraints on plugin loading must implement /// this class and pass it to PluginLoader AddConstraint() /// public interface IPluginConstraint @@ -75,46 +75,46 @@ namespace OpenSim.Framework private List loaded = new List(); private List extpoints = new List(); private PluginInitialiserBase initialiser; - - private Dictionary constraints + + private Dictionary constraints = new Dictionary(); - private Dictionary filters + private Dictionary filters = new Dictionary(); - private static readonly ILog log + private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public PluginInitialiserBase Initialiser - { - set { initialiser = value; } - get { return initialiser; } + { + set { initialiser = value; } + get { return initialiser; } } - public List Plugins - { - get { return loaded; } + public List Plugins + { + get { return loaded; } } public T Plugin - { - get { return (loaded.Count == 1)? loaded [0] : default (T); } + { + get { return (loaded.Count == 1)? loaded [0] : default (T); } } - public PluginLoader () + public PluginLoader () { Initialiser = new PluginInitialiserBase(); initialise_plugin_dir_ ("."); } public PluginLoader (PluginInitialiserBase init) - { + { Initialiser = init; initialise_plugin_dir_ ("."); } public PluginLoader (PluginInitialiserBase init, string dir) - { + { Initialiser = init; initialise_plugin_dir_ (dir); } @@ -123,7 +123,7 @@ namespace OpenSim.Framework { if (extpoints.Contains (extpoint)) return; - + extpoints.Add (extpoint); } @@ -156,7 +156,7 @@ namespace OpenSim.Framework } public void Load () - { + { foreach (string ext in extpoints) { log.Info("[PLUGINS]: Loading extension point " + ext); @@ -169,17 +169,17 @@ namespace OpenSim.Framework } IPluginFilter filter = null; - + if (filters.ContainsKey (ext)) filter = filters [ext]; foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes (ext)) { log.Info("[PLUGINS]: Trying plugin " + node.Path); - + if ((filter != null) && (filter.Apply (node) == false)) continue; - + T plugin = (T) node.CreateInstance(); Initialiser.Initialise (plugin); Plugins.Add (plugin); @@ -219,7 +219,7 @@ namespace OpenSim.Framework private void on_addinloaderror_(object sender, AddinErrorEventArgs args) { if (args.Exception == null) - log.Error ("[PLUGINS]: Plugin Error: " + log.Error ("[PLUGINS]: Plugin Error: " + args.Message); else log.Error ("[PLUGINS]: Plugin Error: " @@ -229,7 +229,7 @@ namespace OpenSim.Framework private void clear_registry_ () { - // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) + // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) // occasionally seems to corrupt its addin cache // Hence, as a temporary solution we'll remove it before each startup try @@ -252,7 +252,7 @@ namespace OpenSim.Framework } } - private static TextWriter prev_console_; + private static TextWriter prev_console_; public void suppress_console_output_ (bool save) { if (save) @@ -262,7 +262,7 @@ namespace OpenSim.Framework } else { - if (prev_console_ != null) + if (prev_console_ != null) System.Console.SetOut(prev_console_); } } @@ -283,7 +283,7 @@ namespace OpenSim.Framework public Type TypeObject { - get + get { if (typeobj != null) return typeobj; @@ -295,9 +295,9 @@ namespace OpenSim.Framework } } - public object CreateInstance () - { - return Activator.CreateInstance (TypeObject); + public object CreateInstance () + { + return Activator.CreateInstance (TypeObject); } } @@ -305,29 +305,29 @@ namespace OpenSim.Framework /// Constraint that bounds the number of plugins to be loaded. /// public class PluginCountConstraint : IPluginConstraint - { - private int min; - private int max; + { + private int min; + private int max; public PluginCountConstraint (int exact) { - min = exact; - max = exact; + min = exact; + max = exact; + } + + public PluginCountConstraint (int minimum, int maximum) + { + min = minimum; + max = maximum; } - public PluginCountConstraint (int minimum, int maximum) - { - min = minimum; - max = maximum; - } - - public string Message - { - get - { - return "The number of plugins is constrained to the interval [" - + min + ", " + max + "]"; - } + public string Message + { + get + { + return "The number of plugins is constrained to the interval [" + + min + ", " + max + "]"; + } } public bool Apply (string extpoint) @@ -340,7 +340,7 @@ namespace OpenSim.Framework return true; } } - + /// /// Filters out which plugin to load based on its "Provider", which is name given by in the addin.xml /// @@ -348,7 +348,7 @@ namespace OpenSim.Framework { private string provider; - public PluginProviderFilter (string p) + public PluginProviderFilter (string p) { provider = p; } diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index ef74b54..f244b51 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -128,7 +128,7 @@ namespace OpenSim.Framework [XmlIgnore] private bool _flexiEntry = false; [XmlIgnore] private bool _lightEntry = false; [XmlIgnore] private bool _sculptEntry = false; - + public byte ProfileCurve { get { return (byte)((byte)HollowShape | (byte)ProfileShape); } @@ -185,10 +185,10 @@ namespace OpenSim.Framework [XmlIgnore] public LLObject.TextureEntry Textures { - get - { + get + { //m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length); - return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); + return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); } set { m_textureEntry = value.ToBytes(); } @@ -198,12 +198,12 @@ namespace OpenSim.Framework { get { return m_textureEntry; } - set - { - if (value == null) + set + { + if (value == null) m_textureEntry = new byte[1]; - else - m_textureEntry = value; + else + m_textureEntry = value; } } @@ -302,7 +302,7 @@ namespace OpenSim.Framework _profileBegin = LLObject.PackBeginCut(profileRange.X); _profileEnd = LLObject.PackEndCut(profileRange.Y); } - + public byte[] ExtraParams { get @@ -941,7 +941,7 @@ namespace OpenSim.Framework return data; } - + public void ReadFlexiData(byte[] data, int pos) { if (data.Length-pos >= 16) @@ -972,7 +972,7 @@ namespace OpenSim.Framework _flexiForceZ = 0f; } } - + public byte[] GetFlexiBytes() { byte[] data = new byte[16]; @@ -991,7 +991,7 @@ namespace OpenSim.Framework return data; } - + public void ReadLightData(byte[] data, int pos) { if (data.Length - pos >= 16) @@ -1021,7 +1021,7 @@ namespace OpenSim.Framework _lightIntensity = 0f; } } - + public byte[] GetLightBytes() { byte[] data = new byte[16]; diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 0b50a81..2d0be15 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework private RegionUp handlerRegionUp = null; // OnRegionUp; private LogOffUser handlerLogOffUser = null; private GetLandData handlerGetLandData = null; - + #region IRegionCommsListener Members public event ExpectUserDelegate OnExpectUser; @@ -228,13 +228,13 @@ namespace OpenSim.Framework return false; } - + public LandData TriggerGetLandData(uint x, uint y) { handlerGetLandData = OnGetLandData; if (handlerGetLandData != null) return handlerGetLandData(x, y); - + return null; } } diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 1d9d9ec..716849c 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework set { m_httpPort = value; } } protected uint m_httpPort; - + /// /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) /// @@ -58,17 +58,17 @@ namespace OpenSim.Framework { get { return m_serverURI; } set { m_serverURI = value; } - } + } protected string m_serverURI; protected bool Allow_Alternate_Ports; public bool m_allow_alternate_ports; protected string m_externalHostName; - + protected IPEndPoint m_internalEndPoint; protected uint? m_regionLocX; protected uint? m_regionLocY; - protected uint m_remotingPort; + protected uint m_remotingPort; public LLUUID RegionID = LLUUID.Zero; public string RemotingAddress; @@ -404,11 +404,11 @@ namespace OpenSim.Framework configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", MasterAvatarSandboxPassword, true); - configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, + configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Last Map UUID", lastMapUUID.ToString(), true); - configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, + configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); - + } public void loadConfigurationOptions() @@ -454,15 +454,14 @@ namespace OpenSim.Framework shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Last Map UUID", lastMapUUID.ToString(), true); - - configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, + + configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); - } public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) { - if (MasterAvatarAssignedUUID == LLUUID.Zero) + return MasterAvatarAssignedUUID == LLUUID.Zero; { return true; } diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index d157bac..b6e466d 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -139,7 +139,7 @@ namespace OpenSim.Framework { case "region_flags": Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)value; - + m_BlockTerraform = (flags & Simulator.RegionFlags.BlockTerraform) != 0; m_BlockFly = @@ -246,7 +246,7 @@ namespace OpenSim.Framework } private bool m_BlockTerraform = false; - + public bool BlockTerraform { get { return m_BlockTerraform; } @@ -254,7 +254,7 @@ namespace OpenSim.Framework } private bool m_BlockFly = false; - + public bool BlockFly { get { return m_BlockFly; } @@ -262,7 +262,7 @@ namespace OpenSim.Framework } private bool m_AllowDamage = false; - + public bool AllowDamage { get { return m_AllowDamage; } @@ -270,7 +270,7 @@ namespace OpenSim.Framework } private bool m_RestrictPushing = false; - + public bool RestrictPushing { get { return m_RestrictPushing; } @@ -278,7 +278,7 @@ namespace OpenSim.Framework } private bool m_AllowLandResell = true; - + public bool AllowLandResell { get { return m_AllowLandResell; } @@ -286,7 +286,7 @@ namespace OpenSim.Framework } private bool m_AllowLandJoinDivide = true; - + public bool AllowLandJoinDivide { get { return m_AllowLandJoinDivide; } @@ -294,7 +294,7 @@ namespace OpenSim.Framework } private bool m_BlockShowInSearch = false; - + public bool BlockShowInSearch { get { return m_BlockShowInSearch; } @@ -302,7 +302,7 @@ namespace OpenSim.Framework } private int m_AgentLimit = 40; - + public int AgentLimit { get { return m_AgentLimit; } @@ -310,7 +310,7 @@ namespace OpenSim.Framework } private double m_ObjectBonus = 1.0; - + public double ObjectBonus { get { return m_ObjectBonus; } @@ -318,7 +318,7 @@ namespace OpenSim.Framework } private int m_Maturity = 1; - + public int Maturity { get { return m_Maturity; } @@ -326,7 +326,7 @@ namespace OpenSim.Framework } private bool m_DisableScripts = false; - + public bool DisableScripts { get { return m_DisableScripts; } @@ -334,7 +334,7 @@ namespace OpenSim.Framework } private bool m_DisableCollisions = false; - + public bool DisableCollisions { get { return m_DisableCollisions; } @@ -342,7 +342,7 @@ namespace OpenSim.Framework } private bool m_DisablePhysics = false; - + public bool DisablePhysics { get { return m_DisablePhysics; } @@ -350,7 +350,7 @@ namespace OpenSim.Framework } private LLUUID m_TerrainTexture1 = LLUUID.Zero; - + public LLUUID TerrainTexture1 { get { return m_TerrainTexture1; } @@ -358,7 +358,7 @@ namespace OpenSim.Framework } private LLUUID m_TerrainTexture2 = LLUUID.Zero; - + public LLUUID TerrainTexture2 { get { return m_TerrainTexture2; } @@ -366,7 +366,7 @@ namespace OpenSim.Framework } private LLUUID m_TerrainTexture3 = LLUUID.Zero; - + public LLUUID TerrainTexture3 { get { return m_TerrainTexture3; } @@ -374,7 +374,7 @@ namespace OpenSim.Framework } private LLUUID m_TerrainTexture4 = LLUUID.Zero; - + public LLUUID TerrainTexture4 { get { return m_TerrainTexture4; } @@ -382,7 +382,7 @@ namespace OpenSim.Framework } private double m_Elevation1NW = 10; - + public double Elevation1NW { get { return m_Elevation1NW; } @@ -390,7 +390,7 @@ namespace OpenSim.Framework } private double m_Elevation2NW = 60; - + public double Elevation2NW { get { return m_Elevation2NW; } @@ -398,7 +398,7 @@ namespace OpenSim.Framework } private double m_Elevation1NE = 10; - + public double Elevation1NE { get { return m_Elevation1NE; } @@ -406,7 +406,7 @@ namespace OpenSim.Framework } private double m_Elevation2NE = 60; - + public double Elevation2NE { get { return m_Elevation2NE; } @@ -414,7 +414,7 @@ namespace OpenSim.Framework } private double m_Elevation1SE = 10; - + public double Elevation1SE { get { return m_Elevation1SE; } @@ -422,7 +422,7 @@ namespace OpenSim.Framework } private double m_Elevation2SE = 60; - + public double Elevation2SE { get { return m_Elevation2SE; } @@ -430,7 +430,7 @@ namespace OpenSim.Framework } private double m_Elevation1SW = 10; - + public double Elevation1SW { get { return m_Elevation1SW; } @@ -438,7 +438,7 @@ namespace OpenSim.Framework } private double m_Elevation2SW = 60; - + public double Elevation2SW { get { return m_Elevation2SW; } @@ -446,7 +446,7 @@ namespace OpenSim.Framework } private double m_WaterHeight = 20; - + public double WaterHeight { get { return m_WaterHeight; } @@ -454,7 +454,7 @@ namespace OpenSim.Framework } private double m_TerrainRaiseLimit = 100; - + public double TerrainRaiseLimit { get { return m_TerrainRaiseLimit; } @@ -462,7 +462,7 @@ namespace OpenSim.Framework } private double m_TerrainLowerLimit = -100; - + public double TerrainLowerLimit { get { return m_TerrainLowerLimit; } @@ -470,7 +470,7 @@ namespace OpenSim.Framework } private bool m_UseEstateSun = true; - + public bool UseEstateSun { get { return m_UseEstateSun; } @@ -478,7 +478,7 @@ namespace OpenSim.Framework } private bool m_Sandbox = false; - + public bool Sandbox { get { return m_Sandbox; } @@ -502,7 +502,7 @@ namespace OpenSim.Framework } private bool m_FixedSun = false; - + public bool FixedSun { get { return m_FixedSun; } @@ -510,7 +510,7 @@ namespace OpenSim.Framework } private double m_SunPosition = 0.0; - + public double SunPosition { get { return m_SunPosition; } @@ -518,7 +518,7 @@ namespace OpenSim.Framework } private LLUUID m_Covenant = LLUUID.Zero; - + public LLUUID Covenant { get { return m_Covenant; } diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 952fb31..c3bd085 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -172,7 +172,7 @@ namespace OpenSim.Framework.Servers OSHttpResponse response = new OSHttpResponse(context.Response); // This is the REST agent interface. We require an agent to properly identify - // itself. If the REST handler recognizes the prefix it will attempt to + // itself. If the REST handler recognizes the prefix it will attempt to // satisfy the request. If it is not recognizable, and no damage has occurred // the request can be passed through to the other handlers. This is a low // probability event; if a request is matched it is normally expected to be @@ -650,7 +650,7 @@ namespace OpenSim.Framework.Servers } response.AddHeader("Content-type", contentType); - + byte[] buffer; if (!contentType.Contains("image")) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index e901b68..33081b9 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -89,7 +89,7 @@ namespace OpenSim.Framework.Servers m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); m_periodicDiagnosticsTimer.Enabled = true; - + // Add ourselves to thread monitoring. This thread will go on to become the console listening thread Thread.CurrentThread.Name = "ConsoleThread"; ThreadTracker.Add(Thread.CurrentThread); @@ -102,15 +102,15 @@ namespace OpenSim.Framework.Servers { StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n"); sb.Append(GetUptimeReport()); - + if (m_stats != null) { sb.Append(m_stats.Report()); } - + m_log.Debug(sb); } - + /// /// Return a report about the uptime of this server /// @@ -120,10 +120,10 @@ namespace OpenSim.Framework.Servers StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now)); sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime)); sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime)); - + return sb.ToString(); } - + /// /// Set the level of log notices being echoed to the console /// @@ -133,7 +133,7 @@ namespace OpenSim.Framework.Servers ILoggerRepository repository = LogManager.GetRepository(); IAppender[] appenders = repository.GetAppenders(); OpenSimAppender consoleAppender = null; - + foreach (IAppender appender in appenders) { if (appender.Name == "Console") @@ -142,13 +142,13 @@ namespace OpenSim.Framework.Servers break; } } - + if (null == consoleAppender) { Notice("No appender named Console found (see the log4net config file for this executable)!"); return; } - + if (setParams.Length > 0) { Level consoleLevel = repository.LevelMap[setParams[0]]; @@ -160,12 +160,12 @@ namespace OpenSim.Framework.Servers "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", setParams[0])); } - + // If there is no threshold set then the threshold is effectively everything. Level thresholdLevel = (null != consoleAppender.Threshold ? consoleAppender.Threshold : log4net.Core.Level.All); - - Notice(String.Format("Console log level is {0}", thresholdLevel)); + + Notice(String.Format("Console log level is {0}", thresholdLevel)); } /// @@ -203,7 +203,7 @@ namespace OpenSim.Framework.Servers Notice(""); Notice("quit - equivalent to shutdown."); - Notice("set log level [level] - change the console logging level only. For example, off or debug."); + Notice("set log level [level] - change the console logging level only. For example, off or debug."); Notice("show info - show server information (e.g. startup path)."); if (m_stats != null) @@ -219,7 +219,7 @@ namespace OpenSim.Framework.Servers case "set": Set(cmdparams); break; - + case "show": if (cmdparams.Length > 0) { @@ -232,8 +232,8 @@ namespace OpenSim.Framework.Servers Shutdown(); break; } - } - + } + /// /// Set an OpenSim parameter /// @@ -245,15 +245,15 @@ namespace OpenSim.Framework.Servers // Temporary while we only have one command which takes at least two parameters if (setArgs.Length < 2) return; - + if (setArgs[0] == "log" && setArgs[1] == "level") { string[] setParams = new string[setArgs.Length - 2]; Array.Copy(setArgs, 2, setParams, 0, setArgs.Length - 2); - - SetConsoleLogLevel(setParams); + + SetConsoleLogLevel(setParams); } - } + } /// /// Outputs to the console information about the region @@ -276,7 +276,7 @@ namespace OpenSim.Framework.Servers Notice(m_stats.Report()); } break; - + case "threads": List threads = ThreadTracker.GetThreads(); if (threads == null) @@ -291,7 +291,7 @@ namespace OpenSim.Framework.Servers Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString()); } } - break; + break; case "uptime": Notice(GetUptimeReport()); @@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers Notice("Version: " + m_version); break; } - } + } /// /// Console output is only possible if a console has been established. diff --git a/OpenSim/Framework/Servers/OSHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHandler.cs index 66fff3e..838f29a 100644 --- a/OpenSim/Framework/Servers/OSHttpHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpHandler.cs @@ -72,21 +72,21 @@ namespace OpenSim.Framework.Servers /// Regular expression used to match against method of /// the incoming HTTP request. If you want to match any string /// either use '.*' or null. To match on the empty string use - /// '^$'. + /// '^$'. /// public virtual Regex Method { get { return _method; } } protected Regex _method; - + /// /// Regular expression used to match against path of the /// incoming HTTP request. If you want to match any string /// either use '.*' or null. To match on the emtpy string use /// '^$'. /// - public virtual Regex Path + public virtual Regex Path { get { return _path; } } @@ -97,7 +97,7 @@ namespace OpenSim.Framework.Servers /// allowing us to match on URI query fields. /// public virtual Dictionary Query - { + { get { return _query; } } protected Dictionary _query; @@ -107,7 +107,7 @@ namespace OpenSim.Framework.Servers /// allowing us to match on HTTP header fields. /// public virtual Dictionary Headers - { + { get { return _headers; } } protected Dictionary _headers; @@ -137,7 +137,7 @@ namespace OpenSim.Framework.Servers /// null or content type /// regex /// null or IP address regex - public OSHttpHandler(Regex method, Regex path, Dictionary query, + public OSHttpHandler(Regex method, Regex path, Dictionary query, Dictionary headers, Regex contentType, Regex whitelist) { _method = method; @@ -155,7 +155,7 @@ namespace OpenSim.Framework.Servers /// /// Process an incoming OSHttpRequest that matched our - /// requirements. + /// requirements. /// /// /// OSHttpHandlerResult.Pass if we are after all not @@ -180,4 +180,4 @@ namespace OpenSim.Framework.Servers return sw.ToString(); } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs index 66120c3..e08df85 100644 --- a/OpenSim/Framework/Servers/OSHttpHttpHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpHttpHandler.cs @@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers /// null or dictionary with header /// regexs /// null or IP address whitelist - public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path, + public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path, Dictionary query, Dictionary headers, Regex whitelist) : base(method, path, query, headers, new Regex(@"^text/html", RegexOptions.IgnoreCase | RegexOptions.Compiled), @@ -71,7 +71,7 @@ namespace OpenSim.Framework.Servers /// Instantiate an HTTP handler. /// /// a GenericHTTPMethod - public OSHttpHttpHandler(GenericHTTPMethod handler) + public OSHttpHttpHandler(GenericHTTPMethod handler) : this(handler, new Regex(@"^GET$", RegexOptions.IgnoreCase | RegexOptions.Compiled), null, null, null, null) { } @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Servers /// /// Invoked by OSHttpRequestPump. /// - public override OSHttpHandlerResult Process(OSHttpRequest request) + public override OSHttpHandlerResult Process(OSHttpRequest request) { // call handler method Hashtable responseData = _handler(request.Query); @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers } response.AddHeader("Content-type", contentType); - + byte[] buffer; if (!contentType.Contains("image")) @@ -142,4 +142,4 @@ namespace OpenSim.Framework.Servers return OSHttpHandlerResult.Done; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs index 0a82a04..01e71c8 100644 --- a/OpenSim/Framework/Servers/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/OSHttpRequest.cs @@ -38,42 +38,35 @@ namespace OpenSim.Framework.Servers { public class OSHttpRequest { - - public string[] AcceptTypes { get { return _acceptTypes; } } private string[] _acceptTypes; - public Encoding ContentEncoding { get { return _contentEncoding; } } private Encoding _contentEncoding; - public long ContentLength { get { return _contentLength64; } } private long _contentLength64; - public long ContentLength64 { get { return ContentLength; } } - public string ContentType { get { return _contentType; } } private string _contentType; - // public CookieCollection Cookies // { // get { return _cookies; } @@ -92,63 +85,54 @@ namespace OpenSim.Framework.Servers } private string _httpMethod; - public Stream InputStream { get { return _inputStream; } } private Stream _inputStream; - // public bool IsSecureConnection // { // get { return _isSecureConnection; } // } // private bool _isSecureConnection; - // public bool IsAuthenticated // { // get { return _isAuthenticated; } // } // private bool _isAuthenticated; - public bool HasEntityBody { get { return _hasbody; } } private bool _hasbody; - public bool KeepAlive { get { return _keepAlive; } } private bool _keepAlive; - public string RawUrl { get { return _rawUrl; } } private string _rawUrl; - public Uri Url { get { return _url; } } private Uri _url; - public string UserAgent { get { return _userAgent; } } private string _userAgent; - public NameValueCollection QueryString { get { return _queryString; } @@ -161,28 +145,24 @@ namespace OpenSim.Framework.Servers } private Hashtable _query; - public IPEndPoint RemoteIPEndPoint { get { return _ipEndPoint; } } private IPEndPoint _ipEndPoint; - internal HttpRequest HttpRequest { get { return _request; } } private HttpRequest _request; - internal HttpClientContext HttpClientContext { get { return _context; } } private HttpClientContext _context; - /// /// Internal whiteboard for handlers to store temporary stuff /// into. @@ -193,12 +173,10 @@ namespace OpenSim.Framework.Servers } private Dictionary _whiteboard = new Dictionary(); - public OSHttpRequest() { } - public OSHttpRequest(HttpListenerRequest req) { _acceptTypes = req.AcceptTypes; diff --git a/OpenSim/Framework/Servers/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/OSHttpRequestPump.cs index 8d4dc0d..b4270b3 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestPump.cs @@ -39,7 +39,6 @@ using System.Threading; using log4net; using HttpServer; - namespace OpenSim.Framework.Servers { /// @@ -58,13 +57,12 @@ namespace OpenSim.Framework.Servers protected Thread _engine; private int _id; - + public string EngineID { get { return String.Format("{0} pump {1}", _server.EngineID, _id); } } - public OSHttpRequestPump(OSHttpServer server, OSHttpRequestQueue queue, int id) { _server = server; @@ -77,7 +75,6 @@ namespace OpenSim.Framework.Servers _engine.Start(); ThreadTracker.Add(_engine); - } public static OSHttpRequestPump[] Pumps(OSHttpServer server, OSHttpRequestQueue queue, int poolSize) @@ -104,21 +101,22 @@ namespace OpenSim.Framework.Servers public void Engine() { OSHttpRequest req = null; - + while (true) { - try { + try + { // dequeue an OSHttpRequest from OSHttpServer's - // request queue + // request queue req = _queue.Dequeue(); - + // get a copy of the list of registered handlers List handlers = _server.OSHttpHandlers; - + // prune list and have it sorted from most // specific to least specific handlers = MatchHandlers(req, handlers); - + // process req: we try each handler in turn until // we are either out of handlers or get back a // Pass or Done @@ -126,18 +124,18 @@ namespace OpenSim.Framework.Servers foreach (OSHttpHandler h in handlers) { rc = h.Process(req); - + // Pass: handler did not process the request, // try next handler if (OSHttpHandlerResult.Pass == rc) continue; // Handled: handler has processed the request if (OSHttpHandlerResult.Done == rc) break; - + // hmm, something went wrong throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc)); } - + if (OSHttpHandlerResult.Unprocessed == rc) { _log.InfoFormat("[{0}] OSHttpHandler: no handler registered for {1}", EngineID, req); @@ -190,7 +188,7 @@ namespace OpenSim.Framework.Servers if (null != remote) { Match epm = h.IPEndPointWhitelist.Match(remote.ToString()); - if (!epm.Success) + if (!epm.Success) { scoredHandlers.Remove(h); continue; @@ -201,7 +199,7 @@ namespace OpenSim.Framework.Servers if (null != h.Method) { Match m = h.Method.Match(req.HttpMethod); - if (!m.Success) + if (!m.Success) { scoredHandlers.Remove(h); continue; @@ -213,7 +211,7 @@ namespace OpenSim.Framework.Servers if (null != h.Path) { Match m = h.Path.Match(req.RawUrl); - if (!m.Success) + if (!m.Success) { scoredHandlers.Remove(h); continue; @@ -272,14 +270,15 @@ namespace OpenSim.Framework.Servers { return 0; } - + // does the content of collection[tag] match // the supplied regex? Match cm = regexs[tag].Match(collection[tag]); - if (!cm.Success) { + if (!cm.Success) + { return 0; } - + // ok: matches matched++; continue; @@ -288,7 +287,7 @@ namespace OpenSim.Framework.Servers return matched; } - [ConditionalAttribute("DEBUGGING")] + [ConditionalAttribute("DEBUGGING")] private void LogDumpHandlerList(List l) { _log.DebugFormat("[{0}] OSHttpHandlerList dump:", EngineID); diff --git a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs index f6f1829..94f7b32 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestQueue.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestQueue.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Servers { private object _syncObject = new object(); - new public void Enqueue(OSHttpRequest req) + new public void Enqueue(OSHttpRequest req) { lock (_syncObject) { @@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers Monitor.Pulse(_syncObject); } } - + new public OSHttpRequest Dequeue() { OSHttpRequest req = null; @@ -65,4 +65,4 @@ namespace OpenSim.Framework.Servers return req; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/OSHttpResponse.cs b/OpenSim/Framework/Servers/OSHttpResponse.cs index eb7e400..21d1e2b 100644 --- a/OpenSim/Framework/Servers/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/OSHttpResponse.cs @@ -56,15 +56,15 @@ namespace OpenSim.Framework.Servers /// /// /// Setting this property will also set IsContentTypeSet to - /// true. + /// true. /// public string ContentType { - get - { + get + { if (HttpServer) return _httpResponse.ContentType; - else + else return _httpListenerResponse.ContentType; } set @@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers /// public long ContentLength { - get - { + get + { if (HttpServer) return _httpResponse.ContentLength; - else + else return _httpListenerResponse.ContentLength64; } set @@ -130,11 +130,11 @@ namespace OpenSim.Framework.Servers /// public Encoding ContentEncoding { - get - { + get + { if (HttpServer) return _httpResponse.Encoding; - else + else return _httpListenerResponse.ContentEncoding; } @@ -142,7 +142,7 @@ namespace OpenSim.Framework.Servers { if (HttpServer) _httpResponse.Encoding = value; - else + else _httpListenerResponse.ContentEncoding = value; } } @@ -152,8 +152,8 @@ namespace OpenSim.Framework.Servers /// public WebHeaderCollection Headers { - get - { + get + { if (HttpServer) return null; else @@ -166,10 +166,10 @@ namespace OpenSim.Framework.Servers /// public bool KeepAlive { - get - { + get + { if (HttpServer) - return _httpResponse.Connection == ConnectionType.KeepAlive; + return _httpResponse.Connection == ConnectionType.KeepAlive; else return _httpListenerResponse.KeepAlive; } @@ -178,7 +178,7 @@ namespace OpenSim.Framework.Servers { if (HttpServer) _httpResponse.Connection = ConnectionType.KeepAlive; - else + else _httpListenerResponse.KeepAlive = value; } } @@ -191,8 +191,8 @@ namespace OpenSim.Framework.Servers /// public Stream OutputStream { - get - { + get + { if (HttpServer) return _httpResponse.Body; else @@ -205,10 +205,10 @@ namespace OpenSim.Framework.Servers /// public Stream Body { - get - { + get + { if (HttpServer) - return _httpResponse.Body; + return _httpResponse.Body; throw new Exception("[OSHttpResponse] mixed .NET and HttpServer access"); } } @@ -228,18 +228,18 @@ namespace OpenSim.Framework.Servers } } - + /// /// Chunk transfers. /// public bool SendChunked { - get - { + get + { if (HttpServer) return _httpResponse.Chunked; else - return _httpListenerResponse.SendChunked; + return _httpListenerResponse.SendChunked; } set @@ -256,12 +256,12 @@ namespace OpenSim.Framework.Servers /// public int StatusCode { - get - { + get + { if (HttpServer) return (int)_httpResponse.Status; - else - return _httpListenerResponse.StatusCode; + else + return _httpListenerResponse.StatusCode; } set @@ -279,12 +279,12 @@ namespace OpenSim.Framework.Servers /// public string StatusDescription { - get - { + get + { if (HttpServer) return _httpResponse.Reason; else - return _httpListenerResponse.StatusDescription; + return _httpListenerResponse.StatusDescription; } set @@ -331,7 +331,7 @@ namespace OpenSim.Framework.Servers /// object. /// Incoming OSHttpRequest to which we are - /// replying + /// replying public OSHttpResponse(OSHttpRequest req) { _httpResponse = new HttpResponse(req.HttpClientContext, req.HttpRequest); @@ -343,7 +343,7 @@ namespace OpenSim.Framework.Servers /// string containing the header field /// name /// string containing the header field - /// value + /// value public void AddHeader(string key, string value) { if (HttpServer) @@ -361,8 +361,8 @@ namespace OpenSim.Framework.Servers { _httpResponse.Body.Flush(); _httpResponse.Send(); - } - else + } + else { OutputStream.Close(); } diff --git a/OpenSim/Framework/Servers/OSHttpServer.cs b/OpenSim/Framework/Servers/OSHttpServer.cs index e0d26ff..40f4229 100644 --- a/OpenSim/Framework/Servers/OSHttpServer.cs +++ b/OpenSim/Framework/Servers/OSHttpServer.cs @@ -80,7 +80,7 @@ namespace OpenSim.Framework.Servers get { return _isSecure; } } - public int QueueSize + public int QueueSize { get { return _pumps.Length; } } @@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers protected List _httpHandlers = new List(); public List OSHttpHandlers { - get + get { lock (_httpHandlers) { @@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers _listener.RequestHandler += OnHttpRequest; _listener.Start(QueueSize); _log.InfoFormat("[{0}] HTTP server started", EngineID); - + lock (_syncObject) Monitor.Wait(_syncObject); } catch (Exception ex) @@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers /// and regular expressions to match against header values public void AddHandler(OSHttpHandler handler) { - lock (_httpHandlers) + lock (_httpHandlers) { if (_httpHandlers.Contains(handler)) { diff --git a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs index f3f056a..996e5dc 100644 --- a/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpXmlRpcHandler.cs @@ -54,16 +54,16 @@ namespace OpenSim.Framework.Servers protected bool XmlRpcMethodMatch(OSHttpRequest req) { XmlRpcRequest xmlRpcRequest = null; - + // check whether req is already reified // if not: reify (and post to whiteboard) - try + try { if (req.Whiteboard.ContainsKey("xmlrequest")) { xmlRpcRequest = req.Whiteboard["xmlrequest"] as XmlRpcRequest; } - else + else { StreamReader body = new StreamReader(req.InputStream); string requestBody = body.ReadToEnd(); @@ -76,22 +76,22 @@ namespace OpenSim.Framework.Servers _log.ErrorFormat("[OSHttpXmlRpcHandler] failed to deserialize XmlRpcRequest from {0}", req.ToString()); return false; } - + // check against methodName - if ((null != xmlRpcRequest) - && !String.IsNullOrEmpty(xmlRpcRequest.MethodName) + if ((null != xmlRpcRequest) + && !String.IsNullOrEmpty(xmlRpcRequest.MethodName) && xmlRpcRequest.MethodName == _methodName) { _log.DebugFormat("[OSHttpXmlRpcHandler] located handler {0} for {1}", _methodName, req.ToString()); return true; } - + return false; } // contains handler for processing XmlRpc Request private XmlRpcMethod _handler; - + // contains XmlRpc method name private string _methodName; @@ -112,9 +112,9 @@ namespace OpenSim.Framework.Servers /// can be null, in which case they are not taken into account /// when the handler is being looked up. /// - public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, + public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path, Dictionary headers, Regex whitelist) - : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, + : base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers, new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled), whitelist) { @@ -138,7 +138,7 @@ namespace OpenSim.Framework.Servers /// /// Invoked by OSHttpRequestPump. /// - public override OSHttpHandlerResult Process(OSHttpRequest request) + public override OSHttpHandlerResult Process(OSHttpRequest request) { XmlRpcResponse xmlRpcResponse; string responseString; @@ -148,13 +148,13 @@ namespace OpenSim.Framework.Servers OSHttpResponse resp = new OSHttpResponse(request); - try + try { // reified XmlRpcRequest must still be on the whiteboard XmlRpcRequest xmlRpcRequest = request.Whiteboard["xmlrequest"] as XmlRpcRequest; xmlRpcResponse = _handler(xmlRpcRequest); responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); - + resp.ContentType = "text/xml"; byte[] buffer = Encoding.UTF8.GetBytes(responseString); @@ -176,4 +176,4 @@ namespace OpenSim.Framework.Servers return OSHttpHandlerResult.Done; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/RestSessionService.cs b/OpenSim/Framework/Servers/RestSessionService.cs index 1ed349f..1cfb425 100644 --- a/OpenSim/Framework/Servers/RestSessionService.cs +++ b/OpenSim/Framework/Servers/RestSessionService.cs @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Servers private CheckIdentityMethod m_smethod; public RestDeserialiseSecureHandler( - string httpMethod, string path, + string httpMethod, string path, RestDeserialiseMethod method, CheckIdentityMethod smethod) : base(httpMethod, path) { @@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers /// /// private RestDeserialiseMethod m_method; - + /// /// The method used to check whether a request is trusted. /// diff --git a/OpenSim/Framework/Statistics/BaseStatsCollector.cs b/OpenSim/Framework/Statistics/BaseStatsCollector.cs index c888f4c..1e59983 100644 --- a/OpenSim/Framework/Statistics/BaseStatsCollector.cs +++ b/OpenSim/Framework/Statistics/BaseStatsCollector.cs @@ -24,10 +24,10 @@ * (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.Text; - + namespace OpenSim.Framework.Statistics { /// @@ -44,7 +44,7 @@ namespace OpenSim.Framework.Statistics string.Format( "Allocated to OpenSim : {0} MB" + Environment.NewLine, Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0))); - + return sb.ToString(); } } diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 06b3185..58d5621 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -40,7 +40,7 @@ namespace OpenSim.Framework.Statistics public class SimExtraStatsCollector : BaseStatsCollector { private long abnormalClientThreadTerminations; - + private long assetsInCache; private long texturesInCache; private long assetCacheMemoryUsage; @@ -49,7 +49,7 @@ namespace OpenSim.Framework.Statistics private long assetServiceRequestFailures; private long inventoryServiceRetrievalFailures; - + private float timeDilation; private float simFps; private float physicsFps; @@ -70,8 +70,8 @@ namespace OpenSim.Framework.Statistics private float pendingDownloads; private float pendingUploads; private float activeScripts; - private float scriptLinesPerSecond; - + private float scriptLinesPerSecond; + /// /// Number of times that a client thread terminated because of an exception /// @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Statistics /// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the - /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these + /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these /// haven't yet been implemented... :) /// public long AssetsInCache { get { return assetsInCache; } } @@ -101,19 +101,19 @@ namespace OpenSim.Framework.Statistics /// as a failure /// public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } - + /// /// Number of known failures to retrieve avatar inventory from the inventory service. This does not /// cover situations where the inventory service accepts the request but never returns any data, since /// we do not yet timeout this situation. /// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } - + /// /// Retrieve the total frame time (in ms) of the last frame /// //public float TotalFrameTime { get { return totalFrameTime; } } - + /// /// Retrieve the physics update component (in ms) of the last frame /// @@ -124,7 +124,7 @@ namespace OpenSim.Framework.Statistics /// private IDictionary packetQueueStatsCollectors = new Dictionary(); - + public void AddAbnormalClientThreadTermination() { abnormalClientThreadTerminations++; @@ -146,7 +146,7 @@ namespace OpenSim.Framework.Statistics textureCacheMemoryUsage += image.Data.Length; } } - + /// /// Signal that the asset cache can be cleared. /// @@ -167,7 +167,7 @@ namespace OpenSim.Framework.Statistics { assetServiceRequestFailures++; } - + public void AddInventoryServiceRetrievalFailure() { inventoryServiceRetrievalFailures++; @@ -199,18 +199,18 @@ namespace OpenSim.Framework.Statistics packetQueueStatsCollectors.Remove(uuid); } } - + /// - /// This is the method on which the classic sim stats reporter (which collects stats for + /// This is the method on which the classic sim stats reporter (which collects stats for /// client purposes) sends information to listeners. /// /// - public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket) + public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket) { // FIXME: Really shouldn't rely on the probably arbitrary order in which // stats are packed into the packet timeDilation = statsPacket.Stat[0].StatValue; - simFps = statsPacket.Stat[1].StatValue; + simFps = statsPacket.Stat[1].StatValue; physicsFps = statsPacket.Stat[2].StatValue; agentUpdates = statsPacket.Stat[3].StatValue; rootAgents = statsPacket.Stat[4].StatValue; @@ -231,7 +231,7 @@ namespace OpenSim.Framework.Statistics activeScripts = statsPacket.Stat[19].StatValue; scriptLinesPerSecond = statsPacket.Stat[20].StatValue; } - + /// /// Report back collected statistical information. /// @@ -248,10 +248,10 @@ Texture cache contains {2,6} texture assets using {3,10} K Blocked client requests for missing textures: {4} Asset service request failures: {5}"+ Environment.NewLine, AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), - TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), + TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), BlockedMissingTextureRequests, AssetServiceRequestFailures)); - + sb.Append(Environment.NewLine); sb.Append("CONNECTION STATISTICS"); sb.Append(Environment.NewLine); @@ -267,7 +267,7 @@ Asset service request failures: {5}"+ Environment.NewLine, string.Format( "Initial inventory caching failures: {0}" + Environment.NewLine, InventoryServiceRetrievalFailures)); - + sb.Append(Environment.NewLine); sb.Append("FRAME STATISTICS"); sb.Append(Environment.NewLine); @@ -278,18 +278,18 @@ Asset service request failures: {5}"+ Environment.NewLine, "{0,6:0.00} {1,6:0} {2,6:0.0} {3,6:0.0} {4,6:0} {5,6:0} {6,6:0} {7,6:0} {8,6:0} {9,6:0}", timeDilation, simFps, physicsFps, agentUpdates, rootAgents, childAgents, totalPrims, activePrims, activeScripts, scriptLinesPerSecond)); - + sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); // There is no script frame time currently because we don't yet collect it sb.Append("PktsIn PktOut PendDl PendUl UnackB TotlFt NetFt PhysFt OthrFt AgntFt ImgsFt"); - sb.Append(Environment.NewLine); + sb.Append(Environment.NewLine); sb.Append( string.Format( "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}", inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime, netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime)); - sb.Append(Environment.NewLine); + sb.Append(Environment.NewLine); /* sb.Append(Environment.NewLine); @@ -311,7 +311,7 @@ Asset service request failures: {5}"+ Environment.NewLine, */ sb.Append(base.Report()); - + return sb.ToString(); } } diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 9b497ab..fc84041 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -226,7 +226,7 @@ namespace OpenSim.Framework private LLUUID _permsGranter; private int _permsMask; private int _type = 0; - + public LLUUID AssetID { get { return _assetID; @@ -437,4 +437,4 @@ namespace OpenSim.Framework _parentPartID = partID; } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index bc35fa6..2a21221 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -716,7 +716,7 @@ namespace OpenSim.Framework XmlRpcRequest client = new XmlRpcRequest(methodName, args); return client.Send(url, 6000); } - + // used for RemoteParcelRequest (for "About Landmark") public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { byte[] bytes = { @@ -726,7 +726,7 @@ namespace OpenSim.Framework (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; return new LLUUID(bytes, 0); } - + public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { byte[] bytes = parcelID.GetBytes(); regionHandle = Helpers.BytesToUInt64(bytes); diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 4a4f8bf..6d46048 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -83,7 +83,7 @@ namespace OpenSim.Grid.AssetServer public override void Startup() { base.Startup(); - + AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); m_log.Info("[ASSET]: Setting up asset DB"); @@ -115,17 +115,17 @@ namespace OpenSim.Grid.AssetServer public IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect) { - PluginLoader loader = + PluginLoader loader = new PluginLoader (new AssetDataInitialiser (connect)); - // loader will try to load all providers (MySQL, MSSQL, etc) + // loader will try to load all providers (MySQL, MSSQL, etc) // unless it is constrainted to the correct "Provider" entry in the addin.xml loader.Add ("/OpenSim/AssetData", new PluginProviderFilter (provider)); loader.Load(); return loader.Plugin; } - + public void setupDB(AssetConfig config) { try diff --git a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs index eed4621..a36d396 100644 --- a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs +++ b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs @@ -40,17 +40,17 @@ namespace OpenSim.Grid.Communications.OGS1 public class OGS1InterServiceInventoryService : IInterServiceInventoryServices { protected Uri m_inventoryServerUrl; - + public OGS1InterServiceInventoryService(Uri inventoryServerUrl) { m_inventoryServerUrl = inventoryServerUrl; } - + /// /// /// /// - /// + /// public bool CreateNewUserInventory(LLUUID userId) { return SynchronousRestObjectPoster.BeginPostObject( diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 3101a38..98abd53 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -61,20 +61,20 @@ namespace OpenSim.Grid.GridServer /// The name of the grid server plugin DLL public void AddPlugin(string provider, string connect) { - PluginLoader gridloader = + PluginLoader gridloader = new PluginLoader (new GridDataInitialiser (connect)); - PluginLoader logloader = + PluginLoader logloader = new PluginLoader (new LogDataInitialiser (connect)); - // loader will try to load all providers (MySQL, MSSQL, etc) + // loader will try to load all providers (MySQL, MSSQL, etc) // unless it is constrainted to the correct "Provider" entry in the addin.xml gridloader.Add ("/OpenSim/GridData", new PluginProviderFilter (provider)); logloader.Add ("/OpenSim/LogData", new PluginProviderFilter (provider)); - + gridloader.Load(); logloader.Load(); - + _plugins = gridloader.Plugins; _logplugins = logloader.Plugins; } @@ -382,7 +382,7 @@ namespace OpenSim.Grid.GridServer string logMsg = e.Message; if (e.InnerException != null) logMsg += ", " + e.InnerException.Message; - + m_log.WarnFormat("[LOGIN END]: {0}", logMsg); return e.XmlRpcErrorResponse; diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs index 71c357b..e2557c0 100644 --- a/OpenSim/Grid/GridServer/IGridPlugin.cs +++ b/OpenSim/Grid/GridServer/IGridPlugin.cs @@ -34,7 +34,7 @@ namespace OpenSim.Grid.GridServer { void Initialise(GridServerBase gridServer); } - + public class GridPluginInitialiser : PluginInitialiserBase { private GridServerBase server; diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 643cf4d..e4d43d4 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -84,12 +84,12 @@ namespace OpenSim.Grid.InventoryServer { return true; } - } - + } + m_log.WarnFormat( - "[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources", - peer); - + "[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources", + peer); + return false; } else @@ -110,7 +110,7 @@ namespace OpenSim.Grid.InventoryServer if (m_doLookup) { m_log.InfoFormat("[GRID AGENT INVENTORY]: checking authed session {0} {1}", session_id, avatar_id); - + if (m_session_cache.getCachedSession(session_id, avatar_id) == null) { // cache miss, ask userserver @@ -137,7 +137,7 @@ namespace OpenSim.Grid.InventoryServer m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache"); return true; } - + m_log.Warn("[GRID AGENT INVENTORY]: unknown session_id, request rejected"); return false; } diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 7e6a29b..a77c570 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -65,7 +65,7 @@ namespace OpenSim.Grid.InventoryServer public override void Startup() { base.Startup(); - + InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); m_inventoryService = new GridInventoryService(config.UserServerURL); diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs index 210e195..06bcee2 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs @@ -43,10 +43,10 @@ namespace OpenGridServices.Manager { case Gtk.ResponseType.Ok: MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); - break; - + break; + case Gtk.ResponseType.Cancel: - break; + break; } this.Hide(); } diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs index cf44ac2..c39e72a 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs @@ -41,9 +41,9 @@ namespace OpenGridServices.Manager private string ServerURL; public LLUUID SessionID; public bool connected=false; - + public RegionBlock[][] WorldMap; - + public bool Connect(string GridServerURL, string username, string password) { try @@ -76,14 +76,14 @@ namespace OpenGridServices.Manager return false; } } - + public void DownloadMap() { System.Net.WebClient mapdownloader = new WebClient(); Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); - + RegionBlock TempRegionData; - + XmlDocument doc = new XmlDocument(); doc.Load(regionliststream); regionliststream.Close(); @@ -105,12 +105,12 @@ namespace OpenGridServices.Manager } } } - + public bool RestartServer() { return true; } - + public bool ShutdownServer() { try @@ -137,7 +137,7 @@ namespace OpenGridServices.Manager return false; } } - + public void DisconnectServer() { this.connected=false; diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs index 7700229..f081665 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs @@ -38,9 +38,9 @@ namespace OpenGridServices.Manager public static BlockingQueue PendingOperations = new BlockingQueue(); private static Thread OperationsRunner; - + private static GridServerConnectionManager gridserverConn; - + private static MainWindow win; public static void DoMainLoop() @@ -79,7 +79,7 @@ namespace OpenGridServices.Manager win.SetStatus("Could not connect"); } break; - + case "restart_gridserver": win.SetStatus("Restarting grid server..."); if (gridserverConn.RestartServer()) @@ -93,7 +93,7 @@ namespace OpenGridServices.Manager win.SetStatus("Error restarting grid server!!!"); } break; - + case "shutdown_gridserver": win.SetStatus("Shutting down grid server..."); if (gridserverConn.ShutdownServer()) @@ -108,7 +108,7 @@ namespace OpenGridServices.Manager win.SetStatus("Could not shutdown grid server!!!"); } break; - + case "disconnect_gridserver": gridserverConn.DisconnectServer(); win.SetGridServerConnected(false); diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index de20d01..c80d48c 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -83,14 +83,12 @@ namespace OpenSim.Grid.MessagingServer public override void Startup() { base.Startup(); - + Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); m_log.Info("[REGION]: Starting HTTP process"); m_httpServer = new BaseHttpServer(Cfg.HttpPort); - - msgsvc = new MessageService(Cfg); if (msgsvc.registerWithUserServer()) @@ -123,7 +121,6 @@ namespace OpenSim.Grid.MessagingServer switch (what) { case "user": - try { //userID = @@ -161,8 +158,6 @@ namespace OpenSim.Grid.MessagingServer m_console.Notice("Region cache cleared! Cleared " + entries.ToString() + " entries"); break; } - - } public override void Shutdown() diff --git a/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs b/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs index 5f60871..281beb9 100644 --- a/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs +++ b/OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs @@ -62,7 +62,7 @@ namespace OpenSim.Grid.MessagingServer } return result; } - + public int Count { get diff --git a/OpenSim/Grid/ScriptServer/FakeScene.cs b/OpenSim/Grid/ScriptServer/FakeScene.cs index 89e7efb..ef88a9d 100644 --- a/OpenSim/Grid/ScriptServer/FakeScene.cs +++ b/OpenSim/Grid/ScriptServer/FakeScene.cs @@ -45,7 +45,6 @@ namespace OpenSim.Grid.ScriptServer regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild, config, "") { - } // What does a scene have to do? :P diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 844f27d..63bdea8 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs @@ -57,7 +57,7 @@ namespace OpenSim.Grid.ScriptServer internal TCPServer m_TCPServer; internal TRPC_Remote RPC; - public ScriptServerMain() + public ScriptServerMain() { m_console = CreateConsole(); @@ -68,7 +68,6 @@ namespace OpenSim.Grid.ScriptServer Engine = ScriptEngines.LoadEngine("DotNetEngine"); Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); - // Set up server //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 9b74dbc..9a3e431 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -90,7 +90,7 @@ namespace OpenSim.Grid.UserServer public override void Startup() { base.Startup(); - + Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); m_stats = StatsManager.StartCollectingUserStats(); @@ -101,11 +101,11 @@ namespace OpenSim.Grid.UserServer m_gridInfoService = new GridInfoService(); - m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); + m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); m_loginService = new UserLoginService( - m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); - + m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); + m_messagesService = new MessageServersConnector(); m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; @@ -151,7 +151,6 @@ namespace OpenSim.Grid.UserServer m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); - m_httpServer.AddStreamHandler( new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); @@ -188,7 +187,7 @@ namespace OpenSim.Grid.UserServer tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); LLUUID userID = new LLUUID(); - + try { userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); @@ -199,7 +198,7 @@ namespace OpenSim.Grid.UserServer } try - { + { if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) { throw new Exception( @@ -245,9 +244,9 @@ namespace OpenSim.Grid.UserServer // requester.ReturnResponseVal = TestResponse; // requester.BeginPostObject(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); SynchronousRestObjectPoster.BeginPostObject>( - "POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser); - break; - + "POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser); + break; + case "logoff-user": if (cmdparams.Length >= 3) @@ -279,7 +278,7 @@ namespace OpenSim.Grid.UserServer m_loginService.LogOffUser(theUser, message); theUser.CurrentAgent.AgentOnline = false; - + m_loginService.CommitAgent(ref theUser); } else diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 0e61b3c..8488e22 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -46,7 +46,7 @@ namespace OpenSim.Grid.UserServer public class UserLoginService : LoginService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected IInterServiceInventoryServices m_inventoryService; public event UserLoggedInAtLocation OnUserLoggedInAtLocation; @@ -63,7 +63,7 @@ namespace OpenSim.Grid.UserServer m_config = config; m_inventoryService = inventoryService; } - + public override void LogOffUser(UserProfileData theUser, string message) { RegionProfileData SimInfo = null; @@ -72,7 +72,7 @@ namespace OpenSim.Grid.UserServer SimInfo = RegionProfileData.RequestSimProfileData( theUser.CurrentAgent.Handle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); - + if (SimInfo == null) { m_log.Error("[GRID]: Region user was in isn't currently logged in"); @@ -84,7 +84,7 @@ namespace OpenSim.Grid.UserServer m_log.Error("[GRID]: Unable to look up region to log user off"); return; } - + // Prepare notification Hashtable SimParams = new Hashtable(); SimParams["agent_id"] = theUser.ID.ToString(); @@ -101,7 +101,7 @@ namespace OpenSim.Grid.UserServer m_log.InfoFormat( "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName); - + try { XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams); @@ -306,8 +306,6 @@ namespace OpenSim.Grid.UserServer theUser.FirstName, theUser.SurName); } } - - } } catch (Exception) @@ -419,7 +417,7 @@ namespace OpenSim.Grid.UserServer else { response.CreateDeadRegionResponse(); - } + } } catch (Exception e) @@ -432,11 +430,11 @@ namespace OpenSim.Grid.UserServer // See LoginService protected override InventoryData GetInventorySkeleton(LLUUID userID) - { + { m_log.DebugFormat( "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", m_config.InventoryUrl, userID); - + List folders = m_inventoryService.GetInventorySkeleton(userID); if (null == folders || folders.Count == 0) diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index b1d95da..760dfe3 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -413,7 +413,7 @@ namespace OpenSim.Grid.UserServer return ProfileToXmlRPCResponse(userProfile); } - + public XmlRpcResponse XmlRPCGetAgentMethodUUID(XmlRpcRequest request) { XmlRpcResponse response = new XmlRpcResponse(); diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 4df6415..59ac161 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -95,7 +95,7 @@ namespace OpenSim } private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself - + /// /// Global exception handler -- all unhandlet exceptions end up here :) /// diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 2e3122f..4fd93e8 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs @@ -33,7 +33,7 @@ namespace OpenSim { void Initialise(OpenSimBase openSim); } - + public class ApplicationPluginInitialiser : PluginInitialiserBase { private OpenSimBase server; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4664b0b..cc2d993 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -90,8 +90,8 @@ namespace OpenSim m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (m_sandbox ? "sandbox" : "grid")); m_console = new ConsoleBase("Region", this); - MainConsole.Instance = m_console; - + MainConsole.Instance = m_console; + base.Startup(); //Run Startup Commands @@ -116,9 +116,9 @@ namespace OpenSim PrintFileToConsole("startuplogo.txt"); RegisterCmd("echoTest", RunEchoTest, "this echos your command args to see how they are parsed"); RegisterCmd("kickuser", KickUserCommand, "kickuser [first] [last] - attempts to log off a user from any region we are serving"); - + // For now, start at the 'root' level by default - ChangeSelectedRegion(new string[] {"root"}); + ChangeSelectedRegion(new string[] {"root"}); } private void RunAutoTimerScript(object sender, EventArgs e) @@ -135,7 +135,7 @@ namespace OpenSim { for (int i = 0; i < cmdparams.Length; i++) { - m_log.Info("[EchoTest]: "+cmdparams[i]+""); + m_log.Info("[EchoTest]: "+cmdparams[i]+""); } } @@ -214,7 +214,7 @@ namespace OpenSim { base.RunCmd(command, cmdparams); RunPluginCommands(command , cmdparams); - + switch (command) { case "clear-assets": @@ -255,7 +255,7 @@ namespace OpenSim m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); m_console.Notice("export-map [filename] - save image of world map"); - m_console.Notice("force-update - force an update of prims in the scene"); + m_console.Notice("force-update - force an update of prims in the scene"); m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); m_console.Notice("remove-region [name] - remove a region"); m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); @@ -273,14 +273,14 @@ namespace OpenSim m_console.Notice("config set section field value - set a config value"); m_console.Notice("config get section field - get a config value"); m_console.Notice("config save - save OpenSim.ini"); - m_console.Notice("terrain help - show help for terrain commands."); + m_console.Notice("terrain help - show help for terrain commands."); ShowPluginCommandsHelp(CombineParams(cmdparams, 0), m_console); - + if (m_sandbox) { m_console.Notice(""); m_console.Notice("create user - adds a new user."); - } + } break; @@ -314,11 +314,11 @@ namespace OpenSim case "load-oar": LoadOar(cmdparams); break; - + case "save-oar": SaveOar(cmdparams); break; - + case "save-inv": SaveInv(cmdparams); break; @@ -343,13 +343,13 @@ namespace OpenSim break; case "create": - Create(cmdparams); + Create(cmdparams); break; case "create-region": CreateRegion(new RegionInfo(cmdparams[0], "Regions/" + cmdparams[1],false), true); break; - + case "remove-region": string regName = CombineParams(cmdparams, 0); @@ -441,7 +441,7 @@ namespace OpenSim } } break; - + case "modules": if (cmdparams.Length > 0) { @@ -488,7 +488,7 @@ namespace OpenSim m_commsManager.AddInventoryService(cmdparams[0]); } break; - + default: string[] tmpPluginArgs = new string[cmdparams.Length + 1]; cmdparams.CopyTo(tmpPluginArgs, 1); @@ -498,7 +498,7 @@ namespace OpenSim break; } } - + /// /// Change the currently selected region. The selected region is that operated upon by single region commands. /// @@ -515,13 +515,13 @@ namespace OpenSim else { m_console.Error("Usage: change-region "); - } + } - string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); + string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); m_console.Notice(String.Format("Currently selected region is {0}", regionName)); - m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); + m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); } - + /// /// Execute switch for some of the create commands /// @@ -530,7 +530,7 @@ namespace OpenSim { if (args.Length == 0) return; - + switch (args[0]) { case "user": @@ -547,7 +547,7 @@ namespace OpenSim { if (args.Length == 0) return; - + switch (args[0]) { case "packet": @@ -566,7 +566,7 @@ namespace OpenSim } break; - + case "scene": if (args.Length == 4) { @@ -580,11 +580,11 @@ namespace OpenSim bool collisionsOn = !Convert.ToBoolean(args[2]); bool physicsOn = !Convert.ToBoolean(args[3]); m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); - + m_console.Notice( - "CONSOLE", + "CONSOLE", String.Format( - "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", + "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", !scriptingOn, !collisionsOn, !physicsOn)); } } @@ -592,9 +592,9 @@ namespace OpenSim { m_console.Error("debug scene (where inside <> is true/false)"); } - - break; - + + break; + default: m_console.Error("Unknown debug"); break; @@ -666,7 +666,7 @@ namespace OpenSim break; } } - + /// /// Create a new user /// @@ -697,7 +697,7 @@ namespace OpenSim if ( cmdparams.Length < 6 ) regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); - else regY = Convert.ToUInt32(cmdparams[5]); + else regY = Convert.ToUInt32(cmdparams[5]); if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) { @@ -706,9 +706,9 @@ namespace OpenSim else { m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); - } + } } - + protected void SaveXml(string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); @@ -721,8 +721,8 @@ namespace OpenSim { m_sceneManager.SaveCurrentSceneToXml(DEFAULT_PRIM_BACKUP_FILENAME); } - } - + } + protected void LoadXml(string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); @@ -758,8 +758,8 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); } - } - + } + protected void SaveXml2(string[] cmdparams) { if (cmdparams.Length > 0) @@ -771,7 +771,7 @@ namespace OpenSim m_sceneManager.SaveCurrentSceneToXml2(DEFAULT_PRIM_BACKUP_FILENAME); } } - + protected void LoadXml2(string[] cmdparams) { if (cmdparams.Length > 0) @@ -782,8 +782,8 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); } - } - + } + /// /// Load a whole region from an opensim archive. /// @@ -800,9 +800,9 @@ namespace OpenSim else { m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); - } + } } - + /// /// Save a region to a file, including all the assets needed to restore it. /// @@ -819,8 +819,8 @@ namespace OpenSim else { m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME); - } - } + } + } private static string CombineParams(string[] commandParams, int pos) { @@ -835,7 +835,7 @@ namespace OpenSim /// /// Runs the best matching plugin command - /// + /// /// returns true if a match was found, false otherwise. /// public bool RunPluginCommands(string cmd, string[] withParams) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0ac8cd7..983773a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -70,7 +70,7 @@ namespace OpenSim /// The file used to load and save an opensim archive if no filename has been specified /// protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene_oar.tar.gz"; - + /// /// The file to load and save inventory if no filename has been specified /// @@ -161,7 +161,7 @@ namespace OpenSim m_config = new OpenSimConfigSource(); m_config.Source = new IniConfigSource(); // IConfigSource icong; - + //check for .INI file (either default or name passed in command line) if (File.Exists(Application.iniFilePath)) { @@ -338,7 +338,7 @@ namespace OpenSim protected void LoadPlugins() { - PluginLoader loader = + PluginLoader loader = new PluginLoader (new ApplicationPluginInitialiser (this)); loader.Load ("/OpenSim/Startup"); @@ -351,7 +351,7 @@ namespace OpenSim public override void Startup() { base.Startup(); - + m_stats = StatsManager.StartCollectingSimExtraStats(); // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) @@ -586,7 +586,7 @@ namespace OpenSim public void handleRestartRegion(RegionInfo whichRegion) { m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); - + // Shutting down the client server bool foundClientServer = false; int clientServerElement = 0; @@ -660,7 +660,7 @@ namespace OpenSim } #endregion - + /// /// Save inventory to a file. /// @@ -668,49 +668,49 @@ namespace OpenSim protected void SaveInv(string[] cmdparams) { m_log.Error("[CONSOLE]: This command has not yet been implemented!"); - + if (cmdparams.Length < 3) { m_log.Error("[CONSOLE]: usage is save-inv []"); return; } - - string firstName = cmdparams[0]; + + string firstName = cmdparams[0]; string lastName = cmdparams[1]; string invPath = cmdparams[2]; //string savePath = (cmdparams.Length > 3 ? cmdparams[3] : DEFAULT_INV_BACKUP_FILENAME); - + UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(firstName, lastName); if (null == userProfile) { m_log.ErrorFormat("[CONSOLE]: Failed to find user {0} {1}", firstName, lastName); return; - } - + } + CachedUserInfo userInfo = m_commsManager.UserProfileCacheService.GetUserDetails(userProfile.ID); if (null == userInfo) { m_log.ErrorFormat("[CONSOLE]: Failed to find user info for {0} {1} {2}", firstName, lastName, userProfile.ID); return; - } - + } + InventoryFolderImpl inventoryFolder = null; InventoryItemBase inventoryItem = null; - + if (userInfo.HasReceivedInventory) { // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl // itself (possibly at a small loss in efficiency). - string[] components + string[] components = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); invPath = String.Empty; foreach (string c in components) { invPath += c + InventoryFolderImpl.PATH_DELIMITER; - } - + } + invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); - + // Annoyingly Split actually returns the original string if the input string consists only of delimiters // Therefore if we still start with a / after the split, then we need the root folder if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER)) @@ -718,10 +718,10 @@ namespace OpenSim inventoryFolder = userInfo.RootFolder; } else - { - inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); + { + inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); } - + // The path may point to an item instead if (inventoryFolder == null) { @@ -733,7 +733,7 @@ namespace OpenSim m_log.ErrorFormat("[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", firstName, lastName, userProfile.ID); return; } - + if (null != inventoryFolder) { m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); @@ -746,8 +746,8 @@ namespace OpenSim { m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); return; - } - } + } + } /// /// Performs any last-minute sanity checking and shuts down the region server diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b14b3db..3c24fb6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest - + private ScriptAnswer handlerScriptAnswer = null; private RequestPayPrice handlerRequestPayPrice = null; private ObjectDeselect handlerObjectDetach = null; @@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP) - { + { m_moneyBalance = 1000; m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion()); @@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_networkServer = packServer; // m_inventoryCache = inventoryCache; - m_authenticateSessionsHandler = authenSessions; + m_authenticateSessionsHandler = authenSessions; m_agentId = agentId; m_sessionId = sessionId; @@ -404,8 +404,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_clientThread.IsBackground = true; m_clientThread.Start(); ThreadTracker.Add(m_clientThread); - - m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); + + m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); } public void SetDebug(int newDebug) @@ -457,9 +457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void Close(bool shutdownCircuit) { m_log.DebugFormat( - "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", + "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", shutdownCircuit, m_scene.RegionInfo.RegionName); - + m_PacketHandler.Flush(); // raise an event on the packet server to Shutdown the circuit @@ -639,7 +639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP # endregion protected int m_terrainCheckerCount = 0; - + /// /// Event handler for check client timer /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings @@ -652,15 +652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) { m_probesWithNoIngressPackets++; - if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) + if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) { if (OnConnectionClosed != null) { m_log.WarnFormat( - "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", + "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", Name, AgentId); - + OnConnectionClosed(this); } } @@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_clientPingTimer = new Timer(5000); m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); m_clientPingTimer.Enabled = true; - + m_scene.AddNewClient(this, true); } @@ -764,7 +764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem item = new LLQueItem(); item.Packet = packet; - + m_PacketHandler.ProcessOutPacket(item); // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to @@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int y = 0; y < 16; y++) { // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception - // see http://opensimulator.org/mantis/view.php?id=1662 + // see http://opensimulator.org/mantis/view.php?id=1662 //for (int x = 0; x < 16; x += 4) //{ // SendLayerPacket(map, y, x); @@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Sends a set of four patches (x, x+1, ..., x+3) to the client /// - /// heightmap + /// heightmap /// X coordinate for patches 0..12 /// Y coordinate for patches 0..15 // private void SendLayerPacket(float[] map, int y, int x) @@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); layerpack.Header.Zerocoded = true; - + OutPacket(layerpack, ThrottleOutPacketType.Land); } catch (Exception e) @@ -1157,7 +1157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// Tell the client that the given neighbour region is ready to receive a child agent. + /// Tell the client that the given neighbour region is ready to receive a child agent. /// /// /// @@ -3405,7 +3405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// + /// /// /// /// @@ -3682,7 +3682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// returns a byte array of the client set throttles Gets multiplied by the multiplier - /// + /// /// /// non 1 multiplier for subdividing the throttles between individual regions /// @@ -3691,7 +3691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); } /// - /// sets the throttles from values supplied by the client + /// sets the throttles from values supplied by the client /// /// public void SetChildAgentThrottle(byte[] throttles) @@ -5291,24 +5291,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.RegionHandleRequest: RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; - + handlerRegionHandleRequest = OnRegionHandleRequest; if (handlerRegionHandleRequest != null) { handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); } break; - + case PacketType.ParcelInfoRequest: ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; - + handlerParcelInfoRequest = OnParcelInfoRequest; if (handlerParcelInfoRequest != null) { handlerParcelInfoRequest(this, pirPack.Data.ParcelID); } break; - + case PacketType.ParcelAccessListRequest: ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; @@ -6277,10 +6277,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - - + + #region Camera - + public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) { SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties); @@ -6292,7 +6292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock(); block.Type = pair.Key; block.Value = pair.Value; - + camPropBlock[idx++] = block; } packet.CameraProperty = camPropBlock; @@ -6314,7 +6314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.ReplyBlock.RegionHandle = handle; OutPacket(reply, ThrottleOutPacketType.Land); } - + public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) { ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); @@ -6325,16 +6325,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.Data.Desc = Helpers.StringToField(land.Description); reply.Data.ActualArea = land.Area; reply.Data.BillableArea = land.Area; // TODO: what is this? - + // Bit 0: Mature, bit 7: on sale, other bits: no idea reply.Data.Flags = (byte)( ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); - + LLVector3 pos = land.UserLocation; if (pos.Equals(LLVector3.Zero)) { - pos = (land.AABBMax + land.AABBMin) * 0.5f; + pos = (land.AABBMax + land.AABBMin) * 0.5f; } reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; @@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP reply.Data.Dwell = 0; // TODO: not implemented yet reply.Data.SalePrice = land.SalePrice; reply.Data.AuctionID = (int)land.AuctionID; - + OutPacket(reply, ThrottleOutPacketType.Land); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 8fe9a7b..8023f58 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Call the load balancer's hook. If this is not active here // we defer to the sim server this client is actually connected - // to. Packet drop notifies will not be triggered in this + // to. Packet drop notifies will not be triggered in this // configuration! // if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) @@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - + private void QueuePacket( Packet packet, ThrottleOutPacketType throttlePacketType, Object id) @@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { int now = System.Environment.TickCount; int lastAck = m_LastAck; - + // Unless we have received at least one ack, don't bother resending // anything. There may not be a client there, don't clog up the // pipes. @@ -558,7 +558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP PruneDupeTracker(); - // Check for duplicate packets.. packets that the client is + // Check for duplicate packets.. packets that the client is // resending because it didn't receive our ack // lock (m_DupeTracker) @@ -677,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_Sequence = info.sequence; } - + public void AddImportantPacket(PacketType type) { if (m_ImportantPackets.Contains(type)) @@ -693,7 +693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_ImportantPackets.Remove(type); } - + private void DropResend(Object id) { foreach (AckData data in new List(m_NeedAck.Values)) @@ -736,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (packet.Header.Reliable) { m_UnackedBytes += packet.ToBytes().Length; - m_NeedAck[packet.Header.Sequence] = new AckData(packet, + m_NeedAck[packet.Header.Sequence] = new AckData(packet, item.Identifier); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 5903661..7c21df2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } BeginReceive(); - + if (packet != null) { try @@ -297,11 +297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); - // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. + // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. // so therefore.. we've got to tell the server to BeginReceiveFrom again. - // This will happen over and over until we've gone through all packets + // This will happen over and over until we've gone through all packets // sent to and from this particular user. - // Stupid I know.. + // Stupid I know.. // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. } catch (SocketException e) @@ -329,7 +329,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (!(packet is UseCircuitCodePacket)) return; - + UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; lock (clientCircuits) { @@ -424,13 +424,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP public virtual void RemoveClientCircuit(uint circuitcode) { EndPoint sendto = null; - if (clientCircuits_reverse.Contains(circuitcode)) + if (clientCircuits_reverse.Contains(circuitcode)) { sendto = (EndPoint)clientCircuits_reverse[circuitcode]; clientCircuits_reverse.Remove(circuitcode); - - lock (clientCircuits) + + lock (clientCircuits) { if (sendto != null) { @@ -442,7 +442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); } } - lock (proxyCircuits) + lock (proxyCircuits) { proxyCircuits.Remove(circuitcode); } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 7a552a6..91f7472 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack public override void Startup() { base.Startup(); - + m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString); m_clientStackManager = CreateClientStackManager(); diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 8149bcc..7501967 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -496,13 +496,13 @@ namespace OpenSim.Region.Communications.Local { m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", regionHandle, x, y); - + if (m_regionListeners.ContainsKey(regionHandle)) { LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); return land; } - + m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); return null; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 9a4c166..7baaa16 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.Communications.OGS1 try { XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); - + // The timeout should always be significantly larger than the timeout for the grid server to request // the initial status of the region before confirming registration. GridResp = GridReq.Send(serversInfo.GridURL, 90000); @@ -630,7 +630,7 @@ namespace OpenSim.Region.Communications.OGS1 } XmlRpcResponse resp = new XmlRpcResponse(); - + if (banned) { m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); @@ -645,7 +645,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); m_localBackend.TriggerExpectUser(regionHandle, agentData); m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); - Hashtable respdata = new Hashtable(); + Hashtable respdata = new Hashtable(); respdata["success"] = "TRUE"; resp.Value = respdata; @@ -1638,10 +1638,10 @@ namespace OpenSim.Region.Communications.OGS1 hash["region_handle"] = regionHandle.ToString(); hash["x"] = x.ToString(); hash["y"] = y.ToString(); - + IList paramList = new ArrayList(); paramList.Add(hash); - + // this might be cached, as we probably requested it just a moment ago... RegionInfo info = RequestNeighbourInfo(regionHandle); diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 06a28d0..1d86646 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -252,7 +252,7 @@ namespace OpenSim.Region.Communications.OGS1 IList parameters = new ArrayList(); parameters.Add(param); XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters); - + try { req.Send(m_parent.NetworkServersInfo.UserURL, 3000); @@ -262,7 +262,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); } } - + public UserProfileData GetUserProfile(string firstName, string lastName) { return GetUserProfile(firstName + " " + lastName); @@ -711,7 +711,7 @@ namespace OpenSim.Region.Communications.OGS1 public AvatarAppearance GetUserAppearance(LLUUID user) { AvatarAppearance appearance = null; - + try { Hashtable param = new Hashtable(); @@ -722,14 +722,14 @@ namespace OpenSim.Region.Communications.OGS1 XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters); XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000); Hashtable respData = (Hashtable) resp.Value; - + return ConvertXMLRPCDataToAvatarAppearance(respData); } catch (WebException e) { m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message); } - + return appearance; } diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs @@ -27,8 +27,6 @@ namespace OpenSim.Region.Environment.Interfaces { - - public interface ICommander { void ProcessConsoleCommand(string function, string[] args); diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); - + /// /// Entirely removes the object, including inventory /// @@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void RemoveObject(LLUUID uuid, LLUUID regionUUID); - + /// /// Store a prim's inventory /// diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// float[] GetFloatsSerialised(); - + double[,] GetDoubles(); bool Tainted(int x, int y); ITerrainChannel MakeCopy(); diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment public void UnloadModule(IRegionModule rm) { rm.Close(); - + m_loadedModules.Remove(rm); } } diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// True if the service has been closed, probably because a user with texture requests still queued /// logged out. @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload public void TextureCallback(LLUUID textureID, AssetBase texture) { //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); - + // There may still be texture requests pending for a logged out client if (closed) return; @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload internal void Close() { closed = true; - + lock (m_textureSenders) { foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) @@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_textureSenders.Clear(); } - + // XXX: It might be possible to also remove pending texture requests from the asset cache queues, // though this might also be more trouble than it's worth. } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends client.OnTerminateFriendship += OnTerminateFriendship; doFriendListUpdateOnline(client.AgentId); - + } private void doFriendListUpdateOnline(LLUUID AgentId) @@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends { m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); - + List updateme = new List(); lock (StoredFriendListUpdates) { @@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); - + //LLUUID[] Agents = new LLUUID[1]; //Agents[0] = msg.toAgentID; diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; lock (m_groupUUIDGroup) { - + GroupData OpenSimulatorGroup = new GroupData(); OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; OpenSimulatorGroup.GroupID = opensimulatorGroupID; @@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - + lock (m_groupmap) { if (!m_groupmap.ContainsKey(client.AgentId)) @@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups updateGroups[0] = OpenSimulatorGroup; client.SendGroupMembership(updateGroups); - - } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) @@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups GC.Collect(); } } - - -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture SceneObjectPart part = scene.GetSceneObjectPart(PrimID); byte[] assetData; AssetBase oldAsset = null; - + if (BlendWithOldTexture) { LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; @@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture assetData = new byte[data.Length]; Array.Copy(data, assetData, data.Length); } - + // Create a new asset for user AssetBase asset = new AssetBase(); asset.FullID = LLUUID.Random(); @@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture // mostly keep the values from before LLObject.TextureEntry tmptex = part.Shape.Textures; - + // remove the old asset from the cache LLUUID oldID = tmptex.DefaultTexture.TextureID; scene.AssetCache.ExpireAsset(oldID); @@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { m_Config = config; IConfig SMTPConfig; - + //FIXME: RegionName is correct?? //m_RegionName = scene.RegionInfo.RegionName; IConfig startupConfig = m_Config.Configs["Startup"]; m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); - + //Load SMTP SERVER config try { @@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Enabled = false; return; } - + if (!SMTPConfig.GetBoolean("enabled", false)) { m_log.InfoFormat("[SMTP] module disabled in configuration"); m_Enabled = false; return; } - + m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); - SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); + SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { get { return true; } } - + /// - /// + /// /// /// private void DelayInSeconds(int seconds) @@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); DateTime EndDelay = DateTime.Now.Add(DiffDelay); while (DateTime.Now < EndDelay) - { + { ;//Do nothing!! } } - + private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) { lock (m_Scenes) @@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectName = part.Name; - ObjectRegionName = m_ObjectRegionName; + ObjectRegionName = m_ObjectRegionName; return; } ObjectAbsolutePosition = part.AbsolutePosition.ToString(); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules ObjectRegionName = m_ObjectRegionName; return; } - + /// /// SendMail function utilized by llEMail /// @@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules public void SendEmail(LLUUID objectID, string address, string subject, string body) { //Check if address is empty - if (address == string.Empty) + if (address == string.Empty) return; - + //FIXED:Check the email is correct form in REGEX - string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" - + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" - + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" - + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" + + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; Regex EMailreStrict = new Regex(EMailpatternStrict); bool isEMailStrictMatch = EMailreStrict.IsMatch(address); @@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules if ((subject.Length + body.Length) > 1024) { m_log.Error("[EMAIL] subject + body > 1024 Byte"); - return; + return; } - + try { string LastObjectName = string.Empty; @@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //From emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); //To - Only One - emailMessage.AddToAddress(new EmailAddress(address)); + emailMessage.AddToAddress(new EmailAddress(address)); //Subject emailMessage.Subject = subject; //TEXT Body resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + - LastObjectPosition+"\r\n\r\n\r\n" + body); + LastObjectPosition+"\r\n\r\n\r\n" + body); //HTML Body - emailMessage.HtmlPart = new HtmlAttachment("

" + + emailMessage.HtmlPart = new HtmlAttachment("

" + "
Object-Name: " + LastObjectName + "
Region: " + LastObjectRegionName + "
Local-Position: " + LastObjectPosition + "


" +body+"\r\n

"); - + //Set SMTP SERVER config SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); //Authentication @@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return; } } - + /// - /// + /// /// /// /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// The location of the archive control file ///
public static readonly string CONTROL_FILE_PATH = "archive.xml"; - + /// /// Path for the assets held in an archive /// public static readonly string ASSETS_PATH = "assets/"; - + /// /// Path for the assets metadata file /// //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; - + /// /// Path for the prims file /// public static readonly string OBJECTS_PATH = "objects/"; - + /// /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. /// public static readonly string TERRAINS_PATH = "terrains/"; - + /// /// Extensions used for asset types in the archive /// public static readonly IDictionary ASSET_TYPE_TO_EXTENSION = new Dictionary(); public static readonly IDictionary EXTENSION_TO_ASSET_TYPE = new Dictionary(); - + static ArchiveConstants() { ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; @@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this #pragma warning restore 0612 @@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this - + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this + EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; #pragma warning restore 0612 diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private Scene m_scene; private string m_loadPath; - + /// /// Used to cache lookups for valid uuids. /// @@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver } private void DearchiveRegion() - { - TarArchiveReader archive + { + TarArchiveReader archive = new TarArchiveReader( - new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); + new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); List serialisedSceneObjects = new List(); string filePath = "ERROR"; - + int successfulAssetRestores = 0; int failedAssetRestores = 0; @@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug("[ARCHIVER]: Reached end of archive"); archive.Close(); - + m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); - + if (failedAssetRestores > 0) m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); - m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); + m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); m_scene.DeleteAllSceneObjects(); - + // Reload serialized prims m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); IRegionSerialiser serialiser = m_scene.RequestModuleInterface(); - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (string serialisedSceneObject in serialisedSceneObjects) - { + { SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); - + // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned // on the same region server and multiple examples a single object archive to be imported // to the same scene (when this is possible). sceneObject.ResetIDs(); - + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid // otherwise, use the master avatar uuid instead LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { if (!resolveUserUuid(part.CreatorID)) part.CreatorID = masterAvatarId; - + if (!resolveUserUuid(part.OwnerID)) part.OwnerID = masterAvatarId; - + if (!resolveUserUuid(part.LastOwnerID)) - part.LastOwnerID = masterAvatarId; - + part.LastOwnerID = masterAvatarId; + // And zap any troublesome sit target information part.SitTargetOrientation = new Quaternion(0,0,0,1); part.SitTargetPosition = new Vector3(0,0,0); - } - + } + if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) - { + { sceneObjects.Add(sceneObject); } - } - + } + m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); - + int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; - + if (ignoredObjects > 0) m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); - + m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); - + m_log.Debug("[ARCHIVER]: Starting scripts"); - + foreach (SceneObjectGroup sceneObject in sceneObjects) { sceneObject.CreateScriptInstances(0, true); - } + } } - + /// /// Look up the given user id to check whether it's one that is valid for this grid. /// @@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else m_validUserUuids.Add(uuid, false); } - + if (m_validUserUuids[uuid]) return true; else - return false; + return false; } - + /// /// Load an asset /// @@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); string extension = filename.Substring(filename.LastIndexOf("_")); - string uuid = filename.Remove(filename.Length - extension.Length); - + string uuid = filename.Remove(filename.Length - extension.Length); + if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) { sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; - + //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); - + AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); asset.Type = assetType; asset.Data = data; - + m_scene.AssetCache.AddAsset(asset); - + return true; } else @@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.ErrorFormat( "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", assetPath, extension); - + return false; } } - + /// /// Load terrain data /// @@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private bool LoadTerrain(string terrainPath, byte[] data) { ITerrainModule terrainModule = m_scene.RequestModuleInterface(); - + MemoryStream ms = new MemoryStream(data); terrainModule.LoadFromStream(terrainPath, ms); ms.Close(); - + m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); - + return true; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public ArchiveWriteRequestExecution( List sceneObjects, - ITerrainModule terrainModule, - IRegionSerialiser serialiser, + ITerrainModule terrainModule, + IRegionSerialiser serialiser, string sceneName, string savePath) { @@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); } - + m_log.InfoFormat( "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); TarArchiveWriter archive = new TarArchiveWriter(); - + // Write out control file archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); - + // Write out terrain string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new MemoryStream(); m_terrainModule.SaveToStream(terrainPath, ms); - archive.AddFile(terrainPath, ms.ToArray()); + archive.AddFile(terrainPath, ms.ToArray()); ms.Close(); - + // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - + LLVector3 position = sceneObject.AbsolutePosition; - + string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); - string filename + string filename = string.Format( "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", - ArchiveConstants.OBJECTS_PATH, sceneObject.Name, - Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), + ArchiveConstants.OBJECTS_PATH, sceneObject.Name, + Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), sceneObject.UUID); - + archive.AddFile(filename, serializedObject); } @@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); - } - + } + /// /// Create the control file for this archive /// @@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteAttributeString("major_version", "0"); xtw.WriteAttributeString("minor_version", "1"); xtw.WriteEndElement(); - + xtw.Flush(); xtw.Close(); - + String s = sw.ToString(); sw.Close(); - + return s; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver protected Scene m_scene; protected string m_savePath; - + /// /// Used for identifying uuids embedded in scripts /// - protected static readonly Regex m_uuidRegex + protected static readonly Regex m_uuidRegex = new Regex( - "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", - RegexOptions.Compiled); + "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", + RegexOptions.Compiled); /// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate @@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Pulse(this); } } - + /// - /// Get an asset synchronously, potentially using an asynchronous callback. If the + /// Get an asset synchronously, potentially using an asynchronous callback. If the /// asynchronous callback is used, we will wait for it to complete. /// /// @@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Wait(this); m_waitingForObjectAsset = false; } - } - + } + return m_requestedObjectAsset; } - + /// /// Record the asset uuids embedded within the given script. /// @@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); MatchCollection uuidMatches = m_uuidRegex.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); - + foreach (Match uuidMatch in uuidMatches) { LLUUID uuid = new LLUUID(uuidMatch.Value); //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); assetUuids[uuid] = 1; } - } + } } - + /// /// Record the uuids referenced by the given wearable asset /// @@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); wearableAsset.Decode(); - + //m_log.DebugFormat( // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); - + foreach (LLUUID uuid in wearableAsset.Textures.Values) { //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); assetUuids[uuid] = 1; } } - + /// /// 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 /// within this object). /// /// - /// - protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) + /// + protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) { AssetBase objectAsset = GetAsset(sceneObjectUuid); @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver string xml = Helpers.FieldToUTF8String(objectAsset.Data); SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); GetSceneObjectAssetUuids(sog, assetUuids); - } + } } /// @@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver try { 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 assetUuids[textureEntry.DefaultTexture.TextureID] = 1; - + // 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 //int i = 0; @@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver assetUuids[texture.TextureID] = 1; } } - + foreach (TaskInventoryItem tii in part.TaskInventory.Values) { //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); - + if (!assetUuids.ContainsKey(tii.AssetID)) { assetUuids[tii.AssetID] = 1; - + if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) { GetWearableAssetUuids(tii.AssetID, assetUuids); @@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (entity is SceneObjectGroup) sceneObjects.Add((SceneObjectGroup)entity); } - + foreach (SceneObjectGroup sceneObject in sceneObjects) { GetSceneObjectAssetUuids(sceneObject, assetUuids); } m_log.DebugFormat( - "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", + "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", sceneObjects.Count, assetUuids.Count); // Asynchronously request all the assets required to perform this archive operation - ArchiveWriteRequestExecution awre + ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution( - sceneObjects, + sceneObjects, m_scene.RequestModuleInterface(), m_scene.RequestModuleInterface(), m_scene.RegionInfo.RegionName, diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsArchiver { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Archive assets /// protected IDictionary m_assets; - + public AssetsArchiver(IDictionary assets) { m_assets = assets; } - + /// /// Archive the assets given to this archiver to the given archive. /// @@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); - + xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + if (asset != null) { xtw.WriteStartElement("asset"); - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; - } - + } + xtw.WriteElementString("filename", uuid.ToString() + extension); - + xtw.WriteElementString("name", asset.Name); xtw.WriteElementString("description", asset.Description); xtw.WriteElementString("asset-type", asset.Type.ToString()); - + xtw.WriteEndElement(); } } - + xtw.WriteEndElement(); - + xtw.WriteEndDocument(); - + archive.AddFile("assets.xml", sw.ToString()); } - + /// /// Write asset data files to the given archive /// @@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; } - + archive.AddFile( ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, asset.Data); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs @@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsDearchiver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); - + /// /// Store for asset data we received before we get the metadata /// @@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Asset metadata. Is null if asset metadata isn't yet available. /// protected Dictionary m_metadata; - + /// /// Cache to which dearchived assets will be added /// protected AssetCache m_cache; - + public AssetsDearchiver(AssetCache cache) { m_cache = cache; } - + /// /// Add asset data to the dearchiver /// @@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(assetFilename, data); } } - + /// /// Add asset metadata xml /// @@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void AddAssetMetadata(string xml) { m_metadata = new Dictionary(); - + StringReader sr = new StringReader(xml); XmlTextReader reader = new XmlTextReader(sr); - + reader.ReadStartElement("assets"); reader.Read(); - + while (reader.Name.Equals("asset")) { reader.Read(); - + AssetMetadata metadata = new AssetMetadata(); - + string filename = reader.ReadElementString("filename"); m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); - + metadata.Name = reader.ReadElementString("name"); metadata.Description = reader.ReadElementString("description"); metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); - + m_metadata[filename] = metadata; - + // Read asset end tag reader.ReadEndElement(); - + reader.Read(); } - + m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); - + ResolvePendingAssetData(); } - + /// /// Resolve asset data that we collected before receiving the metadata /// @@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); } } - + /// /// Resolve a new piece of asset data against stored metadata /// @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); - + if (m_metadata.ContainsKey(filename)) { AssetMetadata metadata = m_metadata[filename]; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) { string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; @@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else { m_log.ErrorFormat( - "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", + "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", assetPath); } } - + /// /// Metadata for an asset /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs @@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver class AssetsRequest { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// uuids to request /// protected ICollection m_uuids; - + /// /// Callback used when all the assets requested have been received. /// @@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Assets retrieved in this request /// protected Dictionary m_assets = new Dictionary(); - + /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// @@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assetCache = assetCache; m_repliesRequired = uuids.Count; } - + protected internal void Execute() { // We can stop here if there are no assets to fetch @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assets[assetID] = asset; else m_notFoundAssetUuids.Add(assetID); - + //m_log.DebugFormat( // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs @@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public byte[] ReadEntry(out string filePath) { filePath = String.Empty; - + TarHeader header = ReadHeader(); - + if (null == header) return null; @@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ///
/// A tar header struct. null if we have reached the end of the archive. protected TarHeader ReadHeader() - { + { byte[] header = m_br.ReadBytes(512); - + // 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 (header[0] == 0) return null; - + TarHeader tarHeader = new TarHeader(); tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs @@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment // Directories are signalled by a final / if (!dirName.EndsWith("/")) dirName += "/"; - + AddFile(dirName, new byte[0]); } - + /// /// Add a file to the tar archive /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment if (data.Length % 512 != 0) { int paddingRequired = 512 - (data.Length % 512); - + //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); byte[] padding = new byte[paddingRequired]; diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; - + bool alreadyInList = false; for (int i = 0; i < banlistcheck.Length; i++) @@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.simName = m_scene.RegionInfo.RegionName; - - + remote_client.SendRegionInfoToEstateMenu(args); } @@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); } + private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) { Dictionary SceneData = new Dictionary(); @@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate continue; } } - + SceneReport.Add(lsri); } } @@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } } remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); - + if (uuidNameLookupList.Count > 0) LookupUUID(uuidNameLookupList); } @@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void LookupUUIDsAsync(List uuidLst) { LLUUID[] uuidarr = new LLUUID[0]; - + lock (uuidLst) { uuidarr = uuidLst.ToArray(); @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (EstateManagers[i] == remoteClient.AgentId) estatemanager = true; } - + args.isEstateManager = estatemanager; args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; @@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnLandStatRequest += HandleLandStatRequest; sendRegionHandshake(client); } - + public uint GetRegionFlags() { Simulator.RegionFlags flags = Simulator.RegionFlags.None; - + // Fully implemented // if (m_scene.RegionInfo.RegionSettings.AllowDamage) diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static readonly string remoteParcelRequestPath = "0009/"; - + private LandChannel landChannel; private Scene m_scene; - - private readonly int[,] landIDList = new int[64, 64]; private readonly Dictionary landList = new Dictionary(); @@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public void PostInitialise() { } @@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public bool AllowedForcefulBans { get { return m_allowedForcefulBans; } @@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land public List ParcelsNearPoint(LLVector3 position) { List parcelsNear = new List(); - int x; - for (x = -4; x <= 4; x += 4) + for (int x = -4; x <= 4; x += 4) { - int y; - for (y = -4; y <= 4; y += 4) + for (int y = -4; y <= 4; y += 4) { ILandObject check = GetLandObject(position.X + x, position.Y + y); if (check != null) @@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); - if (over != null) { if (force) @@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land Console.WriteLine("INVALID LOCAL LAND ID"); } } + /// /// Creates a basic Parcel object without an owner (a zeroed key) /// @@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land new_land.landData.LocalID = lastLandLocalID; landList.Add(lastLandLocalID, new_land.Copy()); - bool[,] landBitmap = new_land.getLandBitmap(); - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmap[x, y]) { @@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// Land.localID of the peice of land to remove. public void removeLandObject(int local_id) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landIDList[x, y] == local_id) { @@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land private void performFinalLandJoin(ILandObject master, ILandObject slave) { - int x; bool[,] landBitmapSlave = slave.getLandBitmap(); - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmapSlave[x, y]) { @@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } return landList[landIDList[x / 4, y / 4]]; } + #endregion #region Parcel Modification @@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ResetAllLandPrimCounts(); lock (m_scene.Entities) { - foreach (EntityBase obj in m_scene.Entities.Values) + foreach (EntityBase obj in m_scene.Entities.Values) { if (obj != null) { @@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land { int totalX = end_x - start_x; int totalY = end_y - start_y; - int y; - for (y = 0; y < totalY; y++) + for (int y = 0; y < totalY; y++) { - int x; - for (x = 0; x < totalX; x++) + for (int x = 0; x < totalX; x++) { ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); if (tempLandObject == null) return; @@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject result = AddLandObject(newLand); UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); result.sendLandUpdateToAvatarsOverMe(); - - - return; } /// @@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject masterLandObject = selectedLandObjects[0]; selectedLandObjects.RemoveAt(0); - if (selectedLandObjects.Count < 1) { return; @@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land performFinalLandJoin(masterLandObject, slaveLandObject); } - SetPrimsTainted(); masterLandObject.sendLandUpdateToAvatarsOverMe(); - - return; } #endregion @@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land int byteArrayCount = 0; int sequenceID = 0; - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { byte tempByte = 0; //This represents the byte for the current 4x4 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); - if (currentParcelBlock != null) { if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) @@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); } - //Now for border control ILandObject westParcel = null; @@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { //Get the land objects within the bounds List temp = new List(); - int x; - int i; int inc_x = end_x - start_x; int inc_y = end_y - start_y; - for (x = 0; x < inc_x; x++) + for (int x = 0; x < inc_x; x++) { - int y; - for (y = 0; y < inc_y; y++) + for (int y = 0; y < inc_y; y++) { ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); @@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land requestResult = LandChannel.LAND_RESULT_MULTIPLE; } - for (i = 0; i < temp.Count; i++) + for (int i = 0; i < temp.Count; i++) { temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); } - SendParcelOverlay(remote_client); } @@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) { - landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); } @@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } public void handleParcelReclaim(int local_id, IClientAPI remote_client) @@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } #endregion @@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land { selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); } - } public void NoLandDataFromStorage() @@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land obj.setParcelObjectMaxOverride(overrideDel); } } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) { } #region CAPS handler + private void OnRegisterCaps(LLUUID agentID, Caps caps) { string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return RemoteParcelRequest(request, path, param, agentID, caps); })); } - + // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x @@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); } - + LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); response.parcel_id = parcelID; m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); - + return LLSDHelpers.SerialiseLLSDReply(response); } @@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land uint x, y; Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); - + LandData landData; if (regionHandle == m_scene.RegionInfo.RegionHandle) landData = this.GetLandObject(x, y).landData; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return newLand; } - + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } #endregion - + #region Packet Request Handling public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event RegionHandleRequest OnRegionHandleRequest; public event ParcelInfoRequest OnParcelInfoRequest; - + #pragma warning restore 67 #endregion @@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { get { return 0; } } - + public ulong GetGroupPowers(LLUUID groupID) { return 0; @@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) - { + { } public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) - { + { } public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); - + if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes public class SceneXmlLoader { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) { XmlDocument doc = new XmlDocument(); @@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes doc.Load(reader); reader.Close(); rootNode = doc.FirstChild; - + // This is to deal with neighbouring regions that are still surrounding the group xml with the // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or // when some other changes forces all regions to upgrade). @@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes // There is only ever one prim. This oddity should be removeable post 0.5.9 return new SceneObjectGroup(aPrimNode.OuterXml); } - + return null; } else { return new SceneObjectGroup(rootNode.OuterXml); - } + } } /// @@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes reader.Close(); XmlNode rootNode = doc.FirstChild; - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (XmlNode aPrimNode in rootNode.ChildNodes) { SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup obj = new SceneObjectGroup(xmlData); - if (scene.AddRestoredSceneObject(obj, true, false)) + if (scene.AddRestoredSceneObject(obj, true, false)) return obj; else return null; @@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) continue; } - + stream.WriteLine(g.ToXmlString2()); primCount++; } diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules private LLVector3 Position = new LLVector3(0,0,0); private LLVector3 Velocity = new LLVector3(0,0,0); private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); - + private long LindenHourOffset = 0; private bool sunFixed = false; @@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules private float GetLindenEstateHourFromCurrentTime() { float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); - + float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; return hour; @@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules float hour = (24 * (ticksleftover / SecondsPerSunCycle)); float offsethours = 0; - + if (LindenHour - 6 > hour) { offsethours = hour + ((LindenHour-6) - hour); @@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules offsethours = hour - (hour - (LindenHour - 6)); } //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); - + LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); @@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules } } } - + public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) { if (m_scene.RegionInfo.RegionHandle == regionHandle) diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Bmp); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } /// /// The human readable version of the file format(s) this loader handles @@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "BMP"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Gif); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Gif); - } + } public override string ToString() { return "GIF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs @@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders /// A terrain channel generated from the image. public virtual ITerrainChannel LoadFile(string filename) { - return LoadBitmap(new Bitmap(filename)); + return LoadBitmap(new Bitmap(filename)); } public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) { throw new NotImplementedException(); } - + public virtual ITerrainChannel LoadStream(Stream stream) { return LoadBitmap(new Bitmap(stream)); } - + protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) { ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - return retval; + return retval; } /// @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } #endregion diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public ITerrainChannel LoadStream(Stream stream) { throw new NotImplementedException(); - } + } public void SaveFile(string filename, ITerrainChannel map) { @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Jpeg); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateBitmapFromMap(map); colours.Save(stream, ImageFormat.Jpeg); - } + } #endregion @@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return bmp; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders FileInfo file = new FileInfo(filename); FileStream s = file.Open(FileMode.Open, FileAccess.Read); ITerrainChannel retval = LoadStream(s); - + s.Close(); return retval; @@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders // i.e. eat X upto where we start while (currFileXOffset < offsetX) { - bs.ReadBytes(sectionWidth * 13); + bs.ReadBytes(sectionWidth * 13); currFileXOffset++; } @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) - { + { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); - + bs.Close(); + return retval; } @@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter binStream = new BinaryWriter(s); @@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - binStream.Close(); + binStream.Close(); } - + public string FileExtension { get { return ".raw"; } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } public override string ToString() { return "PNG"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs @@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } - + public void SaveFile(string filename, ITerrainChannel map) { FileInfo file = new FileInfo(filename); @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter bs = new BinaryWriter(s); @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); + bs.Close(); } #endregion @@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "RAW32"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Tiff); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Tiff); - } + } public override string ToString() { return "TIFF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); bool eof = false; @@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public void SaveStream(Stream stream, ITerrainChannel map) { throw new NotImplementedException(); @@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "Terragen"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { void LoadFromFile(string filename); void SaveToFile(string filename); - + /// /// Load a terrain from a stream. /// @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void LoadFromStream(string filename, Stream stream); - + /// /// Save a terrain to a stream. /// @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void SaveToStream(string filename, Stream stream); - + void InstallPlugin(string name, ITerrainEffect plug); } } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs @@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } } - + /// /// Loads a terrain file from a stream and installs it in the scene. /// @@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } - } + } #region Plugin Loading Methods @@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_tainted = false; m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); m_scene.SaveTerrain(); - + // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. //m_scene.CreateTerrainTexture(true); } @@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain // fixup and height deltas that don't respect them if (respectEstateSettings && LimitChannelChanges(x, y)) { - // this has been vetoed, so update + // this has been vetoed, so update // what we are going to send to the client serialised = m_channel.GetFloatsSerialised(); } - + SendToClients(serialised, x, y); shouldTaint = true; } @@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain private void SendToClients(float[] serialised, int x, int y) { m_scene.ForEachClient( - delegate(IClientAPI controller) + delegate(IClientAPI controller) { controller.SendLayerData( - x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); + x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); } ); } @@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. // for now check a point in the centre of the region - + if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) { InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap { int tc = System.Environment.TickCount; m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); - + double[,] hm = whichScene.Heightmap.GetDoubles(); bool ShadowDebugContinue = true; //Color prim = Color.FromArgb(120, 120, 120); @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return mapbmp; } - - + + private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) { int tc = 0; @@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs @@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly string m_mapLayerPath = "0001/"; - - //private IConfig m_config; + + //private IConfig m_config; private Scene m_scene; private List cachedMapBlocks = new List(); private int cachedTime = 0; private byte[] myMapImageJPEG; - + //private int CacheRegionsDistance = 256; #region IRegionModule Members @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } public void PostInitialise() { - + } public void Close() @@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion - - - - public void OnRegisterCaps(LLUUID agentID, Caps caps) { @@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return MapLayerRequest(request, path, param, - agentID, caps); + agentID, caps); })); - } /// @@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //{ //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", //request, path, param,agentID.ToString()); - + // this is here because CAPS map requests work even beyond the 10,000 limit. ScenePresence avatarPresence = null; m_scene.TryGetAvatar(agentID, out avatarPresence); - + if (avatarPresence != null) { bool lookup = false; @@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); - + lock (cachedMapBlocks) cachedMapBlocks = mapBlocks; @@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap MemoryStream imgstream = new MemoryStream(); Bitmap mapTexture = new Bitmap(1,1); System.Drawing.Image image = (System.Drawing.Image)mapTexture; - - + try { // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data - imgstream = new MemoryStream(); - + // non-async because we know we have the asset immediately. AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); - + // Decode image to System.Drawing.Image image = OpenJPEG.DecodeToImage(mapasset.Data); @@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap myEncoderParameter = new EncoderParameter(myEncoder, 95L); myEncoderParameters.Param[0] = myEncoderParameter; - + // Save bitmap to stream mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); @@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // From msdn private static ImageCodecInfo GetEncoderInfo(String mimeType) { - int j; ImageCodecInfo[] encoders; encoders = ImageCodecInfo.GetImageEncoders(); - for (j = 0; j < encoders.Length; ++j) + for (int j = 0; j < encoders.Length; ++j) { if (encoders[j].MimeType == mimeType) return encoders[j]; } return null; } - } } diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_name; } set { m_name = value; } } - + /// /// Signals whether this group was in a scene but has since been deleted from it. /// @@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return m_isDeleted; } } - protected bool m_isDeleted; + protected bool m_isDeleted; protected LLVector3 m_pos; diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; - public delegate void SignificantClientMovement(IClientAPI remote_client); public event SignificantClientMovement OnSignificantClientMovement; - - public delegate void NewGridInstantMessage(GridInstantMessage message); public event NewGridInstantMessage OnGridInstantMessageToIMModule; @@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptAtTargetEvent OnScriptAtTargetEvent; public delegate void ScriptNotAtTargetEvent(uint localID); - + public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; public delegate void ScriptColliding(uint localID, ColliderArgs colliders); @@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptColliding OnScriptColliding; public event ScriptColliding OnScriptCollidingEnd; - - public delegate void OnMakeChildAgentDelegate(ScenePresence presence); public event OnMakeChildAgentDelegate OnMakeChildAgent; @@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes public int transactionID = 0; public int amountDebited = 0; - public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, bool pauthenticated) @@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes } } - - public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); public delegate void LandBuy(Object sender, LandBuyArgs e); @@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes private ScriptColliding handlerColliding = null; private ScriptColliding handlerCollidingEnd = null; - private SunLindenHour handlerSunGetLindenHour = null; public void TriggerOnScriptChangedEvent(uint localID, uint change) @@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerObjectBeingRemovedFromScene != null) { handlerObjectBeingRemovedFromScene(obj); - } } @@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes { handlerGridInstantMessageToFriends(message); } - } } @@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); } } - public void TriggerLandBuy (Object sender, LandBuyArgs e) + + public void TriggerLandBuy(Object sender, LandBuyArgs e) { handlerLandBuy = OnLandBuy; if (handlerLandBuy != null) @@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes handlerLandBuy(sender, e); } } + public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) { handlerValidateLandBuy = OnValidateLandBuy; @@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes handlerRequestChangeWaterHeight(height); } } + public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) { handlerAvatarKill = OnAvatarKilled; @@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerSignificantClientMovement != null) { handlerSignificantClientMovement(client); - } } @@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerNoticeNoLandDataFromStorage() { handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; @@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes } } - - public void TriggerRequestParcelPrimCountUpdate() { handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; if (handlerRequestParcelPrimCountUpdate != null) { handlerRequestParcelPrimCountUpdate(); - } } + public void TriggerParcelPrimCountTainted() { handlerParcelPrimCountTainted = OnParcelPrimCountTainted; if (handlerParcelPrimCountTainted != null) { handlerParcelPrimCountTainted(); - } } + // this lets us keep track of nasty script events like timer, etc. public void TriggerTimerEvent(uint objLocalID, double Interval) { @@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes if (handlerScriptTimerEvent != null) { handlerScriptTimerEvent(objLocalID, Interval); - } - } public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) @@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes if (handlerCollidingStart != null) handlerCollidingStart(localId, colliders); } + public void TriggerScriptColliding(uint localId, ColliderArgs colliders) { - handlerColliding = OnScriptColliding; if (handlerColliding != null) handlerColliding(localId, colliders); } + public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) { handlerCollidingEnd = OnScriptCollidingEnd; if (handlerCollidingEnd != null) handlerCollidingEnd(localId, colliders); } - } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes // Then we've got to remove the previous // event handler - if (_PhyScene != null) + if (_PhyScene != null) _PhyScene.OnPhysicsCrash -= physicsBasedCrash; _PhyScene = value; @@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes { part.LocalId = m_parentScene.PrimIDAllocate(); } - + sceneObject.UpdateParentIDs(); if (!alreadyPersisted) @@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes sceneObject.ForceInventoryPersistence(); sceneObject.HasGroupChanged = true; } - + return AddSceneObject(sceneObject, attachToBackup); } - + /// /// Add a newly created object to the scene. This will both update the scene, and send information about the /// new object to all clients interested in the scene. @@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) - { + { // Ensure that we persist this new scene object sceneObject.HasGroupChanged = true; - + return AddSceneObject(sceneObject, attachToBackup); } @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes { sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); sceneObject.ScheduleGroupForFullUpdate(); - + lock (Entities) { if (!Entities.ContainsKey(sceneObject.UUID)) @@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes Entities.Add(sceneObject.UUID, sceneObject); m_numPrim += sceneObject.Children.Count; - if (attachToBackup) - sceneObject.AttachToBackup(); + if (attachToBackup) + sceneObject.AttachToBackup(); return true; } @@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); } } - + m_updateList.Clear(); } } @@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal void AddScenePresence(ScenePresence presence) { bool child = presence.IsChildAgent; - + if (child) { m_numChildAgents++; @@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes { if (!ScenePresences.Remove(agentID)) { - m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); + m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); } // else // { @@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes /// Get a scene object group that contains the prim with the given uuid /// /// - /// null if no scene object group containing that prim is found + /// null if no scene object group containing that prim is found private SceneObjectGroup GetGroupByPrim(LLUUID fullID) { List EntityList = GetEntities(); @@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal SceneObjectPart GetSceneObjectPart(uint localID) { SceneObjectGroup group = GetGroupByPrim(localID); - + if (group != null) return group.GetChildPart(localID); else @@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes /// Get a part contained in this scene. /// /// - /// null if the part was not found + /// null if the part was not found protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) { SceneObjectGroup group = GetGroupByPrim(fullID); @@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes group.SendGroupTerseUpdate(); return; } - + if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) { group.UpdateSinglePosition(pos, localID); @@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) { group.SendGroupTerseUpdate(); - + return; } if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) @@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes if (sendEvents) parenPrim.TriggerScriptChangedEvent(Changed.LINK); } - else + else { // The link set has prims remaining. This path is taken // when a subset of a link set's prims are selected // and the root prim is part of that selection // List parts = new List(parenPrim.Children.Values); - + List unlink_ids = new List(); foreach (SceneObjectPart unlink_part in parts) unlink_ids.Add(unlink_part.LocalId); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes // Retrieve item TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); - + if (null == item) - { + { m_log.ErrorFormat( "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " + " but the item does not exist in this inventory", @@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes item.CreationDate = Util.UnixTimeSinceEpoch(); else item.CreationDate = itemUpd.CreationDate; - // TODO: Check if folder changed and move item //item.NextPermissions = itemUpd.Folder; @@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Type = assetType; asset.FullID = LLUUID.Random(); asset.Data = (data == null) ? new byte[1] : data; - + return asset; } @@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes agentItem.Folder = folderId; AddInventoryItem(remoteClient, agentItem); } - + /// /// ClientMoveTaskInventoryItem /// @@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem taskItem = part.GetInventoryItem(itemId); - + if (null == taskItem) { m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" + " because the inventory item could not be found", itemId, primLocalId); - + return; } @@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes MoveTaskInventoryItem(remoteClient, folderId, part, itemId); } - + /// /// MoveTaskInventoryItem /// @@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(avatarId, agentItem); } } - + /// /// Copy a task (prim) inventory item to another task (prim) /// @@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) { // object cannot copy items to an object owned by a different owner @@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem destTaskItem = new TaskInventoryItem(); - + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; @@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != part.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItem(destTaskItem); if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) part.RemoveInventoryItem(itemId); ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List items) { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); @@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes } LLUUID newFolderID = LLUUID.Random(); - + profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); foreach (LLUUID itemID in items) @@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes part.AddInventoryItem(taskItem); part.GetProperties(remoteClient); - + part.CreateScriptInstance(taskItem, 0, false); } } @@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + // Must own the object, and have modify rights if (srcPart.OwnerID != destPart.OwnerID) return; @@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes "[PRIM INVENTORY]: " + "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); - // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - + // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - // "Object: Task Object trying to illegally load script onto task Other_Object!" // How do we shout from in here? return; } - + TaskInventoryItem destTaskItem = new TaskInventoryItem(); - + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; @@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != srcPart.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItemExclusive(destTaskItem); if (running > 0) { destPart.CreateScriptInstance(destTaskItem, 0, false); } - + ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + /// /// Called when an object is removed from the environment into inventory. /// @@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes private bool InventoryDeQueueAndDelete() { DeleteToInventoryHolder x = null; - + try { lock (m_inventoryDeletes) @@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes return true; } } - } + } catch(Exception e) { // We can't put the object group details in here since the root part may have disappeared (which is where these sit). // FIXME: This needs to be fixed. m_log.ErrorFormat( - "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", + "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); } @@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + AssetBase asset = CreateAsset( objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), @@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) { SceneObjectGroup objectGroup = grp; @@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public virtual SceneObjectGroup RezObject( - SceneObjectPart sourcePart, TaskInventoryItem item, + SceneObjectPart sourcePart, TaskInventoryItem item, LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) { // Rez object @@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes return rootPart.ParentGroup; } } - + return null; } - + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) { string message = ""; @@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = folderID; - + if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) { uint perms = returnobjects[i].GetEffectivePermissions(); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; /// - /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is + /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is /// dispenced. - /// + /// private uint m_lastAllocatedLocalId = 720000; - + private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; @@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes public override void Close() { m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); - + // Kick all ROOT agents with the message, 'The simulator is going down' ForEachScenePresence(delegate(ScenePresence avatar) { @@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_frame % m_update_backup == 0) { UpdateStorageBackup(); - + } if (m_frame % m_update_terrain == 0) @@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes public void LazySaveGeneratedMaptile(byte[] data, bool temporary) { // Overwrites the local Asset cache with new maptile data - // Assets are single write, this causes the asset server to ignore this update, + // Assets are single write, this causes the asset server to ignore this update, // but the local asset cache does not // this is on purpose! The net result of this is the region always has the most up to date - // map tile while protecting the (grid) asset database from bloat caused by a new asset each + // map tile while protecting the (grid) asset database from bloat caused by a new asset each // time a mapimage is generated! - + LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; int lastMapRefresh = 0; @@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// public bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes lock (Entities) { ICollection entities = new List(Entities.Values); - + foreach (EntityBase e in entities) { if (e is SceneObjectGroup) DeleteSceneObject((SceneObjectGroup)e); } - } + } } - + /// /// Delete the given object from the scene. /// @@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) { - m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); } @@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml2(string fileName) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); + m_serialiser.LoadPrimsFromXml2(this, fileName); } public void LoadPrimsFromXml2(TextReader reader, bool startScripts) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); } public void SavePrimsToXml2(string fileName) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); - + m_serialiser.SavePrimsToXml2(this, fileName); } public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); - + m_serialiser.SavePrimsToXml2(this, stream, min, max); } @@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes { m_log.InfoFormat( "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); - + List entityList = GetEntities(); List primList = new List(); @@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromArchive(string filePath) { m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); - + m_archiver.DearchiveRegion(filePath); } @@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes public void SavePrimsToArchive(string filePath) { m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); - + m_archiver.ArchiveRegion(filePath); } @@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) { - SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); + SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); AddRestoredSceneObject(sceneObject, true, false); SceneObjectPart RootPrim = GetSceneObjectPart(primID); @@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes { DeleteSceneObject(grp); } - + m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); return false; @@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.DebugFormat( - "[SCENE]: Adding new {0} agent {1} {2} in {3}", + "[SCENE]: Adding new {0} agent {1} {2} in {3}", (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); @@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnScriptReset += ProcessScriptReset; client.OnGetScriptRunning += GetScriptRunning; client.OnSetScriptRunning += SetScriptRunning; - + client.OnRegionHandleRequest += RegionHandleRequest; client.OnUnackedTerrain += TerrainUnAcked; @@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { appearance = null; // VS needs this line, mono doesn't - + try { if (m_AvatarFactory == null || @@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes catch (Exception e) { m_log.ErrorFormat( - "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", + "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", client.Name, client.AgentId, e); appearance = new AvatarAppearance(); - } + } } /// @@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes { childagentYN = avatar.IsChildAgent; } - + try { m_log.DebugFormat( - "[SCENE]: Removing {0} agent {1} from region {2}", + "[SCENE]: Removing {0} agent {1} from region {2}", (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); - + if (avatar.IsChildAgent) { m_innerScene.removeUserCount(false); @@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes // We don't know which count to remove it from // Avatar is already disposed :/ } - + m_eventManager.TriggerOnRemovePresence(agentID); Broadcast(delegate(IClientAPI client) { @@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes { m_innerScene.removeUserCount(true); } - + // Tell a single agent to disconnect from the region. presence.ControllingClient.SendShutdownConnectionNotice(); @@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes { //should be doing this by parcel, but as its only for testing // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 - // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist + // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist // in the context of `<>c__CompilerGenerated17' - // MW said it was okay to comment the body of this method out for now since the code is experimental + // MW said it was okay to comment the body of this method out for now since the code is experimental // and will be replaced anyway // ForEachClient(delegate(IClientAPI client) // { @@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); // }); } - + public void RegionHandleRequest(IClientAPI client, LLUUID regionID) { RegionInfo info; @@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } } -} +} diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; public event LogOffUser OnLogOffUser; public event GetLandData OnGetLandData; - + private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; @@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; private LogOffUser handlerLogOffUser = null; - private GetLandData handlerGetLandData = null; // OnGetLandData + private GetLandData handlerGetLandData = null; // OnGetLandData public KillObjectDelegate KillObject; public string _debugRegionName = String.Empty; @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes } return null; } - + #endregion #region Inform Client of Neighbours @@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 lookAt, uint flags) { bool destRegionUp = false; - + if (regionHandle == m_regionInfo.RegionHandle) { // Teleport within the same region diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes #region Object Permission Checks - public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); - private List GenerateClientFlagsCheckFunctions = new List(); + public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); + private List GenerateClientFlagsCheckFunctions = new List(); - public void addGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Add(delegateFunc); - } - public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Remove(delegateFunc); - } + public void addGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Add(delegateFunc); + } - public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) - { - SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - - if (part == null) - return 0; - - uint perms=part.GetEffectiveObjectFlags() | - (uint)LLObject.ObjectFlags.ObjectModify | - (uint)LLObject.ObjectFlags.ObjectCopy | - (uint)LLObject.ObjectFlags.ObjectMove | - (uint)LLObject.ObjectFlags.ObjectTransfer | - (uint)LLObject.ObjectFlags.ObjectYouOwner | - (uint)LLObject.ObjectFlags.ObjectAnyOwner | - (uint)LLObject.ObjectFlags.ObjectOwnerModify | - (uint)LLObject.ObjectFlags.ObjectYouOfficer; - - foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) - { - perms &= check(userID, objectID); - } - return perms; - } + public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Remove(delegateFunc); + } - public delegate void SetBypassPermissions(bool value); - private List SetBypassPermissionsCheckFunctions = new List(); + public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) + { + SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - public void addSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Remove(delegateFunc); - } + if (part == null) + return 0; + + uint perms=part.GetEffectiveObjectFlags() | + (uint)LLObject.ObjectFlags.ObjectModify | + (uint)LLObject.ObjectFlags.ObjectCopy | + (uint)LLObject.ObjectFlags.ObjectMove | + (uint)LLObject.ObjectFlags.ObjectTransfer | + (uint)LLObject.ObjectFlags.ObjectYouOwner | + (uint)LLObject.ObjectFlags.ObjectAnyOwner | + (uint)LLObject.ObjectFlags.ObjectOwnerModify | + (uint)LLObject.ObjectFlags.ObjectYouOfficer; - public void ExternalChecksSetBypassPermissions(bool value) + foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) { - foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) - { - check(value); - } + perms &= check(userID, objectID); } + return perms; + } - public delegate bool BypassPermissions(); - private List BypassPermissionsCheckFunctions = new List(); + public delegate void SetBypassPermissions(bool value); + private List SetBypassPermissionsCheckFunctions = new List(); - public void addBypassPermissions(BypassPermissions delegateFunc) - { - if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeBypassPermissions(BypassPermissions delegateFunc) + public void addSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public void ExternalChecksSetBypassPermissions(bool value) + { + foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) { - if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Remove(delegateFunc); + check(value); } + } - public bool ExternalChecksBypassPermissions() + public delegate bool BypassPermissions(); + private List BypassPermissionsCheckFunctions = new List(); + + public void addBypassPermissions(BypassPermissions delegateFunc) + { + if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeBypassPermissions(BypassPermissions delegateFunc) + { + if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksBypassPermissions() + { + foreach (BypassPermissions check in BypassPermissionsCheckFunctions) { - foreach (BypassPermissions check in BypassPermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool PropagatePermissions(); - private List PropagatePermissionsCheckFunctions = new List(); + public delegate bool PropagatePermissions(); + private List PropagatePermissionsCheckFunctions = new List(); - public void addPropagatePermissions(PropagatePermissions delegateFunc) - { - if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Add(delegateFunc); - } - public void removePropagatePermissions(PropagatePermissions delegateFunc) - { - if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Remove(delegateFunc); - } + public void addPropagatePermissions(PropagatePermissions delegateFunc) + { + if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksPropagatePermissions() + public void removePropagatePermissions(PropagatePermissions delegateFunc) + { + if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksPropagatePermissions() + { + foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) { - foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - #region REZ OBJECT - public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); - private List CanRezObjectCheckFunctions = new List(); + #region REZ OBJECT + public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); + private List CanRezObjectCheckFunctions = new List(); - public void addCheckRezObject(CanRezObject delegateFunc) - { - if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckRezObject(CanRezObject delegateFunc) - { - if (CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckRezObject(CanRezObject delegateFunc) + { + if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckRezObject(CanRezObject delegateFunc) + { + if (CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanRezObject check in CanRezObjectCheckFunctions) { - foreach (CanRezObject check in CanRezObjectCheckFunctions) + if (check(objectCount, owner,objectPosition, m_scene) == false) { - if (check(objectCount, owner,objectPosition, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DELETE OBJECT - public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); - private List CanDeleteObjectCheckFunctions = new List(); + #region DELETE OBJECT + public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); + private List CanDeleteObjectCheckFunctions = new List(); - public void addCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + public void removeCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + { + foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) { - foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) + if (check(objectID,deleter,m_scene) == false) { - if (check(objectID,deleter,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE OBJECT - public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); - private List CanTakeObjectCheckFunctions = new List(); + #region TAKE OBJECT + public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); + private List CanTakeObjectCheckFunctions = new List(); - public void addCheckTakeObject(CanTakeObject delegateFunc) - { - if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeObject(CanTakeObject delegateFunc) - { - if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckTakeObject(CanTakeObject delegateFunc) + { + if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckTakeObject(CanTakeObject delegateFunc) + { + if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + { + foreach (CanTakeObject check in CanTakeObjectCheckFunctions) { - foreach (CanTakeObject check in CanTakeObjectCheckFunctions) + if (check(objectID, AvatarTakingUUID, m_scene) == false) { - if (check(objectID, AvatarTakingUUID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE COPY OBJECT - public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); - private List CanTakeCopyObjectCheckFunctions = new List(); + #region TAKE COPY OBJECT + public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); + private List CanTakeCopyObjectCheckFunctions = new List(); - public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + { + foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) { - foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) + if (check(objectID,userID,m_scene) == false) { - if (check(objectID,userID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DUPLICATE OBJECT - public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); - private List CanDuplicateObjectCheckFunctions = new List(); + #region DUPLICATE OBJECT + public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); + private List CanDuplicateObjectCheckFunctions = new List(); - public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) { - foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) + if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) { - if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT OBJECT - public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); - private List CanEditObjectCheckFunctions = new List(); + #region EDIT OBJECT + public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); + private List CanEditObjectCheckFunctions = new List(); - public void addCheckEditObject(CanEditObject delegateFunc) - { - if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditObject(CanEditObject delegateFunc) - { - if (CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditObject(CanEditObject delegateFunc) + { + if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckEditObject(CanEditObject delegateFunc) + { + if (CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + { + foreach (CanEditObject check in CanEditObjectCheckFunctions) { - foreach (CanEditObject check in CanEditObjectCheckFunctions) + if (check(objectID, editorID, m_scene) == false) { - if (check(objectID, editorID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region MOVE OBJECT - public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); - private List CanMoveObjectCheckFunctions = new List(); + #region MOVE OBJECT + public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); + private List CanMoveObjectCheckFunctions = new List(); - public void addCheckMoveObject(CanMoveObject delegateFunc) - { - if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckMoveObject(CanMoveObject delegateFunc) - { - if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckMoveObject(CanMoveObject delegateFunc) + { + if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + public void removeCheckMoveObject(CanMoveObject delegateFunc) + { + if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + { + foreach (CanMoveObject check in CanMoveObjectCheckFunctions) { - foreach (CanMoveObject check in CanMoveObjectCheckFunctions) + if (check(objectID,moverID,m_scene) == false) { - if (check(objectID,moverID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region OBJECT ENTRY - public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); - private List CanObjectEntryCheckFunctions = new List(); + #region OBJECT ENTRY + public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); + private List CanObjectEntryCheckFunctions = new List(); - public void addCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Add(delegateFunc); - } - public void removeCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Remove(delegateFunc); - } + public void addCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + { + foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) { - foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) + if (check(objectID, newPoint, m_scene) == false) { - if (check(objectID, newPoint, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RETURN OBJECT - public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); - private List CanReturnObjectCheckFunctions = new List(); + #region RETURN OBJECT + public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); + private List CanReturnObjectCheckFunctions = new List(); - public void addCheckReturnObject(CanReturnObject delegateFunc) - { - if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckReturnObject(CanReturnObject delegateFunc) - { - if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckReturnObject(CanReturnObject delegateFunc) + { + if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckReturnObject(CanReturnObject delegateFunc) + { + if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + { + foreach (CanReturnObject check in CanReturnObjectCheckFunctions) { - foreach (CanReturnObject check in CanReturnObjectCheckFunctions) + if (check(objectID,returnerID,m_scene) == false) { - if (check(objectID,returnerID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region INSTANT MESSAGE - public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); - private List CanInstantMessageCheckFunctions = new List(); + #region INSTANT MESSAGE + public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); + private List CanInstantMessageCheckFunctions = new List(); - public void addCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Add(delegateFunc); - } - public void removeCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Remove(delegateFunc); - } + public void addCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + public void removeCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + { + foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) { - foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } + + #endregion - #endregion + #region INVENTORY TRANSFER + public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); + private List CanInventoryTransferCheckFunctions = new List(); - #region INVENTORY TRANSFER - public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); - private List CanInventoryTransferCheckFunctions = new List(); + public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + { + if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) + CanInventoryTransferCheckFunctions.Add(delegateFunc); + } - public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) - { - if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) - CanInventoryTransferCheckFunctions.Add(delegateFunc); - } - public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) { if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) CanInventoryTransferCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + { + foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) { - foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region VIEW SCRIPT - public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewScriptCheckFunctions = new List(); + #region VIEW SCRIPT + public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewScriptCheckFunctions = new List(); - public void addCheckViewScript(CanViewScript delegateFunc) - { - if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewScript(CanViewScript delegateFunc) - { - if (CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewScript(CanViewScript delegateFunc) + { + if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckViewScript(CanViewScript delegateFunc) + { + if (CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewScript check in CanViewScriptCheckFunctions) { - foreach (CanViewScript check in CanViewScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewNotecardCheckFunctions = new List(); + public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewNotecardCheckFunctions = new List(); - public void addCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) { - foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT SCRIPT - public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditScriptCheckFunctions = new List(); + #region EDIT SCRIPT + public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanEditScriptCheckFunctions = new List(); - public void addCheckEditScript(CanEditScript delegateFunc) - { - if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditScript(CanEditScript delegateFunc) - { - if (CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditScript(CanEditScript delegateFunc) + { + if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditScript(CanEditScript delegateFunc) + { + if (CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanEditScript check in CanEditScriptCheckFunctions) { - foreach (CanEditScript check in CanEditScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditNotecardCheckFunctions = new List(); + public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); + private List CanEditNotecardCheckFunctions = new List(); - public void addCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) { foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) { @@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes return true; } - #endregion + #endregion - #region RUN SCRIPT (When Script Placed in Object) - public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanRunScriptCheckFunctions = new List(); + #region RUN SCRIPT (When Script Placed in Object) + public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanRunScriptCheckFunctions = new List(); - public void addCheckRunScript(CanRunScript delegateFunc) - { - if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunScript(CanRunScript delegateFunc) - { - if (CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckRunScript(CanRunScript delegateFunc) + { + if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckRunScript(CanRunScript delegateFunc) + { + if (CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanRunScript check in CanRunScriptCheckFunctions) { - foreach (CanRunScript check in CanRunScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region START SCRIPT (When Script run box is Checked after placed in object) - public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); - private List CanStartScriptCheckFunctions = new List(); + #region START SCRIPT (When Script run box is Checked after placed in object) + public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); + private List CanStartScriptCheckFunctions = new List(); - public void addCheckStartScript(CanStartScript delegateFunc) - { - if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStartScript(CanStartScript delegateFunc) - { - if (CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckStartScript(CanStartScript delegateFunc) + { + if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckStartScript(CanStartScript delegateFunc) + { + if (CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + { + foreach (CanStartScript check in CanStartScriptCheckFunctions) { - foreach (CanStartScript check in CanStartScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - #region STOP SCRIPT (When Script run box is unchecked after placed in object) - public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); - private List CanStopScriptCheckFunctions = new List(); + #region STOP SCRIPT (When Script run box is unchecked after placed in object) + public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); + private List CanStopScriptCheckFunctions = new List(); + + public void addCheckStopScript(CanStopScript delegateFunc) + { + if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Add(delegateFunc); + } - public void addCheckStopScript(CanStopScript delegateFunc) - { - if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStopScript(CanStopScript delegateFunc) - { - if (CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Remove(delegateFunc); - } + public void removeCheckStopScript(CanStopScript delegateFunc) + { + if (CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + { + foreach (CanStopScript check in CanStopScriptCheckFunctions) { - foreach (CanStopScript check in CanStopScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RESET SCRIPT - public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); - private List CanResetScriptCheckFunctions = new List(); + #region RESET SCRIPT + public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); + private List CanResetScriptCheckFunctions = new List(); - public void addCheckResetScript(CanResetScript delegateFunc) - { - if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckResetScript(CanResetScript delegateFunc) - { - if (CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckResetScript(CanResetScript delegateFunc) + { + if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckResetScript(CanResetScript delegateFunc) + { + if (CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + { + foreach (CanResetScript check in CanResetScriptCheckFunctions) { - foreach (CanResetScript check in CanResetScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TERRAFORM LAND - public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); - private List CanTerraformLandCheckFunctions = new List(); + #region TERRAFORM LAND + public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); + private List CanTerraformLandCheckFunctions = new List(); - public void addCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + { + foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) { - foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) + if (check(user, pos, m_scene) == false) { - if (check(user, pos, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RUN CONSOLE COMMAND - public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); - private List CanRunConsoleCommandCheckFunctions = new List(); + #region RUN CONSOLE COMMAND + public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); + private List CanRunConsoleCommandCheckFunctions = new List(); - public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); - } + public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + { + foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) { - foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region CAN ISSUE ESTATE COMMAND - public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); - private List CanIssueEstateCommandCheckFunctions = new List(); + #region CAN ISSUE ESTATE COMMAND + public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); + private List CanIssueEstateCommandCheckFunctions = new List(); - public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); - } + public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + { + foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) { - foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) + if (check(user, m_scene, ownerCommand) == false) { - if (check(user, m_scene, ownerCommand) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region CAN BE GODLIKE - public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); - private List CanBeGodLikeCheckFunctions = new List(); + #region CAN BE GODLIKE + public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); + private List CanBeGodLikeCheckFunctions = new List(); - public void addCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Add(delegateFunc); - } - public void removeCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Remove(delegateFunc); - } + public void addCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Add(delegateFunc); + } + + public void removeCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanBeGodLike(LLUUID user) + public bool ExternalChecksCanBeGodLike(LLUUID user) + { + foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) { - foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region EDIT PARCEL - public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanEditParcelCheckFunctions = new List(); + #region EDIT PARCEL + public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanEditParcelCheckFunctions = new List(); - public void addCheckEditParcel(CanEditParcel delegateFunc) - { - if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditParcel(CanEditParcel delegateFunc) - { - if (CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditParcel(CanEditParcel delegateFunc) + { + if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckEditParcel(CanEditParcel delegateFunc) + { + if (CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + { + foreach (CanEditParcel check in CanEditParcelCheckFunctions) { - foreach (CanEditParcel check in CanEditParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region SELL PARCEL - public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanSellParcelCheckFunctions = new List(); + #region SELL PARCEL + public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanSellParcelCheckFunctions = new List(); - public void addCheckSellParcel(CanSellParcel delegateFunc) - { - if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckSellParcel(CanSellParcel delegateFunc) - { - if (CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckSellParcel(CanSellParcel delegateFunc) + { + if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckSellParcel(CanSellParcel delegateFunc) + { + if (CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + { + foreach (CanSellParcel check in CanSellParcelCheckFunctions) { - foreach (CanSellParcel check in CanSellParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region ABANDON PARCEL - public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanAbandonParcelCheckFunctions = new List(); + #region ABANDON PARCEL + public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanAbandonParcelCheckFunctions = new List(); - public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + { + foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) { - foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanReclaimParcelCheckFunctions = new List(); + public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanReclaimParcelCheckFunctions = new List(); - public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + { + foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) { - foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); - private List CanBuyLandCheckFunctions = new List(); + return true; + } + public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); + private List CanBuyLandCheckFunctions = new List(); - public void addCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + { + foreach (CanBuyLand check in CanBuyLandCheckFunctions) { - foreach (CanBuyLand check in CanBuyLandCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); - private List CanLinkObjectCheckFunctions = new List(); + public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); + private List CanLinkObjectCheckFunctions = new List(); - public void addCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) { foreach (CanLinkObject check in CanLinkObjectCheckFunctions) { @@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); - private List CanDelinkObjectCheckFunctions = new List(); + public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); + private List CanDelinkObjectCheckFunctions = new List(); - public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + { + foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) { - foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) + if (check(user, objectID) == false) { - if (check(user, objectID) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); - private List CanCreateInventoryCheckFunctions = new List(); + public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); + private List CanCreateInventoryCheckFunctions = new List(); - public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + { + foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) { - foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) + if (check(invType, objectID, userID) == false) { - if (check(invType, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanCopyInventoryCheckFunctions = new List(); + public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanCopyInventoryCheckFunctions = new List(); - public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) { - foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanDeleteInventoryCheckFunctions = new List(); + public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanDeleteInventoryCheckFunctions = new List(); - public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) { - foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanTeleport(LLUUID userID); - private List CanTeleportCheckFunctions = new List(); + public delegate bool CanTeleport(LLUUID userID); + private List CanTeleportCheckFunctions = new List(); - public void addCheckCanTeleport(CanTeleport delegateFunc) - { - if (!CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanTeleport(CanTeleport delegateFunc) - { - if (CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanTeleport(CanTeleport delegateFunc) + { + if (!CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanTeleport(CanTeleport delegateFunc) + { + if (CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTeleport(LLUUID userID) + public bool ExternalChecksCanTeleport(LLUUID userID) + { + foreach (CanTeleport check in CanTeleportCheckFunctions) { - foreach (CanTeleport check in CanTeleportCheckFunctions) + if (check(userID) == false) { - if (check(userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } } } - diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// - /// Force all task inventories of prims in the scene object to persist + /// Force all task inventories of prims in the scene object to persist /// public void ForceInventoryPersistence() { @@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes { part.ForceInventoryPersistence(); } - } + } } - + /// /// Start the scripts contained in all the prims in this group. /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes // taskItem.SalePrice = item.SalePrice; // taskItem.SaleType = item.SaleType; taskItem.CreationDate = (uint)item.CreationDate; - + part.AddInventoryItem(taskItem); return true; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes /// since the group's last persistent backup /// public bool HasGroupChanged = false; - + public float scriptScore = 0f; private LLVector3 lastPhysGroupPos; @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes private bool m_scriptListens_notAtTarget = false; #region Properties - + /// /// The name of an object grouping is always the same as its root part /// @@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return RootPart.Name; } set { RootPart.Name = value; } - } + } /// /// Added because the Parcel code seems to use it @@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes } more = !reader.EOF; } - + reader.Close(); sr.Close(); UpdateParentIDs(); } - + /// /// /// @@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes newPart.LinkNum = 0; m_parts.Add(newPart.UUID, newPart); SetPartAsRoot(newPart); - + // one of these is a proxy. if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) AttachToBackup(); //ApplyPhysics(scene.m_physicalPrim); } - + /// /// /// @@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.ScheduleFullUpdate(); m_rootPart.ClearUndoState(); } - + public void DetachToInventoryPrep() { ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); @@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes return m_scene.MaxUndoCount; return 5; } - - // justincc: I don't believe this hack is needed any longer, especially since the physics + + // justincc: I don't believe this hack is needed any longer, especially since the physics // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false // this method was preventing proper reload of scene objects. - // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects + // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects // at region startup public void ResetChildPrimPhysicsPositions() { @@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes /// public void DeleteGroup() { - // We need to keep track of this state in case this group is still queued for backup. + // We need to keep track of this state in case this group is still queued for backup. // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race // conditions where a user deletes an entity while it is being stored. Really, the update - // code needs a redesign. + // code needs a redesign. m_isDeleted = true; - - DetachFromBackup(this); + + DetachFromBackup(this); lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) { part.RemoveScriptInstances(); - + List avatars = Scene.GetScenePresences(); for (int i = 0; i < avatars.Count; i++) { @@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); } } - + m_rootPart = null; - m_parts.Clear(); + m_parts.Clear(); } } - + public void FakeDeleteGroup() { foreach (SceneObjectPart part in m_parts.Values) @@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes lock (m_targets) m_targets.Clear(); } - + ScheduleGroupForFullUpdate(); } @@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes { part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); } - + // Hack to get the physics scene geometries in the right spot ResetChildPrimPhysicsPositions(); } @@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// public void ProcessBackup(IRegionDataStore datastore) - { + { if (HasGroupChanged) { // don't backup while it's selected or you're asking for changes mid stream. if ((!IsSelected) && (RootPart != null)) { m_log.InfoFormat( - "[SCENE]: Storing object {0}, {1} in {2}", + "[SCENE]: Storing object {0}, {1} in {2}", Name, UUID, m_scene.RegionInfo.RegionName); SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); @@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); } - + // Now we've made a copy that replaces this one, we need to // switch the owner to the person who did the copying // Second Life copies an object and duplicates the first one in it's place @@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.UpdateParentIDs(); dupe.HasGroupChanged = true; dupe.AttachToBackup(); - + ScheduleGroupForFullUpdate(); } @@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes { return true; } - + return false; } @@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + return false; } @@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) { SceneObjectPart selectionPart = GetChildPart(localID); - + if (selectionPart != null) { lock (m_parts) @@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); } //if (part.UUID != m_rootPart.UUID) - + HasGroupChanged = true; ScheduleGroupForFullUpdate(); @@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = pos; - + HasGroupChanged = true; } - + //we need to do a terse update even if the move wasn't allowed // so that the position is reset in the client (the object snaps back) ScheduleGroupForTerseUpdate(); @@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateSinglePosition(LLVector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); - + if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes { part.UpdateOffSet(pos); } - + HasGroupChanged = true; } } @@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = newPos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.RotationOffset.Z); m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } AbsolutePosition = pos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + /// /// Set the user group to which this scene object belongs. /// @@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes { part.SetGroup(GroupID, client); } - + HasGroupChanged = true; } - + ScheduleGroupForFullUpdate(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes private string m_inventoryFileName = String.Empty; private int m_inventoryFileNameSerial = 0; - + /// /// Serial count for inventory file , used to tell if inventory has changed /// no need for this to be part of Database backup @@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// Holds in memory prim inventory /// - protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); + protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); /// /// Tracks whether inventory has changed since the last persistent backup /// protected bool HasInventoryChanged; - + /// /// Force the task inventory of this prim to persist at the next update sweep /// @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes { if (i.InvType == (int)InventoryType.LSL) RemoveScriptInstance(i.ItemID); - + RemoveInventoryItem(i.ItemID); break; } @@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(item.Name, item); } - + /// /// Add an item to this prim's inventory. /// @@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes { item.ParentID = UUID; item.ParentPartID = UUID; - + lock (m_taskInventory) { m_taskInventory.Add(item.ItemID, item); @@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes m_inventorySerial++; //m_inventorySerial += 2; HasInventoryChanged = true; - ParentGroup.HasGroupChanged = true; + ParentGroup.HasGroupChanged = true; } /// @@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// null if the item does not exist public TaskInventoryItem GetInventoryItem(LLUUID itemId) - { + { TaskInventoryItem item; m_taskInventory.TryGetValue(itemId, out item); - + return item; } @@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes } } - + if (scriptcount <= 0) { RemFlag(LLObject.ObjectFlags.Scripted); } - + ScheduleFullUpdate(); return type; @@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes public void ProcessInventoryBackup(IRegionDataStore datastore) { if (HasInventoryChanged) - { + { lock (TaskInventory) { datastore.StorePrimInventory(UUID, TaskInventory.Values); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes public uint AttachmentPoint = (byte)0; [XmlIgnore] public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); - + [XmlIgnore] public bool Undoing = false; @@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes protected LLVector3 m_velocity; // TODO: Those have to be changed into persistent properties at some later point, - // or sit-camera on vehicles will break on sim-crossing. + // or sit-camera on vehicles will break on sim-crossing. private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); private bool m_forceMouselook = false; - + #endregion Fields #region Constructors @@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)PermissionMask.All; private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; - + public LLUUID CreatorID { - get + get { return _creatorID; } - set + set { _creatorID = value; } @@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes { get { return (uint)_flags; } set { _flags = (LLObject.ObjectFlags)value; } - } - + } + public LLUUID UUID { get { return m_uuid; } set { m_uuid = value; } } - + public uint LocalId { get { return m_localId; } set { m_localId = value; } } - + public virtual string Name { get { return m_name; } set { m_name = value; } } - + public byte Material { get { return (byte) m_material; } @@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes /// public LLVector3 AngularVelocity { - get - { + get + { if ((PhysActor != null) && PhysActor.IsPhysical) { m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); } - return m_angularVelocity; + return m_angularVelocity; } set { m_angularVelocity = value; } } @@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_description; } set { m_description = value; } } - + public Color Color { get { return m_color; } @@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes // set of attributes on shape change. For instance, // changing the lighting on a shape shouldn't cause // this. - if (m_shape != null) + if (m_shape != null) shape_changed = true; m_shape = value; @@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes } #endregion - + //--------------- @@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_parentGroup; } } - + public scriptEvents ScriptEvents { @@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes public LLQuaternion SitTargetOrientationLL { - get - { + get + { return new LLQuaternion( m_sitTargetOrientation.x, m_sitTargetOrientation.y, @@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes } } - public uint ParentID + public uint ParentID { get { return _parentID; } set { _parentID = value; } } - public int CreationDate + public int CreationDate { get { return _creationDate; } set { _creationDate = value; } } - public uint Category + public uint Category { get { return _category; } set { _category = value; } } - public int SalePrice + public int SalePrice { get { return _salePrice; } set { _salePrice = value; } } - public byte ObjectSaleType + public byte ObjectSaleType { get { return _objectSaleType; } set { _objectSaleType = value; } } - public int OwnershipCost + public int OwnershipCost { get { return _ownershipCost; } set { _ownershipCost = value; } } - public LLUUID GroupID + public LLUUID GroupID { get { return _groupID; } set { _groupID = value; } } - public LLUUID OwnerID + public LLUUID OwnerID { get { return _ownerID; } set { _ownerID = value; } } - public LLUUID LastOwnerID + public LLUUID LastOwnerID { get { return _lastOwnerID; } set { _lastOwnerID = value; } } - public uint BaseMask + public uint BaseMask { get { return _baseMask; } set { _baseMask = value; } } - public uint OwnerMask + public uint OwnerMask { get { return _ownerMask; } set { _ownerMask = value; } } - public uint GroupMask + public uint GroupMask { get { return _groupMask; } set { _groupMask = value; } } - public uint EveryoneMask + public uint EveryoneMask { get { return _everyoneMask; } set { _everyoneMask = value; } } - public uint NextOwnerMask + public uint NextOwnerMask { get { return _nextOwnerMask; } set { _nextOwnerMask = value; } } - public libsecondlife.LLObject.ObjectFlags Flags + public libsecondlife.LLObject.ObjectFlags Flags { get { return _flags; } set { _flags = value; } } - public LLUUID SitTargetAvatar + public LLUUID SitTargetAvatar { get { return m_sitTargetAvatar; } set { m_sitTargetAvatar = value; } @@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public virtual LLUUID RegionID { - get - { + get + { if (ParentGroup != null && ParentGroup.Scene != null) return ParentGroup.Scene.RegionInfo.RegionID; else @@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public LLUUID ParentUUID { - get + get { - if (ParentGroup != null) + if (ParentGroup != null) { _parentUUID = ParentGroup.UUID; } @@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes } set { _parentUUID = value; } } - + #endregion Public Properties with only Get #region Private Methods @@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes return; } } - + if (m_parentGroup.GetSceneMaxUndo() > 0) @@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes ScaleOffset = Math.Abs(ScaleOffset); Vector3 offset = returnresult.normal * ScaleOffset; returnresult.ipoint = AXpos + offset; - + ///pos = (intersectionpoint + offset); } else @@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes public void SetCameraAtOffset(LLVector3 v) { m_cameraAtOffset = v; } - + public void SetCameraEyeOffset(LLVector3 v) { m_cameraEyeOffset = v; } - + public void SetForceMouselook(bool force) { m_forceMouselook = force; } - + public LLVector3 GetCameraAtOffset() { return m_cameraAtOffset; } - + public LLVector3 GetCameraEyeOffset() { return m_cameraEyeOffset; } - + public bool GetForceMouselook() { return m_forceMouselook; } - + #endregion Public Methods } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveFromPhysicalScene(); } } - + cameraAtOffset = part.GetCameraAtOffset(); cameraEyeOffset = part.GetCameraEyeOffset(); forceMouselook = part.GetForceMouselook(); @@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveAnimation(animID); } - + public LLUUID[] GetAnimationArray() { LLUUID[] animIDs; @@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes /// - /// Do everything required once a client completes its movement into a region + /// Do everything required once a client completes its movement into a region /// public void SendInitialData() { @@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes { if (IsChildAgent) return; - + LLVector3 pos2 = AbsolutePosition; LLVector3 vel = Velocity; @@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes // This means we need to remove the current caps handler here and possibly compensate later, // in case both scenes are being hosted on the same region server. Messy m_scene.RemoveCapsHandler(UUID); - newpos = newpos + (vel); + newpos = newpos + (vel); - CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); + CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); if (userInfo != null) { userInfo.DropInventory(); @@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); - } - + } + bool crossingSuccessful = m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, - m_physicsActor.Flying); + m_physicsActor.Flying); if (crossingSuccessful) { AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); @@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath); MakeChildAgent(); - CrossAttachmentsIntoNewRegion(neighbourHandle); - + CrossAttachmentsIntoNewRegion(neighbourHandle); + m_scene.SendKillObject(m_localId); m_scene.NotifyMyCoarseLocationChange(); // the user may change thier profile information in other region, @@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes else { // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing - m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); + m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); m_scene.AddCapsHandler(UUID); } } @@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + LastCommands = allflags; } diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes m_report.Interval = statsUpdatesEveryMS; m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); m_report.Enabled = true; - + if (StatsManager.SimExtraStats != null) OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; } diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes Rotation = rot; Scale = scale; } - + public UndoState(SceneObjectPart part) { if (part != null) @@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes { Position = part.AbsolutePosition; Rotation = part.RotationOffset; - + } else { @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { part.Undoing = true; - + if (part.ParentID == 0) { part.ParentGroup.AbsolutePosition = Position; @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes part.ScheduleTerseUpdate(); } part.Undoing = false; - + } } diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index d83bba6..16636e0 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -49,7 +49,6 @@ namespace OpenSim.Region.Examples.SimpleModule public RotatingWheel() { - } public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, @@ -78,7 +77,6 @@ namespace OpenSim.Region.Examples.SimpleModule public ComplexObject() { - } public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 6a18091..e7d5db8 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.Examples.SimpleModule { float cpu = m_counter.NextValue()/40f; LLVector3 size = new LLVector3(cpu, cpu, cpu); - + RootPart.Resize(size); base.UpdateMovement(); diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 213f1d4..3bf0956 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin public BasicScene() { } - + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index 48e4ba6..0042c40 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs @@ -48,6 +48,5 @@ namespace OpenSim.Region.Physics.Manager int[] getIndexListAsIntLocked(); float[] getVertexListAsFloatLocked(); void releasePinned(); - } } diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index beca4da..d4af271 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -209,10 +209,8 @@ namespace OpenSim.Region.Physics.Manager public override bool Stopped { get{ return false; } - } - public override PhysicsVector Position { get { return PhysicsVector.Zero; } diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index b14deeb..0c94669 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs @@ -286,7 +286,7 @@ namespace OpenSim.Region.Physics.Meshing // It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end // angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used // to calculate the sine for generating the path radius appears to approximate it's effects there - // too, but there are some subtle differences in the radius which are noticeable as the prim size + // too, but there are some subtle differences in the radius which are noticeable as the prim size // increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on // the meshes generated with this technique appear nearly identical in shape to the same prims when // displayed by the viewer. @@ -369,28 +369,26 @@ namespace OpenSim.Region.Physics.Meshing float yOffset; float zOffset; - xOffset = 0.5f * (skewStart + totalSkew * (float)percentOfPath); xOffset += (float) System.Math.Sin(angle) * pushX * 0.45f; yOffset = (float)(System.Math.Cos(angle) * (0.5f - yPathScale)) * radiusScale; zOffset = (float)(System.Math.Sin(angle + pushY * 0.9f) * (0.5f - yPathScale)) * radiusScale; - - // next apply twist rotation to the profile layer - if (twistTotal != 0.0f || twistBot != 0.0f) + // next apply twist rotation to the profile layer + if (twistTotal != 0.0f || twistBot != 0.0f) + { + Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); + foreach (Vertex v in newLayer.vertices) { - Quaternion profileRot = new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist); - foreach (Vertex v in newLayer.vertices) + if (v != null) { - if (v != null) - { - vTemp = v * profileRot; - v.X = vTemp.X; - v.Y = vTemp.Y; - v.Z = vTemp.Z; - } + vTemp = v * profileRot; + v.X = vTemp.X; + v.Y = vTemp.Y; + v.Z = vTemp.Z; } } + } // now orient the rotation of the profile layer relative to it's position on the path // adding pushY to the angle used to generate the quat appears to approximate the viewer diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index 816b6bb..2cb8d04 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -118,7 +118,7 @@ public class Vertex : PhysicsVector, IComparable { return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); } - + // disable warning: mono compiler moans about overloading // operators hiding base operator but should not according to C# // language spec diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f041aec..a038dc2 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -941,7 +941,7 @@ namespace OpenSim.Region.Physics.Meshing extr.twistBot = (float)primShape.PathTwistBegin * (float)Math.PI * 0.01f; extr.pathBegin = primShape.PathBegin; extr.pathEnd = primShape.PathEnd; - + //System.Console.WriteLine("[MESH]: twistTop = " + twistTop.ToString() + "|" + extr.twistTop.ToString() + ", twistMid = " + twistMid.ToString() + "|" + extr.twistMid.ToString() + ", twistbot = " + twistBot.ToString() + "|" + extr.twistBot.ToString()); //Mesh result = extr.Extrude(m); Mesh result = extr.ExtrudeLinearPath(m); @@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Physics.Meshing } /// - /// Creates a mesh for prim types torus, ring, tube, and sphere + /// Creates a mesh for prim types torus, ring, tube, and sphere /// /// /// @@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Physics.Meshing // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); - + float skew = primShape.PathSkew * 0.01f; float pathScaleX = (float)(200 - primShape.PathScaleX) * 0.01f; float pathScaleY = (float)(200 - primShape.PathScaleY) * 0.01f; @@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Physics.Meshing //System.Console.WriteLine("primShape.PathTaperX: " + primShape.PathTaperX.ToString()); //System.Console.WriteLine("primShape.PathTaperY: " + primShape.PathTaperY.ToString()); - + //System.Console.WriteLine("primShape.PathRadiusOffset: " + primShape.PathRadiusOffset.ToString()); #endif @@ -1875,7 +1875,7 @@ namespace OpenSim.Region.Physics.Meshing if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) { - + SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod); mesh = (Mesh)smesh; CalcNormals(mesh); @@ -1967,7 +1967,7 @@ namespace OpenSim.Region.Physics.Meshing float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; float pathBegin = (float)primShape.PathBegin * 2.0e-5f; float pathEnd = 1.0f - (float)primShape.PathEnd * 2.0e-5f; - + float profileBegin = (float)primShape.ProfileBegin * 2.0e-5f; float profileEnd = 1.0f - (float)primShape.ProfileEnd * 2.0e-5f; diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index 95a244d..1c3153a 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.Physics.Meshing { if (_lod == 2f || _lod == 4f || _lod == 8f || _lod == 16f || _lod == 32f || _lod == 64f) lod = (int)_lod; - + try { idata = OpenJPEG.DecodeToImage(jpegData); @@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Meshing } } - + } private Vertex ColorToVertex(Color input) { @@ -225,7 +225,7 @@ namespace OpenSim.Region.Physics.Meshing // Create a vertex position from the RGB channels in the current pixel // int ypos = y * bLOD.Width; - + if (y == 0) { v1 = northpole; @@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Meshing Add(tri2); } } - + } //Vertex vt31 = sVertices[(y * x_max + x)]; //Vertex vt32 = sVertices[(y * x_max + 0)]; @@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing //Add(tri3); // } //} - + //Vertex vt41 = sVertices[(y * x_max + x)]; //Vertex vt42 = sVertices[((y + 1) * x_max + 0)]; //Vertex vt43 = sVertices[((y + 1) * x_max + x)]; @@ -329,7 +329,7 @@ namespace OpenSim.Region.Physics.Meshing //Add(tri4); //} //} - + } } } diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index bc2ad69..074170a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin private OdePlugin cbt; private PhysicsScene ps; private IMeshingPlugin imp; - + [SetUp] public void Initialize() { @@ -96,11 +96,11 @@ namespace OpenSim.Region.Physics.OdePlugin Assert.That(!oprim.m_taintadd); Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); - + // Make sure we're above the ground //Assert.That(prim.Position.Z > 20f); //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); - + // Make sure we've got a Body Assert.That(oprim.Body != (IntPtr)0); //Console.WriteLine( diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3f8aa26..f285911 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -252,7 +252,6 @@ namespace OpenSim.Region.Physics.OdePlugin public int physics_logging_interval = 0; public bool physics_logging_append_existing_logfile = false; - /// /// Initiailizes the scene /// Sets many properties that ODE requires to be stable @@ -352,14 +351,13 @@ namespace OpenSim.Region.Physics.OdePlugin geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); - + bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); - if (Environment.OSVersion.Platform == PlatformID.Unix) { @@ -367,7 +365,6 @@ namespace OpenSim.Region.Physics.OdePlugin avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); - } else { @@ -547,7 +544,6 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to collide test an object"); return; } @@ -603,7 +599,6 @@ namespace OpenSim.Region.Physics.OdePlugin p2.CollidingGround = true; break; } - // we don't want prim or avatar to explode @@ -850,87 +845,87 @@ namespace OpenSim.Region.Physics.OdePlugin case ActorTypes.Agent: cc2 = (OdeCharacter)p2; - // obj1LocalID = cc2.m_localID; - switch ((ActorTypes)p1.PhysicsActorType) - { - case ActorTypes.Agent: - cc1 = (OdeCharacter)p1; - obj2LocalID = cc1.m_localID; - cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Character; - - //if (cc1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - case ActorTypes.Prim: - cp1 = (OdePrim)p1; - obj2LocalID = cp1.m_localID; - cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Geom; - - //if (cp1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - - case ActorTypes.Ground: - case ActorTypes.Unknown: - obj2LocalID = 0; - //ctype = (int)CollisionCategories.Land; - //returncollisions = true; - break; - } + // obj1LocalID = cc2.m_localID; + switch ((ActorTypes)p1.PhysicsActorType) + { + case ActorTypes.Agent: + cc1 = (OdeCharacter)p1; + obj2LocalID = cc1.m_localID; + cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Character; + + //if (cc1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + case ActorTypes.Prim: + cp1 = (OdePrim)p1; + obj2LocalID = cp1.m_localID; + cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Geom; + + //if (cp1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + + case ActorTypes.Ground: + case ActorTypes.Unknown: + obj2LocalID = 0; + //ctype = (int)CollisionCategories.Land; + //returncollisions = true; + break; + } cc2.AddCollisionEvent(obj2LocalID, collisiondepth); break; case ActorTypes.Prim: cp2 = (OdePrim)p2; - // obj1LocalID = cp2.m_localID; - switch ((ActorTypes)p1.PhysicsActorType) - { - case ActorTypes.Agent: - cc1 = (OdeCharacter)p1; - obj2LocalID = cc1.m_localID; - cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Character; - - //if (cc1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - //returncollisions = true; - - break; - case ActorTypes.Prim: - cp1 = (OdePrim)p1; - obj2LocalID = cp1.m_localID; - cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); - //ctype = (int)CollisionCategories.Geom; - - //if (cp1.CollidingObj) - //cStartStop = (int)StatusIndicators.Generic; - //else - //cStartStop = (int)StatusIndicators.Start; - - //returncollisions = true; - break; - - case ActorTypes.Ground: - case ActorTypes.Unknown: - obj2LocalID = 0; - //ctype = (int)CollisionCategories.Land; - - //returncollisions = true; - break; - } + // obj1LocalID = cp2.m_localID; + switch ((ActorTypes)p1.PhysicsActorType) + { + case ActorTypes.Agent: + cc1 = (OdeCharacter)p1; + obj2LocalID = cc1.m_localID; + cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Character; + + //if (cc1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + //returncollisions = true; + + break; + case ActorTypes.Prim: + cp1 = (OdePrim)p1; + obj2LocalID = cp1.m_localID; + cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); + //ctype = (int)CollisionCategories.Geom; + + //if (cp1.CollidingObj) + //cStartStop = (int)StatusIndicators.Generic; + //else + //cStartStop = (int)StatusIndicators.Start; + + //returncollisions = true; + break; + + case ActorTypes.Ground: + case ActorTypes.Unknown: + obj2LocalID = 0; + //ctype = (int)CollisionCategories.Land; + + //returncollisions = true; + break; + } cp2.AddCollisionEvent(obj2LocalID, collisiondepth); break; @@ -1015,7 +1010,6 @@ namespace OpenSim.Region.Physics.OdePlugin /// private void collision_optimized(float timeStep) { - foreach (OdeCharacter chr in _characters) { // Reset the collision values to false @@ -1579,7 +1573,7 @@ namespace OpenSim.Region.Physics.OdePlugin // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) // return true; - + // return false; @@ -1625,7 +1619,6 @@ namespace OpenSim.Region.Physics.OdePlugin //m_log.Info(timeStep.ToString()); step_time += timeStep; - // If We're loaded down by something else, // or debugging with the Visual Studio project on pause // skip a few frames to catch up gracefully. @@ -1739,7 +1732,6 @@ namespace OpenSim.Region.Physics.OdePlugin } d.WorldQuickStep(world, ODE_STEPSIZE); - d.JointGroupEmpty(contactgroup); //ode.dunlock(world); } @@ -2075,7 +2067,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (resultarr2[y, x] <= 0) { returnarr[i] = 0.0000001f; - + } else returnarr[i] = resultarr2[y, x]; diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 25c0d9a..9195063 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common double x,y,z,s; int f=0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y+left.x >= 0){f+=1;} if (fwd.z+up.x >= 0){f+=2;} if (left.z-up.y >= 0){f+=4;} @@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common x = 2 * (r.x * r.y - r.z * r.s); y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s; z = 2 * (r.x * r.s + r.y * r.z); - return (new LSL_Types.Vector3(x, y, z)); + return (new LSL_Types.Vector3(x, y, z)); } public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) @@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s; return (new LSL_Types.Vector3(x, y, z)); } - + public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) { //A and B should both be normalized @@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// /// - private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, + private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { if (part == null) @@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common { needs_fakedelete = true; } - part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do + part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do // work once the prim is already flexi part.Shape.FlexiSoftness = softness; part.Shape.FlexiGravity = gravity; @@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (needs_fakedelete) { if (part.ParentGroup != null) - { + { part.ParentGroup.FakeDeleteGroup(); } } @@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.SoundGain = volume; m_host.SoundFlags = 1; // looping m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? - + m_host.ScheduleFullUpdate(); m_host.SendFullUpdateToAllClients(); } @@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common llSay(0, String.Format("Could not find object '{0}'", inventory)); throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); } - + // check if destination is an avatar if (World.GetScenePresence(destId) != null) { @@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common { LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( m_localID, m_itemID, item.AssetID.ToString()); - + LLVector3 region = new LLVector3( World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, @@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common if (LLUUID.TryParse(id,out key)) { ScenePresence presence = World.GetScenePresence(key); - + if (presence != null) { return presence.ControllingClient.Name; //return presence.Name; } - + if (World.GetSceneObjectPart(key) != null) { return World.GetSceneObjectPart(key).Name; @@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetRemoteScriptAccessPin(int pin) { m_host.AddScriptLPS(1); - + m_host.ScriptAccessPin = pin; } @@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common bool found = false; LLUUID destId = LLUUID.Zero; LLUUID srcId = LLUUID.Zero; - + if (!LLUUID.TryParse(target, out destId)) { llSay(0, "Could not parse key " + target); return; } - + // target must be a different prim than the one containing the script if (m_host.UUID == destId) { return; } - + // copy the first script found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common } } } - + if (!found) { llSay(0, "Could not find script " + name); return; } - + // the rest of the permission checks are done in RezScript, so check the pin there as well World.RezScript(srcId, m_host, destId, pin, running, start_param); // this will cause the delay even if the script pin or permissions were wrong - seems ok @@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && @@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common // default type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); SetScale(part, v); - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: if (remain < 1) @@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common SetRot(part, q); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common SetPrimitiveShapeParams(map, face); break; } - + break; case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: @@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common float intensity = (float)Convert.ToDouble(rules.Data[idx++]); float radius = (float)Convert.ToDouble(rules.Data[idx++]); float falloff = (float)Convert.ToDouble(rules.Data[idx++]); - + SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); break; @@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common IConfigSource config = new IniConfigSource(Application.iniFilePath); if (config.Configs["LL-Functions"] == null) config.AddConfig("LL-Functions"); - + if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false)) { if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) @@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSL_Types.Vector3(); } ScenePresence presence = World.GetScenePresence(m_host.OwnerID); - if (presence != null) + if (presence != null) { LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); return pos; @@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET: case BuiltIn_Commands_BaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e98dec6..3b317ac 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -703,7 +703,7 @@ namespace OpenSim.Region.ScriptEngine.Common // Otherwise, if we have strings, compare them alphabetically. string str1 = new string(space1); string str2 = new string(space2); - + int result; if (char.IsDigit(space1[0]) && char.IsDigit(space2[0])) @@ -1427,22 +1427,22 @@ namespace OpenSim.Region.ScriptEngine.Common bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1452,22 +1452,22 @@ namespace OpenSim.Region.ScriptEngine.Common { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1623,17 +1623,17 @@ namespace OpenSim.Region.ScriptEngine.Common f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs index 5f86c9c..77cc7ea 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 79c1dde..5c57874 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// Queue containing events waiting to be executed /// public Queue eventQueue = new Queue(); - + #region " Queue structures " /// /// Queue item structure @@ -193,7 +193,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } #endregion - + #region " Shutdown all threads " ~EventQueueManager() { @@ -408,10 +408,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase // Set flag if script should be removed or not EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime; - + // Abort this thread AbortThreadClass(EventQueueThread); - + // We do not need to start another, MaintenenceThread will do that for us //StartNewThreadClass(); } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 255ab99..4376e00 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public class EventQueueThreadClass : iScriptEngineFunctionModule { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// How many ms to sleep if queue is empty /// diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index f04ac01..9a465f6 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common void remote_data(uint localID, LLUUID itemID); void http_response(uint localID, LLUUID itemID); } - + public interface ServerRemotingObject { RemoteEvents Events(); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 06c7387..fa3e35b 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -355,8 +355,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 3f7b95e..8618d6c 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs index 999208d..415c646 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index 9a1f00d..56ed719 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.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 @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index b69f9c4..694e733 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.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 @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 42d9bf8..c94b56a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -39,13 +39,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public class ScriptManager : Common.ScriptEngineBase.ScriptManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) : base(scriptEngine) { base.m_scriptEngine = scriptEngine; } - private Compiler.LSL.Compiler LSLCompiler; + private Compiler.LSL.Compiler LSLCompiler; public override void Initialize() { @@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine public override void _StartScript(uint localID, LLUUID itemID, string Script, int startParam, bool postOnRez) { m_log.DebugFormat( - "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", + "[{0}]: ScriptManager StartScript: localID: {1}, itemID: {2}", m_scriptEngine.ScriptEngineName, localID, itemID); //IScriptHost root = host.GetRoot(); @@ -73,13 +73,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine string CompiledScriptFile = String.Empty; SceneObjectPart m_host = World.GetSceneObjectPart(localID); - + if (null == m_host) { m_log.ErrorFormat( - "[{0}]: Could not find scene object part corresponding to localID {1} to start script", + "[{0}]: Could not find scene object part corresponding to localID {1} to start script", m_scriptEngine.ScriptEngineName, localID); - + return; } diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs index 6924dd2..21888fa 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs @@ -53,12 +53,12 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer public EventManager(ScriptEngine _ScriptEngine) { myScriptEngine = _ScriptEngine; - + m_TCPClient = new TCPClient(); RPC = new TRPC_Remote(m_TCPClient); RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort); - + myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events"); //myScriptEngine.World.EventManager.OnObjectGrab += touch_start; myScriptEngine.World.EventManager.OnRezScript += OnRezScript; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9604828..4de207a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. */ - + /* How we arrived at this llEuler2Rot - * + * * Experiment in SL to determine conventions: * llEuler2Rot()=<1,0,0,0> * llEuler2Rot(<0,PI,0>)=<0,1,0,0> * llEuler2Rot(<0,0,PI>)=<0,0,1,0> - * + * * Important facts about Quaternions * - multiplication is non-commutative (a*b != b*a) * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication - * + * * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): * Qx = c1+i*s1 * Qy = c2+j*s2; * Qz = c3+k*s3; - * + * * Rotations applied in order (from above) Z, Y, X * Q = (Qz * Qy) * Qx * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) @@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api * y=j*(c1*s2*c3-s1*c2*s3) * z=k*(s1*s2*c3+c1*c2*s3) * s= c1*c2*c3-s1*s2*s3 - * + * * This implementation agrees with the functions found here: * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions * And with the results in SL. - * + * * It's also possible to calculate llEuler2Rot by direct multiplication of * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function - * from the wiki). - * Apparently in some cases this is better from a numerical precision perspective? - */ + * from the wiki). + * Apparently in some cases this is better from a numerical precision perspective? + */ public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) { m_host.AddScriptLPS(1); double x,y,z,s; - + double c1 = Math.Cos(v.x/2.0); double c2 = Math.Cos(v.y/2.0); double c3 = Math.Cos(v.z/2.0); @@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api y = c1*s2*c3-s1*c2*s3; z = s1*s2*c3+c1*c2*s3; s = c1*c2*c3-s1*s2*s3; - + return new LSL_Types.Quaternion(x, y, z, s); } @@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api double x, y, z, s; int f = 0; // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection + // Set f for signs detection if (fwd.y + left.x >= 0) { f += 1; } if (fwd.z + up.x >= 0) { f += 2; } if (left.z - up.y >= 0) { f += 4; } @@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetGlow(SceneObjectPart part, int face, float glow) - { + + public void SetGlow(SceneObjectPart part, int face, float glow) + { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Glow = glow; part.UpdateTexture(tex); return; - } + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - + public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) { - + Shininess sval = new Shininess(); - + switch (shiny) { - case 0: + case 0: sval = Shininess.None; break; case 1: @@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api sval = Shininess.None; break; } - + LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) { @@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api tex.FaceTextures[face].Shiny = sval; tex.FaceTextures[face].Bump = bump; part.UpdateTexture(tex); - return; - } + return; + } else if (face == -1) { for (uint i = 0; i < 32; i++) @@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } } - - public void SetFullBright(SceneObjectPart part, int face, bool bright) + + public void SetFullBright(SceneObjectPart part, int face, bool bright) { LLObject.TextureEntry tex = part.Shape.Textures; if (face > -1) @@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (tex.FaceTextures[i] != null) { tex.FaceTextures[i].Fullbright = bright; - } + } } tex.DefaultTexture.Fullbright = bright; part.UpdateTexture(tex); return; } } - + public double llGetAlpha(int face) { m_host.AddScriptLPS(1); @@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set flexi parameters of a part. - /// + /// /// FIXME: Much of this code should probably be within the part itself. /// /// @@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Types.Vector3 Force) { @@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// Set a light point on a part - /// + /// /// FIXME: Much of this code should probably be in SceneObjectGroup /// /// @@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// /// - /// + /// private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) { if (part == null) @@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool found = false; LLUUID destId = LLUUID.Zero; LLUUID objId = LLUUID.Zero; - + if (!LLUUID.TryParse(destination, out destId)) { llSay(0, "Could not parse key " + destination); return; } - + // move the first object found with this inventory name foreach (KeyValuePair inv in m_host.TaskInventory) { @@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); - + // TODO find out about the other defaults and add them here ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ps.PartMaxAge = 10.0f; return ps; } - + public void llParticleSystem(LSL_Types.list rules) { m_host.AddScriptLPS(1); @@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api itemList.Add(itemID); } } - + if (itemList.Count == 0) return; @@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); return Util.Md5Hash(src + ":" + nonce.ToString()); } - + private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); - + if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && @@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); shapeBlock.PathTwist = (sbyte)(200 * twist.y); - + shapeBlock.ObjectLocalID = m_host.LocalId; - + // retain pathcurve - shapeBlock.PathCurve = m_host.Shape.PathCurve; - + shapeBlock.PathCurve = m_host.Shape.PathCurve; + return shapeBlock; } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; - + if (taper_b.x < 0f) { taper_b.x = 0f; @@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.PathShearX = (byte)(100 * topshear.x); shapeBlock.PathShearY = (byte)(100 * topshear.y); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + // profile/path swapped for a sphere shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + shapeBlock.ProfileCurve += fudge; - + shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 100; - + if (dimple.x < 0f) { dimple.x = 0f; @@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) { ObjectShapePacket.ObjectDataBlock shapeBlock; - + shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); - + shapeBlock.ProfileCurve += fudge; // profile/path swapped for a torrus, tube, ring shapeBlock.PathBegin = shapeBlock.ProfileBegin; shapeBlock.PathEnd = shapeBlock.ProfileEnd; - + if (holesize.x < 0.05f) { holesize.x = 0.05f; @@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api skew = 0.95f; } shapeBlock.PathSkew = (sbyte)(100 * skew); - + m_host.UpdateShape(shapeBlock); } - + private void SetPrimitiveShapeParams(string map, int type) { ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); LLUUID sculptId; - + if (!LLUUID.TryParse(map, out sculptId)) { llSay(0, "Could not parse key " + map); @@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api shapeBlock.ObjectLocalID = m_host.LocalId; shapeBlock.PathScaleX = 100; shapeBlock.PathScaleY = 150; - + if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && @@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // default type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; } - + // retain pathcurve shapeBlock.PathCurve = m_host.Shape.PathCurve; @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) { m_host.AddScriptLPS(1); - + if (m_host.ParentGroup == null) return; @@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetRot(part, q); break; - + case (int)ScriptBaseClass.PRIM_TYPE: if (remain < 3) return; - + code = Convert.ToInt32(rules.Data[idx++]); - + remain = rules.Length - idx; float hollow; LSL_Types.Vector3 twist; @@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api float skew; LSL_Types.Vector3 holesize; LSL_Types.Vector3 profilecut; - + switch (code) - { + { case (int)ScriptBaseClass.PRIM_TYPE_BOX: if (remain < 6) return; @@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: if (remain < 6) return; @@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Straight; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_PRISM: if (remain < 6) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TORUS: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; - + case (int)ScriptBaseClass.PRIM_TYPE_TUBE: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; - + case (int)ScriptBaseClass.PRIM_TYPE_RING: if (remain < 11) return; - face = Convert.ToInt32(rules.Data[idx++]); // holeshape + face = Convert.ToInt32(rules.Data[idx++]); // holeshape v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut hollow = (float)Convert.ToDouble(rules.Data[idx++]); twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); @@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.Shape.PathCurve = (byte) Extrusion.Curve1; SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; - + case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: if (remain < 2) return; @@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPrimitiveShapeParams(map, face); break; } - + break; case (int)ScriptBaseClass.PRIM_TEXTURE: @@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; face = Convert.ToInt32(rules.Data[idx++]); float glow = (float)Convert.ToDouble(rules.Data[idx++]); - + SetGlow(part, face, glow); - + break; case (int)ScriptBaseClass.PRIM_BUMP_SHINY: if (remain < 3) - return; + return; face = Convert.ToInt32(rules.Data[idx++]); int shiny = Convert.ToInt32(rules.Data[idx++]); Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); - + SetShiny(part, face, shiny, bump); - + break; case (int)ScriptBaseClass.PRIM_FULLBRIGHT: if (remain < 2) return; - face = Convert.ToInt32(rules.Data[idx++]); + face = Convert.ToInt32(rules.Data[idx++]); string bv = rules.Data[idx++].ToString(); bool st; if (bv.Equals("1")) st = true; else st = false; - + SetFullBright(part, face , st); break; case (int)ScriptBaseClass.PRIM_MATERIAL: @@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_PHANTOM: if (remain < 1) return; - + string ph = rules.Data[idx++].ToString(); bool phantom; - + if (ph.Equals("1")) phantom = true; else phantom = false; - + part.ScriptSetPhantomStatus(phantom); part.ScheduleFullUpdate(); break; case (int)ScriptBaseClass.PRIM_PHYSICS: if (remain < 1) - return; + return; string phy = rules.Data[idx++].ToString(); bool physics; - + if (phy.Equals("1")) physics = true; else physics = false; - + m_host.ScriptSetPhysicsStatus(physics); part.ScheduleFullUpdate(); break; @@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Types.list llGetAnimationList( string id ) { m_host.AddScriptLPS(1); - + LSL_Types.list l = new LSL_Types.list(); ScenePresence av = World.GetScenePresence(id); if (av == null) @@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) m_host.AddScriptLPS(1); for (int i = 0; i < commandList.Data.Length; i++) - { + { switch ((ParcelMediaCommandEnum)commandList.Data[i]) { case ParcelMediaCommandEnum.Play: @@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!agent.IsChildAgent) { agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); - } + } } break; case ParcelMediaCommandEnum.Stop: @@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { //Set the new media URL only if the user is the owner of the land osSetParcelMediaURL(commandList.Data[i + 1].ToString()); - + List scenePresenceList = World.GetScenePresences(); LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); //Send an update of the mediaURL to all the clients that are in the parcel @@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //Send parcel media update to the client agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); } - } - + } + } i++; } @@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); break; }//end switch - + } @@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } return list; - + } public LSL_Types.LSLInteger llModPow(int a, int b, int c) @@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); - if (invItemID == LLUUID.Zero) + if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetCameraParams(LSL_Types.list rules) { m_host.AddScriptLPS(1); - - // our key in the object we are in + + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + SortedDictionary parameters = new SortedDictionary(); object[] data = rules.Data; for (int i = 0; i < data.Length; ++i) { @@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.CAMERA_FOCUS_OFFSET: case ScriptBaseClass.CAMERA_POSITION: LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; - parameters.Add(type + 1, (float)v.x); - parameters.Add(type + 2, (float)v.y); + parameters.Add(type + 1, (float)v.x); + parameters.Add(type + 2, (float)v.y); parameters.Add(type + 3, (float)v.z); break; default: @@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - // our key in the object we are in + // our key in the object we are in LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return; @@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; ScenePresence presence = World.GetScenePresence(agentID); - + // we are not interested in child-agents if (presence.IsChildAgent) return; - + presence.ControllingClient.SendClearFollowCamProperties(objectID); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs index 6c88ae86..52d277e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Dataserver.cs @@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { if (!DataserverRequests.ContainsKey(identifier)) return; - + ds=DataserverRequests[identifier]; DataserverRequests.Remove(identifier); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 89bf51c..3f3cf39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins new LSL_Types.LSLInteger(rInfo.GetIntValue()), new LSL_Types.LSLString(rInfo.GetStrVal()) }; - + foreach (AsyncCommandManager m in m_CmdManager.Managers) { if (m.m_ScriptEngine.PostScriptEvent( diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 5b32cde..c28aa9a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return; MethodInfo mi = inits[api]; - + Object[] args = new Object[1]; args[0] = data; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs index 681b2f2..d6a339b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/IndexedAnswers.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { _arity = arity; } - + /// /// Append the answer to the list and update the indexes, if any. /// Elements of answer must be ground, since arguments with unbound variables make this diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs index a2fe7ec..9f5ae3d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/PrologException.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 @@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. /// /// the error term of the error - /// the message term of the error. If this is a string, it is converted to an + /// the message term of the error. If this is a string, it is converted to an /// Atom so it can be used by Prolog code. /// Message, converted to a string, is use as the printable exception message. /// @@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); } - public class TypeErrorInfo + public class TypeErrorInfo { public readonly Atom _Type; public readonly object _Culprit; @@ -116,14 +116,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public object getProcedureName() { - if (!(_Type._name == "procedure" && + if (!(_Type._name == "procedure" && _Culprit is Functor2 && ((Functor2)_Culprit)._name == Atom.SLASH)) return null; return ((Functor2)_Culprit)._arg1; } /// - /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. + /// If _Type is procedure and _Culprit is name/arity and arity is an integer, return the arity. /// Otherwise return -1. /// /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 97c9087..2e90d74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.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 @@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to an int. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -172,8 +172,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { throw new PrologException (new Functor2 - ("type_error", Atom.a("evaluable"), - new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), + ("type_error", Atom.a("evaluable"), + new Functor2(Atom.SLASH, getFunctorName(term), getFunctorArgs(term).Length)), "Term must be an integer"); } } @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// /// Convert term to a double. This may convert an int to a double, etc. /// If term is a single-element List, use its first element - /// (to handle the char types like "a"). + /// (to handle the char types like "a"). /// If can't convert, throw a PrologException for type_error evaluable (because this is only /// called from arithmetic functions). /// @@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // Assume it is a char type like "a". term = YP.getValue(((Functor2)term)._arg1); if (term is Variable) - throw new PrologException(Atom.a("instantiation_error"), + throw new PrologException(Atom.a("instantiation_error"), "Expected a number but the argument is an unbound variable"); try @@ -776,8 +776,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (term1TypeCode == -2) { // Variable. - // We always check for equality first because we want to be sure - // that less than returns false if the terms are equal, in + // We always check for equality first because we want to be sure + // that less than returns false if the terms are equal, in // case that the less than check really behaves like less than or equal. if ((Variable)Term1 != (Variable)Term2) // The hash code should be unique to a Variable object. @@ -820,8 +820,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// Type code is -2 if term is a Variable, 0 if it is an Atom, - /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, + /// Type code is -2 if term is a Variable, 0 if it is an Atom, + /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 4 if it is Functor. /// Otherwise, type code is -1. /// This does not call YP.getValue(term). @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog "Arg 2 List has an element which is an unbound variable"); if (!(listAtom is Atom && ((Atom)listAtom)._name.Length == 1)) throw new PrologException - (new Functor2("type_error", Atom.a("character"), listAtom), + (new Functor2("type_error", Atom.a("character"), listAtom), "Arg 2 List has an element which is not a one character atom"); charArray[i] = ((Atom)listAtom)._name[0]; } @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog int codeInt; if (!getInt(codeArray[i], out codeInt) || codeInt < 0) throw new PrologException - (new Functor1("representation_error", Atom.a("character_code")), + (new Functor1("representation_error", Atom.a("character_code")), "Element of Arg 2 List is not a character code"); charArray[i] = (char)codeInt; } @@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!YP.number(Number)) throw new PrologException - (new Functor2("type_error", Atom.a("number"), Number), + (new Functor2("type_error", Atom.a("number"), Number), "Arg 1 Number is not var or number"); // We just checked, so convertDouble shouldn't throw an exception. numberString = YP.doubleToString(YP.convertDouble(Number)); @@ -1413,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { if (!(Char is Atom) || ((Atom)Char)._name.Length != 1) throw new PrologException - (new Functor2("type_error", Atom.a("character"), Char), + (new Functor2("type_error", Atom.a("character"), Char), "Arg 1 Char is not var or one-character atom"); if (Code is Variable) @@ -1795,7 +1795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1826,7 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog IndexedAnswers indexedAnswers; if (!_predicatesStore.TryGetValue(nameArity, out clauses)) { - // Create an IndexedAnswers as the only clause of the predicate. + // Create an IndexedAnswers as the only clause of the predicate. _predicatesStore[nameArity] = (clauses = new List()); clauses.Add(indexedAnswers = new IndexedAnswers(values.Length)); } @@ -1855,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { List clauses; if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) - return unknownPredicate(name, arguments.Length, + return unknownPredicate(name, arguments.Length, "Undefined dynamic predicate: " + name + "/" + arguments.Length); if (clauses.Count == 1) @@ -1889,7 +1889,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If _prologFlags["unknown"] is fail then return fail(), else if + /// If _prologFlags["unknown"] is fail then return fail(), else if /// _prologFlags["unknown"] is warning then write the message to YP.write and /// return fail(), else throw a PrologException for existence_error. . /// @@ -1917,7 +1917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// This is deprecated and just calls matchDynamic. This matches all clauses, + /// This is deprecated and just calls matchDynamic. This matches all clauses, /// not just the ones defined with assertFact. /// /// @@ -2066,7 +2066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// dynamic predicate. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable current_predicate(object NameSlashArity, Type declaringClass) @@ -2078,7 +2078,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor2 NameArityFunctor = NameSlashArity as Functor2; if (!(NameArityFunctor != null && NameArityFunctor._name == Atom.SLASH)) throw new PrologException - (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), + (new Functor2("type_error", Atom.a("predicate_indicator"), NameSlashArity), "Must be a name/arity predicate indicator"); object name = YP.getValue(NameArityFunctor._arg1); object arity = YP.getValue(NameArityFunctor._arg2); @@ -2163,12 +2163,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } /// - /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from + /// If Goal is a simple predicate, call YP.getFunctorName(Goal) using arguments from /// YP.getFunctorArgs(Goal). If not found, this throws a PrologException for existence_error. - /// Otherwise, compile the goal as a single clause predicate and invoke it. + /// Otherwise, compile the goal as a single clause predicate and invoke it. /// /// - /// if not null, used to resolve references to the default + /// if not null, used to resolve references to the default /// module Atom.a("") /// public static IEnumerable getIterator(object Goal, Type declaringClass) @@ -2259,7 +2259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog (new Functor2("type_error", Atom.a("atom"), Key), "Arg 1 Key is not an atom"); if (!_prologFlags.ContainsKey(((Atom)Key)._name)) throw new PrologException - (new Functor2("domain_error", Atom.a("prolog_flag"), Key), + (new Functor2("domain_error", Atom.a("prolog_flag"), Key), "Arg 1 Key is not a recognized flag"); foreach (bool l1 in YP.unify(Value, _prologFlags[((Atom)Key)._name])) @@ -2343,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; @@ -2662,7 +2662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog #pragma warning restore 0168 } } - + /// /// CodeListReader extends TextReader and overrides Read to read the next code from /// the CodeList which is a Prolog list of integer character codes. @@ -2683,7 +2683,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public override int Read() { - Functor2 CodeListPair = _CodeList as Functor2; + Functor2 CodeListPair = _CodeList as Functor2; int code; if (!(CodeListPair != null && CodeListPair._name == Atom.DOT && getInt(CodeListPair._arg1, out code))) diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index f9b160d..0f79019 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs @@ -54,11 +54,11 @@ namespace OpenSim.Region.ScriptEngine.Shared { string path = Path.Combine(Directory.GetCurrentDirectory(), Path.Combine(s, assemblyName))+".dll"; - + if (File.Exists(path)) return Assembly.LoadFrom(path); } - + return null; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 4962023..db90f3e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -412,8 +412,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private static string CreateYPCompilerScript(string compileScript) { - - compileScript = String.Empty + "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs index 57e8776..45f92e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSConverter.cs @@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools string quote = String.Empty; bool last_was_escape = false; int quote_replaced_count = 0; - + string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";"); - + string removecomments = conelinecomments.Replace(removefwnoncomments, ""); removecomments = cstylecomments.Replace(removecomments, ""); string[] localscript = removecomments.Split('"'); @@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // checks for alpha.alpha way of referring to objects in C# // ignores alpha.x alpha.y, alpha.z for refering to vector components Match SecurityM; - + // BROKEN: this check is very wrong. It block's any url in strings. SecurityM = Regex.Match(checkscript, @"(?:[a-zA-Z])\.(?:[a-rt-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 831b918..22b3742 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools myCode = myCode.Substring(0, cs_pointer); } myCode.Replace("//yp", "%YPCode"); - + StringWriter myCS_SW = new StringWriter(); StringReader myCode_SR = new StringReader(" yp_nop_header_nop. \n "+myCode + "\n"); diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 8326e16..5497e2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1335,22 +1335,22 @@ namespace OpenSim.Region.ScriptEngine.Shared bool ret = i1.value != i2.value; return ret; } - + static public LSLInteger operator +(LSLInteger i1, int i2) { return new LSLInteger(i1.value + i2); } - + static public LSLInteger operator -(LSLInteger i1, int i2) { return new LSLInteger(i1.value - i2); } - + static public LSLInteger operator *(LSLInteger i1, int i2) { return new LSLInteger(i1.value * i2); } - + static public LSLInteger operator /(LSLInteger i1, int i2) { return new LSLInteger(i1.value / i2); @@ -1360,22 +1360,22 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSLFloat((double)i1.value + f); } - + static public LSLFloat operator -(LSLInteger i1, double f) { return new LSLFloat((double)i1.value - f); } - + static public LSLFloat operator *(LSLInteger i1, double f) { return new LSLFloat((double)i1.value * f); } - + static public LSLFloat operator /(LSLInteger i1, double f) { return new LSLFloat((double)i1.value / f); } - + static public LSLInteger operator -(LSLInteger i) { return new LSLInteger(-i.value); @@ -1536,17 +1536,17 @@ namespace OpenSim.Region.ScriptEngine.Shared f.value--; return f; } - + static public LSLFloat operator +(LSLFloat f, int i) { return new LSLFloat(f.value + (double)i); } - + static public LSLFloat operator -(LSLFloat f, int i) { return new LSLFloat(f.value - (double)i); } - + static public LSLFloat operator *(LSLFloat f, int i) { return new LSLFloat(f.value * (double)i); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cdba1ac..c528c02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -363,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -394,7 +394,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine new WorkItemCallback( this.DoOnRezScriptQueue), new Object[0]); } - else + else { m_CurrentCompile = null; } @@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { string savedState = Path.Combine(Path.GetDirectoryName(m_Assembly), m_ItemID.ToString() + ".state"); - + try { File.Delete(savedState); diff --git a/OpenSim/TestSuite/BotManager.cs b/OpenSim/TestSuite/BotManager.cs index a431a43..29864ab 100644 --- a/OpenSim/TestSuite/BotManager.cs +++ b/OpenSim/TestSuite/BotManager.cs @@ -51,7 +51,7 @@ namespace OpenSim.TestSuite protected Random somthing = new Random(Environment.TickCount); protected int numbots = 0; protected IConfig Previous_config; - + /// /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data /// @@ -97,7 +97,7 @@ namespace OpenSim.TestSuite startupBot(i, Previous_config); } } - + /// /// This starts up the bot and stores the thread for the bot in the thread array /// @@ -128,7 +128,7 @@ namespace OpenSim.TestSuite { string returnstring = ""; string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; - + for (int i = 0; i < 7; i++) { returnstring += chars.Substring(somthing.Next(chars.Length),1); @@ -178,7 +178,7 @@ namespace OpenSim.TestSuite { return new ConsoleBase("Region", this); } - + /// /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit /// @@ -199,7 +199,7 @@ namespace OpenSim.TestSuite case "addbots": int newbots; Helpers.TryParse(cmdparams[0], out newbots); - + if (newbots > 0) addbots(newbots); break; diff --git a/OpenSim/TestSuite/Main.cs b/OpenSim/TestSuite/Main.cs index b944304..8b2de81 100644 --- a/OpenSim/TestSuite/Main.cs +++ b/OpenSim/TestSuite/Main.cs @@ -58,9 +58,9 @@ namespace OpenSim.TestSuite else { // TODO: unused: int botcount = config.GetInt("botcount", 1); - + // BotManager bm = new BotManager(); - + Utils.TestPass("Completed Startup"); } } @@ -69,18 +69,18 @@ namespace OpenSim.TestSuite { //Set up our nifty config.. thanks to nini ArgvConfigSource cs = new ArgvConfigSource(args); - + // TODO: unused: cs.AddSwitch("Startup", "botcount","n"); cs.AddSwitch("Startup", "loginuri","l"); cs.AddSwitch("Startup", "firstname"); cs.AddSwitch("Startup", "lastname"); cs.AddSwitch("Startup", "password"); cs.AddSwitch("Startup", "help","h"); - + IConfig ol = cs.Configs["Startup"]; return ol; } - + private static void Help() { Console.WriteLine( diff --git a/OpenSim/Tests/Inventory/TestInventory.cs b/OpenSim/Tests/Inventory/TestInventory.cs index 7863904..3c90e1f 100644 --- a/OpenSim/Tests/Inventory/TestInventory.cs +++ b/OpenSim/Tests/Inventory/TestInventory.cs @@ -94,7 +94,7 @@ namespace OpenSim.Test.Inventory if (a.parentFolderID != b.parentFolderID) return false; return true; } - + /// /// Test that we can insert a root folder /// diff --git a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs index dbc58ff..25044db 100644 --- a/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs +++ b/OpenSim/Tools/LaunchSLClient/LaunchSLClient/Form1.cs @@ -123,7 +123,7 @@ namespace LaunchSLClient string sandboxHostName = ""; string sandboxPort = ""; string text; - + Regex myRegex = new Regex(".*internal_ip_port=\\\"(?.*?)\\\".*external_host_name=\\\"(?.*?)\\\".*"); FileInfo defaultFile = new FileInfo("Regions/default.xml"); diff --git a/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs b/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs index a43795a..d6a3d04 100644 --- a/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs +++ b/OpenSim/Tools/OpenSim.GUI/InputTextBoxControl.cs @@ -38,7 +38,7 @@ namespace OpenSim.GUI { this.KeyDown += new System.Windows.Forms.KeyEventHandler(TextInputControl_KeyDown); } - + private List CommandHistory = new List(); private bool InHistory = false; private int HistoryPosition = -1; diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 302dc08..4bdc494 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -51,7 +51,7 @@ namespace pCampBot protected Random somthing = new Random(Environment.TickCount); protected int numbots = 0; protected IConfig Previous_config; - + /// /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data /// @@ -96,7 +96,7 @@ namespace pCampBot startupBot(i, Previous_config); } } - + /// /// This starts up the bot and stores the thread for the bot in the thread array /// @@ -127,7 +127,7 @@ namespace pCampBot { string returnstring = ""; string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; - + for (int i = 0; i < 7; i++) { returnstring += chars.Substring(somthing.Next(chars.Length),1); @@ -177,7 +177,7 @@ namespace pCampBot { return new ConsoleBase("Region", this); } - + /// /// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit /// @@ -198,7 +198,7 @@ namespace pCampBot case "addbots": int newbots; Helpers.TryParse(cmdparams[0], out newbots); - + if (newbots > 0) addbots(newbots); break; diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index 81ec2b2..9cde451 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs @@ -54,9 +54,9 @@ namespace pCampBot else { int botcount = config.GetInt("botcount", 1); - + BotManager bm = new BotManager(); - + //startup specified number of bots. 1 is the default bm.dobotStartup(botcount, config); while (true) @@ -70,18 +70,18 @@ namespace pCampBot { //Set up our nifty config.. thanks to nini ArgvConfigSource cs = new ArgvConfigSource(args); - + cs.AddSwitch("Startup", "botcount","n"); cs.AddSwitch("Startup", "loginuri","l"); cs.AddSwitch("Startup", "firstname"); cs.AddSwitch("Startup", "lastname"); cs.AddSwitch("Startup", "password"); cs.AddSwitch("Startup", "help","h"); - + IConfig ol = cs.Configs["Startup"]; return ol; } - + private static void Help() { Console.WriteLine( -- cgit v1.1