aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.API.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs44
1 files changed, 22 insertions, 22 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 51f02da..40e0021 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -27,14 +27,14 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net;
30using System.Text; 31using System.Text;
31using OpenSim.Framework.Interfaces; 32using Axiom.MathLib;
32using OpenSim.Framework.Inventory;
33using OpenSim.Framework.Types;
34
35using libsecondlife; 33using libsecondlife;
36using libsecondlife.Packets; 34using libsecondlife.Packets;
37using System.Net; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types;
38 38
39namespace OpenSim.Region.ClientStack 39namespace OpenSim.Region.ClientStack
40{ 40{
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ClientStack
137 /// <param name="regionInfo"></param> 137 /// <param name="regionInfo"></param>
138 public void SendRegionHandshake(RegionInfo regionInfo) 138 public void SendRegionHandshake(RegionInfo regionInfo)
139 { 139 {
140 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 140 Encoding _enc = Encoding.ASCII;
141 RegionHandshakePacket handshake = new RegionHandshakePacket(); 141 RegionHandshakePacket handshake = new RegionHandshakePacket();
142 142
143 handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor; 143 handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor;
@@ -219,8 +219,8 @@ namespace OpenSim.Region.ClientStack
219 /// <param name="fromAgentID"></param> 219 /// <param name="fromAgentID"></param>
220 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 220 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
221 { 221 {
222 System.Text.Encoding enc = System.Text.Encoding.ASCII; 222 Encoding enc = Encoding.ASCII;
223 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); 223 ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
224 reply.ChatData.Audible = 1; 224 reply.ChatData.Audible = 1;
225 reply.ChatData.Message = message; 225 reply.ChatData.Message = message;
226 reply.ChatData.ChatType = type; 226 reply.ChatData.ChatType = type;
@@ -260,7 +260,7 @@ namespace OpenSim.Region.ClientStack
260 } 260 }
261 catch (Exception e) 261 catch (Exception e)
262 { 262 {
263 OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString()); 263 MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
264 } 264 }
265 } 265 }
266 266
@@ -286,7 +286,7 @@ namespace OpenSim.Region.ClientStack
286 } 286 }
287 catch (Exception e) 287 catch (Exception e)
288 { 288 {
289 OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString()); 289 MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
290 } 290 }
291 } 291 }
292 292
@@ -298,7 +298,7 @@ namespace OpenSim.Region.ClientStack
298 /// <param name="neighbourPort"></param> 298 /// <param name="neighbourPort"></param>
299 public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint ) 299 public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint )
300 { 300 {
301 System.Net.IPAddress neighbourIP = neighbourEndPoint.Address; 301 IPAddress neighbourIP = neighbourEndPoint.Address;
302 ushort neighbourPort = (ushort) neighbourEndPoint.Port; 302 ushort neighbourPort = (ushort) neighbourEndPoint.Port;
303 303
304 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 304 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
@@ -343,7 +343,7 @@ namespace OpenSim.Region.ClientStack
343 newSimPack.Info = new CrossedRegionPacket.InfoBlock(); 343 newSimPack.Info = new CrossedRegionPacket.InfoBlock();
344 newSimPack.Info.Position = pos; 344 newSimPack.Info.Position = pos;
345 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! 345 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
346 newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); 346 newSimPack.RegionData = new CrossedRegionPacket.RegionDataBlock();
347 newSimPack.RegionData.RegionHandle = newRegionHandle; 347 newSimPack.RegionData.RegionHandle = newRegionHandle;
348 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes(); 348 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes();
349 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; 349 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
@@ -359,7 +359,7 @@ namespace OpenSim.Region.ClientStack
359 359
360 public void SendMapBlock(List<MapBlockData> mapBlocks) 360 public void SendMapBlock(List<MapBlockData> mapBlocks)
361 { 361 {
362 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 362 Encoding _enc = Encoding.ASCII;
363 363
364 MapBlockReplyPacket mapReply = new MapBlockReplyPacket(); 364 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
365 mapReply.AgentData.AgentID = this.AgentID; 365 mapReply.AgentData.AgentID = this.AgentID;
@@ -514,20 +514,20 @@ namespace OpenSim.Region.ClientStack
514 /// <param name="Pos"></param> 514 /// <param name="Pos"></param>
515 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry) 515 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry)
516 { 516 {
517 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 517 Encoding _enc = Encoding.ASCII;
518 //send a objectupdate packet with information about the clients avatar 518 //send a objectupdate packet with information about the clients avatar
519 519
520 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 520 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
521 objupdate.RegionData.RegionHandle = regionHandle; 521 objupdate.RegionData.RegionHandle = regionHandle;
522 objupdate.RegionData.TimeDilation = 64096; 522 objupdate.RegionData.TimeDilation = 64096;
523 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 523 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
524 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry); 524 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry);
525 //give this avatar object a local id and assign the user a name 525 //give this avatar object a local id and assign the user a name
526 526
527 objupdate.ObjectData[0].ID = avatarLocalID; 527 objupdate.ObjectData[0].ID = avatarLocalID;
528 objupdate.ObjectData[0].FullID = avatarID; 528 objupdate.ObjectData[0].FullID = avatarID;
529 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0"); 529 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0");
530 libsecondlife.LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); 530 LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
531 byte[] pb = pos2.GetBytes(); 531 byte[] pb = pos2.GetBytes();
532 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 532 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
533 533
@@ -716,9 +716,9 @@ namespace OpenSim.Region.ClientStack
716 ushort InternVelocityX; 716 ushort InternVelocityX;
717 ushort InternVelocityY; 717 ushort InternVelocityY;
718 ushort InternVelocityZ; 718 ushort InternVelocityZ;
719 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0); 719 Vector3 internDirec = new Vector3(0, 0, 0);
720 720
721 internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z); 721 internDirec = new Vector3(velocity.X, velocity.Y, velocity.Z);
722 722
723 internDirec = internDirec / 128.0f; 723 internDirec = internDirec / 128.0f;
724 internDirec.x += 1; 724 internDirec.x += 1;
@@ -961,7 +961,7 @@ namespace OpenSim.Region.ClientStack
961 /// <returns></returns> 961 /// <returns></returns>
962 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry) 962 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
963 { 963 {
964 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); 964 ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
965 965
966 SetDefaultAvatarPacketValues(ref objdata); 966 SetDefaultAvatarPacketValues(ref objdata);
967 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); 967 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
@@ -977,12 +977,12 @@ namespace OpenSim.Region.ClientStack
977 { 977 {
978 objdata.TextureEntry = textureEntry; 978 objdata.TextureEntry = textureEntry;
979 } 979 }
980 System.Text.Encoding enc = System.Text.Encoding.ASCII; 980 Encoding enc = Encoding.ASCII;
981 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 981 LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
982 pos.X = 100f; 982 pos.X = 100f;
983 objdata.ID = 8880000; 983 objdata.ID = 8880000;
984 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); 984 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
985 libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f); 985 LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
986 //objdata.FullID=user.AgentID; 986 //objdata.FullID=user.AgentID;
987 byte[] pb = pos.GetBytes(); 987 byte[] pb = pos.GetBytes();
988 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); 988 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);