diff options
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.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 92 |
1 files changed, 3 insertions, 89 deletions
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 | |||
57 | if (!PermissionsMngr.CanTerraform(remoteUser.AgentId, new LLVector3(north, west, 0))) | 57 | if (!PermissionsMngr.CanTerraform(remoteUser.AgentId, new LLVector3(north, west, 0))) |
58 | return; | 58 | return; |
59 | 59 | ||
60 | // Shiny. | 60 | //if it wasn't for the permission checking we could have the terrain module directly subscribe to the OnModifyTerrain event |
61 | double size = (double)(1 << brushsize); | 61 | Terrain.ModifyTerrain(height, seconds, brushsize, action, north, west, remoteUser); |
62 | |||
63 | switch (action) | ||
64 | { | ||
65 | case 0: | ||
66 | // flatten terrain | ||
67 | Terrain.FlattenTerrain(west, north, size, (double)seconds / 5.0); | ||
68 | break; | ||
69 | case 1: | ||
70 | // raise terrain | ||
71 | Terrain.RaiseTerrain(west, north, size, (double)seconds / 5.0); | ||
72 | break; | ||
73 | case 2: | ||
74 | //lower terrain | ||
75 | Terrain.LowerTerrain(west, north, size, (double)seconds / 5.0); | ||
76 | break; | ||
77 | case 3: | ||
78 | // smooth terrain | ||
79 | Terrain.SmoothTerrain(west, north, size, (double)seconds / 5.0); | ||
80 | break; | ||
81 | case 4: | ||
82 | // noise | ||
83 | Terrain.NoiseTerrain(west, north, size, (double)seconds / 5.0); | ||
84 | break; | ||
85 | case 5: | ||
86 | // revert | ||
87 | Terrain.RevertTerrain(west, north, size, (double)seconds / 5.0); | ||
88 | break; | ||
89 | |||
90 | // CLIENT EXTENSIONS GO HERE | ||
91 | case 128: | ||
92 | // erode-thermal | ||
93 | break; | ||
94 | case 129: | ||
95 | // erode-aerobic | ||
96 | break; | ||
97 | case 130: | ||
98 | // erode-hydraulic | ||
99 | break; | ||
100 | } | ||
101 | |||
102 | for (int x = 0; x < 16; x++) | ||
103 | { | ||
104 | for (int y = 0; y < 16; y++) | ||
105 | { | ||
106 | if (Terrain.Tainted(x * 16, y * 16)) | ||
107 | { | ||
108 | remoteUser.SendLayerData(x, y, Terrain.GetHeights1D()); | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | |||
113 | return; | ||
114 | } | 62 | } |
115 | 63 | ||
116 | /// <summary> | 64 | /// <summary> |
@@ -146,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
146 | } | 94 | } |
147 | 95 | ||
148 | /// <summary> | 96 | /// <summary> |
149 | /// | 97 | /// Should be removed soon as the Chat modules should take over this function |
150 | /// </summary> | 98 | /// </summary> |
151 | /// <param name="message"></param> | 99 | /// <param name="message"></param> |
152 | /// <param name="type"></param> | 100 | /// <param name="type"></param> |
@@ -616,40 +564,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
616 | } | 564 | } |
617 | } | 565 | } |
618 | 566 | ||
619 | /// <summary> | ||
620 | /// | ||
621 | /// </summary> | ||
622 | /// <param name="remoteClient"></param> | ||
623 | /// <param name="avatarID"></param> | ||
624 | public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) | ||
625 | { | ||
626 | string about = "OpenSim crash test dummy"; | ||
627 | string bornOn = "Before now"; | ||
628 | string flAbout = "First life? What is one of those? OpenSim is my life!"; | ||
629 | LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000"); | ||
630 | remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "", partner); | ||
631 | } | ||
632 | |||
633 | /// <summary> | ||
634 | /// | ||
635 | /// </summary> | ||
636 | /// <param name="remoteClient"></param> | ||
637 | /// <param name="xferID"></param> | ||
638 | /// <param name="fileName"></param> | ||
639 | public void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName) | ||
640 | { | ||
641 | /* | ||
642 | foreach (EntityBase ent in Entities.Values) | ||
643 | { | ||
644 | if (ent is SceneObjectGroup) | ||
645 | { | ||
646 | ((SceneObjectGroup)ent).RequestInventoryFile(remoteClient, ((SceneObjectGroup)ent).LocalId, xferID); | ||
647 | break; | ||
648 | } | ||
649 | }*/ | ||
650 | } | ||
651 | |||
652 | |||
653 | public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 567 | public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
654 | { | 568 | { |
655 | this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); | 569 | this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); |