aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/ClientView.API.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/ClientView.API.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs105
1 files changed, 93 insertions, 12 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 0ace92c..80719d6 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -63,6 +63,8 @@ namespace OpenSim
63 public event GenericCall2 OnStopMovement; 63 public event GenericCall2 OnStopMovement;
64 public event NewAvatar OnNewAvatar; 64 public event NewAvatar OnNewAvatar;
65 public event GenericCall6 OnRemoveAvatar; 65 public event GenericCall6 OnRemoveAvatar;
66 public event RequestMapBlocks OnRequestMapBlocks;
67 public event TeleportLocationRequest OnTeleportLocationRequest;
66 68
67 public event ParcelPropertiesRequest OnParcelPropertiesRequest; 69 public event ParcelPropertiesRequest OnParcelPropertiesRequest;
68 public event ParcelDivideRequest OnParcelDivideRequest; 70 public event ParcelDivideRequest OnParcelDivideRequest;
@@ -155,7 +157,7 @@ namespace OpenSim
155 handshake.RegionInfo.TerrainBase3 = regionInfo.estateSettings.terrainBase3; 157 handshake.RegionInfo.TerrainBase3 = regionInfo.estateSettings.terrainBase3;
156 handshake.RegionInfo.TerrainDetail0 = regionInfo.estateSettings.terrainDetail0; 158 handshake.RegionInfo.TerrainDetail0 = regionInfo.estateSettings.terrainDetail0;
157 handshake.RegionInfo.TerrainDetail1 = regionInfo.estateSettings.terrainDetail1; 159 handshake.RegionInfo.TerrainDetail1 = regionInfo.estateSettings.terrainDetail1;
158 handshake.RegionInfo.TerrainDetail2 =regionInfo.estateSettings.terrainDetail2; 160 handshake.RegionInfo.TerrainDetail2 = regionInfo.estateSettings.terrainDetail2;
159 handshake.RegionInfo.TerrainDetail3 = regionInfo.estateSettings.terrainDetail3; 161 handshake.RegionInfo.TerrainDetail3 = regionInfo.estateSettings.terrainDetail3;
160 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting? 162 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
161 163
@@ -166,7 +168,7 @@ namespace OpenSim
166 /// 168 ///
167 /// </summary> 169 /// </summary>
168 /// <param name="regInfo"></param> 170 /// <param name="regInfo"></param>
169 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos) 171 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
170 { 172 {
171 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 173 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
172 mov.AgentData.SessionID = this.SessionID; 174 mov.AgentData.SessionID = this.SessionID;
@@ -182,16 +184,16 @@ namespace OpenSim
182 { 184 {
183 mov.Data.Position = this.startpos; 185 mov.Data.Position = this.startpos;
184 } 186 }
185 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); 187 mov.Data.LookAt = look;
186 188
187 OutPacket(mov); 189 OutPacket(mov);
188 } 190 }
189 191
190 public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 192 public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
191 { 193 {
192 SendChatMessage( Helpers.StringToField( message ), type, fromPos, fromName, fromAgentID); 194 SendChatMessage(Helpers.StringToField(message), type, fromPos, fromName, fromAgentID);
193 } 195 }
194 196
195 /// <summary> 197 /// <summary>
196 /// 198 ///
197 /// </summary> 199 /// </summary>
@@ -216,7 +218,7 @@ namespace OpenSim
216 this.OutPacket(reply); 218 this.OutPacket(reply);
217 } 219 }
218 220
219 221
220 /// <summary> 222 /// <summary>
221 /// Send the region heightmap to the client 223 /// Send the region heightmap to the client
222 /// </summary> 224 /// </summary>
@@ -272,7 +274,7 @@ namespace OpenSim
272 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString()); 274 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
273 } 275 }
274 } 276 }
275 277
276 /// <summary> 278 /// <summary>
277 /// 279 ///
278 /// </summary> 280 /// </summary>
@@ -314,8 +316,8 @@ namespace OpenSim
314 316
315 public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort) 317 public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, System.Net.IPAddress newRegionIP, ushort newRegionPort)
316 { 318 {
317 LLVector3 look = new LLVector3(lookAt.X *10, lookAt.Y *10, lookAt.Z *10); 319 LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10);
318 320
319 CrossedRegionPacket newSimPack = new CrossedRegionPacket(); 321 CrossedRegionPacket newSimPack = new CrossedRegionPacket();
320 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); 322 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
321 newSimPack.AgentData.AgentID = this.AgentID; 323 newSimPack.AgentData.AgentID = this.AgentID;
@@ -334,7 +336,86 @@ namespace OpenSim
334 newSimPack.RegionData.SeedCapability = new byte[0]; 336 newSimPack.RegionData.SeedCapability = new byte[0];
335 337
336 this.OutPacket(newSimPack); 338 this.OutPacket(newSimPack);
337 this.DowngradeClient(); 339 //this.DowngradeClient();
340 }
341
342 public void SendMapBlock(List<MapBlockData> mapBlocks)
343 {
344 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
345
346 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
347 mapReply.AgentData.AgentID = this.AgentID;
348 mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count];
349 mapReply.AgentData.Flags = 0;
350
351 for (int i = 0; i < mapBlocks.Count; i++)
352 {
353 mapReply.Data[i] = new MapBlockReplyPacket.DataBlock();
354 mapReply.Data[i].MapImageID = mapBlocks[i].MapImageId;
355 mapReply.Data[i].X = mapBlocks[i].X;
356 mapReply.Data[i].Y = mapBlocks[i].Y;
357 mapReply.Data[i].WaterHeight = mapBlocks[i].WaterHeight;
358 mapReply.Data[i].Name = _enc.GetBytes(mapBlocks[i].Name);
359 mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags;
360 mapReply.Data[i].Access = mapBlocks[i].Access;
361 mapReply.Data[i].Agents = mapBlocks[i].Agents;
362 }
363 this.OutPacket(mapReply);
364 }
365
366 public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags)
367 {
368 TeleportLocalPacket tpLocal2 = new TeleportLocalPacket();
369 tpLocal2.Info.AgentID = this.AgentID;
370 tpLocal2.Info.TeleportFlags = flags;
371 tpLocal2.Info.LocationID = 2;
372 tpLocal2.Info.LookAt = lookAt;
373 tpLocal2.Info.Position = position;
374 OutPacket(tpLocal2);
375 }
376
377 public void SendRegionTeleport(ulong regionHandle, byte simAccess, string ipAddress, ushort ipPort, uint locationID, uint flags)
378 {
379 TeleportFinishPacket Teleport = new TeleportFinishPacket();
380 Teleport.Info.AgentID = this.AgentID;
381 Teleport.Info.RegionHandle = regionHandle;
382 Teleport.Info.SimAccess = simAccess;
383 Teleport.Info.SeedCapability = new byte[0];
384
385 System.Net.IPAddress oIP = System.Net.IPAddress.Parse(ipAddress);
386 byte[] byteIP = oIP.GetAddressBytes();
387 uint ip = (uint)byteIP[3] << 24;
388 ip += (uint)byteIP[2] << 16;
389 ip += (uint)byteIP[1] << 8;
390 ip += (uint)byteIP[0];
391
392 Teleport.Info.SimIP = ip;
393 Teleport.Info.SimPort = ipPort;
394 Teleport.Info.LocationID = 4;
395 Teleport.Info.TeleportFlags = 1 << 4;
396 OutPacket(Teleport);
397 }
398
399 /// <summary>
400 ///
401 /// </summary>
402 public void SendTeleportCancel()
403 {
404 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
405 tpCancel.Info.SessionID = this.SessionID;
406 tpCancel.Info.AgentID = this.AgentID;
407
408 OutPacket(tpCancel);
409 }
410
411 /// <summary>
412 ///
413 /// </summary>
414 public void SendTeleportLocationStart()
415 {
416 TeleportStartPacket tpStart = new TeleportStartPacket();
417 tpStart.Info.TeleportFlags = 16; // Teleport via location
418 OutPacket(tpStart);
338 } 419 }
339 420
340 #region Appearance/ Wearables Methods 421 #region Appearance/ Wearables Methods
@@ -511,7 +592,7 @@ namespace OpenSim
511 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 592 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
512 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID); 593 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID);
513 outPacket.ObjectData[0].ID = localID; 594 outPacket.ObjectData[0].ID = localID;
514 outPacket.ObjectData[0].FullID = primData.FullID; 595 outPacket.ObjectData[0].FullID = primData.FullID;
515 byte[] pb = pos.GetBytes(); 596 byte[] pb = pos.GetBytes();
516 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 597 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
517 598
@@ -570,7 +651,7 @@ namespace OpenSim
570 ushort InternVelocityY; 651 ushort InternVelocityY;
571 ushort InternVelocityZ; 652 ushort InternVelocityZ;
572 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0); 653 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
573 654
574 internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z); 655 internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z);
575 656
576 internDirec = internDirec / 128.0f; 657 internDirec = internDirec / 128.0f;