From 8e3b2392d129d727bfd00a2d9faa08d9e5be92de Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 28 Aug 2007 14:21:17 +0000 Subject: Start of trying to make Region/Scene more modular. Added preliminary IRegionModule interface. Also have a work in progress way of Modules registering optional API methods (kind of like Apache optional functions). But there must be a cleaner/nicer way in c# of doing these than the current way. Added three work in progress modules: ChatModule (simple handles in world chat, but by moving this to a module, we could support other types of chat modules, ie like a irc - opensim bridge module. ) , AvatarProfilesModule and XferModule. Moved most of the code from Scene.ModifyTerrain() into the BasicTerrain library, as the start of trying to make that more modular. Stopped Child agents showing up as part of the "show users" command. --- .../Environment/Scenes/Scene.PacketHandlers.cs | 92 +--------------------- 1 file changed, 3 insertions(+), 89 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index d94a748..dcec289 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -57,60 +57,8 @@ namespace OpenSim.Region.Environment.Scenes if (!PermissionsMngr.CanTerraform(remoteUser.AgentId, new LLVector3(north, west, 0))) return; - // Shiny. - double size = (double)(1 << brushsize); - - switch (action) - { - case 0: - // flatten terrain - Terrain.FlattenTerrain(west, north, size, (double)seconds / 5.0); - break; - case 1: - // raise terrain - Terrain.RaiseTerrain(west, north, size, (double)seconds / 5.0); - break; - case 2: - //lower terrain - Terrain.LowerTerrain(west, north, size, (double)seconds / 5.0); - break; - case 3: - // smooth terrain - Terrain.SmoothTerrain(west, north, size, (double)seconds / 5.0); - break; - case 4: - // noise - Terrain.NoiseTerrain(west, north, size, (double)seconds / 5.0); - break; - case 5: - // revert - Terrain.RevertTerrain(west, north, size, (double)seconds / 5.0); - break; - - // CLIENT EXTENSIONS GO HERE - case 128: - // erode-thermal - break; - case 129: - // erode-aerobic - break; - case 130: - // erode-hydraulic - break; - } - - for (int x = 0; x < 16; x++) - { - for (int y = 0; y < 16; y++) - { - if (Terrain.Tainted(x * 16, y * 16)) - { - remoteUser.SendLayerData(x, y, Terrain.GetHeights1D()); - } - } - } - - return; + //if it wasn't for the permission checking we could have the terrain module directly subscribe to the OnModifyTerrain event + Terrain.ModifyTerrain(height, seconds, brushsize, action, north, west, remoteUser); } /// @@ -146,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// + /// Should be removed soon as the Chat modules should take over this function /// /// /// @@ -616,40 +564,6 @@ namespace OpenSim.Region.Environment.Scenes } } - /// - /// - /// - /// - /// - public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) - { - string about = "OpenSim crash test dummy"; - string bornOn = "Before now"; - string flAbout = "First life? What is one of those? OpenSim is my life!"; - LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000"); - remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "", partner); - } - - /// - /// - /// - /// - /// - /// - public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName) - { - /* - foreach (EntityBase ent in Entities.Values) - { - if (ent is SceneObjectGroup) - { - ((SceneObjectGroup)ent).RequestInventoryFile(remoteClient, ((SceneObjectGroup)ent).LocalId, xferID); - break; - } - }*/ - } - - public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); -- cgit v1.1