diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs index 0771a4a..d589a7b 100644 --- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs +++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs | |||
@@ -27,9 +27,8 @@ | |||
27 | */ | 27 | */ |
28 | using libsecondlife; | 28 | using libsecondlife; |
29 | using libsecondlife.Packets; | 29 | using libsecondlife.Packets; |
30 | using OpenSim.Framework.Console; | ||
31 | using OpenSim.Framework.Interfaces; | ||
32 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Framework.Console; | ||
33 | 32 | ||
34 | namespace OpenSim.Region.ClientStack | 33 | namespace OpenSim.Region.ClientStack |
35 | { | 34 | { |
@@ -37,17 +36,17 @@ namespace OpenSim.Region.ClientStack | |||
37 | { | 36 | { |
38 | protected virtual void RegisterLocalPacketHandlers() | 37 | protected virtual void RegisterLocalPacketHandlers() |
39 | { | 38 | { |
40 | this.AddLocalPacketHandler(PacketType.LogoutRequest, this.Logout); | 39 | AddLocalPacketHandler(PacketType.LogoutRequest, Logout); |
41 | this.AddLocalPacketHandler(PacketType.ViewerEffect, this.HandleViewerEffect); | 40 | AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect); |
42 | this.AddLocalPacketHandler(PacketType.AgentCachedTexture, this.AgentTextureCached); | 41 | AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached); |
43 | this.AddLocalPacketHandler(PacketType.MultipleObjectUpdate, this.MultipleObjUpdate); | 42 | AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate); |
44 | } | 43 | } |
45 | 44 | ||
46 | private bool HandleViewerEffect(IClientAPI sender, Packet Pack) | 45 | private bool HandleViewerEffect(IClientAPI sender, Packet Pack) |
47 | { | 46 | { |
48 | ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; | 47 | ViewerEffectPacket viewer = (ViewerEffectPacket) Pack; |
49 | 48 | ||
50 | if( OnViewerEffect != null ) | 49 | if (OnViewerEffect != null) |
51 | { | 50 | { |
52 | OnViewerEffect(sender, viewer.Effect); | 51 | OnViewerEffect(sender, viewer.Effect); |
53 | } | 52 | } |
@@ -59,7 +58,7 @@ namespace OpenSim.Region.ClientStack | |||
59 | { | 58 | { |
60 | MainLog.Instance.Verbose("CLIENT", "Got a logout request"); | 59 | MainLog.Instance.Verbose("CLIENT", "Got a logout request"); |
61 | 60 | ||
62 | if( OnLogout != null ) | 61 | if (OnLogout != null) |
63 | { | 62 | { |
64 | OnLogout(client); | 63 | OnLogout(client); |
65 | } | 64 | } |
@@ -70,13 +69,14 @@ namespace OpenSim.Region.ClientStack | |||
70 | protected bool AgentTextureCached(IClientAPI simclient, Packet packet) | 69 | protected bool AgentTextureCached(IClientAPI simclient, Packet packet) |
71 | { | 70 | { |
72 | //System.Console.WriteLine("texture cached: " + packet.ToString()); | 71 | //System.Console.WriteLine("texture cached: " + packet.ToString()); |
73 | AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; | 72 | AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket) packet; |
74 | AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); | 73 | AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); |
75 | cachedresp.AgentData.AgentID = this.AgentId; | 74 | cachedresp.AgentData.AgentID = AgentId; |
76 | cachedresp.AgentData.SessionID = this.m_sessionId; | 75 | cachedresp.AgentData.SessionID = m_sessionId; |
77 | cachedresp.AgentData.SerialNum = this.cachedtextureserial; | 76 | cachedresp.AgentData.SerialNum = cachedtextureserial; |
78 | this.cachedtextureserial++; | 77 | cachedtextureserial++; |
79 | cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length]; | 78 | cachedresp.WearableData = |
79 | new AgentCachedTextureResponsePacket.WearableDataBlock[chechedtex.WearableData.Length]; | ||
80 | for (int i = 0; i < chechedtex.WearableData.Length; i++) | 80 | for (int i = 0; i < chechedtex.WearableData.Length; i++) |
81 | { | 81 | { |
82 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 82 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
@@ -84,17 +84,18 @@ namespace OpenSim.Region.ClientStack | |||
84 | cachedresp.WearableData[i].TextureID = LLUUID.Zero; | 84 | cachedresp.WearableData[i].TextureID = LLUUID.Zero; |
85 | cachedresp.WearableData[i].HostName = new byte[0]; | 85 | cachedresp.WearableData[i].HostName = new byte[0]; |
86 | } | 86 | } |
87 | this.OutPacket(cachedresp); | 87 | OutPacket(cachedresp); |
88 | return true; | 88 | return true; |
89 | } | 89 | } |
90 | 90 | ||
91 | protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) | 91 | protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) |
92 | { | 92 | { |
93 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; | 93 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket) packet; |
94 | // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); | 94 | // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); |
95 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) | 95 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) |
96 | { | 96 | { |
97 | #region position | 97 | #region position |
98 | |||
98 | if (multipleupdate.ObjectData[i].Type == 9) //change position | 99 | if (multipleupdate.ObjectData[i].Type == 9) //change position |
99 | { | 100 | { |
100 | if (OnUpdatePrimGroupPosition != null) | 101 | if (OnUpdatePrimGroupPosition != null) |
@@ -102,20 +103,20 @@ namespace OpenSim.Region.ClientStack | |||
102 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 103 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
103 | OnUpdatePrimGroupPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 104 | OnUpdatePrimGroupPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
104 | } | 105 | } |
105 | |||
106 | } | 106 | } |
107 | else if (multipleupdate.ObjectData[i].Type == 1) //single item of group change position | 107 | else if (multipleupdate.ObjectData[i].Type == 1) //single item of group change position |
108 | { | 108 | { |
109 | if (OnUpdatePrimSinglePosition != null) | 109 | if (OnUpdatePrimSinglePosition != null) |
110 | { | 110 | { |
111 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 111 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
112 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 112 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
113 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 113 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | #endregion position | 116 | #endregion position |
117 | #region rotation | 117 | #region rotation |
118 | else if (multipleupdate.ObjectData[i].Type == 2)// single item of group rotation from tab | 118 | |
119 | else if (multipleupdate.ObjectData[i].Type == 2) // single item of group rotation from tab | ||
119 | { | 120 | { |
120 | if (OnUpdatePrimSingleRotation != null) | 121 | if (OnUpdatePrimSingleRotation != null) |
121 | { | 122 | { |
@@ -124,38 +125,39 @@ namespace OpenSim.Region.ClientStack | |||
124 | OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); | 125 | OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); |
125 | } | 126 | } |
126 | } | 127 | } |
127 | else if (multipleupdate.ObjectData[i].Type == 3)// single item of group rotation from mouse | 128 | else if (multipleupdate.ObjectData[i].Type == 3) // single item of group rotation from mouse |
128 | { | 129 | { |
129 | if (OnUpdatePrimSingleRotation != null) | 130 | if (OnUpdatePrimSingleRotation != null) |
130 | { | 131 | { |
131 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); | 132 | LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); |
132 | //System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); | 133 | //System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); |
133 | OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); | 134 | OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); |
134 | } | 135 | } |
135 | } | 136 | } |
136 | else if (multipleupdate.ObjectData[i].Type == 10)//group rotation from object tab | 137 | else if (multipleupdate.ObjectData[i].Type == 10) //group rotation from object tab |
137 | { | 138 | { |
138 | if (OnUpdatePrimGroupRotation != null) | 139 | if (OnUpdatePrimGroupRotation != null) |
139 | { | 140 | { |
140 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); | 141 | LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); |
141 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); | 142 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); |
142 | OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); | 143 | OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); |
143 | } | 144 | } |
144 | } | 145 | } |
145 | else if (multipleupdate.ObjectData[i].Type == 11)//group rotation from mouse | 146 | else if (multipleupdate.ObjectData[i].Type == 11) //group rotation from mouse |
146 | { | 147 | { |
147 | if (OnUpdatePrimGroupMouseRotation != null) | 148 | if (OnUpdatePrimGroupMouseRotation != null) |
148 | { | 149 | { |
149 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 150 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
150 | libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); | 151 | LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); |
151 | //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 152 | //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
152 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); | 153 | // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); |
153 | OnUpdatePrimGroupMouseRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this); | 154 | OnUpdatePrimGroupMouseRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this); |
154 | } | 155 | } |
155 | } | 156 | } |
156 | #endregion | 157 | #endregion |
157 | #region scale | 158 | #region scale |
158 | else if (multipleupdate.ObjectData[i].Type == 13)//group scale from object tab | 159 | |
160 | else if (multipleupdate.ObjectData[i].Type == 13) //group scale from object tab | ||
159 | { | 161 | { |
160 | if (OnUpdatePrimScale != null) | 162 | if (OnUpdatePrimScale != null) |
161 | { | 163 | { |
@@ -164,40 +166,41 @@ namespace OpenSim.Region.ClientStack | |||
164 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 166 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
165 | 167 | ||
166 | // Change the position based on scale (for bug number 246) | 168 | // Change the position based on scale (for bug number 246) |
167 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 169 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
168 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 170 | // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
169 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 171 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
170 | } | 172 | } |
171 | } | 173 | } |
172 | else if (multipleupdate.ObjectData[i].Type == 29)//group scale from mouse | 174 | else if (multipleupdate.ObjectData[i].Type == 29) //group scale from mouse |
173 | { | 175 | { |
174 | if (OnUpdatePrimScale != null) | 176 | if (OnUpdatePrimScale != null) |
175 | { | 177 | { |
176 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 178 | LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
177 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); | 179 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); |
178 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 180 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
179 | libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); | 181 | LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); |
180 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); | 182 | OnUpdatePrimSinglePosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); |
181 | } | 183 | } |
182 | } | 184 | } |
183 | else if (multipleupdate.ObjectData[i].Type == 5)//single prim scale from object tab | 185 | else if (multipleupdate.ObjectData[i].Type == 5) //single prim scale from object tab |
184 | { | 186 | { |
185 | if (OnUpdatePrimScale != null) | 187 | if (OnUpdatePrimScale != null) |
186 | { | 188 | { |
187 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 189 | LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
188 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 190 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
189 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 191 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
190 | } | 192 | } |
191 | } | 193 | } |
192 | else if (multipleupdate.ObjectData[i].Type == 21)//single prim scale from mouse | 194 | else if (multipleupdate.ObjectData[i].Type == 21) //single prim scale from mouse |
193 | { | 195 | { |
194 | if (OnUpdatePrimScale != null) | 196 | if (OnUpdatePrimScale != null) |
195 | { | 197 | { |
196 | libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); | 198 | LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); |
197 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 199 | // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
198 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); | 200 | OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); |
199 | } | 201 | } |
200 | } | 202 | } |
203 | |||
201 | #endregion | 204 | #endregion |
202 | } | 205 | } |
203 | return true; | 206 | return true; |
@@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack | |||
208 | //should be getting the map layer from the grid server | 211 | //should be getting the map layer from the grid server |
209 | //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) | 212 | //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) |
210 | MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); | 213 | MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); |
211 | mapReply.AgentData.AgentID = this.AgentId; | 214 | mapReply.AgentData.AgentID = AgentId; |
212 | mapReply.AgentData.Flags = 0; | 215 | mapReply.AgentData.Flags = 0; |
213 | mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1]; | 216 | mapReply.LayerData = new MapLayerReplyPacket.LayerDataBlock[1]; |
214 | mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock(); | 217 | mapReply.LayerData[0] = new MapLayerReplyPacket.LayerDataBlock(); |
@@ -217,7 +220,7 @@ namespace OpenSim.Region.ClientStack | |||
217 | mapReply.LayerData[0].Top = 30000; | 220 | mapReply.LayerData[0].Top = 30000; |
218 | mapReply.LayerData[0].Right = 30000; | 221 | mapReply.LayerData[0].Right = 30000; |
219 | mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); | 222 | mapReply.LayerData[0].ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); |
220 | this.OutPacket(mapReply); | 223 | OutPacket(mapReply); |
221 | } | 224 | } |
222 | 225 | ||
223 | public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) | 226 | public void RequestMapBlocks(int minX, int minY, int maxX, int maxY) |
@@ -251,4 +254,4 @@ namespace OpenSim.Region.ClientStack | |||
251 | */ | 254 | */ |
252 | } | 255 | } |
253 | } | 256 | } |
254 | } | 257 | } \ No newline at end of file |