diff options
author | MW | 2007-05-21 19:12:18 +0000 |
---|---|---|
committer | MW | 2007-05-21 19:12:18 +0000 |
commit | f96083a903024550243ada885c8edccad7e0eed7 (patch) | |
tree | e789d0d973490b0d5fdca86a41bacf319fe80f31 /OpenSim.RegionServer/world/World.PacketHandlers.cs | |
parent | Merged the new ODE stuff (diff) | |
download | opensim-SC_OLD-f96083a903024550243ada885c8edccad7e0eed7.zip opensim-SC_OLD-f96083a903024550243ada885c8edccad7e0eed7.tar.gz opensim-SC_OLD-f96083a903024550243ada885c8edccad7e0eed7.tar.bz2 opensim-SC_OLD-f96083a903024550243ada885c8edccad7e0eed7.tar.xz |
More work on adding Events to ClientView (and registering to handle those events in Avatar and World)
Diffstat (limited to 'OpenSim.RegionServer/world/World.PacketHandlers.cs')
-rw-r--r-- | OpenSim.RegionServer/world/World.PacketHandlers.cs | 98 |
1 files changed, 62 insertions, 36 deletions
diff --git a/OpenSim.RegionServer/world/World.PacketHandlers.cs b/OpenSim.RegionServer/world/World.PacketHandlers.cs index 27f200f..d12013a 100644 --- a/OpenSim.RegionServer/world/World.PacketHandlers.cs +++ b/OpenSim.RegionServer/world/World.PacketHandlers.cs | |||
@@ -15,31 +15,22 @@ namespace OpenSim.world | |||
15 | { | 15 | { |
16 | public partial class World | 16 | public partial class World |
17 | { | 17 | { |
18 | 18 | public void ModifyTerrain(byte Action, float North, float West) | |
19 | public bool ModifyTerrain(ClientView simClient, Packet packet) | ||
20 | { | 19 | { |
21 | ModifyLandPacket modify = (ModifyLandPacket)packet; | 20 | switch (Action) |
22 | |||
23 | switch (modify.ModifyBlock.Action) | ||
24 | { | 21 | { |
25 | case 1: | 22 | case 1: |
26 | // raise terrain | 23 | // raise terrain |
27 | if (modify.ParcelData.Length > 0) | 24 | Terrain.raise(North, West, 10.0, 0.1); |
28 | { | 25 | RegenerateTerrain(true, (int)North, (int)West); |
29 | Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); | ||
30 | RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); | ||
31 | } | ||
32 | break; | 26 | break; |
33 | case 2: | 27 | case 2: |
34 | //lower terrain | 28 | //lower terrain |
35 | if (modify.ParcelData.Length > 0) | 29 | Terrain.lower(North, West, 10.0, 0.1); |
36 | { | 30 | RegenerateTerrain(true, (int)North, (int)West); |
37 | Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); | ||
38 | RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); | ||
39 | } | ||
40 | break; | 31 | break; |
41 | } | 32 | } |
42 | return true; | 33 | return; |
43 | } | 34 | } |
44 | 35 | ||
45 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | 36 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) |
@@ -79,27 +70,13 @@ namespace OpenSim.world | |||
79 | } | 70 | } |
80 | } | 71 | } |
81 | 72 | ||
82 | public bool RezObject(ClientView simClient, Packet packet) | 73 | public void RezObject(AssetBase primasset, LLVector3 pos) |
83 | { | 74 | { |
84 | RezObjectPacket rezPacket = (RezObjectPacket)packet; | 75 | PrimData primd = new PrimData(primasset.Data); |
85 | AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID); | 76 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); |
86 | if (inven != null) | 77 | nPrim.CreateFromStorage(primd, pos, this._primCount, true); |
87 | { | 78 | this.Entities.Add(nPrim.uuid, nPrim); |
88 | if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID)) | 79 | this._primCount++; |
89 | { | ||
90 | AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID); | ||
91 | if (asset != null) | ||
92 | { | ||
93 | PrimData primd = new PrimData(asset.Data); | ||
94 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); | ||
95 | nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true); | ||
96 | this.Entities.Add(nPrim.uuid, nPrim); | ||
97 | this._primCount++; | ||
98 | this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID); | ||
99 | } | ||
100 | } | ||
101 | } | ||
102 | return true; | ||
103 | } | 80 | } |
104 | 81 | ||
105 | public bool DeRezObject(ClientView simClient, Packet packet) | 82 | public bool DeRezObject(ClientView simClient, Packet packet) |
@@ -191,6 +168,7 @@ namespace OpenSim.world | |||
191 | return true; | 168 | return true; |
192 | } | 169 | } |
193 | 170 | ||
171 | /* | ||
194 | public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY) | 172 | public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY) |
195 | { | 173 | { |
196 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; | 174 | System.Text.Encoding _enc = System.Text.Encoding.ASCII; |
@@ -212,6 +190,54 @@ namespace OpenSim.world | |||
212 | simClient.OutPacket(mapReply); | 190 | simClient.OutPacket(mapReply); |
213 | } | 191 | } |
214 | } | 192 | } |
193 | public bool RezObjectHandler(ClientView simClient, Packet packet) | ||
194 | { | ||
195 | RezObjectPacket rezPacket = (RezObjectPacket)packet; | ||
196 | AgentInventory inven = this._inventoryCache.GetAgentsInventory(simClient.AgentID); | ||
197 | if (inven != null) | ||
198 | { | ||
199 | if (inven.InventoryItems.ContainsKey(rezPacket.InventoryData.ItemID)) | ||
200 | { | ||
201 | AssetBase asset = this._assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID); | ||
202 | if (asset != null) | ||
203 | { | ||
204 | PrimData primd = new PrimData(asset.Data); | ||
205 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); | ||
206 | nPrim.CreateFromStorage(primd, rezPacket.RezData.RayEnd, this._primCount, true); | ||
207 | this.Entities.Add(nPrim.uuid, nPrim); | ||
208 | this._primCount++; | ||
209 | this._inventoryCache.DeleteInventoryItem(simClient, rezPacket.InventoryData.ItemID); | ||
210 | } | ||
211 | } | ||
212 | } | ||
213 | return true; | ||
214 | } | ||
215 | public bool ModifyTerrain(ClientView simClient, Packet packet) | ||
216 | { | ||
217 | ModifyLandPacket modify = (ModifyLandPacket)packet; | ||
218 | |||
219 | switch (modify.ModifyBlock.Action) | ||
220 | { | ||
221 | case 1: | ||
222 | // raise terrain | ||
223 | if (modify.ParcelData.Length > 0) | ||
224 | { | ||
225 | Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); | ||
226 | RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); | ||
227 | } | ||
228 | break; | ||
229 | case 2: | ||
230 | //lower terrain | ||
231 | if (modify.ParcelData.Length > 0) | ||
232 | { | ||
233 | Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1); | ||
234 | RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West); | ||
235 | } | ||
236 | break; | ||
237 | } | ||
238 | return true; | ||
239 | } | ||
240 | */ | ||
215 | 241 | ||
216 | } | 242 | } |
217 | } | 243 | } |