aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs353
1 files changed, 180 insertions, 173 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 3dbce5b..72de55a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -42,12 +42,12 @@ using OpenSim.Framework.Communications.Cache;
42using OpenSim.Framework.Statistics; 42using OpenSim.Framework.Statistics;
43using OpenSim.Region.ClientStack.LindenUDP; 43using OpenSim.Region.ClientStack.LindenUDP;
44using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
45using Timer=System.Timers.Timer; 45using Timer = System.Timers.Timer;
46 46
47namespace OpenSim.Region.ClientStack.LindenUDP 47namespace OpenSim.Region.ClientStack.LindenUDP
48{ 48{
49 public delegate bool PacketMethod(IClientAPI simClient, Packet packet); 49 public delegate bool PacketMethod(IClientAPI simClient, Packet packet);
50 50
51 51
52 /// <summary> 52 /// <summary>
53 /// Class that keeps track of past packets so that they don't get 53 /// Class that keeps track of past packets so that they don't get
@@ -727,7 +727,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
727 m_log.WarnFormat( 727 m_log.WarnFormat(
728 "[CLIENT]: New user request denied to avatar {0} connecting with circuit code {1} from {2}", 728 "[CLIENT]: New user request denied to avatar {0} connecting with circuit code {1} from {2}",
729 m_agentId, m_circuitCode, m_userEndPoint); 729 m_agentId, m_circuitCode, m_userEndPoint);
730 730
731 m_packetQueue.Close(); 731 m_packetQueue.Close();
732 m_clientThread.Abort(); 732 m_clientThread.Abort();
733 } 733 }
@@ -742,7 +742,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
742 { 742 {
743 m_secureSessionId = sessionInfo.LoginInfo.SecureSession; 743 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
744 } 744 }
745 745
746 // This sets up all the timers 746 // This sets up all the timers
747 InitNewClient(); 747 InitNewClient();
748 748
@@ -753,24 +753,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
753 { 753 {
754 if (e is ThreadAbortException) 754 if (e is ThreadAbortException)
755 throw e; 755 throw e;
756 756
757 if (StatsManager.SimExtraStats != null) 757 if (StatsManager.SimExtraStats != null)
758 StatsManager.SimExtraStats.AddAbnormalClientThreadTermination(); 758 StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
759 759
760 // Don't let a failure in an individual client thread crash the whole sim. 760 // Don't let a failure in an individual client thread crash the whole sim.
761 m_log.ErrorFormat("[CLIENT]: Client thread for {0} {1} crashed. Logging them out. Exception {2}", Name, AgentId, e); 761 m_log.ErrorFormat("[CLIENT]: Client thread for {0} {1} crashed. Logging them out. Exception {2}", Name, AgentId, e);
762 762
763 try 763 try
764 { 764 {
765 // Make an attempt to alert the user that their session has crashed 765 // Make an attempt to alert the user that their session has crashed
766 AgentAlertMessagePacket packet 766 AgentAlertMessagePacket packet
767 = BuildAgentAlertPacket( 767 = BuildAgentAlertPacket(
768 "Unfortunately the session for this client on the server has crashed.\n" 768 "Unfortunately the session for this client on the server has crashed.\n"
769 + "Any further actions taken will not be processed.\n" 769 + "Any further actions taken will not be processed.\n"
770 + "Please relog", true); 770 + "Please relog", true);
771 771
772 ProcessOutPacket(packet); 772 ProcessOutPacket(packet);
773 773
774 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to 774 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to
775 // listeners yet, though. 775 // listeners yet, though.
776 Logout(this); 776 Logout(this);
@@ -779,7 +779,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
779 { 779 {
780 if (e2 is ThreadAbortException) 780 if (e2 is ThreadAbortException)
781 throw e2; 781 throw e2;
782 782
783 m_log.ErrorFormat("[CLIENT]: Further exception thrown on forced session logout. {0}", e2); 783 m_log.ErrorFormat("[CLIENT]: Further exception thrown on forced session logout. {0}", e2);
784 } 784 }
785 } 785 }
@@ -1108,7 +1108,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1108 private void DoSendLayerData(object o) 1108 private void DoSendLayerData(object o)
1109 { 1109 {
1110 float[] map = (float[])o; 1110 float[] map = (float[])o;
1111 1111
1112 try 1112 try
1113 { 1113 {
1114 for (int y = 0; y < 16; y++) 1114 for (int y = 0; y < 16; y++)
@@ -1120,10 +1120,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1120 // SendLayerPacket(map, y, x); 1120 // SendLayerPacket(map, y, x);
1121 // Thread.Sleep(150); 1121 // Thread.Sleep(150);
1122 //} 1122 //}
1123 for (int x= 0; x < 16; x++) 1123 for (int x = 0; x < 16; x++)
1124 { 1124 {
1125 SendLayerData(x, y, map); 1125 SendLayerData(x, y, map);
1126 Thread.Sleep(35); 1126 Thread.Sleep(35);
1127 } 1127 }
1128 } 1128 }
1129 } 1129 }
@@ -1278,15 +1278,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1278 1278
1279 public void SendMapBlock(List<MapBlockData> mapBlocks, uint flag) 1279 public void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
1280 { 1280 {
1281 1281
1282 MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); 1282 MapBlockData[] mapBlocks2 = mapBlocks.ToArray();
1283 1283
1284 int maxsend = 10; 1284 int maxsend = 10;
1285 1285
1286 //int packets = Math.Ceiling(mapBlocks2.Length / maxsend); 1286 //int packets = Math.Ceiling(mapBlocks2.Length / maxsend);
1287 1287
1288 List<MapBlockData> sendingBlocks = new List<MapBlockData>(); 1288 List<MapBlockData> sendingBlocks = new List<MapBlockData>();
1289 1289
1290 for (int i = 0; i < mapBlocks2.Length; i++) 1290 for (int i = 0; i < mapBlocks2.Length; i++)
1291 { 1291 {
1292 sendingBlocks.Add(mapBlocks2[i]); 1292 sendingBlocks.Add(mapBlocks2[i]);
@@ -1389,14 +1389,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1389 payPriceReply.ObjectData.ObjectID = objectID; 1389 payPriceReply.ObjectData.ObjectID = objectID;
1390 payPriceReply.ObjectData.DefaultPayPrice = payPrice[0]; 1390 payPriceReply.ObjectData.DefaultPayPrice = payPrice[0];
1391 1391
1392 payPriceReply.ButtonData=new PayPriceReplyPacket.ButtonDataBlock[4]; 1392 payPriceReply.ButtonData = new PayPriceReplyPacket.ButtonDataBlock[4];
1393 payPriceReply.ButtonData[0]=new PayPriceReplyPacket.ButtonDataBlock(); 1393 payPriceReply.ButtonData[0] = new PayPriceReplyPacket.ButtonDataBlock();
1394 payPriceReply.ButtonData[0].PayButton = payPrice[1]; 1394 payPriceReply.ButtonData[0].PayButton = payPrice[1];
1395 payPriceReply.ButtonData[1]=new PayPriceReplyPacket.ButtonDataBlock(); 1395 payPriceReply.ButtonData[1] = new PayPriceReplyPacket.ButtonDataBlock();
1396 payPriceReply.ButtonData[1].PayButton = payPrice[2]; 1396 payPriceReply.ButtonData[1].PayButton = payPrice[2];
1397 payPriceReply.ButtonData[2]=new PayPriceReplyPacket.ButtonDataBlock(); 1397 payPriceReply.ButtonData[2] = new PayPriceReplyPacket.ButtonDataBlock();
1398 payPriceReply.ButtonData[2].PayButton = payPrice[3]; 1398 payPriceReply.ButtonData[2].PayButton = payPrice[3];
1399 payPriceReply.ButtonData[3]=new PayPriceReplyPacket.ButtonDataBlock(); 1399 payPriceReply.ButtonData[3] = new PayPriceReplyPacket.ButtonDataBlock();
1400 payPriceReply.ButtonData[3].PayButton = payPrice[4]; 1400 payPriceReply.ButtonData[3].PayButton = payPrice[4];
1401 1401
1402 OutPacket(payPriceReply, ThrottleOutPacketType.Task); 1402 OutPacket(payPriceReply, ThrottleOutPacketType.Task);
@@ -1448,8 +1448,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1448 // 6 to 7 items at a time, so let's stick with 6 1448 // 6 to 7 items at a time, so let's stick with 6
1449 int MAX_ITEMS_PER_PACKET = 6; 1449 int MAX_ITEMS_PER_PACKET = 6;
1450 1450
1451//Ckrinke This variable is not used, so comment out to remove the warning from the compiler (3-21-08) 1451 //Ckrinke This variable is not used, so comment out to remove the warning from the compiler (3-21-08)
1452//Ckrinke uint FULL_MASK_PERMISSIONS = 2147483647; 1452 //Ckrinke uint FULL_MASK_PERMISSIONS = 2147483647;
1453 1453
1454 if (fetchItems) 1454 if (fetchItems)
1455 { 1455 {
@@ -1576,7 +1576,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1576 descend.FolderData[i].FolderID = folder.ID; 1576 descend.FolderData[i].FolderID = folder.ID;
1577 descend.FolderData[i].Name = Helpers.StringToField(folder.Name); 1577 descend.FolderData[i].Name = Helpers.StringToField(folder.Name);
1578 descend.FolderData[i].ParentID = folder.ParentID; 1578 descend.FolderData[i].ParentID = folder.ParentID;
1579 descend.FolderData[i].Type = (sbyte) folder.Type; 1579 descend.FolderData[i].Type = (sbyte)folder.Type;
1580 1580
1581 i++; 1581 i++;
1582 count++; 1582 count++;
@@ -1902,7 +1902,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1902 { 1902 {
1903 OutPacket(BuildAgentAlertPacket(message, modal), ThrottleOutPacketType.Task); 1903 OutPacket(BuildAgentAlertPacket(message, modal), ThrottleOutPacketType.Task);
1904 } 1904 }
1905 1905
1906 /// <summary> 1906 /// <summary>
1907 /// Construct an agent alert packet 1907 /// Construct an agent alert packet
1908 /// </summary> 1908 /// </summary>
@@ -1915,7 +1915,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1915 alertPack.AgentData.AgentID = AgentId; 1915 alertPack.AgentData.AgentID = AgentId;
1916 alertPack.AlertData.Message = Helpers.StringToField(message); 1916 alertPack.AlertData.Message = Helpers.StringToField(message);
1917 alertPack.AlertData.Modal = modal; 1917 alertPack.AlertData.Modal = modal;
1918 1918
1919 return alertPack; 1919 return alertPack;
1920 } 1920 }
1921 1921
@@ -2003,13 +2003,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2003 public void SendSunPos(LLVector3 Position, LLVector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) 2003 public void SendSunPos(LLVector3 Position, LLVector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition)
2004 { 2004 {
2005 SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); 2005 SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage);
2006 viewertime.TimeInfo.SunDirection = Position; 2006 viewertime.TimeInfo.SunDirection = Position;
2007 viewertime.TimeInfo.SunAngVelocity = Velocity; 2007 viewertime.TimeInfo.SunAngVelocity = Velocity;
2008 viewertime.TimeInfo.UsecSinceStart = CurrentTime; 2008 viewertime.TimeInfo.UsecSinceStart = CurrentTime;
2009 viewertime.TimeInfo.SecPerDay = SecondsPerSunCycle; 2009 viewertime.TimeInfo.SecPerDay = SecondsPerSunCycle;
2010 viewertime.TimeInfo.SecPerYear = SecondsPerYear; 2010 viewertime.TimeInfo.SecPerYear = SecondsPerYear;
2011 viewertime.TimeInfo.SunPhase = OrbitalPosition; 2011 viewertime.TimeInfo.SunPhase = OrbitalPosition;
2012 viewertime.Header.Reliable = false; 2012 viewertime.Header.Reliable = false;
2013 viewertime.Header.Zerocoded = true; 2013 viewertime.Header.Zerocoded = true;
2014 OutPacket(viewertime, ThrottleOutPacketType.Task); 2014 OutPacket(viewertime, ThrottleOutPacketType.Task);
2015 } 2015 }
@@ -2296,7 +2296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2296 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, 2296 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel,
2297 acc, rotation, rvel, flags, 2297 acc, rotation, rvel, flags,
2298 objectID, ownerID, text, color, parentID, particleSystem, 2298 objectID, ownerID, text, color, parentID, particleSystem,
2299 clickAction, textureanim, false,(uint)0, LLUUID.Zero, LLUUID.Zero,0,0,0); 2299 clickAction, textureanim, false, (uint)0, LLUUID.Zero, LLUUID.Zero, 0, 0, 0);
2300 } 2300 }
2301 2301
2302 public void SendPrimitiveToClient( 2302 public void SendPrimitiveToClient(
@@ -2485,13 +2485,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2485 2485
2486 public void SendSimStats(Packet pack) 2486 public void SendSimStats(Packet pack)
2487 { 2487 {
2488 pack.Header.Reliable = false; 2488 pack.Header.Reliable = false;
2489 OutPacket(pack, ThrottleOutPacketType.Task); 2489 OutPacket(pack, ThrottleOutPacketType.Task);
2490 } 2490 }
2491 2491
2492 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID, 2492 public void SendObjectPropertiesFamilyData(uint RequestFlags, LLUUID ObjectUUID, LLUUID OwnerID, LLUUID GroupID,
2493 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, 2493 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
2494 uint NextOwnerMask, int OwnershipCost, byte SaleType,int SalePrice, uint Category, 2494 uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category,
2495 LLUUID LastOwnerID, string ObjectName, string Description) 2495 LLUUID LastOwnerID, string ObjectName, string Description)
2496 { 2496 {
2497 ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); 2497 ObjectPropertiesFamilyPacket objPropFamilyPack = (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily);
@@ -2621,7 +2621,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2621 continue; 2621 continue;
2622 BannedUsers[i] = bl[i].bannedUUID; 2622 BannedUsers[i] = bl[i].bannedUUID;
2623 } 2623 }
2624 2624
2625 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 2625 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
2626 packet.AgentData.TransactionID = LLUUID.Random(); 2626 packet.AgentData.TransactionID = LLUUID.Random();
2627 packet.AgentData.AgentID = this.AgentId; 2627 packet.AgentData.AgentID = this.AgentId;
@@ -2659,10 +2659,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2659 RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock(); 2659 RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock();
2660 rinfopack.AgentData.AgentID = this.AgentId; 2660 rinfopack.AgentData.AgentID = this.AgentId;
2661 rinfopack.AgentData.SessionID = this.SessionId; 2661 rinfopack.AgentData.SessionID = this.SessionId;
2662 rinfoblk.BillableFactor =args.billableFactor; 2662 rinfoblk.BillableFactor = args.billableFactor;
2663 rinfoblk.EstateID = args.estateID; 2663 rinfoblk.EstateID = args.estateID;
2664 rinfoblk.MaxAgents = args.maxAgents; 2664 rinfoblk.MaxAgents = args.maxAgents;
2665 rinfoblk.ObjectBonusFactor =args.objectBonusFactor; 2665 rinfoblk.ObjectBonusFactor = args.objectBonusFactor;
2666 rinfoblk.ParentEstateID = args.parentEstateID; 2666 rinfoblk.ParentEstateID = args.parentEstateID;
2667 rinfoblk.PricePerMeter = args.pricePerMeter; 2667 rinfoblk.PricePerMeter = args.pricePerMeter;
2668 rinfoblk.RedirectGridX = args.redirectGridX; 2668 rinfoblk.RedirectGridX = args.redirectGridX;
@@ -2741,9 +2741,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2741 this.OutPacket(packet, ThrottleOutPacketType.Task); 2741 this.OutPacket(packet, ThrottleOutPacketType.Task);
2742 } 2742 }
2743 2743
2744 public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 2744 public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
2745 { 2745 {
2746 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties); 2746 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
2747 // TODO: don't create new blocks if recycling an old packet 2747 // TODO: don't create new blocks if recycling an old packet
2748 2748
2749 updatePacket.ParcelData.AABBMax = landData.AABBMax; 2749 updatePacket.ParcelData.AABBMax = landData.AABBMax;
@@ -2755,13 +2755,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2755 updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray; 2755 updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray;
2756 2756
2757 updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc); 2757 updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc);
2758 updatePacket.ParcelData.Category = (byte) landData.category; 2758 updatePacket.ParcelData.Category = (byte)landData.category;
2759 updatePacket.ParcelData.ClaimDate = landData.claimDate; 2759 updatePacket.ParcelData.ClaimDate = landData.claimDate;
2760 updatePacket.ParcelData.ClaimPrice = landData.claimPrice; 2760 updatePacket.ParcelData.ClaimPrice = landData.claimPrice;
2761 updatePacket.ParcelData.GroupID = landData.groupID; 2761 updatePacket.ParcelData.GroupID = landData.groupID;
2762 updatePacket.ParcelData.GroupPrims = landData.groupPrims; 2762 updatePacket.ParcelData.GroupPrims = landData.groupPrims;
2763 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned; 2763 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned;
2764 updatePacket.ParcelData.LandingType = (byte) landData.landingType; 2764 updatePacket.ParcelData.LandingType = (byte)landData.landingType;
2765 updatePacket.ParcelData.LocalID = landData.localID; 2765 updatePacket.ParcelData.LocalID = landData.localID;
2766 if (landData.area > 0) 2766 if (landData.area > 0)
2767 { 2767 {
@@ -2787,13 +2787,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2787 updatePacket.ParcelData.PassPrice = landData.passPrice; 2787 updatePacket.ParcelData.PassPrice = landData.passPrice;
2788 updatePacket.ParcelData.PublicCount = 0; //unemplemented 2788 updatePacket.ParcelData.PublicCount = 0; //unemplemented
2789 2789
2790 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) > 2790 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) >
2791 0); 2791 0);
2792 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) > 2792 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) >
2793 0); 2793 0);
2794 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint) Simulator.RegionFlags.DenyTransacted) > 2794 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) >
2795 0); 2795 0);
2796 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint) Simulator.RegionFlags.RestrictPushObject) > 2796 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) >
2797 0); 2797 0);
2798 2798
2799 updatePacket.ParcelData.RentPrice = 0; 2799 updatePacket.ParcelData.RentPrice = 0;
@@ -2813,13 +2813,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2813 updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims; 2813 updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims;
2814 updatePacket.ParcelData.SnapSelection = snap_selection; 2814 updatePacket.ParcelData.SnapSelection = snap_selection;
2815 updatePacket.ParcelData.SnapshotID = landData.snapshotID; 2815 updatePacket.ParcelData.SnapshotID = landData.snapshotID;
2816 updatePacket.ParcelData.Status = (byte) landData.landStatus; 2816 updatePacket.ParcelData.Status = (byte)landData.landStatus;
2817 updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims + 2817 updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims +
2818 landData.selectedPrims; 2818 landData.selectedPrims;
2819 updatePacket.ParcelData.UserLocation = landData.userLocation; 2819 updatePacket.ParcelData.UserLocation = landData.userLocation;
2820 updatePacket.ParcelData.UserLookAt = landData.userLookAt; 2820 updatePacket.ParcelData.UserLookAt = landData.userLookAt;
2821 updatePacket.Header.Zerocoded = true; 2821 updatePacket.Header.Zerocoded = true;
2822 remote_client.OutPacket((Packet) updatePacket, ThrottleOutPacketType.Task); 2822 remote_client.OutPacket((Packet)updatePacket, ThrottleOutPacketType.Task);
2823 } 2823 }
2824 2824
2825 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID) 2825 public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)
@@ -3330,14 +3330,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3330 3330
3331 private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack) 3331 private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack)
3332 { 3332 {
3333 UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket) Pack; 3333 UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack;
3334 3334
3335 for (int i=0;i< upack.UUIDNameBlock.Length; i++) 3335 for (int i = 0; i < upack.UUIDNameBlock.Length; i++)
3336 { 3336 {
3337 handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest; 3337 handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest;
3338 if (handlerUUIDGroupNameRequest != null) 3338 if (handlerUUIDGroupNameRequest != null)
3339 { 3339 {
3340 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID,this); 3340 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this);
3341 } 3341 }
3342 } 3342 }
3343 3343
@@ -3421,7 +3421,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3421 { 3421 {
3422 return Logout(client); 3422 return Logout(client);
3423 } 3423 }
3424 3424
3425 /// <summary> 3425 /// <summary>
3426 /// 3426 ///
3427 /// </summary> 3427 /// </summary>
@@ -3754,7 +3754,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3754 m_needAck.Add(Pack.Header.Sequence, Pack); 3754 m_needAck.Add(Pack.Header.Sequence, Pack);
3755 m_unAckedBytes += Pack.ToBytes().Length; 3755 m_unAckedBytes += Pack.ToBytes().Length;
3756 } 3756 }
3757 //BUG: severity=major - This looks like a framework bug!? 3757 //BUG: severity=major - This looks like a framework bug!?
3758 catch (Exception) // HACKY 3758 catch (Exception) // HACKY
3759 { 3759 {
3760 // Ignore 3760 // Ignore
@@ -3777,7 +3777,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3777 /// <param name="Pack"></param> 3777 /// <param name="Pack"></param>
3778 protected virtual void SetPendingAcks(ref Packet Pack) 3778 protected virtual void SetPendingAcks(ref Packet Pack)
3779 { 3779 {
3780 3780
3781 lock (m_pendingAcks) 3781 lock (m_pendingAcks)
3782 { 3782 {
3783 // TODO: If we are over MAX_APPENDED_ACKS we should drain off some of these 3783 // TODO: If we are over MAX_APPENDED_ACKS we should drain off some of these
@@ -3919,7 +3919,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3919 } 3919 }
3920 } 3920 }
3921 } 3921 }
3922 3922
3923 /// <summary> 3923 /// <summary>
3924 /// The dreaded OutPacket. This should only be called from withink the ClientStack itself right now 3924 /// The dreaded OutPacket. This should only be called from withink the ClientStack itself right now
3925 /// This is the entry point for simulator packets to go out to the client. 3925 /// This is the entry point for simulator packets to go out to the client.
@@ -4127,9 +4127,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4127 uint regionX = 0; 4127 uint regionX = 0;
4128 uint regionY = 0; 4128 uint regionY = 0;
4129 try 4129 try
4130
4131 { 4130 {
4132 Helpers.LongToUInts(Scene.RegionInfo.RegionHandle,out regionX, out regionY); 4131 Helpers.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
4133 locx = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[0].Parameter)) - (float)regionX; 4132 locx = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[0].Parameter)) - (float)regionX;
4134 locy = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[1].Parameter)) - (float)regionY; 4133 locy = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[1].Parameter)) - (float)regionY;
4135 locz = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[2].Parameter)); 4134 locz = Convert.ToSingle(Helpers.FieldToUTF8String(gmParams[2].Parameter));
@@ -4149,7 +4148,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4149 4148
4150 4149
4151 break; 4150 break;
4152 default: 4151 default:
4153 m_log.Debug("[CLIENT]: Unknown Generic Message, Method: " + gmMethod + ". Invoice: " + gmInvoice.ToString() + ". Dumping Params:"); 4152 m_log.Debug("[CLIENT]: Unknown Generic Message, Method: " + gmMethod + ". Invoice: " + gmInvoice.ToString() + ". Dumping Params:");
4154 for (int hi = 0; hi < gmParams.Length; hi++) 4153 for (int hi = 0; hi < gmParams.Length; hi++)
4155 { 4154 {
@@ -4170,7 +4169,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4170 { 4169 {
4171 // always ack the packet! 4170 // always ack the packet!
4172 ack_pack(Pack); 4171 ack_pack(Pack);
4173 4172
4174 // check for duplicate packets.. packets that the client is 4173 // check for duplicate packets.. packets that the client is
4175 // resending because it didn't receive our ack 4174 // resending because it didn't receive our ack
4176 4175
@@ -4190,7 +4189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4190 m_dupeLimiter.Add(Pack.Header.Sequence, pkdedupe); 4189 m_dupeLimiter.Add(Pack.Header.Sequence, pkdedupe);
4191 } 4190 }
4192 } 4191 }
4193 4192
4194 // check if we've got a local packet handler for this packet.type. See RegisterLocalPacketHandlers() 4193 // check if we've got a local packet handler for this packet.type. See RegisterLocalPacketHandlers()
4195 if (ProcessPacketMethod(Pack)) 4194 if (ProcessPacketMethod(Pack))
4196 { 4195 {
@@ -4206,9 +4205,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4206 4205
4207 case PacketType.GenericMessage: 4206 case PacketType.GenericMessage:
4208 GenericMessagePacket gmpack = (GenericMessagePacket)Pack; 4207 GenericMessagePacket gmpack = (GenericMessagePacket)Pack;
4209 4208
4210 DecipherGenericMessage(Helpers.FieldToUTF8String(gmpack.MethodData.Method),gmpack.MethodData.Invoice,gmpack.ParamList); 4209 DecipherGenericMessage(Helpers.FieldToUTF8String(gmpack.MethodData.Method), gmpack.MethodData.Invoice, gmpack.ParamList);
4211 4210
4212 break; 4211 break;
4213 case PacketType.AvatarPropertiesRequest: 4212 case PacketType.AvatarPropertiesRequest:
4214 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; 4213 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
@@ -4511,7 +4510,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4511 handlerObjectDetach = OnObjectDetach; 4510 handlerObjectDetach = OnObjectDetach;
4512 if (handlerObjectDetach != null) 4511 if (handlerObjectDetach != null)
4513 { 4512 {
4514 handlerObjectDetach(obj,this); 4513 handlerObjectDetach(obj, this);
4515 } 4514 }
4516 4515
4517 } 4516 }
@@ -4541,18 +4540,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4541 4540
4542 AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData; 4541 AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData;
4543 AgentUpdateArgs arg = new AgentUpdateArgs(); 4542 AgentUpdateArgs arg = new AgentUpdateArgs();
4544 arg.AgentID = x.AgentID; 4543 arg.AgentID = x.AgentID;
4545 arg.BodyRotation = x.BodyRotation; 4544 arg.BodyRotation = x.BodyRotation;
4546 arg.CameraAtAxis = x.CameraAtAxis; 4545 arg.CameraAtAxis = x.CameraAtAxis;
4547 arg.CameraCenter = x.CameraCenter; 4546 arg.CameraCenter = x.CameraCenter;
4548 arg.CameraLeftAxis = x.CameraLeftAxis; 4547 arg.CameraLeftAxis = x.CameraLeftAxis;
4549 arg.CameraUpAxis = x.CameraUpAxis; 4548 arg.CameraUpAxis = x.CameraUpAxis;
4550 arg.ControlFlags = x.ControlFlags; 4549 arg.ControlFlags = x.ControlFlags;
4551 arg.Far = x.Far; 4550 arg.Far = x.Far;
4552 arg.Flags = x.Flags; 4551 arg.Flags = x.Flags;
4553 arg.HeadRotation = x.HeadRotation; 4552 arg.HeadRotation = x.HeadRotation;
4554 arg.SessionID = x.SessionID; 4553 arg.SessionID = x.SessionID;
4555 arg.State = x.State; 4554 arg.State = x.State;
4556 4555
4557 handlerAgentUpdate = OnAgentUpdate; 4556 handlerAgentUpdate = OnAgentUpdate;
4558 if (handlerAgentUpdate != null) 4557 if (handlerAgentUpdate != null)
@@ -4842,7 +4841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4842 // DEPRECATED: but till libsecondlife removes it, people will use it 4841 // DEPRECATED: but till libsecondlife removes it, people will use it
4843 ObjectPositionPacket position = (ObjectPositionPacket)Pack; 4842 ObjectPositionPacket position = (ObjectPositionPacket)Pack;
4844 4843
4845 for (int i=0; i<position.ObjectData.Length; i++) 4844 for (int i = 0; i < position.ObjectData.Length; i++)
4846 { 4845 {
4847 handlerUpdateVector = OnUpdatePrimGroupPosition; 4846 handlerUpdateVector = OnUpdatePrimGroupPosition;
4848 if (handlerUpdateVector != null) 4847 if (handlerUpdateVector != null)
@@ -4854,7 +4853,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4854 // DEPRECATED: but till libsecondlife removes it, people will use it 4853 // DEPRECATED: but till libsecondlife removes it, people will use it
4855 ObjectScalePacket scale = (ObjectScalePacket)Pack; 4854 ObjectScalePacket scale = (ObjectScalePacket)Pack;
4856 4855
4857 for (int i=0; i<scale.ObjectData.Length; i++) 4856 for (int i = 0; i < scale.ObjectData.Length; i++)
4858 { 4857 {
4859 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 4858 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
4860 if (handlerUpdatePrimGroupScale != null) 4859 if (handlerUpdatePrimGroupScale != null)
@@ -4866,7 +4865,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4866 // DEPRECATED: but till libsecondlife removes it, people will use it 4865 // DEPRECATED: but till libsecondlife removes it, people will use it
4867 ObjectRotationPacket rotation = (ObjectRotationPacket)Pack; 4866 ObjectRotationPacket rotation = (ObjectRotationPacket)Pack;
4868 4867
4869 for (int i=0; i<rotation.ObjectData.Length; i++) 4868 for (int i = 0; i < rotation.ObjectData.Length; i++)
4870 { 4869 {
4871 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 4870 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
4872 if (handlerUpdatePrimRotation != null) 4871 if (handlerUpdatePrimRotation != null)
@@ -5415,26 +5414,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5415 handlerUpdateTaskInventory = OnUpdateTaskInventory; 5414 handlerUpdateTaskInventory = OnUpdateTaskInventory;
5416 if (handlerUpdateTaskInventory != null) 5415 if (handlerUpdateTaskInventory != null)
5417 { 5416 {
5418 TaskInventoryItem newTaskItem=new TaskInventoryItem(); 5417 TaskInventoryItem newTaskItem = new TaskInventoryItem();
5419 newTaskItem.ItemID=updatetask.InventoryData.ItemID; 5418 newTaskItem.ItemID = updatetask.InventoryData.ItemID;
5420 newTaskItem.ParentID=updatetask.InventoryData.FolderID; 5419 newTaskItem.ParentID = updatetask.InventoryData.FolderID;
5421 newTaskItem.CreatorID=updatetask.InventoryData.CreatorID; 5420 newTaskItem.CreatorID = updatetask.InventoryData.CreatorID;
5422 newTaskItem.OwnerID=updatetask.InventoryData.OwnerID; 5421 newTaskItem.OwnerID = updatetask.InventoryData.OwnerID;
5423 newTaskItem.GroupID=updatetask.InventoryData.GroupID; 5422 newTaskItem.GroupID = updatetask.InventoryData.GroupID;
5424 newTaskItem.BaseMask=updatetask.InventoryData.BaseMask; 5423 newTaskItem.BaseMask = updatetask.InventoryData.BaseMask;
5425 newTaskItem.OwnerMask=updatetask.InventoryData.OwnerMask; 5424 newTaskItem.OwnerMask = updatetask.InventoryData.OwnerMask;
5426 newTaskItem.GroupMask=updatetask.InventoryData.GroupMask; 5425 newTaskItem.GroupMask = updatetask.InventoryData.GroupMask;
5427 newTaskItem.EveryoneMask=updatetask.InventoryData.EveryoneMask; 5426 newTaskItem.EveryoneMask = updatetask.InventoryData.EveryoneMask;
5428 newTaskItem.NextOwnerMask=updatetask.InventoryData.NextOwnerMask; 5427 newTaskItem.NextOwnerMask = updatetask.InventoryData.NextOwnerMask;
5429 //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; 5428 //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned;
5430 newTaskItem.Type=updatetask.InventoryData.Type; 5429 newTaskItem.Type = updatetask.InventoryData.Type;
5431 newTaskItem.InvType=updatetask.InventoryData.InvType; 5430 newTaskItem.InvType = updatetask.InventoryData.InvType;
5432 newTaskItem.Flags=updatetask.InventoryData.Flags; 5431 newTaskItem.Flags = updatetask.InventoryData.Flags;
5433 //newTaskItem.SaleType=updatetask.InventoryData.SaleType; 5432 //newTaskItem.SaleType=updatetask.InventoryData.SaleType;
5434 //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; 5433 //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;;
5435 newTaskItem.Name=Util.FieldToString(updatetask.InventoryData.Name); 5434 newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name);
5436 newTaskItem.Description=Util.FieldToString(updatetask.InventoryData.Description); 5435 newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description);
5437 newTaskItem.CreationDate=(uint)updatetask.InventoryData.CreationDate; 5436 newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate;
5438 handlerUpdateTaskInventory(this, updatetask.InventoryData.TransactionID, 5437 handlerUpdateTaskInventory(this, updatetask.InventoryData.TransactionID,
5439 newTaskItem, updatetask.UpdateData.LocalID); 5438 newTaskItem, updatetask.UpdateData.LocalID);
5440 } 5439 }
@@ -5478,25 +5477,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5478 RezScriptPacket rezScriptx = (RezScriptPacket)Pack; 5477 RezScriptPacket rezScriptx = (RezScriptPacket)Pack;
5479 5478
5480 handlerRezScript = OnRezScript; 5479 handlerRezScript = OnRezScript;
5481 InventoryItemBase item=new InventoryItemBase(); 5480 InventoryItemBase item = new InventoryItemBase();
5482 item.ID=rezScriptx.InventoryBlock.ItemID; 5481 item.ID = rezScriptx.InventoryBlock.ItemID;
5483 item.Folder=rezScriptx.InventoryBlock.FolderID; 5482 item.Folder = rezScriptx.InventoryBlock.FolderID;
5484 item.Creator=rezScriptx.InventoryBlock.CreatorID; 5483 item.Creator = rezScriptx.InventoryBlock.CreatorID;
5485 item.Owner=rezScriptx.InventoryBlock.OwnerID; 5484 item.Owner = rezScriptx.InventoryBlock.OwnerID;
5486 item.BasePermissions=rezScriptx.InventoryBlock.BaseMask; 5485 item.BasePermissions = rezScriptx.InventoryBlock.BaseMask;
5487 item.CurrentPermissions=rezScriptx.InventoryBlock.OwnerMask; 5486 item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask;
5488 item.EveryOnePermissions=rezScriptx.InventoryBlock.EveryoneMask; 5487 item.EveryOnePermissions = rezScriptx.InventoryBlock.EveryoneMask;
5489 item.NextPermissions=rezScriptx.InventoryBlock.NextOwnerMask; 5488 item.NextPermissions = rezScriptx.InventoryBlock.NextOwnerMask;
5490 item.GroupOwned=rezScriptx.InventoryBlock.GroupOwned; 5489 item.GroupOwned = rezScriptx.InventoryBlock.GroupOwned;
5491 item.GroupID=rezScriptx.InventoryBlock.GroupID; 5490 item.GroupID = rezScriptx.InventoryBlock.GroupID;
5492 item.AssetType=rezScriptx.InventoryBlock.Type; 5491 item.AssetType = rezScriptx.InventoryBlock.Type;
5493 item.InvType=rezScriptx.InventoryBlock.InvType; 5492 item.InvType = rezScriptx.InventoryBlock.InvType;
5494 item.Flags=rezScriptx.InventoryBlock.Flags; 5493 item.Flags = rezScriptx.InventoryBlock.Flags;
5495 item.SaleType=rezScriptx.InventoryBlock.SaleType; 5494 item.SaleType = rezScriptx.InventoryBlock.SaleType;
5496 item.SalePrice=rezScriptx.InventoryBlock.SalePrice; 5495 item.SalePrice = rezScriptx.InventoryBlock.SalePrice;
5497 item.Name=Util.FieldToString(rezScriptx.InventoryBlock.Name); 5496 item.Name = Util.FieldToString(rezScriptx.InventoryBlock.Name);
5498 item.Description=Util.FieldToString(rezScriptx.InventoryBlock.Description); 5497 item.Description = Util.FieldToString(rezScriptx.InventoryBlock.Description);
5499 item.CreationDate=(int)rezScriptx.InventoryBlock.CreationDate; 5498 item.CreationDate = (int)rezScriptx.InventoryBlock.CreationDate;
5500 5499
5501 if (handlerRezScript != null) 5500 if (handlerRezScript != null)
5502 { 5501 {
@@ -5564,7 +5563,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5564 handlerTeleportHomeRequest = OnTeleportHomeRequest; 5563 handlerTeleportHomeRequest = OnTeleportHomeRequest;
5565 if (handlerTeleportHomeRequest != null) 5564 if (handlerTeleportHomeRequest != null)
5566 { 5565 {
5567 handlerTeleportHomeRequest(this.AgentId,this); 5566 handlerTeleportHomeRequest(this.AgentId, this);
5568 } 5567 }
5569 break; 5568 break;
5570 } 5569 }
@@ -5781,7 +5780,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5781 handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; 5780 handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest;
5782 if (handlerParcelReturnObjectsRequest != null) 5781 if (handlerParcelReturnObjectsRequest != null)
5783 { 5782 {
5784 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID,parcelReturnObjects.ParcelData.ReturnType,puserselectedOwnerIDs,puserselectedTaskIDs, this); 5783 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this);
5785 5784
5786 } 5785 }
5787 break; 5786 break;
@@ -5805,12 +5804,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5805 case "setregioninfo": 5804 case "setregioninfo":
5806 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId)) 5805 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5807 { 5806 {
5808 OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter),convertParamStringToBool(messagePacket.ParamList[1].Parameter), 5807 OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter),
5809 convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter), 5808 convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
5810 Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter))), 5809 Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter))),
5811 (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)), 5810 (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)),
5812 Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[6].Parameter)), 5811 Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[6].Parameter)),
5813 convertParamStringToBool(messagePacket.ParamList[7].Parameter),convertParamStringToBool(messagePacket.ParamList[8].Parameter)); 5812 convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter));
5814 5813
5815 } 5814 }
5816 5815
@@ -5842,7 +5841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5842 Int16 corner = Convert.ToInt16(splitField[0]); 5841 Int16 corner = Convert.ToInt16(splitField[0]);
5843 LLUUID textureUUID = new LLUUID(splitField[1]); 5842 LLUUID textureUUID = new LLUUID(splitField[1]);
5844 5843
5845 OnSetEstateTerrainDetailTexture(this, corner,textureUUID); 5844 OnSetEstateTerrainDetailTexture(this, corner, textureUUID);
5846 } 5845 }
5847 } 5846 }
5848 } 5847 }
@@ -5861,7 +5860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5861 float lowValue = (float)Convert.ToDecimal(splitField[1]); 5860 float lowValue = (float)Convert.ToDecimal(splitField[1]);
5862 float highValue = (float)Convert.ToDecimal(splitField[2]); 5861 float highValue = (float)Convert.ToDecimal(splitField[2]);
5863 5862
5864 OnSetEstateTerrainTextureHeights(this,corner,lowValue,highValue); 5863 OnSetEstateTerrainTextureHeights(this, corner, lowValue, highValue);
5865 } 5864 }
5866 } 5865 }
5867 } 5866 }
@@ -5932,7 +5931,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5932 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId)) 5931 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
5933 { 5932 {
5934 int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter)); 5933 int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
5935 OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice,estateAccessType,new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter))); 5934 OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)));
5936 5935
5937 } 5936 }
5938 break; 5937 break;
@@ -5944,7 +5943,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5944 string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter); 5943 string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter);
5945 string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter); 5944 string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter);
5946 LLUUID sessionID = messagePacket.AgentData.SessionID; 5945 LLUUID sessionID = messagePacket.AgentData.SessionID;
5947 OnSimulatorBlueBoxMessageRequest(this,invoice,SenderID, sessionID, SenderName,Message); 5946 OnSimulatorBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message);
5948 } 5947 }
5949 break; 5948 break;
5950 case "instantmessage": 5949 case "instantmessage":
@@ -5955,7 +5954,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5955 string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter); 5954 string SenderName = Helpers.FieldToUTF8String(messagePacket.ParamList[3].Parameter);
5956 string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter); 5955 string Message = Helpers.FieldToUTF8String(messagePacket.ParamList[4].Parameter);
5957 LLUUID sessionID = messagePacket.AgentData.SessionID; 5956 LLUUID sessionID = messagePacket.AgentData.SessionID;
5958 OnEstateBlueBoxMessageRequest(this,invoice,SenderID, sessionID, SenderName,Message); 5957 OnEstateBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message);
5959 } 5958 }
5960 break; 5959 break;
5961 case "setregiondebug": 5960 case "setregiondebug":
@@ -5967,7 +5966,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5967 bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter); 5966 bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter);
5968 bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter); 5967 bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter);
5969 5968
5970 OnEstateDebugRegionRequest(this, invoice,SenderID,scripted,collisionEvents,physics); 5969 OnEstateDebugRegionRequest(this, invoice, SenderID, scripted, collisionEvents, physics);
5971 } 5970 }
5972 break; 5971 break;
5973 case "teleporthomeuser": 5972 case "teleporthomeuser":
@@ -5979,7 +5978,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5979 5978
5980 Helpers.TryParse(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter), out Prey); 5979 Helpers.TryParse(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter), out Prey);
5981 5980
5982 OnEstateTeleportOneUserHomeRequest(this,invoice,SenderID,Prey); 5981 OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey);
5983 } 5982 }
5984 break; 5983 break;
5985 case "colliders": 5984 case "colliders":
@@ -6018,7 +6017,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6018 handlerLandStatRequest = OnLandStatRequest; 6017 handlerLandStatRequest = OnLandStatRequest;
6019 if (handlerLandStatRequest != null) 6018 if (handlerLandStatRequest != null)
6020 { 6019 {
6021 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID,lsrp.RequestData.ReportType,lsrp.RequestData.RequestFlags,Helpers.FieldToUTF8String(lsrp.RequestData.Filter),this); 6020 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Helpers.FieldToUTF8String(lsrp.RequestData.Filter), this);
6022 } 6021 }
6023 //int parcelID, uint reportType, uint requestflags, string filter 6022 //int parcelID, uint reportType, uint requestflags, string filter
6024 6023
@@ -6136,6 +6135,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6136 6135
6137 #endregion 6136 #endregion
6138 6137
6138 #region Script Packets
6139
6140 case PacketType.GetScriptRunning:
6141 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
6142 handlerGetScriptRunning = OnGetScriptRunning;
6143 if (handlerGetScriptRunning != null)
6144 {
6145 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
6146 }
6147 break;
6148
6149 case PacketType.SetScriptRunning:
6150 SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack;
6151 handlerSetScriptRunning = OnSetScriptRunning;
6152 if (handlerSetScriptRunning != null)
6153 {
6154 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
6155 }
6156 break;
6157
6158 case PacketType.ScriptReset:
6159 ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack;
6160 handlerScriptReset = OnScriptReset;
6161 if (handlerScriptReset != null)
6162 {
6163 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
6164 }
6165 break;
6166
6167 #endregion
6168
6139 #region unimplemented handlers 6169 #region unimplemented handlers
6140 6170
6141 case PacketType.StartPingCheck: 6171 case PacketType.StartPingCheck:
@@ -6148,14 +6178,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6148 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client 6178 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
6149 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet"); 6179 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
6150 break; 6180 break;
6151 case PacketType.ScriptReset: 6181
6152 ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack;
6153 handlerScriptReset = OnScriptReset;
6154 if (handlerScriptReset != null)
6155 {
6156 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
6157 }
6158 break;
6159 case PacketType.ViewerStats: 6182 case PacketType.ViewerStats:
6160 // TODO: handle this packet 6183 // TODO: handle this packet
6161 m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); 6184 m_log.Warn("[CLIENT]: unhandled ViewerStats packet");
@@ -6166,9 +6189,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6166 m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet"); 6189 m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet");
6167 break; 6190 break;
6168 //case PacketType.GenericMessage: 6191 //case PacketType.GenericMessage:
6169 // TODO: handle this packet 6192 // TODO: handle this packet
6170 //m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); 6193 //m_log.Warn("[CLIENT]: unhandled GenericMessage packet");
6171 //break; 6194 //break;
6172 case PacketType.MapItemRequest: 6195 case PacketType.MapItemRequest:
6173 // TODO: handle this packet 6196 // TODO: handle this packet
6174 m_log.Warn("[CLIENT]: unhandled MapItemRequest packet"); 6197 m_log.Warn("[CLIENT]: unhandled MapItemRequest packet");
@@ -6206,22 +6229,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6206 // TODO: handle this packet 6229 // TODO: handle this packet
6207 m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); 6230 m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
6208 break; 6231 break;
6209 case PacketType.GetScriptRunning:
6210 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
6211 handlerGetScriptRunning = OnGetScriptRunning;
6212 if (handlerGetScriptRunning != null)
6213 {
6214 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
6215 }
6216 break;
6217 case PacketType.SetScriptRunning:
6218 SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack;
6219 handlerSetScriptRunning = OnSetScriptRunning;
6220 if (handlerSetScriptRunning != null)
6221 {
6222 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
6223 }
6224 break;
6225 default: 6232 default:
6226 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); 6233 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
6227 break; 6234 break;
@@ -6435,7 +6442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6435 6442
6436 public void SendAsset(AssetRequestToClient req) 6443 public void SendAsset(AssetRequestToClient req)
6437 { 6444 {
6438 6445
6439 //Console.WriteLine("sending asset " + req.RequestAssetID); 6446 //Console.WriteLine("sending asset " + req.RequestAssetID);
6440 TransferInfoPacket Transfer = new TransferInfoPacket(); 6447 TransferInfoPacket Transfer = new TransferInfoPacket();
6441 Transfer.TransferInfo.ChannelType = 2; 6448 Transfer.TransferInfo.ChannelType = 2;
@@ -6511,7 +6518,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6511 6518
6512 public void SendTexture(AssetBase TextureAsset) 6519 public void SendTexture(AssetBase TextureAsset)
6513 { 6520 {
6514 6521
6515 } 6522 }
6516 6523
6517 public ClientInfo GetClientInfo() 6524 public ClientInfo GetClientInfo()
@@ -6525,7 +6532,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6525 6532
6526 info.pendingAcks = m_pendingAcks; 6533 info.pendingAcks = m_pendingAcks;
6527 6534
6528 info.needAck = new Dictionary<uint,byte[]>(); 6535 info.needAck = new Dictionary<uint, byte[]>();
6529 6536
6530 lock (m_needAck) 6537 lock (m_needAck)
6531 { 6538 {
@@ -6535,20 +6542,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6535 } 6542 }
6536 } 6543 }
6537 6544
6538/* pending 6545 /* pending
6539 QueItem[] queitems = m_packetQueue.GetQueueArray(); 6546 QueItem[] queitems = m_packetQueue.GetQueueArray();
6540 6547
6541 MainLog.Instance.Verbose("CLIENT", "Queue Count : [{0}]", queitems.Length); 6548 MainLog.Instance.Verbose("CLIENT", "Queue Count : [{0}]", queitems.Length);
6542 6549
6543 for (int i = 0; i < queitems.Length; i++) 6550 for (int i = 0; i < queitems.Length; i++)
6544 { 6551 {
6545 if (queitems[i].Incoming == false) 6552 if (queitems[i].Incoming == false)
6546 { 6553 {
6547 info.out_packets.Add(queitems[i].Packet.ToBytes()); 6554 info.out_packets.Add(queitems[i].Packet.ToBytes());
6548 MainLog.Instance.Verbose("CLIENT", "Add OutPacket [{0}]", queitems[i].Packet.Type.ToString()); 6555 MainLog.Instance.Verbose("CLIENT", "Add OutPacket [{0}]", queitems[i].Packet.Type.ToString());
6549 } 6556 }
6550 } 6557 }
6551*/ 6558 */
6552 6559
6553 info.sequence = m_sequence; 6560 info.sequence = m_sequence;
6554 6561
@@ -6561,7 +6568,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6561 { 6568 {
6562 m_pendingAcks = info.pendingAcks; 6569 m_pendingAcks = info.pendingAcks;
6563 6570
6564 m_needAck = new Dictionary<uint,Packet>(); 6571 m_needAck = new Dictionary<uint, Packet>();
6565 6572
6566 Packet packet = null; 6573 Packet packet = null;
6567 int packetEnd = 0; 6574 int packetEnd = 0;