diff options
Renamed World class to Scene class
Diffstat (limited to 'OpenSim/OpenSim.Region/Scene/Scene.PacketHandlers.cs')
-rw-r--r-- | OpenSim/OpenSim.Region/Scene/Scene.PacketHandlers.cs | 253 |
1 files changed, 253 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Region/Scene/Scene.PacketHandlers.cs b/OpenSim/OpenSim.Region/Scene/Scene.PacketHandlers.cs new file mode 100644 index 0000000..1c6fbcd --- /dev/null +++ b/OpenSim/OpenSim.Region/Scene/Scene.PacketHandlers.cs | |||
@@ -0,0 +1,253 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using libsecondlife; | ||
32 | using libsecondlife.Packets; | ||
33 | using OpenSim.Physics.Manager; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework.Types; | ||
36 | using OpenSim.Framework.Inventory; | ||
37 | using OpenSim.Framework.Utilities; | ||
38 | |||
39 | namespace OpenSim.Region | ||
40 | { | ||
41 | public partial class Scene | ||
42 | { | ||
43 | /// <summary> | ||
44 | /// | ||
45 | /// </summary> | ||
46 | /// <param name="action"></param> | ||
47 | /// <param name="north"></param> | ||
48 | /// <param name="west"></param> | ||
49 | public void ModifyTerrain(byte action, float north, float west) | ||
50 | { | ||
51 | switch (action) | ||
52 | { | ||
53 | case 1: | ||
54 | // raise terrain | ||
55 | Terrain.raise(north, west, 10.0, 0.001); | ||
56 | RegenerateTerrain(true, (int)north, (int)west); | ||
57 | break; | ||
58 | case 2: | ||
59 | //lower terrain | ||
60 | Terrain.lower(north, west, 10.0, 0.001); | ||
61 | RegenerateTerrain(true, (int)north, (int)west); | ||
62 | break; | ||
63 | } | ||
64 | return; | ||
65 | } | ||
66 | |||
67 | /// <summary> | ||
68 | /// | ||
69 | /// </summary> | ||
70 | /// <param name="message"></param> | ||
71 | /// <param name="type"></param> | ||
72 | /// <param name="fromPos"></param> | ||
73 | /// <param name="fromName"></param> | ||
74 | /// <param name="fromAgentID"></param> | ||
75 | public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) | ||
76 | { | ||
77 | Console.WriteLine("Chat message"); | ||
78 | Avatar avatar = null; | ||
79 | foreach (IClientAPI client in m_clientThreads.Values) | ||
80 | { | ||
81 | int dis = -1000; | ||
82 | if (this.Avatars.ContainsKey(client.AgentId)) | ||
83 | { | ||
84 | |||
85 | avatar = this.Avatars[client.AgentId]; | ||
86 | // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); | ||
87 | dis= (int)avatar.Pos.GetDistanceTo(fromPos); | ||
88 | Console.WriteLine("found avatar at " +dis); | ||
89 | |||
90 | } | ||
91 | |||
92 | switch (type) | ||
93 | { | ||
94 | case 0: // Whisper | ||
95 | if ((dis < 10) && (dis > -10)) | ||
96 | { | ||
97 | //should change so the message is sent through the avatar rather than direct to the ClientView | ||
98 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
99 | } | ||
100 | break; | ||
101 | case 1: // Say | ||
102 | if ((dis < 30) && (dis > -30)) | ||
103 | { | ||
104 | Console.WriteLine("sending chat"); | ||
105 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
106 | } | ||
107 | break; | ||
108 | case 2: // Shout | ||
109 | if ((dis < 100) && (dis > -100)) | ||
110 | { | ||
111 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
112 | } | ||
113 | break; | ||
114 | |||
115 | case 0xff: // Broadcast | ||
116 | client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); | ||
117 | break; | ||
118 | } | ||
119 | |||
120 | } | ||
121 | } | ||
122 | |||
123 | /// <summary> | ||
124 | /// | ||
125 | /// </summary> | ||
126 | /// <param name="primAsset"></param> | ||
127 | /// <param name="pos"></param> | ||
128 | public void RezObject(AssetBase primAsset, LLVector3 pos) | ||
129 | { | ||
130 | |||
131 | } | ||
132 | |||
133 | /// <summary> | ||
134 | /// | ||
135 | /// </summary> | ||
136 | /// <param name="packet"></param> | ||
137 | /// <param name="simClient"></param> | ||
138 | public void DeRezObject(Packet packet, IClientAPI simClient) | ||
139 | { | ||
140 | |||
141 | } | ||
142 | |||
143 | /// <summary> | ||
144 | /// | ||
145 | /// </summary> | ||
146 | /// <param name="remoteClient"></param> | ||
147 | public void SendAvatarsToClient(IClientAPI remoteClient) | ||
148 | { | ||
149 | |||
150 | } | ||
151 | |||
152 | /// <summary> | ||
153 | /// | ||
154 | /// </summary> | ||
155 | /// <param name="parentPrim"></param> | ||
156 | /// <param name="childPrims"></param> | ||
157 | public void LinkObjects(uint parentPrim, List<uint> childPrims) | ||
158 | { | ||
159 | |||
160 | |||
161 | } | ||
162 | |||
163 | /// <summary> | ||
164 | /// | ||
165 | /// </summary> | ||
166 | /// <param name="primLocalID"></param> | ||
167 | /// <param name="shapeBlock"></param> | ||
168 | public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) | ||
169 | { | ||
170 | |||
171 | } | ||
172 | |||
173 | /// <summary> | ||
174 | /// | ||
175 | /// </summary> | ||
176 | /// <param name="primLocalID"></param> | ||
177 | /// <param name="remoteClient"></param> | ||
178 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) | ||
179 | { | ||
180 | |||
181 | } | ||
182 | |||
183 | /// <summary> | ||
184 | /// | ||
185 | /// </summary> | ||
186 | /// <param name="localID"></param> | ||
187 | /// <param name="packet"></param> | ||
188 | /// <param name="remoteClient"></param> | ||
189 | public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient) | ||
190 | { | ||
191 | |||
192 | } | ||
193 | |||
194 | /// <summary> | ||
195 | /// | ||
196 | /// </summary> | ||
197 | /// <param name="localID"></param> | ||
198 | /// <param name="texture"></param> | ||
199 | /// <param name="remoteClient"></param> | ||
200 | public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) | ||
201 | { | ||
202 | |||
203 | } | ||
204 | |||
205 | /// <summary> | ||
206 | /// | ||
207 | /// </summary> | ||
208 | /// <param name="localID"></param> | ||
209 | /// <param name="pos"></param> | ||
210 | /// <param name="remoteClient"></param> | ||
211 | public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) | ||
212 | { | ||
213 | foreach (Entity ent in Entities.Values) | ||
214 | { | ||
215 | if (ent.localid == localID) | ||
216 | { | ||
217 | ((OpenSim.Region.Primitive)ent).UpdatePosition(pos); | ||
218 | break; | ||
219 | } | ||
220 | } | ||
221 | } | ||
222 | |||
223 | /// <summary> | ||
224 | /// | ||
225 | /// </summary> | ||
226 | /// <param name="localID"></param> | ||
227 | /// <param name="rot"></param> | ||
228 | /// <param name="remoteClient"></param> | ||
229 | public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) | ||
230 | { | ||
231 | |||
232 | } | ||
233 | |||
234 | /// <summary> | ||
235 | /// | ||
236 | /// </summary> | ||
237 | /// <param name="localID"></param> | ||
238 | /// <param name="scale"></param> | ||
239 | /// <param name="remoteClient"></param> | ||
240 | public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) | ||
241 | { | ||
242 | } | ||
243 | |||
244 | /// <summary> | ||
245 | /// Sends prims to a client | ||
246 | /// </summary> | ||
247 | /// <param name="RemoteClient">Client to send to</param> | ||
248 | public void GetInitialPrims(IClientAPI RemoteClient) | ||
249 | { | ||
250 | |||
251 | } | ||
252 | } | ||
253 | } | ||