aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
authorMike Mazur2009-02-04 00:01:36 +0000
committerMike Mazur2009-02-04 00:01:36 +0000
commit0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch)
treea90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
parent* Add another object to the existing save oar test (diff)
downloadopensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip
opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz
opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2
opensim-SC_OLD-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs260
1 files changed, 130 insertions, 130 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 96a274c..42dbbee 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -63,9 +63,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
63 /* private variables */ 63 /* private variables */
64 private readonly UUID m_sessionId; 64 private readonly UUID m_sessionId;
65 private readonly UUID m_secureSessionId = UUID.Zero; 65 private readonly UUID m_secureSessionId = UUID.Zero;
66 66
67 private int m_debugPacketLevel; 67 private int m_debugPacketLevel;
68 68
69 private readonly AssetCache m_assetCache; 69 private readonly AssetCache m_assetCache;
70 private int m_cachedTextureSerial; 70 private int m_cachedTextureSerial;
71 private Timer m_clientPingTimer; 71 private Timer m_clientPingTimer;
@@ -355,7 +355,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
355 355
356 if (m_groupPowers.ContainsKey(groupID)) 356 if (m_groupPowers.ContainsKey(groupID))
357 return m_groupPowers[groupID]; 357 return m_groupPowers[groupID];
358 358
359 return 0; 359 return 0;
360 } 360 }
361 361
@@ -454,8 +454,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
454 m_circuitCode = circuitCode; 454 m_circuitCode = circuitCode;
455 455
456 m_userEndPoint = remoteEP; 456 m_userEndPoint = remoteEP;
457 m_proxyEndPoint = proxyEP; 457 m_proxyEndPoint = proxyEP;
458 458
459 m_firstName = sessionInfo.LoginInfo.First; 459 m_firstName = sessionInfo.LoginInfo.First;
460 m_lastName = sessionInfo.LoginInfo.Last; 460 m_lastName = sessionInfo.LoginInfo.Last;
461 m_startpos = sessionInfo.LoginInfo.StartPos; 461 m_startpos = sessionInfo.LoginInfo.StartPos;
@@ -473,7 +473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
473 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); 473 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings);
474 m_PacketHandler.SynchronizeClient = SynchronizeClient; 474 m_PacketHandler.SynchronizeClient = SynchronizeClient;
475 m_PacketHandler.OnPacketStats += PopulateStats; 475 m_PacketHandler.OnPacketStats += PopulateStats;
476 476
477 RegisterLocalPacketHandlers(); 477 RegisterLocalPacketHandlers();
478 m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface<OpenSim.Region.Environment.Interfaces.IJ2KDecoder>()); 478 m_imageManager = new LLImageManager(this, m_assetCache,Scene.RequestModuleInterface<OpenSim.Region.Environment.Interfaces.IJ2KDecoder>());
479 } 479 }
@@ -501,7 +501,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
501 // Shut down timers 501 // Shut down timers
502 m_clientPingTimer.Stop(); 502 m_clientPingTimer.Stop();
503 503
504 504
505 // This is just to give the client a reasonable chance of 505 // This is just to give the client a reasonable chance of
506 // flushing out all it's packets. There should probably 506 // flushing out all it's packets. There should probably
507 // be a better mechanism here 507 // be a better mechanism here
@@ -538,7 +538,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
538 m_log.DebugFormat( 538 m_log.DebugFormat(
539 "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}", 539 "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}",
540 shutdownCircuit, Name, m_scene.RegionInfo.RegionName); 540 shutdownCircuit, Name, m_scene.RegionInfo.RegionName);
541 541
542 m_imageManager.Close(); 542 m_imageManager.Close();
543 543
544 m_PacketHandler.Flush(); 544 m_PacketHandler.Flush();
@@ -716,14 +716,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
716 { 716 {
717 info = packet.Type.ToString(); 717 info = packet.Type.ToString();
718 } 718 }
719 719
720 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info); 720 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
721 } 721 }
722 } 722 }
723 723
724 /// <summary> 724 /// <summary>
725 /// Main packet processing loop for the UDP component of the client session. Both incoming and outgoing 725 /// Main packet processing loop for the UDP component of the client session. Both incoming and outgoing
726 /// packets are processed here. 726 /// packets are processed here.
727 /// </summary> 727 /// </summary>
728 protected virtual void ClientLoop() 728 protected virtual void ClientLoop()
729 { 729 {
@@ -733,12 +733,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
733 while (IsActive) 733 while (IsActive)
734 { 734 {
735 LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); 735 LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue();
736 736
737 if (nextPacket.Incoming) 737 if (nextPacket.Incoming)
738 { 738 {
739 DebugPacket("IN", nextPacket.Packet); 739 DebugPacket("IN", nextPacket.Packet);
740 m_PacketHandler.ProcessInPacket(nextPacket); 740 m_PacketHandler.ProcessInPacket(nextPacket);
741 } 741 }
742 else 742 else
743 { 743 {
744 DebugPacket("OUT", nextPacket.Packet); 744 DebugPacket("OUT", nextPacket.Packet);
@@ -821,14 +821,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
821 m_clientThread.Name = "ClientThread"; 821 m_clientThread.Name = "ClientThread";
822 m_clientThread.IsBackground = true; 822 m_clientThread.IsBackground = true;
823 m_clientThread.Start(); 823 m_clientThread.Start();
824 ThreadTracker.Add(m_clientThread); 824 ThreadTracker.Add(m_clientThread);
825 } 825 }
826 826
827 /// <summary> 827 /// <summary>
828 /// Run a user session. This method lies at the base of the entire client thread. 828 /// Run a user session. This method lies at the base of the entire client thread.
829 /// </summary> 829 /// </summary>
830 protected virtual void RunUserSession() 830 protected virtual void RunUserSession()
831 { 831 {
832 //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) 832 //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US)
833 //otherwise it will override this and use the system default 833 //otherwise it will override this and use the system default
834 Culture.SetCurrentCulture(); 834 Culture.SetCurrentCulture();
@@ -838,7 +838,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
838 // This sets up all the timers 838 // This sets up all the timers
839 InitNewClient(); 839 InitNewClient();
840 ClientLoop(); 840 ClientLoop();
841 } 841 }
842 catch (Exception e) 842 catch (Exception e)
843 { 843 {
844 if (e is ThreadAbortException) 844 if (e is ThreadAbortException)
@@ -1065,7 +1065,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1065 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 1065 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
1066 public event ClassifiedDelete OnClassifiedDelete; 1066 public event ClassifiedDelete OnClassifiedDelete;
1067 public event ClassifiedDelete OnClassifiedGodDelete; 1067 public event ClassifiedDelete OnClassifiedGodDelete;
1068 1068
1069 public event EventNotificationAddRequest OnEventNotificationAddRequest; 1069 public event EventNotificationAddRequest OnEventNotificationAddRequest;
1070 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 1070 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
1071 public event EventGodDelete OnEventGodDelete; 1071 public event EventGodDelete OnEventGodDelete;
@@ -1078,14 +1078,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1078 public void ActivateGesture(UUID assetId, UUID gestureId) 1078 public void ActivateGesture(UUID assetId, UUID gestureId)
1079 { 1079 {
1080 } 1080 }
1081 1081
1082 public void DeactivateGesture(UUID assetId, UUID gestureId) 1082 public void DeactivateGesture(UUID assetId, UUID gestureId)
1083 { 1083 {
1084 } 1084 }
1085 1085
1086 // Sound 1086 // Sound
1087 public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid,UUID ParentId,float Gain, Vector3 Position,UInt64 Handle) 1087 public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid,UUID ParentId,float Gain, Vector3 Position,UInt64 Handle)
1088 { 1088 {
1089 } 1089 }
1090 1090
1091 #region Scene/Avatar to Client 1091 #region Scene/Avatar to Client
@@ -1330,7 +1330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1330 1330
1331 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(map, patches); 1331 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(map, patches);
1332 layerpack.Header.Zerocoded = true; 1332 layerpack.Header.Zerocoded = true;
1333 1333
1334 OutPacket(layerpack, ThrottleOutPacketType.Land); 1334 OutPacket(layerpack, ThrottleOutPacketType.Land);
1335 1335
1336 } 1336 }
@@ -1410,11 +1410,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1410 agentData.child = false; 1410 agentData.child = false;
1411 agentData.firstname = m_firstName; 1411 agentData.firstname = m_firstName;
1412 agentData.lastname = m_lastName; 1412 agentData.lastname = m_lastName;
1413 1413
1414 ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>(); 1414 ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>();
1415 agentData.CapsPath = capsModule.GetCapsPath(m_agentId); 1415 agentData.CapsPath = capsModule.GetCapsPath(m_agentId);
1416 agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId)); 1416 agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId));
1417 1417
1418 return agentData; 1418 return agentData;
1419 } 1419 }
1420 1420
@@ -1852,21 +1852,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1852 inventoryReply.Header.Zerocoded = true; 1852 inventoryReply.Header.Zerocoded = true;
1853 OutPacket(inventoryReply, ThrottleOutPacketType.Asset); 1853 OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
1854 } 1854 }
1855 1855
1856 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryFolderBase)</see> 1856 /// <see>IClientAPI.SendBulkUpdateInventory(InventoryFolderBase)</see>
1857 public void SendBulkUpdateInventory(InventoryFolderBase folderBase) 1857 public void SendBulkUpdateInventory(InventoryFolderBase folderBase)
1858 { 1858 {
1859 // XXX: Nasty temporary move that will be resolved shortly 1859 // XXX: Nasty temporary move that will be resolved shortly
1860 InventoryFolderImpl folder = (InventoryFolderImpl)folderBase; 1860 InventoryFolderImpl folder = (InventoryFolderImpl)folderBase;
1861 1861
1862 // We will use the same transaction id for all the separate packets to be sent out in this update. 1862 // We will use the same transaction id for all the separate packets to be sent out in this update.
1863 UUID transactionId = UUID.Random(); 1863 UUID transactionId = UUID.Random();
1864 1864
1865 List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks 1865 List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks
1866 = new List<BulkUpdateInventoryPacket.FolderDataBlock>(); 1866 = new List<BulkUpdateInventoryPacket.FolderDataBlock>();
1867 1867
1868 SendBulkUpdateInventoryRecursive(folder, ref folderDataBlocks, transactionId); 1868 SendBulkUpdateInventoryRecursive(folder, ref folderDataBlocks, transactionId);
1869 1869
1870 if (folderDataBlocks.Count > 0) 1870 if (folderDataBlocks.Count > 0)
1871 { 1871 {
1872 // We'll end up with some unsent folder blocks if there were some empty folders at the end of the list 1872 // We'll end up with some unsent folder blocks if there were some empty folders at the end of the list
@@ -1874,16 +1874,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1874 BulkUpdateInventoryPacket bulkUpdate 1874 BulkUpdateInventoryPacket bulkUpdate
1875 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); 1875 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory);
1876 bulkUpdate.Header.Zerocoded = true; 1876 bulkUpdate.Header.Zerocoded = true;
1877 1877
1878 bulkUpdate.AgentData.AgentID = AgentId; 1878 bulkUpdate.AgentData.AgentID = AgentId;
1879 bulkUpdate.AgentData.TransactionID = transactionId; 1879 bulkUpdate.AgentData.TransactionID = transactionId;
1880 bulkUpdate.FolderData = folderDataBlocks.ToArray(); 1880 bulkUpdate.FolderData = folderDataBlocks.ToArray();
1881 1881
1882 //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate); 1882 //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate);
1883 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); 1883 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset);
1884 } 1884 }
1885 } 1885 }
1886 1886
1887 /// <summary> 1887 /// <summary>
1888 /// Recursively construct bulk update packets to send folders and items 1888 /// Recursively construct bulk update packets to send folders and items
1889 /// </summary> 1889 /// </summary>
@@ -1891,11 +1891,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1891 /// <param name="folderDataBlocks"></param> 1891 /// <param name="folderDataBlocks"></param>
1892 /// <param name="transactionId"></param> 1892 /// <param name="transactionId"></param>
1893 private void SendBulkUpdateInventoryRecursive( 1893 private void SendBulkUpdateInventoryRecursive(
1894 InventoryFolderImpl folder, ref List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks, 1894 InventoryFolderImpl folder, ref List<BulkUpdateInventoryPacket.FolderDataBlock> folderDataBlocks,
1895 UUID transactionId) 1895 UUID transactionId)
1896 { 1896 {
1897 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder)); 1897 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder));
1898 1898
1899 const int MAX_ITEMS_PER_PACKET = 5; 1899 const int MAX_ITEMS_PER_PACKET = 5;
1900 1900
1901 // If there are any items then we have to start sending them off in this packet - the next folder will have 1901 // If there are any items then we have to start sending them off in this packet - the next folder will have
@@ -1909,10 +1909,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1909 bulkUpdate.Header.Zerocoded = true; 1909 bulkUpdate.Header.Zerocoded = true;
1910 1910
1911 bulkUpdate.AgentData.AgentID = AgentId; 1911 bulkUpdate.AgentData.AgentID = AgentId;
1912 bulkUpdate.AgentData.TransactionID = transactionId; 1912 bulkUpdate.AgentData.TransactionID = transactionId;
1913 bulkUpdate.FolderData = folderDataBlocks.ToArray(); 1913 bulkUpdate.FolderData = folderDataBlocks.ToArray();
1914 1914
1915 int itemsToSend = (items.Count > MAX_ITEMS_PER_PACKET ? MAX_ITEMS_PER_PACKET : items.Count); 1915 int itemsToSend = (items.Count > MAX_ITEMS_PER_PACKET ? MAX_ITEMS_PER_PACKET : items.Count);
1916 bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[itemsToSend]; 1916 bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[itemsToSend];
1917 1917
1918 for (int i = 0; i < itemsToSend; i++) 1918 for (int i = 0; i < itemsToSend; i++)
@@ -1921,51 +1921,51 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1921 bulkUpdate.ItemData[i] = GenerateBulkUpdateItemDataBlock(items[items.Count - 1]); 1921 bulkUpdate.ItemData[i] = GenerateBulkUpdateItemDataBlock(items[items.Count - 1]);
1922 items.RemoveAt(items.Count - 1); 1922 items.RemoveAt(items.Count - 1);
1923 } 1923 }
1924 1924
1925 //Console.WriteLine("SendBulkUpdateInventoryRecursive :" + bulkUpdate); 1925 //Console.WriteLine("SendBulkUpdateInventoryRecursive :" + bulkUpdate);
1926 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); 1926 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset);
1927 1927
1928 folderDataBlocks = new List<BulkUpdateInventoryPacket.FolderDataBlock>(); 1928 folderDataBlocks = new List<BulkUpdateInventoryPacket.FolderDataBlock>();
1929 1929
1930 // If we're going to be sending another items packet then it needs to contain just the folder to which those 1930 // If we're going to be sending another items packet then it needs to contain just the folder to which those
1931 // items belong. 1931 // items belong.
1932 if (items.Count > 0) 1932 if (items.Count > 0)
1933 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder)); 1933 folderDataBlocks.Add(GenerateBulkUpdateFolderDataBlock(folder));
1934 } 1934 }
1935 1935
1936 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); 1936 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls();
1937 foreach (InventoryFolderImpl subFolder in subFolders) 1937 foreach (InventoryFolderImpl subFolder in subFolders)
1938 { 1938 {
1939 SendBulkUpdateInventoryRecursive(subFolder, ref folderDataBlocks, transactionId); 1939 SendBulkUpdateInventoryRecursive(subFolder, ref folderDataBlocks, transactionId);
1940 } 1940 }
1941 } 1941 }
1942 1942
1943 /// <summary> 1943 /// <summary>
1944 /// Generate a bulk update inventory data block for the given folder 1944 /// Generate a bulk update inventory data block for the given folder
1945 /// </summary> 1945 /// </summary>
1946 /// <param name="folder"></param> 1946 /// <param name="folder"></param>
1947 /// <returns></returns> 1947 /// <returns></returns>
1948 private BulkUpdateInventoryPacket.FolderDataBlock GenerateBulkUpdateFolderDataBlock(InventoryFolderBase folder) 1948 private BulkUpdateInventoryPacket.FolderDataBlock GenerateBulkUpdateFolderDataBlock(InventoryFolderBase folder)
1949 { 1949 {
1950 BulkUpdateInventoryPacket.FolderDataBlock folderBlock = new BulkUpdateInventoryPacket.FolderDataBlock(); 1950 BulkUpdateInventoryPacket.FolderDataBlock folderBlock = new BulkUpdateInventoryPacket.FolderDataBlock();
1951 1951
1952 folderBlock.FolderID = folder.ID; 1952 folderBlock.FolderID = folder.ID;
1953 folderBlock.ParentID = folder.ParentID; 1953 folderBlock.ParentID = folder.ParentID;
1954 folderBlock.Type = -1; 1954 folderBlock.Type = -1;
1955 folderBlock.Name = Utils.StringToBytes(folder.Name); 1955 folderBlock.Name = Utils.StringToBytes(folder.Name);
1956 1956
1957 return folderBlock; 1957 return folderBlock;
1958 } 1958 }
1959 1959
1960 /// <summary> 1960 /// <summary>
1961 /// Generate a bulk update inventory data block for the given item 1961 /// Generate a bulk update inventory data block for the given item
1962 /// </summary> 1962 /// </summary>
1963 /// <param name="item"></param> 1963 /// <param name="item"></param>
1964 /// <returns></returns> 1964 /// <returns></returns>
1965 private BulkUpdateInventoryPacket.ItemDataBlock GenerateBulkUpdateItemDataBlock(InventoryItemBase item) 1965 private BulkUpdateInventoryPacket.ItemDataBlock GenerateBulkUpdateItemDataBlock(InventoryItemBase item)
1966 { 1966 {
1967 BulkUpdateInventoryPacket.ItemDataBlock itemBlock = new BulkUpdateInventoryPacket.ItemDataBlock(); 1967 BulkUpdateInventoryPacket.ItemDataBlock itemBlock = new BulkUpdateInventoryPacket.ItemDataBlock();
1968 1968
1969 itemBlock.ItemID = item.ID; 1969 itemBlock.ItemID = item.ID;
1970 itemBlock.AssetID = item.AssetID; 1970 itemBlock.AssetID = item.AssetID;
1971 itemBlock.CreatorID = item.Creator; 1971 itemBlock.CreatorID = item.Creator;
@@ -1996,7 +1996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1996 itemBlock.ItemID, itemBlock.FolderID, 1996 itemBlock.ItemID, itemBlock.FolderID,
1997 (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All, 1997 (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All,
1998 (uint)PermissionMask.All); 1998 (uint)PermissionMask.All);
1999 1999
2000 return itemBlock; 2000 return itemBlock;
2001 } 2001 }
2002 2002
@@ -2396,17 +2396,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2396 OutPacket(viewertime, ThrottleOutPacketType.Task); 2396 OutPacket(viewertime, ThrottleOutPacketType.Task);
2397 */ 2397 */
2398 } 2398 }
2399 2399
2400 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) 2400 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
2401 { 2401 {
2402 ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); 2402 ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect);
2403 packet.Effect = effectBlocks; 2403 packet.Effect = effectBlocks;
2404 2404
2405 packet.AgentData.AgentID = AgentId; 2405 packet.AgentData.AgentID = AgentId;
2406 packet.AgentData.SessionID = SessionId; 2406 packet.AgentData.SessionID = SessionId;
2407 packet.Header.Reliable = false; 2407 packet.Header.Reliable = false;
2408 packet.Header.Zerocoded = true; 2408 packet.Header.Zerocoded = true;
2409 OutPacket(packet, ThrottleOutPacketType.Task); 2409 OutPacket(packet, ThrottleOutPacketType.Task);
2410 } 2410 }
2411 2411
2412 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, 2412 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
@@ -2439,7 +2439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2439 // Gesture 2439 // Gesture
2440 2440
2441 #region Appearance/ Wearables Methods 2441 #region Appearance/ Wearables Methods
2442 2442
2443 public void SendWearables(AvatarWearable[] wearables, int serial) 2443 public void SendWearables(AvatarWearable[] wearables, int serial)
2444 { 2444 {
2445 AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); 2445 AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate);
@@ -2457,9 +2457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2457 awb.AssetID = wearables[i].AssetID; 2457 awb.AssetID = wearables[i].AssetID;
2458 awb.ItemID = wearables[i].ItemID; 2458 awb.ItemID = wearables[i].ItemID;
2459 aw.WearableData[i] = awb; 2459 aw.WearableData[i] = awb;
2460 2460
2461// m_log.DebugFormat( 2461// m_log.DebugFormat(
2462// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", 2462// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
2463// awb.ItemID, awb.AssetID, i, Name); 2463// awb.ItemID, awb.AssetID, i, Name);
2464 } 2464 }
2465 2465
@@ -2489,7 +2489,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2489 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId) 2489 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId)
2490 { 2490 {
2491 //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name); 2491 //m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name);
2492 2492
2493 AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); 2493 AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation);
2494 // TODO: don't create new blocks if recycling an old packet 2494 // TODO: don't create new blocks if recycling an old packet
2495 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; 2495 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1];
@@ -2546,16 +2546,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2546 2546
2547 /// <summary> 2547 /// <summary>
2548 /// Send a terse positional/rotation/velocity update about an avatar to the client. This avatar can be that of 2548 /// Send a terse positional/rotation/velocity update about an avatar to the client. This avatar can be that of
2549 /// the client itself. 2549 /// the client itself.
2550 /// </summary> 2550 /// </summary>
2551 public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, 2551 public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position,
2552 Vector3 velocity, Quaternion rotation) 2552 Vector3 velocity, Quaternion rotation)
2553 { 2553 {
2554 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) 2554 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0)
2555 rotation = Quaternion.Identity; 2555 rotation = Quaternion.Identity;
2556 2556
2557 //m_log.DebugFormat("[CLIENT]: Sending rotation {0} for {1} to {2}", rotation, localID, Name); 2557 //m_log.DebugFormat("[CLIENT]: Sending rotation {0} for {1} to {2}", rotation, localID, Name);
2558 2558
2559 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = 2559 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock =
2560 CreateAvatarImprovedBlock(localID, position, velocity, rotation); 2560 CreateAvatarImprovedBlock(localID, position, velocity, rotation);
2561 ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); 2561 ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
@@ -2567,7 +2567,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2567 2567
2568 terse.Header.Reliable = false; 2568 terse.Header.Reliable = false;
2569 terse.Header.Zerocoded = true; 2569 terse.Header.Zerocoded = true;
2570 2570
2571 OutPacket(terse, ThrottleOutPacketType.Task); 2571 OutPacket(terse, ThrottleOutPacketType.Task);
2572 } 2572 }
2573 2573
@@ -2593,7 +2593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2593 loc.Index = ib; 2593 loc.Index = ib;
2594 loc.Header.Reliable = false; 2594 loc.Header.Reliable = false;
2595 loc.Header.Zerocoded = true; 2595 loc.Header.Zerocoded = true;
2596 2596
2597 OutPacket(loc, ThrottleOutPacketType.Task); 2597 OutPacket(loc, ThrottleOutPacketType.Task);
2598 } 2598 }
2599 2599
@@ -2808,7 +2808,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2808 im.Header.Zerocoded = true; 2808 im.Header.Zerocoded = true;
2809 OutPacket(im, ThrottleOutPacketType.Texture); 2809 OutPacket(im, ThrottleOutPacketType.Texture);
2810 } 2810 }
2811 2811
2812 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) 2812 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
2813 { 2813 {
2814 ImagePacketPacket im = new ImagePacketPacket(); 2814 ImagePacketPacket im = new ImagePacketPacket();
@@ -2816,13 +2816,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2816 im.ImageID.Packet = partNumber; 2816 im.ImageID.Packet = partNumber;
2817 im.ImageID.ID = imageUuid; 2817 im.ImageID.ID = imageUuid;
2818 im.ImageData.Data = imageData; 2818 im.ImageData.Data = imageData;
2819 2819
2820 OutPacket(im, ThrottleOutPacketType.Texture); 2820 OutPacket(im, ThrottleOutPacketType.Texture);
2821 } 2821 }
2822 2822
2823 public void SendImageNotFound(UUID imageid) 2823 public void SendImageNotFound(UUID imageid)
2824 { 2824 {
2825 ImageNotInDatabasePacket notFoundPacket 2825 ImageNotInDatabasePacket notFoundPacket
2826 = (ImageNotInDatabasePacket)PacketPool.Instance.GetPacket(PacketType.ImageNotInDatabase); 2826 = (ImageNotInDatabasePacket)PacketPool.Instance.GetPacket(PacketType.ImageNotInDatabase);
2827 2827
2828 notFoundPacket.ImageID.ID = imageid; 2828 notFoundPacket.ImageID.ID = imageid;
@@ -2845,9 +2845,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2845 pack.Region.ObjectCapacity = stats.ObjectCapacity; 2845 pack.Region.ObjectCapacity = stats.ObjectCapacity;
2846 //pack.Region = //stats.RegionBlock; 2846 //pack.Region = //stats.RegionBlock;
2847 pack.Stat = stats.StatsBlock; 2847 pack.Stat = stats.StatsBlock;
2848 2848
2849 pack.Header.Reliable = false; 2849 pack.Header.Reliable = false;
2850 2850
2851 OutPacket(pack, ThrottleOutPacketType.Task); 2851 OutPacket(pack, ThrottleOutPacketType.Task);
2852 } 2852 }
2853 2853
@@ -3129,7 +3129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3129 updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; 3129 updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned;
3130 updatePacket.ParcelData.LandingType = landData.LandingType; 3130 updatePacket.ParcelData.LandingType = landData.LandingType;
3131 updatePacket.ParcelData.LocalID = landData.LocalID; 3131 updatePacket.ParcelData.LocalID = landData.LocalID;
3132 3132
3133 if (landData.Area > 0) 3133 if (landData.Area > 0)
3134 { 3134 {
3135 updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; 3135 updatePacket.ParcelData.MaxPrims = parcelObjectCapacity;
@@ -3138,10 +3138,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3138 { 3138 {
3139 updatePacket.ParcelData.MaxPrims = 0; 3139 updatePacket.ParcelData.MaxPrims = 0;
3140 } 3140 }
3141 3141
3142 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 3142 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale;
3143 updatePacket.ParcelData.MediaID = landData.MediaID; 3143 updatePacket.ParcelData.MediaID = landData.MediaID;
3144 updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL); 3144 updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL);
3145 updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL); 3145 updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL);
3146 updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name); 3146 updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name);
3147 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 3147 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime;
@@ -4162,7 +4162,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4162 4162
4163 /// <summary> 4163 /// <summary>
4164 /// This is the starting point for sending a simulator packet out to the client. 4164 /// This is the starting point for sending a simulator packet out to the client.
4165 /// 4165 ///
4166 /// Please do not call this from outside the LindenUDP client stack. 4166 /// Please do not call this from outside the LindenUDP client stack.
4167 /// </summary> 4167 /// </summary>
4168 /// <param name="NewPack"></param> 4168 /// <param name="NewPack"></param>
@@ -4244,13 +4244,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4244 if (ProcessPacketMethod(Pack)) 4244 if (ProcessPacketMethod(Pack))
4245 { 4245 {
4246 //there is a handler registered that handled this packet type 4246 //there is a handler registered that handled this packet type
4247 4247
4248 // in the end, we dereference this, so we have to check if it's null 4248 // in the end, we dereference this, so we have to check if it's null
4249 if (m_imageManager != null) 4249 if (m_imageManager != null)
4250 m_imageManager.ProcessImageQueue(3); 4250 m_imageManager.ProcessImageQueue(3);
4251 return; 4251 return;
4252 } 4252 }
4253 4253
4254 // Main packet processing conditional 4254 // Main packet processing conditional
4255 switch (Pack.Type) 4255 switch (Pack.Type)
4256 { 4256 {
@@ -4266,7 +4266,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4266 } 4266 }
4267 4267
4268 break; 4268 break;
4269 4269
4270 case PacketType.ChatFromViewer: 4270 case PacketType.ChatFromViewer:
4271 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; 4271 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
4272 4272
@@ -4296,7 +4296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4296 handlerChatFromClient(this, args); 4296 handlerChatFromClient(this, args);
4297 } 4297 }
4298 break; 4298 break;
4299 4299
4300 case PacketType.AvatarPropertiesUpdate: 4300 case PacketType.AvatarPropertiesUpdate:
4301 AvatarPropertiesUpdatePacket Packet = (AvatarPropertiesUpdatePacket)Pack; 4301 AvatarPropertiesUpdatePacket Packet = (AvatarPropertiesUpdatePacket)Pack;
4302 4302
@@ -4335,7 +4335,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4335 } 4335 }
4336 4336
4337 break; 4337 break;
4338 4338
4339 case PacketType.ImprovedInstantMessage: 4339 case PacketType.ImprovedInstantMessage:
4340 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; 4340 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
4341 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 4341 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
@@ -4383,7 +4383,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4383 4383
4384 case PacketType.DeclineFriendship: 4384 case PacketType.DeclineFriendship:
4385 DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack; 4385 DeclineFriendshipPacket dfriendpack = (DeclineFriendshipPacket)Pack;
4386 4386
4387 if (OnDenyFriendRequest != null) 4387 if (OnDenyFriendRequest != null)
4388 { 4388 {
4389 OnDenyFriendRequest(this, 4389 OnDenyFriendRequest(this,
@@ -4391,7 +4391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4391 dfriendpack.TransactionBlock.TransactionID, 4391 dfriendpack.TransactionBlock.TransactionID,
4392 null); 4392 null);
4393 } 4393 }
4394 break; 4394 break;
4395 4395
4396 case PacketType.TerminateFriendship: 4396 case PacketType.TerminateFriendship:
4397 TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack; 4397 TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack;
@@ -4404,7 +4404,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4404 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 4404 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
4405 } 4405 }
4406 break; 4406 break;
4407 4407
4408 case PacketType.RezObject: 4408 case PacketType.RezObject:
4409 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 4409 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
4410 4410
@@ -4418,8 +4418,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4418 rezPacket.RezData.FromTaskID); 4418 rezPacket.RezData.FromTaskID);
4419 } 4419 }
4420 break; 4420 break;
4421 4421
4422 case PacketType.DeRezObject: 4422 case PacketType.DeRezObject:
4423 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) Pack; 4423 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) Pack;
4424 handlerDeRezObject = OnDeRezObject; 4424 handlerDeRezObject = OnDeRezObject;
4425 if (handlerDeRezObject != null) 4425 if (handlerDeRezObject != null)
@@ -4427,8 +4427,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4427 foreach (DeRezObjectPacket.ObjectDataBlock data in 4427 foreach (DeRezObjectPacket.ObjectDataBlock data in
4428 DeRezPacket.ObjectData) 4428 DeRezPacket.ObjectData)
4429 { 4429 {
4430 // It just so happens that the values on the DeRezAction enumerator match the Destination 4430 // It just so happens that the values on the DeRezAction enumerator match the Destination
4431 // values given by a Second Life client 4431 // values given by a Second Life client
4432 handlerDeRezObject(this, data.ObjectLocalID, 4432 handlerDeRezObject(this, data.ObjectLocalID,
4433 DeRezPacket.AgentBlock.GroupID, 4433 DeRezPacket.AgentBlock.GroupID,
4434 (DeRezAction)DeRezPacket.AgentBlock.Destination, 4434 (DeRezAction)DeRezPacket.AgentBlock.Destination,
@@ -4436,7 +4436,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4436 } 4436 }
4437 } 4437 }
4438 break; 4438 break;
4439 4439
4440 case PacketType.ModifyLand: 4440 case PacketType.ModifyLand:
4441 ModifyLandPacket modify = (ModifyLandPacket)Pack; 4441 ModifyLandPacket modify = (ModifyLandPacket)Pack;
4442 //m_log.Info("[LAND]: LAND:" + modify.ToString()); 4442 //m_log.Info("[LAND]: LAND:" + modify.ToString());
@@ -4461,7 +4461,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4461 } 4461 }
4462 4462
4463 break; 4463 break;
4464 4464
4465 case PacketType.RegionHandshakeReply: 4465 case PacketType.RegionHandshakeReply:
4466 4466
4467 handlerRegionHandShakeReply = OnRegionHandShakeReply; 4467 handlerRegionHandShakeReply = OnRegionHandShakeReply;
@@ -4471,7 +4471,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4471 } 4471 }
4472 4472
4473 break; 4473 break;
4474 4474
4475 case PacketType.AgentWearablesRequest: 4475 case PacketType.AgentWearablesRequest:
4476 handlerRequestWearables = OnRequestWearables; 4476 handlerRequestWearables = OnRequestWearables;
4477 4477
@@ -4488,7 +4488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4488 } 4488 }
4489 4489
4490 break; 4490 break;
4491 4491
4492 case PacketType.AgentSetAppearance: 4492 case PacketType.AgentSetAppearance:
4493 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; 4493 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
4494 4494
@@ -4537,7 +4537,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4537 } 4537 }
4538 } 4538 }
4539 break; 4539 break;
4540 4540
4541 case PacketType.RezSingleAttachmentFromInv: 4541 case PacketType.RezSingleAttachmentFromInv:
4542 handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; 4542 handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
4543 if (handlerRezSingleAttachment != null) 4543 if (handlerRezSingleAttachment != null)
@@ -4548,7 +4548,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4548 } 4548 }
4549 4549
4550 break; 4550 break;
4551 4551
4552 case PacketType.DetachAttachmentIntoInv: 4552 case PacketType.DetachAttachmentIntoInv:
4553 handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; 4553 handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
4554 if (handlerDetachAttachmentIntoInv != null) 4554 if (handlerDetachAttachmentIntoInv != null)
@@ -4561,7 +4561,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4561 handlerDetachAttachmentIntoInv(itemID, this); 4561 handlerDetachAttachmentIntoInv(itemID, this);
4562 } 4562 }
4563 break; 4563 break;
4564 4564
4565 case PacketType.ObjectAttach: 4565 case PacketType.ObjectAttach:
4566 if (OnObjectAttach != null) 4566 if (OnObjectAttach != null)
4567 { 4567 {
@@ -4578,7 +4578,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4578 } 4578 }
4579 } 4579 }
4580 break; 4580 break;
4581 4581
4582 case PacketType.ObjectDetach: 4582 case PacketType.ObjectDetach:
4583 ObjectDetachPacket dett = (ObjectDetachPacket)Pack; 4583 ObjectDetachPacket dett = (ObjectDetachPacket)Pack;
4584 for (int j = 0; j < dett.ObjectData.Length; j++) 4584 for (int j = 0; j < dett.ObjectData.Length; j++)
@@ -4592,7 +4592,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4592 4592
4593 } 4593 }
4594 break; 4594 break;
4595 4595
4596 case PacketType.ObjectDrop: 4596 case PacketType.ObjectDrop:
4597 ObjectDropPacket dropp = (ObjectDropPacket)Pack; 4597 ObjectDropPacket dropp = (ObjectDropPacket)Pack;
4598 for (int j = 0; j < dropp.ObjectData.Length; j++) 4598 for (int j = 0; j < dropp.ObjectData.Length; j++)
@@ -4605,7 +4605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4605 } 4605 }
4606 } 4606 }
4607 break; 4607 break;
4608 4608
4609 case PacketType.SetAlwaysRun: 4609 case PacketType.SetAlwaysRun:
4610 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; 4610 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
4611 4611
@@ -4614,7 +4614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4614 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); 4614 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun);
4615 4615
4616 break; 4616 break;
4617 4617
4618 case PacketType.CompleteAgentMovement: 4618 case PacketType.CompleteAgentMovement:
4619 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 4619 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
4620 if (handlerCompleteMovementToRegion != null) 4620 if (handlerCompleteMovementToRegion != null)
@@ -4624,7 +4624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4624 handlerCompleteMovementToRegion = null; 4624 handlerCompleteMovementToRegion = null;
4625 4625
4626 break; 4626 break;
4627 4627
4628 case PacketType.AgentUpdate: 4628 case PacketType.AgentUpdate:
4629 if (OnAgentUpdate != null) 4629 if (OnAgentUpdate != null)
4630 { 4630 {
@@ -4653,7 +4653,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4653 //agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotationa); 4653 //agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotationa);
4654 } 4654 }
4655 break; 4655 break;
4656 4656
4657 case PacketType.AgentAnimation: 4657 case PacketType.AgentAnimation:
4658 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; 4658 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
4659 4659
@@ -4680,7 +4680,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4680 } 4680 }
4681 } 4681 }
4682 break; 4682 break;
4683 4683
4684 case PacketType.AgentRequestSit: 4684 case PacketType.AgentRequestSit:
4685 if (OnAgentRequestSit != null) 4685 if (OnAgentRequestSit != null)
4686 { 4686 {
@@ -4692,7 +4692,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4692 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); 4692 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
4693 } 4693 }
4694 break; 4694 break;
4695 4695
4696 case PacketType.AgentSit: 4696 case PacketType.AgentSit:
4697 if (OnAgentSit != null) 4697 if (OnAgentSit != null)
4698 { 4698 {
@@ -4705,7 +4705,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4705 } 4705 }
4706 } 4706 }
4707 break; 4707 break;
4708 4708
4709 case PacketType.SoundTrigger: 4709 case PacketType.SoundTrigger:
4710 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; 4710 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack;
4711 handlerSoundTrigger = OnSoundTrigger; 4711 handlerSoundTrigger = OnSoundTrigger;
@@ -4718,7 +4718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4718 4718
4719 } 4719 }
4720 break; 4720 break;
4721 4721
4722 case PacketType.AvatarPickerRequest: 4722 case PacketType.AvatarPickerRequest:
4723 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; 4723 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack;
4724 AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; 4724 AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData;
@@ -4732,7 +4732,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4732 Utils.BytesToString(querydata.Name)); 4732 Utils.BytesToString(querydata.Name));
4733 } 4733 }
4734 break; 4734 break;
4735 4735
4736 case PacketType.AgentDataUpdateRequest: 4736 case PacketType.AgentDataUpdateRequest:
4737 AgentDataUpdateRequestPacket avRequestDataUpdatePacket = (AgentDataUpdateRequestPacket)Pack; 4737 AgentDataUpdateRequestPacket avRequestDataUpdatePacket = (AgentDataUpdateRequestPacket)Pack;
4738 4738
@@ -5108,10 +5108,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5108 break; 5108 break;
5109 case PacketType.ObjectName: 5109 case PacketType.ObjectName:
5110 ObjectNamePacket objName = (ObjectNamePacket)Pack; 5110 ObjectNamePacket objName = (ObjectNamePacket)Pack;
5111 5111
5112 handlerObjectName = null; 5112 handlerObjectName = null;
5113 for (int i = 0; i < objName.ObjectData.Length; i++) 5113 for (int i = 0; i < objName.ObjectData.Length; i++)
5114 { 5114 {
5115 handlerObjectName = OnObjectName; 5115 handlerObjectName = OnObjectName;
5116 if (handlerObjectName != null) 5116 if (handlerObjectName != null)
5117 { 5117 {
@@ -5243,7 +5243,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5243 ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack; 5243 ObjectClickActionPacket ocpacket = (ObjectClickActionPacket)Pack;
5244 5244
5245 handlerObjectClickAction = OnObjectClickAction; 5245 handlerObjectClickAction = OnObjectClickAction;
5246 if (handlerObjectClickAction != null) 5246 if (handlerObjectClickAction != null)
5247 { 5247 {
5248 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) 5248 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData)
5249 { 5249 {
@@ -5302,7 +5302,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5302 break; 5302 break;
5303 case PacketType.TransferRequest: 5303 case PacketType.TransferRequest:
5304 //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); 5304 //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request");
5305 5305
5306 TransferRequestPacket transfer = (TransferRequestPacket)Pack; 5306 TransferRequestPacket transfer = (TransferRequestPacket)Pack;
5307 //Console.WriteLine("Transfer Request: " + transfer.ToString()); 5307 //Console.WriteLine("Transfer Request: " + transfer.ToString());
5308 // Validate inventory transfers 5308 // Validate inventory transfers
@@ -5346,12 +5346,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5346 if (userInfo == null) 5346 if (userInfo == null)
5347 { 5347 {
5348 m_log.ErrorFormat( 5348 m_log.ErrorFormat(
5349 "[CLIENT]: Could not resolve user {0} for caps inventory update", 5349 "[CLIENT]: Could not resolve user {0} for caps inventory update",
5350 AgentId); 5350 AgentId);
5351 5351
5352 break; 5352 break;
5353 } 5353 }
5354 5354
5355 if (userInfo.RootFolder == null) 5355 if (userInfo.RootFolder == null)
5356 break; 5356 break;
5357 5357
@@ -5881,7 +5881,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5881 5881
5882 } 5882 }
5883 break; 5883 break;
5884 5884
5885 case PacketType.TeleportLocationRequest: 5885 case PacketType.TeleportLocationRequest:
5886 TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; 5886 TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;
5887 // Console.WriteLine(tpLocReq.ToString()); 5887 // Console.WriteLine(tpLocReq.ToString());
@@ -6693,11 +6693,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6693 // TODO: handle this packet 6693 // TODO: handle this packet
6694 //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); 6694 //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet");
6695 break; 6695 break;
6696 6696
6697 case PacketType.InventoryDescendents: 6697 case PacketType.InventoryDescendents:
6698 // TODO: handle this packet 6698 // TODO: handle this packet
6699 //m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); 6699 //m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
6700 6700
6701 break; 6701 break;
6702 case PacketType.DirPlacesQuery: 6702 case PacketType.DirPlacesQuery:
6703 DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack; 6703 DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack;
@@ -6775,7 +6775,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6775 OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID); 6775 OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID);
6776 } 6776 }
6777 break; 6777 break;
6778 6778
6779 case PacketType.ParcelSetOtherCleanTime: 6779 case PacketType.ParcelSetOtherCleanTime:
6780 ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack; 6780 ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack;
6781 handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; 6781 handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime;
@@ -7516,7 +7516,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7516 } 7516 }
7517 7517
7518 public void SendAgentOnline(UUID[] agentIDs) 7518 public void SendAgentOnline(UUID[] agentIDs)
7519 { 7519 {
7520 OnlineNotificationPacket onp = new OnlineNotificationPacket(); 7520 OnlineNotificationPacket onp = new OnlineNotificationPacket();
7521 OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length]; 7521 OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
7522 for (int i = 0; i < agentIDs.Length; i++) 7522 for (int i = 0; i < agentIDs.Length; i++)
@@ -7682,7 +7682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7682 { 7682 {
7683 Transfer.TransferInfo.Params = new byte[20]; 7683 Transfer.TransferInfo.Params = new byte[20];
7684 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); 7684 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
7685 int assType = req.AssetInf.Type; 7685 int assType = req.AssetInf.Metadata.Type;
7686 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); 7686 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
7687 } 7687 }
7688 else if (req.AssetRequestSource == 3) 7688 else if (req.AssetRequestSource == 3)
@@ -7901,7 +7901,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7901 { 7901 {
7902 case "ReliableIsImportant": 7902 case "ReliableIsImportant":
7903 return m_PacketHandler.ReliableIsImportant.ToString(); 7903 return m_PacketHandler.ReliableIsImportant.ToString();
7904 7904
7905 default: 7905 default:
7906 break; 7906 break;
7907 } 7907 }
@@ -8340,7 +8340,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8340 dg.AgentData = new AgentDropGroupPacket.AgentDataBlock(); 8340 dg.AgentData = new AgentDropGroupPacket.AgentDataBlock();
8341 dg.AgentData.AgentID = AgentId; 8341 dg.AgentData.AgentID = AgentId;
8342 dg.AgentData.GroupID = groupID; 8342 dg.AgentData.GroupID = groupID;
8343 8343
8344 OutPacket(dg, ThrottleOutPacketType.Task); 8344 OutPacket(dg, ThrottleOutPacketType.Task);
8345 } 8345 }
8346 8346
@@ -8352,7 +8352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8352 8352
8353 an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock(); 8353 an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock();
8354 an.AgentData.AgentID = AgentId; 8354 an.AgentData.AgentID = AgentId;
8355 8355
8356 an.Data = new AvatarNotesReplyPacket.DataBlock(); 8356 an.Data = new AvatarNotesReplyPacket.DataBlock();
8357 an.Data.TargetID = targetID; 8357 an.Data.TargetID = targetID;
8358 an.Data.Notes = Utils.StringToBytes(text); 8358 an.Data.Notes = Utils.StringToBytes(text);
@@ -8369,7 +8369,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8369 ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock(); 8369 ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock();
8370 ap.AgentData.AgentID = AgentId; 8370 ap.AgentData.AgentID = AgentId;
8371 ap.AgentData.TargetID = targetID; 8371 ap.AgentData.TargetID = targetID;
8372 8372
8373 ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count]; 8373 ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count];
8374 8374
8375 int i = 0; 8375 int i = 0;
@@ -8393,7 +8393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8393 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock(); 8393 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
8394 ac.AgentData.AgentID = AgentId; 8394 ac.AgentData.AgentID = AgentId;
8395 ac.AgentData.TargetID = targetID; 8395 ac.AgentData.TargetID = targetID;
8396 8396
8397 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count]; 8397 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count];
8398 8398
8399 int i = 0; 8399 int i = 0;
@@ -8416,7 +8416,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8416 8416
8417 pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock(); 8417 pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock();
8418 pd.AgentData.AgentID = AgentId; 8418 pd.AgentData.AgentID = AgentId;
8419 8419
8420 pd.Data = new ParcelDwellReplyPacket.DataBlock(); 8420 pd.Data = new ParcelDwellReplyPacket.DataBlock();
8421 pd.Data.LocalID = localID; 8421 pd.Data.LocalID = localID;
8422 pd.Data.ParcelID = parcelID; 8422 pd.Data.ParcelID = parcelID;
@@ -8437,7 +8437,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8437 8437
8438 ur.AgentData = new UserInfoReplyPacket.AgentDataBlock(); 8438 ur.AgentData = new UserInfoReplyPacket.AgentDataBlock();
8439 ur.AgentData.AgentID = AgentId; 8439 ur.AgentData.AgentID = AgentId;
8440 8440
8441 ur.UserData = new UserInfoReplyPacket.UserDataBlock(); 8441 ur.UserData = new UserInfoReplyPacket.UserDataBlock();
8442 ur.UserData.IMViaEMail = imViaEmail; 8442 ur.UserData.IMViaEMail = imViaEmail;
8443 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible); 8443 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible);