aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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
parent* Add another object to the existing save oar test (diff)
downloadopensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip
opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz
opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2
opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs260
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs28
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs52
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGGridServices.cs82
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs36
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs36
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs46
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs28
-rw-r--r--OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs68
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs120
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs124
17 files changed, 573 insertions, 573 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);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs
index 517de34..d2d86b9 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
42{ 42{
43 /// <summary> 43 /// <summary>
44 /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules 44 /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules
45 /// This file currently contains multiple classes that need to be split out into their own files. 45 /// This file currently contains multiple classes that need to be split out into their own files.
46 /// </summary> 46 /// </summary>
47 public class LLFileTransfer : IClientFileTransfer 47 public class LLFileTransfer : IClientFileTransfer
48 { 48 {
@@ -206,13 +206,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
206 private void Initialise(UUID fileID, string fileName) 206 private void Initialise(UUID fileID, string fileName)
207 { 207 {
208 m_asset = new AssetBase(); 208 m_asset = new AssetBase();
209 m_asset.FullID = fileID; 209 m_asset.Metadata.FullID = fileID;
210 m_asset.Type = type; 210 m_asset.Metadata.Type = type;
211 m_asset.Data = new byte[0]; 211 m_asset.Data = new byte[0];
212 m_asset.Name = fileName; 212 m_asset.Metadata.Name = fileName;
213 m_asset.Description = "empty"; 213 m_asset.Metadata.Description = "empty";
214 m_asset.Local = true; 214 m_asset.Metadata.Local = true;
215 m_asset.Temporary = true; 215 m_asset.Metadata.Temporary = true;
216 mXferID = Util.GetNextXferID(); 216 mXferID = Util.GetNextXferID();
217 } 217 }
218 218
@@ -223,13 +223,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
223 223
224 public void RequestStartXfer(IClientAPI pRemoteClient) 224 public void RequestStartXfer(IClientAPI pRemoteClient)
225 { 225 {
226 if (!String.IsNullOrEmpty(m_asset.Name)) 226 if (!String.IsNullOrEmpty(m_asset.Metadata.Name))
227 { 227 {
228 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); 228 pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name));
229 } 229 }
230 else 230 else
231 { 231 {
232 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); 232 pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]);
233 } 233 }
234 } 234 }
235 235
@@ -238,7 +238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
238 /// </summary> 238 /// </summary>
239 /// <param name="xferID"></param> 239 /// <param name="xferID"></param>
240 /// <param name="packetID"></param> 240 /// <param name="packetID"></param>
241 /// <param name="data"></param> 241 /// <param name="data"></param>
242 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) 242 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
243 { 243 {
244 if (mXferID == xferID) 244 if (mXferID == xferID)
@@ -273,7 +273,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
273 handlerUploadDone = UploadDone; 273 handlerUploadDone = UploadDone;
274 if (handlerUploadDone != null) 274 if (handlerUploadDone != null)
275 { 275 {
276 handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient); 276 handlerUploadDone(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, m_asset.Data, remoteClient);
277 } 277 }
278 } 278 }
279 279
@@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
282 handlerAbort = UploadAborted; 282 handlerAbort = UploadAborted;
283 if (handlerAbort != null) 283 if (handlerAbort != null)
284 { 284 {
285 handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); 285 handlerAbort(m_asset.Metadata.Name, m_asset.Metadata.FullID, mXferID, remoteClient);
286 } 286 }
287 } 287 }
288 } 288 }
@@ -373,4 +373,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
373 } 373 }
374 } 374 }
375 375
376} \ No newline at end of file 376}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 3b21c85..f903c45 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
47 /// Priority Queue for images. Contains lots of data 47 /// Priority Queue for images. Contains lots of data
48 /// </summary> 48 /// </summary>
49 private readonly IPriorityQueue<Prio<J2KImage>> pq = new IntervalHeap<Prio<J2KImage>>(); 49 private readonly IPriorityQueue<Prio<J2KImage>> pq = new IntervalHeap<Prio<J2KImage>>();
50 50
51 /// <summary> 51 /// <summary>
52 /// Dictionary of PriorityQueue handles by AssetId 52 /// Dictionary of PriorityQueue handles by AssetId
53 /// </summary> 53 /// </summary>
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
87 87
88 //if (req.RequestType == 1) // avatar body texture! 88 //if (req.RequestType == 1) // avatar body texture!
89 // return; 89 // return;
90 90
91 AddQueueItem(req.RequestedAssetID, (int)req.Priority + 100000); 91 AddQueueItem(req.RequestedAssetID, (int)req.Priority + 100000);
92 //if (pq[PQHandles[req.RequestedAssetID]].data.Missing) 92 //if (pq[PQHandles[req.RequestedAssetID]].data.Missing)
93 //{ 93 //{
@@ -96,9 +96,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
96 // 96 //
97 //if (pq[PQHandles[req.RequestedAssetID]].data.HasData && pq[PQHandles[req.RequestedAssetID]].data.Layers.Length > 0) 97 //if (pq[PQHandles[req.RequestedAssetID]].data.HasData && pq[PQHandles[req.RequestedAssetID]].data.Layers.Length > 0)
98 //{ 98 //{
99 99
100 //} 100 //}
101 101
102 pq[PQHandles[req.RequestedAssetID]].data.requestedUUID = req.RequestedAssetID; 102 pq[PQHandles[req.RequestedAssetID]].data.requestedUUID = req.RequestedAssetID;
103 pq[PQHandles[req.RequestedAssetID]].data.Priority = (int)req.Priority; 103 pq[PQHandles[req.RequestedAssetID]].data.Priority = (int)req.Priority;
104 104
@@ -118,7 +118,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
118 return; 118 return;
119 119
120 //Console.WriteLine("AssetCallback for assetId" + assetID); 120 //Console.WriteLine("AssetCallback for assetId" + assetID);
121 121
122 if (asset == null || asset.Data == null) 122 if (asset == null || asset.Data == null)
123 { 123 {
124 lock (pq) 124 lock (pq)
@@ -132,12 +132,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
132 132
133 133
134 pq[PQHandles[assetID]].data.asset = asset; 134 pq[PQHandles[assetID]].data.asset = asset;
135 135
136 //lock (pq[PQHandles[assetID]].data) 136 //lock (pq[PQHandles[assetID]].data)
137 pq[PQHandles[assetID]].data.Update((int)pq[PQHandles[assetID]].data.Priority, pq[PQHandles[assetID]].data.CurrentPacket); 137 pq[PQHandles[assetID]].data.Update((int)pq[PQHandles[assetID]].data.Priority, pq[PQHandles[assetID]].data.CurrentPacket);
138 138
139 139
140 140
141 } 141 }
142 142
143 /// <summary> 143 /// <summary>
@@ -174,7 +174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
174 // Is the asset missing? 174 // Is the asset missing?
175 if (process.data.Missing) 175 if (process.data.Missing)
176 { 176 {
177 177
178 //m_client.sendtextur 178 //m_client.sendtextur
179 pq[h] -= 90000; 179 pq[h] -= 90000;
180 /* 180 /*
@@ -191,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
191 // Substitute a blank image 191 // Substitute a blank image
192 process.data.asset = MissingSubstitute; 192 process.data.asset = MissingSubstitute;
193 process.data.Missing = false; 193 process.data.Missing = false;
194 194
195 // If the priority is less then -4billion, the client has forgotten about it. 195 // If the priority is less then -4billion, the client has forgotten about it.
196 if (pq[h] < -400000000) 196 if (pq[h] < -400000000)
197 { 197 {
@@ -224,7 +224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
224 j2kDecodedCallback(process.data.AssetId, new OpenJPEG.J2KLayerInfo[0]); 224 j2kDecodedCallback(process.data.AssetId, new OpenJPEG.J2KLayerInfo[0]);
225 } 225 }
226 226
227 227
228 228
229 } // Are we waiting? 229 } // Are we waiting?
230 else if (!process.data.J2KDecodeWaiting) 230 else if (!process.data.J2KDecodeWaiting)
@@ -259,10 +259,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
259 259
260 //pq[h] = process; 260 //pq[h] = process;
261 } 261 }
262 262
263 // uncomment the following line to see the upper most asset and the priority 263 // uncomment the following line to see the upper most asset and the priority
264 //Console.WriteLine(process.ToString()); 264 //Console.WriteLine(process.ToString());
265 265
266 // Lower priority to give the next image a chance to bubble up 266 // Lower priority to give the next image a chance to bubble up
267 pq[h] -= 50000; 267 pq[h] -= 50000;
268 } 268 }
@@ -318,7 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
318 } 318 }
319 } 319 }
320 } 320 }
321 321
322 322
323 /// <summary> 323 /// <summary>
324 /// Adds an image to the queue and update priority 324 /// Adds an image to the queue and update priority
@@ -336,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
336 { 336 {
337 h = PQHandles[AssetId]; 337 h = PQHandles[AssetId];
338 pq[h] = pq[h].SetPriority(priority); 338 pq[h] = pq[h].SetPriority(priority);
339 339
340 } 340 }
341 else 341 else
342 { 342 {
@@ -354,7 +354,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
354 public void Close() 354 public void Close()
355 { 355 {
356 m_shuttingdown = true; 356 m_shuttingdown = true;
357 357
358 lock (pq) 358 lock (pq)
359 { 359 {
360 while (!pq.IsEmpty) 360 while (!pq.IsEmpty)
@@ -362,7 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
362 pq.DeleteMin(); 362 pq.DeleteMin();
363 } 363 }
364 } 364 }
365 365
366 366
367 lock (PQHandles) 367 lock (PQHandles)
368 PQHandles.Clear(); 368 PQHandles.Clear();
@@ -423,7 +423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
423 /// </summary> 423 /// </summary>
424 public UUID AssetId 424 public UUID AssetId
425 { 425 {
426 get { return m_asset_ref.FullID; } 426 get { return m_asset_ref.Metadata.FullID; }
427 } 427 }
428 428
429 /// <summary> 429 /// <summary>
@@ -544,7 +544,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
544 /// <returns>true if a packet was sent, false if not</returns> 544 /// <returns>true if a packet was sent, false if not</returns>
545 public bool SendPacket(LLClientView client) 545 public bool SendPacket(LLClientView client)
546 { 546 {
547 // If we've hit the end of the send or if the client set -1, return false. 547 // If we've hit the end of the send or if the client set -1, return false.
548 if (CurrentPacket > StopPacket || StopPacket == -1) 548 if (CurrentPacket > StopPacket || StopPacket == -1)
549 return false; 549 return false;
550 550
@@ -564,7 +564,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
564 } 564 }
565 else 565 else
566 { 566 {
567 567
568 // Send first packet 568 // Send first packet
569 byte[] firstImageData = new byte[FIRST_IMAGE_PACKET_SIZE]; 569 byte[] firstImageData = new byte[FIRST_IMAGE_PACKET_SIZE];
570 try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } 570 try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); }
@@ -585,7 +585,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
585 // figure out if we're on the last packet, if so, use the last packet size. If not, use 1000. 585 // figure out if we're on the last packet, if so, use the last packet size. If not, use 1000.
586 // we know that the total image size is greater then 1000 if we're here 586 // we know that the total image size is greater then 1000 if we're here
587 int imagePacketSize = (CurrentPacket == (TexturePacketCount() ) ) ? LastPacketSize() : IMAGE_PACKET_SIZE; 587 int imagePacketSize = (CurrentPacket == (TexturePacketCount() ) ) ? LastPacketSize() : IMAGE_PACKET_SIZE;
588 588
589 //if (imagePacketSize > 0) 589 //if (imagePacketSize > 0)
590 // imagePacketSize = IMAGE_PACKET_SIZE; 590 // imagePacketSize = IMAGE_PACKET_SIZE;
591 //if (imagePacketSize != 1000) 591 //if (imagePacketSize != 1000)
@@ -611,7 +611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
611 try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } 611 try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); }
612 catch (Exception e) 612 catch (Exception e)
613 { 613 {
614 Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), 614 Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(),
615 imageData.Length, imagePacketSize, CurrentPacket,StopPacket,TexturePacketCount())); 615 imageData.Length, imagePacketSize, CurrentPacket,StopPacket,TexturePacketCount()));
616 Console.WriteLine(e.ToString()); 616 Console.WriteLine(e.ToString());
617 //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); 617 //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString());
@@ -622,7 +622,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
622 622
623 // Send next packet to the client 623 // Send next packet to the client
624 client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData); 624 client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData);
625 625
626 ++CurrentPacket; 626 ++CurrentPacket;
627 627
628 if (atEnd) 628 if (atEnd)
@@ -630,7 +630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
630 630
631 return true; 631 return true;
632 } 632 }
633 633
634 } 634 }
635 635
636 /// <summary> 636 /// <summary>
@@ -676,7 +676,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
676 676
677 public static Prio<D> operator -(Prio<D> tp, int delta) 677 public static Prio<D> operator -(Prio<D> tp, int delta)
678 { 678 {
679 if (tp.priority - delta < 0) 679 if (tp.priority - delta < 0)
680 return new Prio<D>(tp.data, tp.priority - delta); 680 return new Prio<D>(tp.data, tp.priority - delta);
681 else 681 else
682 return new Prio<D>(tp.data, 0); 682 return new Prio<D>(tp.data, 0);
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
index 0874676..961ecb1 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
@@ -1,29 +1,29 @@
1/** 1/**
2 * Copyright (c) 2008, Contributors. All rights reserved. 2 * Copyright (c) 2008, Contributors. All rights reserved.
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without modification, 5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met: 6 * are permitted provided that the following conditions are met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright notice, 8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice, 10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation 11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution. 12 * and/or other materials provided with the distribution.
13 * * Neither the name of the Organizations nor the names of Individual 13 * * Neither the name of the Organizations nor the names of Individual
14 * Contributors may be used to endorse or promote products derived from 14 * Contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission. 15 * this software without specific prior written permission.
16 * 16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THE POSSIBILITY OF SUCH DAMAGE.
26 * 26 *
27 */ 27 */
28 28
29 29
@@ -73,11 +73,11 @@ namespace OpenSim.Region.Communications.Hypergrid
73 public BaseHttpServer httpServer; 73 public BaseHttpServer httpServer;
74 74
75 protected List<RegionInfo> m_regionsOnInstance = new List<RegionInfo>(); 75 protected List<RegionInfo> m_regionsOnInstance = new List<RegionInfo>();
76 76
77 // Hyperlink regions are hyperlinks on the map 77 // Hyperlink regions are hyperlinks on the map
78 protected List<RegionInfo> m_hyperlinkRegions = new List<RegionInfo>(); 78 protected List<RegionInfo> m_hyperlinkRegions = new List<RegionInfo>();
79 79
80 // Known regions are home regions of visiting foreign users. 80 // Known regions are home regions of visiting foreign users.
81 // They are not on the map as static hyperlinks. They are dynamic hyperlinks, they go away when 81 // They are not on the map as static hyperlinks. They are dynamic hyperlinks, they go away when
82 // the visitor goes away. They are mapped to X=0 on the map. 82 // the visitor goes away. They are mapped to X=0 on the map.
83 // This is key-ed on agent ID 83 // This is key-ed on agent ID
@@ -326,13 +326,13 @@ namespace OpenSim.Region.Communications.Hypergrid
326 //Console.WriteLine("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 326 //Console.WriteLine("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
327 byte[] imageData = OpenJPEG.EncodeFromImage(m, true); 327 byte[] imageData = OpenJPEG.EncodeFromImage(m, true);
328 AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString()); 328 AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString());
329 info.RegionSettings.TerrainImageID = ass.FullID; 329 info.RegionSettings.TerrainImageID = ass.Metadata.FullID;
330 ass.Type = (int)AssetType.Texture; 330 ass.Metadata.Type = (int)AssetType.Texture;
331 ass.Temporary = false; 331 ass.Metadata.Temporary = false;
332 //imageData.CopyTo(ass.Data, 0); 332 //imageData.CopyTo(ass.Data, 0);
333 ass.Data = imageData; 333 ass.Data = imageData;
334 m_assetcache.AddAsset(ass); 334 m_assetcache.AddAsset(ass);
335 335
336 } 336 }
337 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke 337 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
338 { 338 {
@@ -342,7 +342,7 @@ namespace OpenSim.Region.Communications.Hypergrid
342 342
343 // A little ugly, since this code is exactly the same as OSG1's, and we're already 343 // A little ugly, since this code is exactly the same as OSG1's, and we're already
344 // calling that for when the region in in grid mode... (for the grid regions) 344 // calling that for when the region in in grid mode... (for the grid regions)
345 // 345 //
346 public virtual LandData RequestLandData (ulong regionHandle, uint x, uint y) 346 public virtual LandData RequestLandData (ulong regionHandle, uint x, uint y)
347 { 347 {
348 m_log.DebugFormat("[HGrid]: requests land data in {0}, at {1}, {2}", 348 m_log.DebugFormat("[HGrid]: requests land data in {0}, at {1}, {2}",
@@ -542,23 +542,23 @@ namespace OpenSim.Region.Communications.Hypergrid
542 m_log.Info("[HGrid]: InformRegionOfUser: Local grid region " + regInfo.regionSecret); 542 m_log.Info("[HGrid]: InformRegionOfUser: Local grid region " + regInfo.regionSecret);
543 } 543 }
544 544
545 string capsPath = agentData.CapsPath; 545 string capsPath = agentData.CapsPath;
546 Hashtable loginParams = new Hashtable(); 546 Hashtable loginParams = new Hashtable();
547 loginParams["session_id"] = agentData.SessionID.ToString(); 547 loginParams["session_id"] = agentData.SessionID.ToString();
548 loginParams["secure_session_id"] = agentData.SecureSessionID.ToString(); 548 loginParams["secure_session_id"] = agentData.SecureSessionID.ToString();
549 549
550 loginParams["firstname"] = agentData.firstname; 550 loginParams["firstname"] = agentData.firstname;
551 loginParams["lastname"] = agentData.lastname; 551 loginParams["lastname"] = agentData.lastname;
552 552
553 loginParams["agent_id"] = agentData.AgentID.ToString(); 553 loginParams["agent_id"] = agentData.AgentID.ToString();
554 loginParams["circuit_code"] = agentData.circuitcode.ToString(); 554 loginParams["circuit_code"] = agentData.circuitcode.ToString();
555 loginParams["startpos_x"] = agentData.startpos.X.ToString(); 555 loginParams["startpos_x"] = agentData.startpos.X.ToString();
556 loginParams["startpos_y"] = agentData.startpos.Y.ToString(); 556 loginParams["startpos_y"] = agentData.startpos.Y.ToString();
557 loginParams["startpos_z"] = agentData.startpos.Z.ToString(); 557 loginParams["startpos_z"] = agentData.startpos.Z.ToString();
558 loginParams["caps_path"] = capsPath; 558 loginParams["caps_path"] = capsPath;
559 559
560 CachedUserInfo u = m_userProfileCache.GetUserDetails(agentData.AgentID); 560 CachedUserInfo u = m_userProfileCache.GetUserDetails(agentData.AgentID);
561 if (u != null && u.UserProfile != null) 561 if (u != null && u.UserProfile != null)
562 { 562 {
563 loginParams["region_uuid"] = u.UserProfile.HomeRegionID.ToString(); // This seems to be always Zero 563 loginParams["region_uuid"] = u.UserProfile.HomeRegionID.ToString(); // This seems to be always Zero
564 //Console.WriteLine(" --------- Home Region UUID -------"); 564 //Console.WriteLine(" --------- Home Region UUID -------");
@@ -691,7 +691,7 @@ namespace OpenSim.Region.Communications.Hypergrid
691 691
692 userData.UserServerURI = (string)requestData["userserver_id"]; 692 userData.UserServerURI = (string)requestData["userserver_id"];
693 userData.UserAssetURI = (string)requestData["assetserver_id"]; 693 userData.UserAssetURI = (string)requestData["assetserver_id"];
694 userData.UserInventoryURI = (string)requestData["inventoryserver_id"]; 694 userData.UserInventoryURI = (string)requestData["inventoryserver_id"];
695 695
696 UUID rootID = UUID.Zero; 696 UUID rootID = UUID.Zero;
697 UUID.TryParse((string)requestData["root_folder_id"], out rootID); 697 UUID.TryParse((string)requestData["root_folder_id"], out rootID);
@@ -710,7 +710,7 @@ namespace OpenSim.Region.Communications.Hypergrid
710 710
711 m_log.DebugFormat("[HGrid]: Told by user service to prepare for a connection from {0} {1} {2}", 711 m_log.DebugFormat("[HGrid]: Told by user service to prepare for a connection from {0} {1} {2}",
712 userData.FirstName, userData.SurName, userData.ID); 712 userData.FirstName, userData.SurName, userData.ID);
713 m_log.Debug("[HGrid]: home_address: " + userData.UserHomeAddress + 713 m_log.Debug("[HGrid]: home_address: " + userData.UserHomeAddress +
714 "; home_port: " + userData.UserHomePort + "; remoting: " + userData.UserHomeRemotingPort); 714 "; home_port: " + userData.UserHomePort + "; remoting: " + userData.UserHomeRemotingPort);
715 715
716 716
@@ -926,7 +926,7 @@ namespace OpenSim.Region.Communications.Hypergrid
926 return true; 926 return true;
927 } 927 }
928 928
929 public virtual bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 929 public virtual bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
930 { 930 {
931 // If we're here, it's because regionHandle is a remote, non-grided region 931 // If we're here, it's because regionHandle is a remote, non-grided region
932 m_log.Info("[HGrid]: InformRegionOfChildAgent for " + regionHandle); 932 m_log.Info("[HGrid]: InformRegionOfChildAgent for " + regionHandle);
@@ -934,7 +934,7 @@ namespace OpenSim.Region.Communications.Hypergrid
934 RegionInfo regInfo = GetHyperlinkRegion(regionHandle); 934 RegionInfo regInfo = GetHyperlinkRegion(regionHandle);
935 if (regInfo == null) 935 if (regInfo == null)
936 return false; 936 return false;
937 937
938 //ulong realHandle = regionHandle; 938 //ulong realHandle = regionHandle;
939 939
940 if (!SendUserInformation(regInfo, agentData)) 940 if (!SendUserInformation(regInfo, agentData))
@@ -1184,7 +1184,7 @@ namespace OpenSim.Region.Communications.Hypergrid
1184 #region Methods triggered by calls from external instances 1184 #region Methods triggered by calls from external instances
1185 1185
1186 /// <summary> 1186 /// <summary>
1187 /// 1187 ///
1188 /// </summary> 1188 /// </summary>
1189 /// <param name="regionHandle"></param> 1189 /// <param name="regionHandle"></param>
1190 /// <param name="agentData"></param> 1190 /// <param name="agentData"></param>
@@ -1192,7 +1192,7 @@ namespace OpenSim.Region.Communications.Hypergrid
1192 public void AdjustUserInformation(AgentCircuitData agentData) 1192 public void AdjustUserInformation(AgentCircuitData agentData)
1193 { 1193 {
1194 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID); 1194 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
1195 if ((uinfo != null) && (uinfo.UserProfile != null) && 1195 if ((uinfo != null) && (uinfo.UserProfile != null) &&
1196 (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData))) 1196 (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData)))
1197 { 1197 {
1198 //Console.WriteLine("---------------> Local User!"); 1198 //Console.WriteLine("---------------> Local User!");
@@ -1232,7 +1232,7 @@ namespace OpenSim.Region.Communications.Hypergrid
1232 if (info.RegionHandle == ihandle) 1232 if (info.RegionHandle == ihandle)
1233 return info; 1233 return info;
1234 } 1234 }
1235 1235
1236 return null; 1236 return null;
1237 } 1237 }
1238 1238
@@ -1250,7 +1250,7 @@ namespace OpenSim.Region.Communications.Hypergrid
1250 ohandle = Convert.ToInt64(info.regionSecret); 1250 ohandle = Convert.ToInt64(info.regionSecret);
1251 m_log.Info("[HGrid] remote region " + ohandle); 1251 m_log.Info("[HGrid] remote region " + ohandle);
1252 } 1252 }
1253 catch 1253 catch
1254 { 1254 {
1255 m_log.Error("[HGrid] Could not convert secret for " + ihandle + " (" + info.regionSecret + ")"); 1255 m_log.Error("[HGrid] Could not convert secret for " + ihandle + " (" + info.regionSecret + ")");
1256 } 1256 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 689b4d5..7f4bb0b 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
72 } 72 }
73 73
74 public void HandleXfer(ulong xferID, uint packetID, byte[] data) 74 public void HandleXfer(ulong xferID, uint packetID, byte[] data)
75 { 75 {
76 lock (XferUploaders) 76 lock (XferUploaders)
77 { 77 {
78 foreach (AssetXferUploader uploader in XferUploaders.Values) 78 foreach (AssetXferUploader uploader in XferUploaders.Values)
@@ -97,8 +97,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
97 wearableType, nextOwnerMask); 97 wearableType, nextOwnerMask);
98 } 98 }
99 } 99 }
100 100
101 101
102 102
103 /// <summary> 103 /// <summary>
104 /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. 104 /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed.
@@ -171,10 +171,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
171 "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", 171 "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
172 item.Name, part.Name, transactionID); 172 item.Name, part.Name, transactionID);
173 173
174 asset.Name = item.Name; 174 asset.Metadata.Name = item.Name;
175 asset.Description = item.Description; 175 asset.Metadata.Description = item.Description;
176 asset.Type = (sbyte)item.Type; 176 asset.Metadata.Type = (sbyte)item.Type;
177 item.AssetID = asset.FullID; 177 item.AssetID = asset.Metadata.FullID;
178 178
179 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); 179 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
180 180
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
206 asset = GetTransactionAsset(transactionID); 206 asset = GetTransactionAsset(transactionID);
207 } 207 }
208 208
209 if (asset != null && asset.FullID == assetID) 209 if (asset != null && asset.Metadata.FullID == assetID)
210 { 210 {
211 // Assets never get updated, new ones get created 211 // Assets never get updated, new ones get created
212 asset.FullID = UUID.Random(); 212 asset.Metadata.FullID = UUID.Random();
213 asset.Name = item.Name; 213 asset.Metadata.Name = item.Name;
214 asset.Description = item.Description; 214 asset.Metadata.Description = item.Description;
215 asset.Type = (sbyte)item.AssetType; 215 asset.Metadata.Type = (sbyte)item.AssetType;
216 item.AssetID = asset.FullID; 216 item.AssetID = asset.Metadata.FullID;
217 217
218 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); 218 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
219 } 219 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
index 6dcbe83..5387165 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -113,17 +113,17 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
113 { 113 {
114 ourClient = remoteClient; 114 ourClient = remoteClient;
115 m_asset = new AssetBase(); 115 m_asset = new AssetBase();
116 m_asset.FullID = assetID; 116 m_asset.Metadata.FullID = assetID;
117 m_asset.Type = type; 117 m_asset.Metadata.Type = type;
118 m_asset.Data = data; 118 m_asset.Data = data;
119 m_asset.Name = "blank"; 119 m_asset.Metadata.Name = "blank";
120 m_asset.Description = "empty"; 120 m_asset.Metadata.Description = "empty";
121 m_asset.Local = storeLocal; 121 m_asset.Metadata.Local = storeLocal;
122 m_asset.Temporary = tempFile; 122 m_asset.Metadata.Temporary = tempFile;
123 123
124 TransactionID = transaction; 124 TransactionID = transaction;
125 m_storeLocal = storeLocal; 125 m_storeLocal = storeLocal;
126 126
127 if (m_asset.Data.Length > 2) 127 if (m_asset.Data.Length > 2)
128 { 128 {
129 SendCompleteMessage(); 129 SendCompleteMessage();
@@ -140,12 +140,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
140 protected void RequestStartXfer() 140 protected void RequestStartXfer()
141 { 141 {
142 XferID = Util.GetNextXferID(); 142 XferID = Util.GetNextXferID();
143 ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); 143 ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]);
144 } 144 }
145 145
146 protected void SendCompleteMessage() 146 protected void SendCompleteMessage()
147 { 147 {
148 ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); 148 ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID);
149 149
150 m_finished = true; 150 m_finished = true;
151 if (m_createItem) 151 if (m_createItem)
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
164 DateTime now = DateTime.Now; 164 DateTime now = DateTime.Now;
165 string filename = 165 string filename =
166 String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, 166 String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
167 now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); 167 now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type);
168 SaveAssetToFile(filename, m_asset.Data); 168 SaveAssetToFile(filename, m_asset.Data);
169 } 169 }
170 } 170 }
@@ -196,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
196 this.invType = invType; 196 this.invType = invType;
197 this.wearableType = wearableType; 197 this.wearableType = wearableType;
198 nextPerm = nextOwnerMask; 198 nextPerm = nextOwnerMask;
199 m_asset.Name = name; 199 m_asset.Metadata.Name = name;
200 m_asset.Description = description; 200 m_asset.Metadata.Description = description;
201 m_asset.Type = type; 201 m_asset.Metadata.Type = type;
202 202
203 if (m_finished) 203 if (m_finished)
204 { 204 {
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
211 } 211 }
212 } 212 }
213 213
214 214
215 private void DoCreateItem() 215 private void DoCreateItem()
216 { 216 {
217 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); 217 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset);
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
225 item.Owner = ourClient.AgentId; 225 item.Owner = ourClient.AgentId;
226 item.Creator = ourClient.AgentId; 226 item.Creator = ourClient.AgentId;
227 item.ID = UUID.Random(); 227 item.ID = UUID.Random();
228 item.AssetID = m_asset.FullID; 228 item.AssetID = m_asset.Metadata.FullID;
229 item.Description = m_description; 229 item.Description = m_description;
230 item.Name = m_name; 230 item.Name = m_name;
231 item.AssetType = type; 231 item.AssetType = type;
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
245 else 245 else
246 { 246 {
247 m_log.ErrorFormat( 247 m_log.ErrorFormat(
248 "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", 248 "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation",
249 ourClient.AgentId); 249 ourClient.AgentId);
250 } 250 }
251 } 251 }
252 252
253 /// <summary> 253 /// <summary>
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
260 { 260 {
261 return m_asset; 261 return m_asset;
262 } 262 }
263 263
264 return null; 264 return null;
265 } 265 }
266 } 266 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index a6901b6..f9a10bf 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
55 /// </summary> 55 /// </summary>
56 private AssetBase m_asset; 56 private AssetBase m_asset;
57 57
58 //public UUID assetID { get { return m_asset.FullID; } } 58 //public UUID assetID { get { return m_asset.Metadata.FullID; } }
59 59
60 // private bool m_cancel = false; 60 // private bool m_cancel = false;
61 61
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
93 get { return false; } 93 get { return false; }
94 set 94 set
95 { 95 {
96 // m_cancel = value; 96 // m_cancel = value;
97 } 97 }
98 } 98 }
99 99
@@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
102 get { return false; } 102 get { return false; }
103 set 103 set
104 { 104 {
105 // m_sending = value; 105 // m_sending = value;
106 } 106 }
107 } 107 }
108 108
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
117 // See ITextureSender 117 // See ITextureSender
118 public bool SendTexturePacket() 118 public bool SendTexturePacket()
119 { 119 {
120 //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); 120 //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.Metadata.FullID);
121 121
122 SendPacket(); 122 SendPacket();
123 counter++; 123 counter++;
@@ -154,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
154 { 154 {
155 if (NumPackets == 0) 155 if (NumPackets == 0)
156 { 156 {
157 RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); 157 RequestUser.SendImageFirstPart(1, m_asset.Metadata.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
158 PacketCounter++; 158 PacketCounter++;
159 } 159 }
160 else 160 else
@@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
163 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); 163 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
164 164
165 RequestUser.SendImageFirstPart( 165 RequestUser.SendImageFirstPart(
166 (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); 166 (ushort)(NumPackets), m_asset.Metadata.FullID, (uint)m_asset.Data.Length, ImageData1, 2);
167 PacketCounter++; 167 PacketCounter++;
168 } 168 }
169 } 169 }
@@ -179,11 +179,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
179 catch (ArgumentOutOfRangeException) 179 catch (ArgumentOutOfRangeException)
180 { 180 {
181 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + 181 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
182 m_asset.FullID.ToString()); 182 m_asset.Metadata.ID);
183 return; 183 return;
184 } 184 }
185 185
186 RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); 186 RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.Metadata.FullID, imageData);
187 PacketCounter++; 187 PacketCounter++;
188 } 188 }
189 } 189 }
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 862caa9..dcfcba3 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
46 public class InventoryArchiveReadRequest 46 public class InventoryArchiveReadRequest
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected Scene scene; 50 protected Scene scene;
51 protected TarArchiveReader archive; 51 protected TarArchiveReader archive;
52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); 52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
65 InventoryItemBase item = new InventoryItemBase(); 65 InventoryItemBase item = new InventoryItemBase();
66 StringReader sr = new StringReader(contents); 66 StringReader sr = new StringReader(contents);
67 XmlTextReader reader = new XmlTextReader(sr); 67 XmlTextReader reader = new XmlTextReader(sr);
68 68
69 if (contents.Equals("")) return null; 69 if (contents.Equals("")) return null;
70 70
71 reader.ReadStartElement("InventoryObject"); 71 reader.ReadStartElement("InventoryObject");
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
79 item.InvType = System.Convert.ToInt32(reader.ReadString()); 79 item.InvType = System.Convert.ToInt32(reader.ReadString());
80 reader.ReadEndElement(); 80 reader.ReadEndElement();
81 reader.ReadStartElement("CreatorUUID"); 81 reader.ReadStartElement("CreatorUUID");
82 item.Creator = UUID.Parse(reader.ReadString()); 82 item.Creator = UUID.Parse(reader.ReadString());
83 reader.ReadEndElement(); 83 reader.ReadEndElement();
84 reader.ReadStartElement("CreationDate"); 84 reader.ReadStartElement("CreationDate");
85 item.CreationDate = System.Convert.ToInt32(reader.ReadString()); 85 item.CreationDate = System.Convert.ToInt32(reader.ReadString());
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
94 } 94 }
95 else 95 else
96 { 96 {
97 reader.ReadStartElement("Description"); 97 reader.ReadStartElement("Description");
98 item.Description = reader.ReadString(); 98 item.Description = reader.ReadString();
99 reader.ReadEndElement(); 99 reader.ReadEndElement();
100 } 100 }
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
145 int successfulAssetRestores = 0; 145 int successfulAssetRestores = 0;
146 int failedAssetRestores = 0; 146 int failedAssetRestores = 0;
147 int successfulItemRestores = 0; 147 int successfulItemRestores = 0;
148 148
149 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName); 149 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName);
150 if (null == userProfile) 150 if (null == userProfile)
151 { 151 {
@@ -157,28 +157,28 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
157 if (null == userInfo) 157 if (null == userInfo)
158 { 158 {
159 m_log.ErrorFormat( 159 m_log.ErrorFormat(
160 "[CONSOLE]: Failed to find user info for {0} {1} {2}", 160 "[CONSOLE]: Failed to find user info for {0} {1} {2}",
161 firstName, lastName, userProfile.ID); 161 firstName, lastName, userProfile.ID);
162 162
163 return; 163 return;
164 } 164 }
165 165
166 if (!userInfo.HasReceivedInventory) 166 if (!userInfo.HasReceivedInventory)
167 { 167 {
168 m_log.ErrorFormat( 168 m_log.ErrorFormat(
169 "[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", 169 "[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}",
170 firstName, lastName, userProfile.ID); 170 firstName, lastName, userProfile.ID);
171 171
172 return; 172 return;
173 } 173 }
174 174
175 InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); 175 InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath);
176 176
177 if (null == inventoryFolder) 177 if (null == inventoryFolder)
178 { 178 {
179 // TODO: Later on, automatically create this folder if it does not exist 179 // TODO: Later on, automatically create this folder if it does not exist
180 m_log.ErrorFormat("[ARCHIVER]: Inventory path {0} does not exist", invPath); 180 m_log.ErrorFormat("[ARCHIVER]: Inventory path {0} does not exist", invPath);
181 181
182 return; 182 return;
183 } 183 }
184 184
@@ -202,17 +202,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
202 else 202 else
203 { 203 {
204 InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data)); 204 InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data));
205 205
206 if (item != null) 206 if (item != null)
207 { 207 {
208 item.Creator = userProfile.ID; 208 item.Creator = userProfile.ID;
209 item.Owner = userProfile.ID; 209 item.Owner = userProfile.ID;
210 210
211 // Reset folder ID to the one in which we want to load it 211 // Reset folder ID to the one in which we want to load it
212 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this 212 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this
213 // single folder no matter where in the saved folder structure they are. 213 // single folder no matter where in the saved folder structure they are.
214 item.Folder = inventoryFolder.ID; 214 item.Folder = inventoryFolder.ID;
215 215
216 userInfo.AddItem(item); 216 userInfo.AddItem(item);
217 successfulItemRestores++; 217 successfulItemRestores++;
218 } 218 }
@@ -258,7 +258,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
258 258
259 AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); 259 AssetBase asset = new AssetBase(new UUID(uuid), "RandomName");
260 260
261 asset.Type = assetType; 261 asset.Metadata.Type = assetType;
262 asset.Data = data; 262 asset.Data = data;
263 263
264 scene.AssetCache.AddAsset(asset); 264 scene.AssetCache.AddAsset(asset);
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 0974f02..bddf10d 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -231,21 +231,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
231 231
232 // Create a new asset for user 232 // Create a new asset for user
233 AssetBase asset = new AssetBase(); 233 AssetBase asset = new AssetBase();
234 asset.FullID = UUID.Random(); 234 asset.Metadata.FullID = UUID.Random();
235 asset.Data = assetData; 235 asset.Data = assetData;
236 asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); 236 asset.Metadata.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000);
237 asset.Type = 0; 237 asset.Metadata.Type = 0;
238 asset.Description = "dynamic image"; 238 asset.Metadata.Description = "dynamic image";
239 asset.Local = false; 239 asset.Metadata.Local = false;
240 asset.Temporary = true; 240 asset.Metadata.Temporary = true;
241 scene.AssetCache.AddAsset(asset); 241 scene.AssetCache.AddAsset(asset);
242 242
243 LastAssetID = asset.FullID; 243 LastAssetID = asset.Metadata.FullID;
244 244
245 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); 245 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
246 if (cacheLayerDecode != null) 246 if (cacheLayerDecode != null)
247 { 247 {
248 cacheLayerDecode.syncdecode(asset.FullID, asset.Data); 248 cacheLayerDecode.syncdecode(asset.Metadata.FullID, asset.Data);
249 } 249 }
250 cacheLayerDecode = null; 250 cacheLayerDecode = null;
251 251
@@ -256,7 +256,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
256 UUID oldID = tmptex.DefaultTexture.TextureID; 256 UUID oldID = tmptex.DefaultTexture.TextureID;
257 scene.AssetCache.ExpireAsset(oldID); 257 scene.AssetCache.ExpireAsset(oldID);
258 258
259 tmptex.DefaultTexture.TextureID = asset.FullID; 259 tmptex.DefaultTexture.TextureID = asset.Metadata.FullID;
260 // I'm pretty sure we always want to force this to true 260 // I'm pretty sure we always want to force this to true
261 tmptex.DefaultTexture.Fullbright = true; 261 tmptex.DefaultTexture.Fullbright = true;
262 262
@@ -287,7 +287,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
287 try 287 try
288 { 288 {
289 result = OpenJPEG.EncodeFromImage(joint, true); 289 result = OpenJPEG.EncodeFromImage(joint, true);
290 } 290 }
291 catch (Exception) 291 catch (Exception)
292 { 292 {
293 Console.WriteLine( 293 Console.WriteLine(
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 4e9fcef..c860d01 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -66,12 +66,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
66 m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); 66 m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
67 m_errorMessage = String.Empty; 67 m_errorMessage = String.Empty;
68 } 68 }
69 69
70 public ArchiveReadRequest(Scene scene, Stream loadStream) 70 public ArchiveReadRequest(Scene scene, Stream loadStream)
71 { 71 {
72 m_scene = scene; 72 m_scene = scene;
73 m_loadStream = loadStream; 73 m_loadStream = loadStream;
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Dearchive the region embodied in this request. 77 /// Dearchive the region embodied in this request.
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
81 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions 81 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions
82 DearchiveRegion0DotStar(); 82 DearchiveRegion0DotStar();
83 } 83 }
84 84
85 private void DearchiveRegion0DotStar() 85 private void DearchiveRegion0DotStar()
86 { 86 {
87 int successfulAssetRestores = 0; 87 int successfulAssetRestores = 0;
@@ -98,12 +98,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
98 98
99 byte[] data; 99 byte[] data;
100 TarArchiveReader.TarEntryType entryType; 100 TarArchiveReader.TarEntryType entryType;
101 101
102 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 102 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
103 { 103 {
104 //m_log.DebugFormat( 104 //m_log.DebugFormat(
105 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length); 105 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length);
106 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) 106 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType)
107 { 107 {
108 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", 108 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}",
109 filePath); 109 filePath);
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
133 LoadRegionSettings(filePath, data); 133 LoadRegionSettings(filePath, data);
134 } 134 }
135 } 135 }
136 136
137 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 137 //m_log.Debug("[ARCHIVER]: Reached end of archive");
138 138
139 archive.Close(); 139 archive.Close();
@@ -154,10 +154,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
154 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); 154 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
155 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores); 155 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores);
156 } 156 }
157 157
158 m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); 158 m_log.Info("[ARCHIVER]: Clearing all existing scene objects");
159 m_scene.DeleteAllSceneObjects(); 159 m_scene.DeleteAllSceneObjects();
160 160
161 // Reload serialized prims 161 // Reload serialized prims
162 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 162 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
163 163
@@ -176,10 +176,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
176 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid 176 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
177 // otherwise, use the master avatar uuid instead 177 // otherwise, use the master avatar uuid instead
178 UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; 178 UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
179 179
180 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) 180 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
181 masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; 181 masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner;
182 182
183 foreach (SceneObjectPart part in sceneObject.Children.Values) 183 foreach (SceneObjectPart part in sceneObject.Children.Values)
184 { 184 {
185 if (!resolveUserUuid(part.CreatorID)) 185 if (!resolveUserUuid(part.CreatorID))
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
233 { 233 {
234 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0); 234 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0);
235 } 235 }
236 236
237 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage); 237 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage);
238 } 238 }
239 239
@@ -290,12 +290,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
290 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 290 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
291 291
292 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); 292 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty);
293 asset.Type = assetType; 293 asset.Metadata.Type = assetType;
294 asset.Data = data; 294 asset.Data = data;
295 295
296 m_scene.AssetCache.AddAsset(asset); 296 m_scene.AssetCache.AddAsset(asset);
297 297
298 /** 298 /**
299 * Create layers on decode for image assets. This is likely to significantly increase the time to load archives so 299 * Create layers on decode for image assets. This is likely to significantly increase the time to load archives so
300 * it might be best done when dearchive takes place on a separate thread 300 * it might be best done when dearchive takes place on a separate thread
301 if (asset.Type=AssetType.Texture) 301 if (asset.Type=AssetType.Texture)
@@ -317,7 +317,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
317 return false; 317 return false;
318 } 318 }
319 } 319 }
320 320
321 /// <summary> 321 /// <summary>
322 /// Load region settings data 322 /// Load region settings data
323 /// </summary> 323 /// </summary>
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
329 private bool LoadRegionSettings(string settingsPath, byte[] data) 329 private bool LoadRegionSettings(string settingsPath, byte[] data)
330 { 330 {
331 RegionSettings loadedRegionSettings; 331 RegionSettings loadedRegionSettings;
332 332
333 try 333 try
334 { 334 {
335 loadedRegionSettings = RegionSettingsSerializer.Deserialize(data); 335 loadedRegionSettings = RegionSettingsSerializer.Deserialize(data);
@@ -337,13 +337,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
337 catch (Exception e) 337 catch (Exception e)
338 { 338 {
339 m_log.ErrorFormat( 339 m_log.ErrorFormat(
340 "[ARCHIVER]: Could not parse region settings file {0}. Ignoring. Exception was {1}", 340 "[ARCHIVER]: Could not parse region settings file {0}. Ignoring. Exception was {1}",
341 settingsPath, e); 341 settingsPath, e);
342 return false; 342 return false;
343 } 343 }
344 344
345 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; 345 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
346 346
347 currentRegionSettings.AgentLimit = loadedRegionSettings.AgentLimit; 347 currentRegionSettings.AgentLimit = loadedRegionSettings.AgentLimit;
348 currentRegionSettings.AllowDamage = loadedRegionSettings.AllowDamage; 348 currentRegionSettings.AllowDamage = loadedRegionSettings.AllowDamage;
349 currentRegionSettings.AllowLandJoinDivide = loadedRegionSettings.AllowLandJoinDivide; 349 currentRegionSettings.AllowLandJoinDivide = loadedRegionSettings.AllowLandJoinDivide;
@@ -373,10 +373,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
373 currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; 373 currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
374 currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; 374 currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
375 currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; 375 currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
376 376
377 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 377 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
378 estateModule.sendRegionHandshakeToAll(); 378 estateModule.sendRegionHandshakeToAll();
379 379
380 return true; 380 return true;
381 } 381 }
382 382
@@ -411,11 +411,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
411 if (File.Exists(path)) 411 if (File.Exists(path))
412 { 412 {
413 return new FileStream(path, FileMode.Open); 413 return new FileStream(path, FileMode.Open);
414 } 414 }
415 else 415 else
416 { 416 {
417 Uri uri = new Uri(path); // throw exception if not valid URI 417 Uri uri = new Uri(path); // throw exception if not valid URI
418 if (uri.Scheme == "file") 418 if (uri.Scheme == "file")
419 { 419 {
420 return new FileStream(uri.AbsolutePath, FileMode.Open); 420 return new FileStream(uri.AbsolutePath, FileMode.Open);
421 } 421 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
index 75ae474..36a60f3 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
@@ -86,16 +86,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
86 86
87 string extension = string.Empty; 87 string extension = string.Empty;
88 88
89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type))
90 { 90 {
91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type];
92 } 92 }
93 93
94 xtw.WriteElementString("filename", uuid.ToString() + extension); 94 xtw.WriteElementString("filename", uuid.ToString() + extension);
95 95
96 xtw.WriteElementString("name", asset.Name); 96 xtw.WriteElementString("name", asset.Metadata.Name);
97 xtw.WriteElementString("description", asset.Description); 97 xtw.WriteElementString("description", asset.Metadata.Description);
98 xtw.WriteElementString("asset-type", asset.Type.ToString()); 98 xtw.WriteElementString("asset-type", asset.Metadata.Type.ToString());
99 99
100 xtw.WriteEndElement(); 100 xtw.WriteEndElement();
101 } 101 }
@@ -123,15 +123,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
123 123
124 string extension = string.Empty; 124 string extension = string.Empty;
125 125
126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type))
127 { 127 {
128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type];
129 } 129 }
130 else 130 else
131 { 131 {
132 m_log.ErrorFormat( 132 m_log.ErrorFormat(
133 "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded", 133 "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded",
134 asset.Type, asset.ID); 134 asset.Metadata.Type, asset.Metadata.ID);
135 } 135 }
136 136
137 archive.AddFile( 137 archive.AddFile(
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
index b26fe4c..0ef1e1d 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
@@ -157,8 +157,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
157 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); 157 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
158 158
159 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); 159 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name);
160 asset.Description = metadata.Description; 160 asset.Metadata.Description = metadata.Description;
161 asset.Type = metadata.AssetType; 161 asset.Metadata.Type = metadata.AssetType;
162 asset.Data = data; 162 asset.Data = data;
163 163
164 m_cache.AddAsset(asset); 164 m_cache.AddAsset(asset);
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
index 6d69443..2ba4e34 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
@@ -37,13 +37,13 @@ using OpenSim.Region.Environment.Scenes;
37 37
38namespace OpenSim.Region.Environment.Modules.World.Estate 38namespace OpenSim.Region.Environment.Modules.World.Estate
39{ 39{
40 40
41 public class EstateTerrainXferHandler 41 public class EstateTerrainXferHandler
42 { 42 {
43 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private AssetBase m_asset; 45 private AssetBase m_asset;
46 46
47 public delegate void TerrainUploadComplete(string name, byte[] filedata, IClientAPI remoteClient); 47 public delegate void TerrainUploadComplete(string name, byte[] filedata, IClientAPI remoteClient);
48 48
49 public event TerrainUploadComplete TerrainUploadDone; 49 public event TerrainUploadComplete TerrainUploadDone;
@@ -52,21 +52,21 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
52 //private string m_name = String.Empty; 52 //private string m_name = String.Empty;
53 //private UUID TransactionID = UUID.Zero; 53 //private UUID TransactionID = UUID.Zero;
54 private sbyte type = 0; 54 private sbyte type = 0;
55 55
56 public ulong mXferID; 56 public ulong mXferID;
57 private TerrainUploadComplete handlerTerrainUploadDone; 57 private TerrainUploadComplete handlerTerrainUploadDone;
58 58
59 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) 59 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
60 { 60 {
61 61
62 m_asset = new AssetBase(); 62 m_asset = new AssetBase();
63 m_asset.FullID = UUID.Zero; 63 m_asset.Metadata.FullID = UUID.Zero;
64 m_asset.Type = type; 64 m_asset.Metadata.Type = type;
65 m_asset.Data = new byte[0]; 65 m_asset.Data = new byte[0];
66 m_asset.Name = pClientFilename; 66 m_asset.Metadata.Name = pClientFilename;
67 m_asset.Description = "empty"; 67 m_asset.Metadata.Description = "empty";
68 m_asset.Local = true; 68 m_asset.Metadata.Local = true;
69 m_asset.Temporary = true; 69 m_asset.Metadata.Temporary = true;
70 70
71 } 71 }
72 72
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
78 public void RequestStartXfer(IClientAPI pRemoteClient) 78 public void RequestStartXfer(IClientAPI pRemoteClient)
79 { 79 {
80 mXferID = Util.GetNextXferID(); 80 mXferID = Util.GetNextXferID();
81 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); 81 pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name));
82 } 82 }
83 83
84 /// <summary> 84 /// <summary>
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
86 /// </summary> 86 /// </summary>
87 /// <param name="xferID"></param> 87 /// <param name="xferID"></param>
88 /// <param name="packetID"></param> 88 /// <param name="packetID"></param>
89 /// <param name="data"></param> 89 /// <param name="data"></param>
90 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) 90 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
91 { 91 {
92 if (mXferID == xferID) 92 if (mXferID == xferID)
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
110 if ((packetID & 0x80000000) != 0) 110 if ((packetID & 0x80000000) != 0)
111 { 111 {
112 SendCompleteMessage(remoteClient); 112 SendCompleteMessage(remoteClient);
113 113
114 } 114 }
115 } 115 }
116 } 116 }
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
120 handlerTerrainUploadDone = TerrainUploadDone; 120 handlerTerrainUploadDone = TerrainUploadDone;
121 if (handlerTerrainUploadDone != null) 121 if (handlerTerrainUploadDone != null)
122 { 122 {
123 handlerTerrainUploadDone(m_asset.Name,m_asset.Data, remoteClient); 123 handlerTerrainUploadDone(m_asset.Metadata.Name, m_asset.Data, remoteClient);
124 } 124 }
125 } 125 }
126 } 126 }
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
index 3acaa21..73a5a3a 100644
--- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
@@ -1,29 +1,29 @@
1/** 1/**
2 * Copyright (c) 2008, Contributors. All rights reserved. 2 * Copyright (c) 2008, Contributors. All rights reserved.
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without modification, 5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met: 6 * are permitted provided that the following conditions are met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright notice, 8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice, 10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation 11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution. 12 * and/or other materials provided with the distribution.
13 * * Neither the name of the Organizations nor the names of Individual 13 * * Neither the name of the Organizations nor the names of Individual
14 * Contributors may be used to endorse or promote products derived from 14 * Contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission. 15 * this software without specific prior written permission.
16 * 16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THE POSSIBILITY OF SUCH DAMAGE.
26 * 26 *
27 */ 27 */
28 28
29using System; 29using System;
@@ -48,7 +48,7 @@ using OpenSim.Region.Environment.Scenes;
48 48
49namespace OpenSim.Region.Environment.Scenes.Hypergrid 49namespace OpenSim.Region.Environment.Scenes.Hypergrid
50{ 50{
51 public class HGAssetMapper 51 public class HGAssetMapper
52 { 52 {
53 #region Fields 53 #region Fields
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -128,12 +128,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
128 128
129 if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) 129 if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null))
130 { 130 {
131 m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); 131 m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Metadata.Name + " " + assetID);
132 // I think I need to store it in the asset DB too. 132 // I think I need to store it in the asset DB too.
133 // For now, let me just do it for textures and scripts 133 // For now, let me just do it for textures and scripts
134 if (((AssetType)asset.Type == AssetType.Texture) || 134 if (((AssetType)asset.Metadata.Type == AssetType.Texture) ||
135 ((AssetType)asset.Type == AssetType.LSLBytecode) || 135 ((AssetType)asset.Metadata.Type == AssetType.LSLBytecode) ||
136 ((AssetType)asset.Type == AssetType.LSLText)) 136 ((AssetType)asset.Metadata.Type == AssetType.LSLText))
137 { 137 {
138 AssetBase asset1 = new AssetBase(); 138 AssetBase asset1 = new AssetBase();
139 Copy(asset, asset1); 139 Copy(asset, asset1);
@@ -157,9 +157,9 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
157 if (asset1 != null) 157 if (asset1 != null)
158 { 158 {
159 // See long comment in AssetCache.AddAsset 159 // See long comment in AssetCache.AddAsset
160 if (!asset1.Temporary || asset1.Local) 160 if (!asset1.Metadata.Temporary || asset1.Metadata.Local)
161 { 161 {
162 // The asset cache returns instances of subclasses of AssetBase: 162 // The asset cache returns instances of subclasses of AssetBase:
163 // TextureImage or AssetInfo. So in passing them to the remote 163 // TextureImage or AssetInfo. So in passing them to the remote
164 // server we first need to convert this to instances of AssetBase, 164 // server we first need to convert this to instances of AssetBase,
165 // which is the serializable class for assets. 165 // which is the serializable class for assets.
@@ -179,14 +179,14 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
179 private void Copy(AssetBase from, AssetBase to) 179 private void Copy(AssetBase from, AssetBase to)
180 { 180 {
181 to.Data = from.Data; 181 to.Data = from.Data;
182 to.Description = from.Description; 182 to.Metadata.Description = from.Metadata.Description;
183 to.FullID = from.FullID; 183 to.Metadata.FullID = from.Metadata.FullID;
184 to.ID = from.ID; 184 to.Metadata.ID = from.Metadata.ID;
185 to.Local = from.Local; 185 to.Metadata.Local = from.Metadata.Local;
186 to.Name = from.Name; 186 to.Metadata.Name = from.Metadata.Name;
187 to.Temporary = from.Temporary; 187 to.Metadata.Temporary = from.Metadata.Temporary;
188 to.Type = from.Type; 188 to.Metadata.Type = from.Metadata.Type;
189 189
190 } 190 }
191 191
192 private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val) 192 private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val)
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
243 private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) 243 private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset)
244 { 244 {
245 Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); 245 Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>();
246 if ((asset != null) && ((AssetType)asset.Type == AssetType.Object)) 246 if ((asset != null) && ((AssetType)asset.Metadata.Type == AssetType.Object))
247 { 247 {
248 string ass_str = Utils.BytesToString(asset.Data); 248 string ass_str = Utils.BytesToString(asset.Data);
249 SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); 249 SceneObjectGroup sog = new SceneObjectGroup(ass_str, true);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 58ab058..cb9aee2 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -42,12 +42,12 @@ namespace OpenSim.Region.Environment.Scenes
42 public partial class Scene 42 public partial class Scene
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 /// <summary> 47 /// <summary>
48 /// Allows asynchronous derezzing of objects from the scene into a client's inventory. 48 /// Allows asynchronous derezzing of objects from the scene into a client's inventory.
49 /// </summary> 49 /// </summary>
50 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; 50 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter;
51 51
52 /// <summary> 52 /// <summary>
53 /// Start all the scripts in the scene which should be started. 53 /// Start all the scripts in the scene which should be started.
@@ -145,9 +145,9 @@ namespace OpenSim.Region.Environment.Scenes
145 else 145 else
146 { 146 {
147 m_log.ErrorFormat( 147 m_log.ErrorFormat(
148 "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", 148 "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item",
149 remoteClient.AgentId); 149 remoteClient.AgentId);
150 } 150 }
151 } 151 }
152 152
153 /// <summary> 153 /// <summary>
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes
175 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); 175 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
176 return UUID.Zero; 176 return UUID.Zero;
177 } 177 }
178 178
179 remoteClient.SendAgentAlertMessage("Notecard saved", false); 179 remoteClient.SendAgentAlertMessage("Notecard saved", false);
180 } 180 }
181 else if ((InventoryType)item.InvType == InventoryType.LSL) 181 else if ((InventoryType)item.InvType == InventoryType.LSL)
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
185 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); 185 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
186 return UUID.Zero; 186 return UUID.Zero;
187 } 187 }
188 188
189 remoteClient.SendAgentAlertMessage("Script saved", false); 189 remoteClient.SendAgentAlertMessage("Script saved", false);
190 } 190 }
191 191
@@ -193,21 +193,21 @@ namespace OpenSim.Region.Environment.Scenes
193 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); 193 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data);
194 AssetCache.AddAsset(asset); 194 AssetCache.AddAsset(asset);
195 195
196 item.AssetID = asset.FullID; 196 item.AssetID = asset.Metadata.FullID;
197 userInfo.UpdateItem(item); 197 userInfo.UpdateItem(item);
198 198
199 // remoteClient.SendInventoryItemCreateUpdate(item); 199 // remoteClient.SendInventoryItemCreateUpdate(item);
200 return (asset.FullID); 200 return (asset.Metadata.FullID);
201 } 201 }
202 } 202 }
203 } 203 }
204 else 204 else
205 { 205 {
206 m_log.ErrorFormat( 206 m_log.ErrorFormat(
207 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", 207 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update",
208 remoteClient.AgentId); 208 remoteClient.AgentId);
209 } 209 }
210 210
211 return UUID.Zero; 211 return UUID.Zero;
212 } 212 }
213 213
@@ -283,9 +283,9 @@ namespace OpenSim.Region.Environment.Scenes
283 { 283 {
284 part.Inventory.RemoveScriptInstance(item.ItemID); 284 part.Inventory.RemoveScriptInstance(item.ItemID);
285 } 285 }
286 286
287 // Update item with new asset 287 // Update item with new asset
288 item.AssetID = asset.FullID; 288 item.AssetID = asset.Metadata.FullID;
289 group.UpdateInventoryItem(item); 289 group.UpdateInventoryItem(item);
290 part.GetProperties(remoteClient); 290 part.GetProperties(remoteClient);
291 291
@@ -406,7 +406,7 @@ namespace OpenSim.Region.Environment.Scenes
406 /// </summary> 406 /// </summary>
407 /// <param name="recipientClient"></param> 407 /// <param name="recipientClient"></param>
408 /// <param name="senderId">ID of the sender of the item</param> 408 /// <param name="senderId">ID of the sender of the item</param>
409 /// <param name="itemId"></param> 409 /// <param name="itemId"></param>
410 public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) 410 public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId)
411 { 411 {
412 InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId); 412 InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId);
@@ -420,19 +420,19 @@ namespace OpenSim.Region.Environment.Scenes
420 /// </summary> 420 /// </summary>
421 /// <param name="recipient"></param> 421 /// <param name="recipient"></param>
422 /// <param name="senderId">ID of the sender of the item</param> 422 /// <param name="senderId">ID of the sender of the item</param>
423 /// <param name="itemId"></param> 423 /// <param name="itemId"></param>
424 /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> 424 /// <returns>The inventory item copy given, null if the give was unsuccessful</returns>
425 public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId) 425 public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId)
426 { 426 {
427 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); 427 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero);
428 } 428 }
429 429
430 /// <summary> 430 /// <summary>
431 /// Give an inventory item from one user to another 431 /// Give an inventory item from one user to another
432 /// </summary> 432 /// </summary>
433 /// <param name="recipient"></param> 433 /// <param name="recipient"></param>
434 /// <param name="senderId">ID of the sender of the item</param> 434 /// <param name="senderId">ID of the sender of the item</param>
435 /// <param name="itemId"></param> 435 /// <param name="itemId"></param>
436 /// <param name="recipientFolderId"> 436 /// <param name="recipientFolderId">
437 /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most 437 /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most
438 /// appropriate default folder. 438 /// appropriate default folder.
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes
485 itemCopy.AssetType = item.AssetType; 485 itemCopy.AssetType = item.AssetType;
486 itemCopy.InvType = item.InvType; 486 itemCopy.InvType = item.InvType;
487 itemCopy.Folder = recipientFolderId; 487 itemCopy.Folder = recipientFolderId;
488 488
489 if (Permissions.PropagatePermissions()) 489 if (Permissions.PropagatePermissions())
490 { 490 {
491 if (item.InvType == 6) 491 if (item.InvType == 6)
@@ -557,19 +557,19 @@ namespace OpenSim.Region.Environment.Scenes
557 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); 557 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder");
558 return null; 558 return null;
559 } 559 }
560 560
561 return null; 561 return null;
562 } 562 }
563 563
564 /// <summary> 564 /// <summary>
565 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent 565 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent
566 /// folders) is given. 566 /// folders) is given.
567 /// </summary> 567 /// </summary>
568 /// <param name="recipientId"></param> 568 /// <param name="recipientId"></param>
569 /// <param name="senderId">ID of the sender of the item</param> 569 /// <param name="senderId">ID of the sender of the item</param>
570 /// <param name="folderId"></param> 570 /// <param name="folderId"></param>
571 /// <param name="recipientParentFolderId"> 571 /// <param name="recipientParentFolderId">
572 /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the 572 /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the
573 /// recipient folder is the root folder 573 /// recipient folder is the root folder
574 /// </param> 574 /// </param>
575 /// <returns> 575 /// <returns>
@@ -588,24 +588,24 @@ namespace OpenSim.Region.Environment.Scenes
588 588
589 return null; 589 return null;
590 } 590 }
591 591
592 if (!senderUserInfo.HasReceivedInventory) 592 if (!senderUserInfo.HasReceivedInventory)
593 { 593 {
594 m_log.DebugFormat( 594 m_log.DebugFormat(
595 "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", 595 "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}",
596 senderId); 596 senderId);
597 597
598 return null; 598 return null;
599 } 599 }
600 600
601 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); 601 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId);
602 602
603 if (null == folder) 603 if (null == folder)
604 { 604 {
605 m_log.ErrorFormat( 605 m_log.ErrorFormat(
606 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); 606 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId);
607 607
608 return null; 608 return null;
609 } 609 }
610 610
611 CachedUserInfo recipientUserInfo 611 CachedUserInfo recipientUserInfo
@@ -618,30 +618,30 @@ namespace OpenSim.Region.Environment.Scenes
618 618
619 return null; 619 return null;
620 } 620 }
621 621
622 if (recipientParentFolderId == UUID.Zero) 622 if (recipientParentFolderId == UUID.Zero)
623 recipientParentFolderId = recipientUserInfo.RootFolder.ID; 623 recipientParentFolderId = recipientUserInfo.RootFolder.ID;
624 624
625 UUID newFolderId = UUID.Random(); 625 UUID newFolderId = UUID.Random();
626 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); 626 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId);
627 627
628 // XXX: Messy - we should really get this back in the CreateFolder call 628 // XXX: Messy - we should really get this back in the CreateFolder call
629 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); 629 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId);
630 630
631 // Give all the subfolders 631 // Give all the subfolders
632 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); 632 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls();
633 foreach (InventoryFolderImpl childFolder in subFolders) 633 foreach (InventoryFolderImpl childFolder in subFolders)
634 { 634 {
635 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); 635 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID);
636 } 636 }
637 637
638 // Give all the items 638 // Give all the items
639 List<InventoryItemBase> items = folder.RequestListOfItems(); 639 List<InventoryItemBase> items = folder.RequestListOfItems();
640 foreach (InventoryItemBase item in items) 640 foreach (InventoryItemBase item in items)
641 { 641 {
642 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); 642 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID);
643 } 643 }
644 644
645 return copiedFolder; 645 return copiedFolder;
646 } 646 }
647 647
@@ -688,7 +688,7 @@ namespace OpenSim.Region.Environment.Scenes
688 { 688 {
689 if (newName != String.Empty) 689 if (newName != String.Empty)
690 { 690 {
691 asset.Name = newName; 691 asset.Metadata.Name = newName;
692 } 692 }
693 else 693 else
694 { 694 {
@@ -728,10 +728,10 @@ namespace OpenSim.Region.Environment.Scenes
728 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) 728 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
729 { 729 {
730 AssetBase asset = new AssetBase(); 730 AssetBase asset = new AssetBase();
731 asset.Name = name; 731 asset.Metadata.Name = name;
732 asset.Description = description; 732 asset.Metadata.Description = description;
733 asset.Type = assetType; 733 asset.Metadata.Type = assetType;
734 asset.FullID = UUID.Random(); 734 asset.Metadata.FullID = UUID.Random();
735 asset.Data = (data == null) ? new byte[1] : data; 735 asset.Data = (data == null) ? new byte[1] : data;
736 736
737 return asset; 737 return asset;
@@ -831,11 +831,11 @@ namespace OpenSim.Region.Environment.Scenes
831 item.Owner = remoteClient.AgentId; 831 item.Owner = remoteClient.AgentId;
832 item.Creator = remoteClient.AgentId; 832 item.Creator = remoteClient.AgentId;
833 item.ID = UUID.Random(); 833 item.ID = UUID.Random();
834 item.AssetID = asset.FullID; 834 item.AssetID = asset.Metadata.FullID;
835 item.Description = asset.Description; 835 item.Description = asset.Metadata.Description;
836 item.Name = name; 836 item.Name = name;
837 item.Flags = flags; 837 item.Flags = flags;
838 item.AssetType = asset.Type; 838 item.AssetType = asset.Metadata.Type;
839 item.InvType = invType; 839 item.InvType = invType;
840 item.Folder = folderID; 840 item.Folder = folderID;
841 item.CurrentPermissions = currentMask; 841 item.CurrentPermissions = currentMask;
@@ -879,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes
879 879
880 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 880 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
881 return; 881 return;
882 882
883 if (transactionID == UUID.Zero) 883 if (transactionID == UUID.Zero)
884 { 884 {
885 CachedUserInfo userInfo 885 CachedUserInfo userInfo
@@ -890,7 +890,7 @@ namespace OpenSim.Region.Environment.Scenes
890 ScenePresence presence; 890 ScenePresence presence;
891 TryGetAvatar(remoteClient.AgentId, out presence); 891 TryGetAvatar(remoteClient.AgentId, out presence);
892 byte[] data = null; 892 byte[] data = null;
893 893
894 if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum 894 if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum
895 { 895 {
896 Vector3 pos = presence.AbsolutePosition; 896 Vector3 pos = presence.AbsolutePosition;
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes
905 AssetBase asset = CreateAsset(name, description, assetType, data); 905 AssetBase asset = CreateAsset(name, description, assetType, data);
906 AssetCache.AddAsset(asset); 906 AssetCache.AddAsset(asset);
907 907
908 CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); 908 CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
909 } 909 }
910 else 910 else
911 { 911 {
@@ -1429,7 +1429,7 @@ namespace OpenSim.Region.Environment.Scenes
1429 } 1429 }
1430 } 1430 }
1431 else // Updating existing item with new perms etc 1431 else // Updating existing item with new perms etc
1432 { 1432 {
1433 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 1433 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
1434 if (agentTransactions != null) 1434 if (agentTransactions != null)
1435 { 1435 {
@@ -1511,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes
1511 } 1511 }
1512 } 1512 }
1513 else // script has been rezzed directly into a prim's inventory 1513 else // script has been rezzed directly into a prim's inventory
1514 { 1514 {
1515 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); 1515 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder);
1516 if (part == null) 1516 if (part == null)
1517 return; 1517 return;
@@ -1521,10 +1521,10 @@ namespace OpenSim.Region.Environment.Scenes
1521 1521
1522 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1522 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1523 return; 1523 return;
1524 1524
1525 if (!Permissions.CanCreateObjectInventory( 1525 if (!Permissions.CanCreateObjectInventory(
1526 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1526 itemBase.InvType, part.UUID, remoteClient.AgentId))
1527 return; 1527 return;
1528 1528
1529 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}")); 1529 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
1530 AssetCache.AddAsset(asset); 1530 AssetCache.AddAsset(asset);
@@ -1550,7 +1550,7 @@ namespace OpenSim.Region.Environment.Scenes
1550 taskItem.Flags = itemBase.Flags; 1550 taskItem.Flags = itemBase.Flags;
1551 taskItem.PermsGranter = UUID.Zero; 1551 taskItem.PermsGranter = UUID.Zero;
1552 taskItem.PermsMask = 0; 1552 taskItem.PermsMask = 0;
1553 taskItem.AssetID = asset.FullID; 1553 taskItem.AssetID = asset.Metadata.FullID;
1554 1554
1555 part.Inventory.AddInventoryItem(taskItem, false); 1555 part.Inventory.AddInventoryItem(taskItem, false);
1556 part.GetProperties(remoteClient); 1556 part.GetProperties(remoteClient);
@@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Environment.Scenes
1737 grp.UUID, 1737 grp.UUID,
1738 remoteClient.AgentId); 1738 remoteClient.AgentId);
1739 permissionToDelete = permissionToTake; 1739 permissionToDelete = permissionToTake;
1740 1740
1741 if (permissionToDelete) 1741 if (permissionToDelete)
1742 { 1742 {
1743 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); 1743 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
@@ -1794,8 +1794,8 @@ namespace OpenSim.Region.Environment.Scenes
1794 /// </summary> 1794 /// </summary>
1795 /// <param name="action"></param> 1795 /// <param name="action"></param>
1796 /// <param name="folderID"></param> 1796 /// <param name="folderID"></param>
1797 /// <param name="objectGroup"></param> 1797 /// <param name="objectGroup"></param>
1798 /// <param name="remoteClient"> </param> 1798 /// <param name="remoteClient"> </param>
1799 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 1799 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
1800 SceneObjectGroup objectGroup, IClientAPI remoteClient) 1800 SceneObjectGroup objectGroup, IClientAPI remoteClient)
1801 { 1801 {
@@ -1807,7 +1807,7 @@ namespace OpenSim.Region.Environment.Scenes
1807 // 1807 //
1808 CachedUserInfo userInfo; 1808 CachedUserInfo userInfo;
1809 1809
1810 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || 1810 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
1811 action == DeRezAction.SaveToExistingUserInventoryItem) 1811 action == DeRezAction.SaveToExistingUserInventoryItem)
1812 { 1812 {
1813 // Take or take copy require a taker 1813 // Take or take copy require a taker
@@ -1850,25 +1850,25 @@ namespace OpenSim.Region.Environment.Scenes
1850 // 1850 //
1851 1851
1852 InventoryFolderBase folder = null; 1852 InventoryFolderBase folder = null;
1853 InventoryItemBase item = null; 1853 InventoryItemBase item = null;
1854 1854
1855 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1855 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1856 { 1856 {
1857 item = userInfo.RootFolder.FindItem( 1857 item = userInfo.RootFolder.FindItem(
1858 objectGroup.RootPart.FromUserInventoryItemID); 1858 objectGroup.RootPart.FromUserInventoryItemID);
1859 1859
1860 if (null == item) 1860 if (null == item)
1861 { 1861 {
1862 m_log.DebugFormat( 1862 m_log.DebugFormat(
1863 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", 1863 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
1864 objectGroup.Name, objectGroup.UUID); 1864 objectGroup.Name, objectGroup.UUID);
1865 return UUID.Zero; 1865 return UUID.Zero;
1866 } 1866 }
1867 } 1867 }
1868 else 1868 else
1869 { 1869 {
1870 // Folder magic 1870 // Folder magic
1871 // 1871 //
1872 if (action == DeRezAction.Delete) 1872 if (action == DeRezAction.Delete)
1873 { 1873 {
1874 // Deleting someone else's item 1874 // Deleting someone else's item
@@ -1940,7 +1940,7 @@ namespace OpenSim.Region.Environment.Scenes
1940 item.InvType = (int)InventoryType.Object; 1940 item.InvType = (int)InventoryType.Object;
1941 item.Folder = folder.ID; 1941 item.Folder = folder.ID;
1942 item.Owner = userInfo.UserProfile.ID; 1942 item.Owner = userInfo.UserProfile.ID;
1943 1943
1944 } 1944 }
1945 1945
1946 AssetBase asset = CreateAsset( 1946 AssetBase asset = CreateAsset(
@@ -1949,16 +1949,16 @@ namespace OpenSim.Region.Environment.Scenes
1949 (sbyte)AssetType.Object, 1949 (sbyte)AssetType.Object,
1950 Utils.StringToBytes(sceneObjectXml)); 1950 Utils.StringToBytes(sceneObjectXml));
1951 AssetCache.AddAsset(asset); 1951 AssetCache.AddAsset(asset);
1952 assetID = asset.FullID; 1952 assetID = asset.Metadata.FullID;
1953 1953
1954 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1954 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1955 { 1955 {
1956 item.AssetID = asset.FullID; 1956 item.AssetID = asset.Metadata.FullID;
1957 userInfo.UpdateItem(item); 1957 userInfo.UpdateItem(item);
1958 } 1958 }
1959 else 1959 else
1960 { 1960 {
1961 item.AssetID = asset.FullID; 1961 item.AssetID = asset.Metadata.FullID;
1962 1962
1963 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) 1963 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions())
1964 { 1964 {
@@ -1991,12 +1991,12 @@ namespace OpenSim.Region.Environment.Scenes
1991 1991
1992 // TODO: add the new fields (Flags, Sale info, etc) 1992 // TODO: add the new fields (Flags, Sale info, etc)
1993 item.CreationDate = Util.UnixTimeSinceEpoch(); 1993 item.CreationDate = Util.UnixTimeSinceEpoch();
1994 item.Description = asset.Description; 1994 item.Description = asset.Metadata.Description;
1995 item.Name = asset.Name; 1995 item.Name = asset.Metadata.Name;
1996 item.AssetType = asset.Type; 1996 item.AssetType = asset.Metadata.Type;
1997 1997
1998 userInfo.AddItem(item); 1998 userInfo.AddItem(item);
1999 1999
2000 if (remoteClient != null && item.Owner == remoteClient.AgentId) 2000 if (remoteClient != null && item.Owner == remoteClient.AgentId)
2001 { 2001 {
2002 remoteClient.SendInventoryItemCreateUpdate(item); 2002 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -2008,10 +2008,10 @@ namespace OpenSim.Region.Environment.Scenes
2008 { 2008 {
2009 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); 2009 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item);
2010 } 2010 }
2011 } 2011 }
2012 } 2012 }
2013 } 2013 }
2014 2014
2015 return assetID; 2015 return assetID;
2016 } 2016 }
2017 2017
@@ -2025,11 +2025,11 @@ namespace OpenSim.Region.Environment.Scenes
2025 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); 2025 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
2026 return; 2026 return;
2027 } 2027 }
2028 2028
2029 m_log.InfoFormat( 2029 m_log.InfoFormat(
2030 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", 2030 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
2031 grp.UUID, grp.GetAttachmentPoint()); 2031 grp.UUID, grp.GetAttachmentPoint());
2032 2032
2033 string sceneObjectXml = objectGroup.ToXmlString(); 2033 string sceneObjectXml = objectGroup.ToXmlString();
2034 2034
2035 CachedUserInfo userInfo = 2035 CachedUserInfo userInfo =
@@ -2077,10 +2077,10 @@ namespace OpenSim.Region.Environment.Scenes
2077 Utils.StringToBytes(sceneObjectXml)); 2077 Utils.StringToBytes(sceneObjectXml));
2078 AssetCache.AddAsset(asset); 2078 AssetCache.AddAsset(asset);
2079 2079
2080 item.AssetID = asset.FullID; 2080 item.AssetID = asset.Metadata.FullID;
2081 item.Description = asset.Description; 2081 item.Description = asset.Metadata.Description;
2082 item.Name = asset.Name; 2082 item.Name = asset.Metadata.Name;
2083 item.AssetType = asset.Type; 2083 item.AssetType = asset.Metadata.Type;
2084 item.InvType = (int)InventoryType.Object; 2084 item.InvType = (int)InventoryType.Object;
2085 item.Folder = foundFolder; 2085 item.Folder = foundFolder;
2086 2086
@@ -2118,10 +2118,10 @@ namespace OpenSim.Region.Environment.Scenes
2118 item.Creator = grp.RootPart.CreatorID; 2118 item.Creator = grp.RootPart.CreatorID;
2119 item.Owner = remoteClient.AgentId; 2119 item.Owner = remoteClient.AgentId;
2120 item.ID = UUID.Random(); 2120 item.ID = UUID.Random();
2121 item.AssetID = asset.FullID; 2121 item.AssetID = asset.Metadata.FullID;
2122 item.Description = asset.Description; 2122 item.Description = asset.Metadata.Description;
2123 item.Name = asset.Name; 2123 item.Name = asset.Metadata.Name;
2124 item.AssetType = asset.Type; 2124 item.AssetType = asset.Metadata.Type;
2125 item.InvType = (int)InventoryType.Object; 2125 item.InvType = (int)InventoryType.Object;
2126 2126
2127 item.Folder = UUID.Zero; // Objects folder! 2127 item.Folder = UUID.Zero; // Objects folder!
@@ -2241,20 +2241,20 @@ namespace OpenSim.Region.Environment.Scenes
2241 if (rezAsset != null) 2241 if (rezAsset != null)
2242 { 2242 {
2243 UUID itemId = UUID.Zero; 2243 UUID itemId = UUID.Zero;
2244 2244
2245 // If we have permission to copy then link the rezzed object back to the user inventory 2245 // If we have permission to copy then link the rezzed object back to the user inventory
2246 // item that it came from. This allows us to enable 'save object to inventory' 2246 // item that it came from. This allows us to enable 'save object to inventory'
2247 if (!Permissions.BypassPermissions()) 2247 if (!Permissions.BypassPermissions())
2248 { 2248 {
2249 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) 2249 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy)
2250 { 2250 {
2251 itemId = item.ID; 2251 itemId = item.ID;
2252 } 2252 }
2253 } 2253 }
2254 2254
2255 string xmlData = Utils.BytesToString(rezAsset.Data); 2255 string xmlData = Utils.BytesToString(rezAsset.Data);
2256 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); 2256 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true);
2257 2257
2258 if (!Permissions.CanRezObject( 2258 if (!Permissions.CanRezObject(
2259 group.Children.Count, remoteClient.AgentId, pos) 2259 group.Children.Count, remoteClient.AgentId, pos)
2260 && !attachment) 2260 && !attachment)
@@ -2351,12 +2351,12 @@ namespace OpenSim.Region.Environment.Scenes
2351 group.ClearPartAttachmentData(); 2351 group.ClearPartAttachmentData();
2352 } 2352 }
2353 } 2353 }
2354 2354
2355 if (!attachment) 2355 if (!attachment)
2356 { 2356 {
2357 // Fire on_rez 2357 // Fire on_rez
2358 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); 2358 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0);
2359 2359
2360 rootPart.ScheduleFullUpdate(); 2360 rootPart.ScheduleFullUpdate();
2361 } 2361 }
2362 2362
@@ -2500,7 +2500,7 @@ namespace OpenSim.Region.Environment.Scenes
2500 DeRezObject(null, grp.RootPart.LocalId, 2500 DeRezObject(null, grp.RootPart.LocalId,
2501 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); 2501 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
2502 } 2502 }
2503 2503
2504 return true; 2504 return true;
2505 } 2505 }
2506 2506
@@ -2632,7 +2632,7 @@ namespace OpenSim.Region.Environment.Scenes
2632 } 2632 }
2633 2633
2634 } 2634 }
2635 2635
2636 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); 2636 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
2637 } 2637 }
2638 2638
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 33dae66..32bd9aa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -115,18 +115,18 @@ namespace OpenSim.Region.Environment.Scenes
115 115
116 /// <value> 116 /// <value>
117 /// All the region modules attached to this scene. 117 /// All the region modules attached to this scene.
118 /// </value> 118 /// </value>
119 public Dictionary<string, IRegionModule> Modules 119 public Dictionary<string, IRegionModule> Modules
120 { 120 {
121 get { return m_modules; } 121 get { return m_modules; }
122 } 122 }
123 protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>(); 123 protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>();
124 124
125 /// <value> 125 /// <value>
126 /// The module interfaces available from this scene. 126 /// The module interfaces available from this scene.
127 /// </value> 127 /// </value>
128 protected Dictionary<Type, List<object> > ModuleInterfaces = new Dictionary<Type, List<object> >(); 128 protected Dictionary<Type, List<object> > ModuleInterfaces = new Dictionary<Type, List<object> >();
129 129
130 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); 130 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>();
131 protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); 131 protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>();
132 132
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes
143 protected IInterregionCommsIn m_interregionCommsIn; 143 protected IInterregionCommsIn m_interregionCommsIn;
144 protected IDialogModule m_dialogModule; 144 protected IDialogModule m_dialogModule;
145 protected internal ICapabilitiesModule CapsModule; 145 protected internal ICapabilitiesModule CapsModule;
146 146
147 // Central Update Loop 147 // Central Update Loop
148 148
149 protected int m_fps = 10; 149 protected int m_fps = 10;
@@ -280,10 +280,10 @@ namespace OpenSim.Region.Environment.Scenes
280 } 280 }
281 281
282 public int objectCapacity = 45000; 282 public int objectCapacity = 45000;
283 283
284 /// <value> 284 /// <value>
285 /// Registered classes that are capable of creating entities. 285 /// Registered classes that are capable of creating entities.
286 /// </value> 286 /// </value>
287 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); 287 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>();
288 288
289 #endregion 289 #endregion
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes
316 316
317 m_eventManager = new EventManager(); 317 m_eventManager = new EventManager();
318 m_permissions = new ScenePermissions(this); 318 m_permissions = new ScenePermissions(this);
319 319
320 m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this); 320 m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
321 m_asyncSceneObjectDeleter.Enabled = true; 321 m_asyncSceneObjectDeleter.Enabled = true;
322 322
@@ -421,7 +421,7 @@ namespace OpenSim.Region.Environment.Scenes
421 protected virtual void RegisterDefaultSceneEvents() 421 protected virtual void RegisterDefaultSceneEvents()
422 { 422 {
423 IDialogModule dm = RequestModuleInterface<IDialogModule>(); 423 IDialogModule dm = RequestModuleInterface<IDialogModule>();
424 424
425 if (dm != null) 425 if (dm != null)
426 m_eventManager.OnPermissionError += dm.SendAlertToUser; 426 m_eventManager.OnPermissionError += dm.SendAlertToUser;
427 } 427 }
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
564 m_incrementsof15seconds = (int)seconds / 15; 564 m_incrementsof15seconds = (int)seconds / 15;
565 m_RestartTimerCounter = 0; 565 m_RestartTimerCounter = 0;
566 m_restartTimer.AutoReset = true; 566 m_restartTimer.AutoReset = true;
567 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 567 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
568 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 568 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
569 m_restartTimer.Start(); 569 m_restartTimer.Start();
570 m_dialogModule.SendNotificationToUsersInRegion( 570 m_dialogModule.SendNotificationToUsersInRegion(
@@ -583,8 +583,8 @@ namespace OpenSim.Region.Environment.Scenes
583 { 583 {
584 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) 584 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
585 m_dialogModule.SendNotificationToUsersInRegion( 585 m_dialogModule.SendNotificationToUsersInRegion(
586 UUID.Random(), 586 UUID.Random(),
587 String.Empty, 587 String.Empty,
588 RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds"); 588 RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds");
589 } 589 }
590 else 590 else
@@ -717,7 +717,7 @@ namespace OpenSim.Region.Environment.Scenes
717 717
718 // Stop all client threads. 718 // Stop all client threads.
719 ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); }); 719 ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); });
720 720
721 // Stop updating the scene objects and agents. 721 // Stop updating the scene objects and agents.
722 //m_heartbeatTimer.Close(); 722 //m_heartbeatTimer.Close();
723 shuttingdown = true; 723 shuttingdown = true;
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Environment.Scenes
733 } 733 }
734 734
735 m_sceneGraph.Close(); 735 m_sceneGraph.Close();
736 736
737 // De-register with region communications (events cleanup) 737 // De-register with region communications (events cleanup)
738 UnRegisterRegionWithComms(); 738 UnRegisterRegionWithComms();
739 739
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Scenes
1400 //tc = System.Environment.TickCount - tc; 1400 //tc = System.Environment.TickCount - tc;
1401 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms"); 1401 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
1402 } 1402 }
1403 1403
1404 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (System.Environment.TickCount - tc) + " ms"); 1404 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (System.Environment.TickCount - tc) + " ms");
1405 1405
1406 bool drawPrimVolume = true; 1406 bool drawPrimVolume = true;
@@ -1644,13 +1644,13 @@ namespace OpenSim.Region.Environment.Scenes
1644 m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID; 1644 m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
1645 1645
1646 AssetBase asset = new AssetBase(); 1646 AssetBase asset = new AssetBase();
1647 asset.FullID = m_regInfo.RegionSettings.TerrainImageID; 1647 asset.Metadata.FullID = m_regInfo.RegionSettings.TerrainImageID;
1648 asset.Data = data; 1648 asset.Data = data;
1649 asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); 1649 asset.Metadata.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
1650 asset.Description = RegionInfo.RegionName; 1650 asset.Metadata.Description = RegionInfo.RegionName;
1651 1651
1652 asset.Type = 0; 1652 asset.Metadata.Type = 0;
1653 asset.Temporary = temporary; 1653 asset.Metadata.Temporary = temporary;
1654 AssetCache.AddAsset(asset); 1654 AssetCache.AddAsset(asset);
1655 } 1655 }
1656 1656
@@ -1699,7 +1699,7 @@ namespace OpenSim.Region.Environment.Scenes
1699 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", 1699 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children",
1700 group.Children == null ? 0 : group.Children.Count); 1700 group.Children == null ? 0 : group.Children.Count);
1701 } 1701 }
1702 1702
1703 AddRestoredSceneObject(group, true, true); 1703 AddRestoredSceneObject(group, true, true);
1704 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1704 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1705 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; 1705 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
@@ -1814,7 +1814,7 @@ namespace OpenSim.Region.Environment.Scenes
1814 { 1814 {
1815 //m_log.DebugFormat( 1815 //m_log.DebugFormat(
1816 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); 1816 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
1817 1817
1818 // If an entity creator has been registered for this prim type then use that 1818 // If an entity creator has been registered for this prim type then use that
1819 if (m_entityCreators.ContainsKey((PCode)shape.PCode)) 1819 if (m_entityCreators.ContainsKey((PCode)shape.PCode))
1820 return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape); 1820 return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
@@ -2094,7 +2094,7 @@ namespace OpenSim.Region.Environment.Scenes
2094 /// <returns></returns> 2094 /// <returns></returns>
2095 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod) 2095 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
2096 { 2096 {
2097 2097
2098 if (XMLMethod == 0) 2098 if (XMLMethod == 0)
2099 { 2099 {
2100 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID); 2100 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
@@ -2308,7 +2308,7 @@ namespace OpenSim.Region.Environment.Scenes
2308 2308
2309 CreateAndAddScenePresence(client); 2309 CreateAndAddScenePresence(client);
2310 } 2310 }
2311 2311
2312 m_LastLogin = System.Environment.TickCount; 2312 m_LastLogin = System.Environment.TickCount;
2313 EventManager.TriggerOnNewClient(client); 2313 EventManager.TriggerOnNewClient(client);
2314 } 2314 }
@@ -2390,7 +2390,7 @@ namespace OpenSim.Region.Environment.Scenes
2390 client.OnUnackedTerrain += TerrainUnAcked; 2390 client.OnUnackedTerrain += TerrainUnAcked;
2391 2391
2392 client.OnObjectOwner += ObjectOwner; 2392 client.OnObjectOwner += ObjectOwner;
2393 2393
2394 if (StatsReporter != null) 2394 if (StatsReporter != null)
2395 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsFromClientStats; 2395 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsFromClientStats;
2396 2396
@@ -2561,7 +2561,7 @@ namespace OpenSim.Region.Environment.Scenes
2561 m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}", 2561 m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}",
2562 client.Name, e); 2562 client.Name, e);
2563 } 2563 }
2564 2564
2565 m_log.Warn("[APPEARANCE]: Appearance not found, returning default"); 2565 m_log.Warn("[APPEARANCE]: Appearance not found, returning default");
2566 } 2566 }
2567 2567
@@ -2770,21 +2770,21 @@ namespace OpenSim.Region.Environment.Scenes
2770 2770
2771 ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID); 2771 ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID);
2772 if (sp != null) 2772 if (sp != null)
2773 { 2773 {
2774 m_log.DebugFormat( 2774 m_log.DebugFormat(
2775 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}", 2775 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}",
2776 agent.AgentID, RegionInfo.RegionName); 2776 agent.AgentID, RegionInfo.RegionName);
2777 2777
2778 sp.AdjustKnownSeeds(); 2778 sp.AdjustKnownSeeds();
2779 2779
2780 return; 2780 return;
2781 } 2781 }
2782 2782
2783 // Don't disable this log message - it's too helpful 2783 // Don't disable this log message - it's too helpful
2784 m_log.DebugFormat( 2784 m_log.DebugFormat(
2785 "[CONNECTION BEGIN]: Region {0} told of incoming client {1} {2} {3} (circuit code {4})", 2785 "[CONNECTION BEGIN]: Region {0} told of incoming client {1} {2} {3} (circuit code {4})",
2786 RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); 2786 RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode);
2787 2787
2788 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) 2788 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2789 { 2789 {
2790 m_log.WarnFormat( 2790 m_log.WarnFormat(
@@ -2808,10 +2808,10 @@ namespace OpenSim.Region.Environment.Scenes
2808 } 2808 }
2809 2809
2810 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2810 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2811 2811
2812 // rewrite session_id 2812 // rewrite session_id
2813 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); 2813 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
2814 2814
2815 if (userinfo != null) 2815 if (userinfo != null)
2816 { 2816 {
2817 userinfo.SessionID = agent.SessionID; 2817 userinfo.SessionID = agent.SessionID;
@@ -2873,12 +2873,12 @@ namespace OpenSim.Region.Environment.Scenes
2873 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) 2873 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
2874 { 2874 {
2875 ScenePresence presence; 2875 ScenePresence presence;
2876 2876
2877 lock (m_scenePresences) 2877 lock (m_scenePresences)
2878 { 2878 {
2879 m_scenePresences.TryGetValue(agentID, out presence); 2879 m_scenePresences.TryGetValue(agentID, out presence);
2880 } 2880 }
2881 2881
2882 if (presence != null) 2882 if (presence != null)
2883 { 2883 {
2884 try 2884 try
@@ -2902,14 +2902,14 @@ namespace OpenSim.Region.Environment.Scenes
2902 { 2902 {
2903// m_log.DebugFormat( 2903// m_log.DebugFormat(
2904// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); 2904// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
2905 2905
2906 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 2906 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
2907 if (childAgentUpdate != null) 2907 if (childAgentUpdate != null)
2908 { 2908 {
2909 childAgentUpdate.ChildAgentDataUpdate(cAgentData); 2909 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
2910 return true; 2910 return true;
2911 } 2911 }
2912 2912
2913 return false; 2913 return false;
2914 } 2914 }
2915 2915
@@ -2932,10 +2932,10 @@ namespace OpenSim.Region.Environment.Scenes
2932 // Not Implemented: 2932 // Not Implemented:
2933 //TODO: Do we need to pass the message on to one of our neighbors? 2933 //TODO: Do we need to pass the message on to one of our neighbors?
2934 } 2934 }
2935 2935
2936 return true; 2936 return true;
2937 } 2937 }
2938 2938
2939 return false; 2939 return false;
2940 } 2940 }
2941 2941
@@ -2957,7 +2957,7 @@ namespace OpenSim.Region.Environment.Scenes
2957 public bool IncomingCloseAgent(UUID agentID) 2957 public bool IncomingCloseAgent(UUID agentID)
2958 { 2958 {
2959 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); 2959 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
2960 2960
2961 ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); 2961 ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
2962 if (presence != null) 2962 if (presence != null)
2963 { 2963 {
@@ -2972,7 +2972,7 @@ namespace OpenSim.Region.Environment.Scenes
2972 } 2972 }
2973 2973
2974 // Don't do this to root agents on logout, it's not nice for the viewer 2974 // Don't do this to root agents on logout, it's not nice for the viewer
2975 if (presence.IsChildAgent) 2975 if (presence.IsChildAgent)
2976 { 2976 {
2977 // Tell a single agent to disconnect from the region. 2977 // Tell a single agent to disconnect from the region.
2978 IEventQueue eq = RequestModuleInterface<IEventQueue>(); 2978 IEventQueue eq = RequestModuleInterface<IEventQueue>();
@@ -2984,11 +2984,11 @@ namespace OpenSim.Region.Environment.Scenes
2984 else 2984 else
2985 presence.ControllingClient.SendShutdownConnectionNotice(); 2985 presence.ControllingClient.SendShutdownConnectionNotice();
2986 } 2986 }
2987 2987
2988 presence.ControllingClient.Close(true); 2988 presence.ControllingClient.Close(true);
2989 return true; 2989 return true;
2990 } 2990 }
2991 2991
2992 // Agent not here 2992 // Agent not here
2993 return false; 2993 return false;
2994 } 2994 }
@@ -3059,7 +3059,7 @@ namespace OpenSim.Region.Environment.Scenes
3059 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); 3059 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
3060 return; 3060 return;
3061 } 3061 }
3062 3062
3063 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags); 3063 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
3064 } 3064 }
3065 3065
@@ -3080,7 +3080,7 @@ namespace OpenSim.Region.Environment.Scenes
3080 if (m_scenePresences.ContainsKey(remoteClient.AgentId)) 3080 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
3081 sp = m_scenePresences[remoteClient.AgentId]; 3081 sp = m_scenePresences[remoteClient.AgentId];
3082 } 3082 }
3083 3083
3084 if (sp != null) 3084 if (sp != null)
3085 { 3085 {
3086 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, 3086 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
@@ -3211,7 +3211,7 @@ namespace OpenSim.Region.Environment.Scenes
3211 return; 3211 return;
3212 3212
3213 l.Add(mod); 3213 l.Add(mod);
3214 3214
3215 if (mod is IEntityCreator) 3215 if (mod is IEntityCreator)
3216 { 3216 {
3217 IEntityCreator entityCreator = (IEntityCreator)mod; 3217 IEntityCreator entityCreator = (IEntityCreator)mod;
@@ -3220,7 +3220,7 @@ namespace OpenSim.Region.Environment.Scenes
3220 m_entityCreators[pcode] = entityCreator; 3220 m_entityCreators[pcode] = entityCreator;
3221 } 3221 }
3222 } 3222 }
3223 3223
3224 ModuleInterfaces[typeof(M)] = l; 3224 ModuleInterfaces[typeof(M)] = l;
3225 } 3225 }
3226 3226
@@ -3243,7 +3243,7 @@ namespace OpenSim.Region.Environment.Scenes
3243 /// <summary> 3243 /// <summary>
3244 /// For the given interface, retrieve an array of region modules that implement it. 3244 /// For the given interface, retrieve an array of region modules that implement it.
3245 /// </summary> 3245 /// </summary>
3246 /// <returns>an empty array if there are no registered modules implementing that interface</returns> 3246 /// <returns>an empty array if there are no registered modules implementing that interface</returns>
3247 public override T[] RequestModuleInterfaces<T>() 3247 public override T[] RequestModuleInterfaces<T>()
3248 { 3248 {
3249 if (ModuleInterfaces.ContainsKey(typeof(T))) 3249 if (ModuleInterfaces.ContainsKey(typeof(T)))
@@ -3383,7 +3383,7 @@ namespace OpenSim.Region.Environment.Scenes
3383 else 3383 else
3384 { 3384 {
3385 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 3385 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
3386 } 3386 }
3387 } 3387 }
3388 } 3388 }
3389 3389
@@ -3855,14 +3855,14 @@ namespace OpenSim.Region.Environment.Scenes
3855 public override bool PresenceChildStatus(UUID avatarID) 3855 public override bool PresenceChildStatus(UUID avatarID)
3856 { 3856 {
3857 ScenePresence cp = GetScenePresence(avatarID); 3857 ScenePresence cp = GetScenePresence(avatarID);
3858 3858
3859 // FIXME: This is really crap - some logout code is relying on a NullReferenceException to halt its processing 3859 // FIXME: This is really crap - some logout code is relying on a NullReferenceException to halt its processing
3860 // This needs to be fixed properly by cleaning up the logout code. 3860 // This needs to be fixed properly by cleaning up the logout code.
3861 //if (cp != null) 3861 //if (cp != null)
3862 // return cp.IsChildAgent; 3862 // return cp.IsChildAgent;
3863 3863
3864 //return false; 3864 //return false;
3865 3865
3866 return cp.IsChildAgent; 3866 return cp.IsChildAgent;
3867 } 3867 }
3868 3868
@@ -4140,10 +4140,10 @@ namespace OpenSim.Region.Environment.Scenes
4140 4140
4141 item.ID = UUID.Random(); 4141 item.ID = UUID.Random();
4142 item.Owner = remoteClient.AgentId; 4142 item.Owner = remoteClient.AgentId;
4143 item.AssetID = asset.FullID; 4143 item.AssetID = asset.Metadata.FullID;
4144 item.Description = asset.Description; 4144 item.Description = asset.Metadata.Description;
4145 item.Name = asset.Name; 4145 item.Name = asset.Metadata.Name;
4146 item.AssetType = asset.Type; 4146 item.AssetType = asset.Metadata.Type;
4147 item.InvType = (int)InventoryType.Object; 4147 item.InvType = (int)InventoryType.Object;
4148 item.Folder = categoryID; 4148 item.Folder = categoryID;
4149 4149
@@ -4194,7 +4194,7 @@ namespace OpenSim.Region.Environment.Scenes
4194 if (!okToSell) 4194 if (!okToSell)
4195 { 4195 {
4196 m_dialogModule.SendAlertToUser( 4196 m_dialogModule.SendAlertToUser(
4197 remoteClient, "This item's inventory doesn't appear to be for sale"); 4197 remoteClient, "This item's inventory doesn't appear to be for sale");
4198 return false; 4198 return false;
4199 } 4199 }
4200 4200
@@ -4252,7 +4252,7 @@ namespace OpenSim.Region.Environment.Scenes
4252 4252
4253 // This routine is normally called from within a lock (OdeLock) from within the OdePhysicsScene 4253 // This routine is normally called from within a lock (OdeLock) from within the OdePhysicsScene
4254 // WARNING: be careful of deadlocks here if you manipulate the scene. Remember you are being called 4254 // WARNING: be careful of deadlocks here if you manipulate the scene. Remember you are being called
4255 // from within the OdePhysicsScene. 4255 // from within the OdePhysicsScene.
4256 4256
4257 protected internal void jointMoved(PhysicsJoint joint) 4257 protected internal void jointMoved(PhysicsJoint joint)
4258 { 4258 {
@@ -4348,7 +4348,7 @@ namespace OpenSim.Region.Environment.Scenes
4348 // FIXME: this causes a sequential lookup of all objects in the scene; use a dictionary 4348 // FIXME: this causes a sequential lookup of all objects in the scene; use a dictionary
4349 if (joint != null) 4349 if (joint != null)
4350 { 4350 {
4351 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages) 4351 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages)
4352 return; 4352 return;
4353 4353
4354 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene); 4354 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3e7ffab..734b3ef 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -37,8 +37,8 @@ using OpenSim.Framework;
37using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
38using OpenSim.Region.Environment.Interfaces; 38using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Scenes; 39using OpenSim.Region.Environment.Scenes;
40using OpenSim.Region.ScriptEngine.Shared; 40using OpenSim.Region.ScriptEngine.Shared;
41using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; 41using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
42using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 42using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
43using OpenSim.Region.ScriptEngine.Interfaces; 43using OpenSim.Region.ScriptEngine.Interfaces;
44using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 44using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
@@ -117,7 +117,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
117 m_host = host; 117 m_host = host;
118 m_localID = localID; 118 m_localID = localID;
119 m_itemID = itemID; 119 m_itemID = itemID;
120 120
121 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) 121 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
122 m_OSFunctionsEnabled = true; 122 m_OSFunctionsEnabled = true;
123 123
@@ -328,9 +328,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
328 CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); 328 CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice");
329 329
330 m_host.AddScriptLPS(1); 330 m_host.AddScriptLPS(1);
331 331
332 IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); 332 IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
333 333
334 if (dm != null) 334 if (dm != null)
335 dm.SendGeneralAlert(msg); 335 dm.SendGeneralAlert(msg);
336 } 336 }
@@ -776,7 +776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
776 return String.Empty; 776 return String.Empty;
777 } 777 }
778 } 778 }
779 779
780 public string osGetSimulatorVersion() 780 public string osGetSimulatorVersion()
781 { 781 {
782 // High because it can be used to target attacks to known weaknesses 782 // High because it can be used to target attacks to known weaknesses
@@ -802,37 +802,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
802 802
803 World.ParcelMediaSetTime((float)time); 803 World.ParcelMediaSetTime((float)time);
804 } 804 }
805 805
806 public Hashtable osParseJSON(string JSON) 806 public Hashtable osParseJSON(string JSON)
807 { 807 {
808 CheckThreatLevel(ThreatLevel.None, "osParseJSON"); 808 CheckThreatLevel(ThreatLevel.None, "osParseJSON");
809 809
810 m_host.AddScriptLPS(1); 810 m_host.AddScriptLPS(1);
811 811
812 // see http://www.json.org/ for more details on JSON 812 // see http://www.json.org/ for more details on JSON
813 813
814 string currentKey=null; 814 string currentKey=null;
815 Stack objectStack = new Stack(); // objects in JSON can be nested so we need to keep a track of this 815 Stack objectStack = new Stack(); // objects in JSON can be nested so we need to keep a track of this
816 Hashtable jsondata = new Hashtable(); // the hashtable to be returned 816 Hashtable jsondata = new Hashtable(); // the hashtable to be returned
817 int i=0; 817 int i=0;
818 try 818 try
819 { 819 {
820 820
821 // iterate through the serialised stream of tokens and store at the right depth in the hashtable 821 // iterate through the serialised stream of tokens and store at the right depth in the hashtable
822 // the top level hashtable may contain more nested hashtables within it each containing an objects representation 822 // the top level hashtable may contain more nested hashtables within it each containing an objects representation
823 for (i=0;i<JSON.Length; i++) 823 for (i=0;i<JSON.Length; i++)
824 { 824 {
825 825
826 // Console.WriteLine(""+JSON[i]); 826 // Console.WriteLine(""+JSON[i]);
827 switch (JSON[i]) 827 switch (JSON[i])
828 { 828 {
829 case '{': 829 case '{':
830 // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON 830 // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON
831 831
832 Hashtable currentObject = new Hashtable(); 832 Hashtable currentObject = new Hashtable();
833 if (objectStack.Count==0) // the stack should only be empty for the first outer object 833 if (objectStack.Count==0) // the stack should only be empty for the first outer object
834 { 834 {
835 835
836 objectStack.Push(jsondata); 836 objectStack.Push(jsondata);
837 } 837 }
838 else if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 838 else if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
@@ -842,12 +842,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
842 objectStack.Push(currentObject); 842 objectStack.Push(currentObject);
843 } 843 }
844 else 844 else
845 { 845 {
846 // add it to the parent hashtable 846 // add it to the parent hashtable
847 ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); 847 ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject);
848 objectStack.Push(currentObject); 848 objectStack.Push(currentObject);
849 } 849 }
850 850
851 // clear the key 851 // clear the key
852 currentKey=null; 852 currentKey=null;
853 break; 853 break;
@@ -856,25 +856,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
856 objectStack.Pop(); 856 objectStack.Pop();
857 break; 857 break;
858 case '"':// string boundary 858 case '"':// string boundary
859 859
860 string tokenValue=""; 860 string tokenValue="";
861 i++; // move to next char 861 i++; // move to next char
862 862
863 // just loop through until the next quote mark storing the string, ignore quotes with pre-ceding \ 863 // just loop through until the next quote mark storing the string, ignore quotes with pre-ceding \
864 while (JSON[i]!='"') 864 while (JSON[i]!='"')
865 { 865 {
866 tokenValue+=JSON[i]; 866 tokenValue+=JSON[i];
867 867
868 // handle escaped double quotes \" 868 // handle escaped double quotes \"
869 if (JSON[i]=='\\' && JSON[i+1]=='"') 869 if (JSON[i]=='\\' && JSON[i+1]=='"')
870 { 870 {
871 tokenValue+=JSON[i+1]; 871 tokenValue+=JSON[i+1];
872 i++; 872 i++;
873 } 873 }
874 i++; 874 i++;
875 875
876 } 876 }
877 877
878 // ok we've got a string, if we've got an array on the top of the stack then we store it 878 // ok we've got a string, if we've got an array on the top of the stack then we store it
879 if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 879 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
880 { 880 {
@@ -884,14 +884,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
884 { 884 {
885 currentKey = tokenValue; 885 currentKey = tokenValue;
886 } 886 }
887 else 887 else
888 { 888 {
889 // we have a key so lets store this value 889 // we have a key so lets store this value
890 ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); 890 ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue);
891 // now lets clear the key, we're done with it and moving on 891 // now lets clear the key, we're done with it and moving on
892 currentKey=null; 892 currentKey=null;
893 } 893 }
894 894
895 break; 895 break;
896 case ':':// key : value separator 896 case ':':// key : value separator
897 // just ignore 897 // just ignore
@@ -900,20 +900,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
900 // just ignore 900 // just ignore
901 break; 901 break;
902 case '[': // array start 902 case '[': // array start
903 ArrayList currentArray = new ArrayList(); 903 ArrayList currentArray = new ArrayList();
904 904
905 if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 905 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
906 { 906 {
907 ((ArrayList)objectStack.Peek()).Add(currentArray); 907 ((ArrayList)objectStack.Peek()).Add(currentArray);
908 } 908 }
909 else 909 else
910 { 910 {
911 ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); 911 ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray);
912 // clear the key 912 // clear the key
913 currentKey=null; 913 currentKey=null;
914 } 914 }
915 objectStack.Push(currentArray); 915 objectStack.Push(currentArray);
916 916
917 break; 917 break;
918 case ',':// seperator 918 case ',':// seperator
919 // just ignore 919 // just ignore
@@ -923,24 +923,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
923 objectStack.Pop(); 923 objectStack.Pop();
924 break; 924 break;
925 case 't': // we've found a character start not in quotes, it must be a boolean true 925 case 't': // we've found a character start not in quotes, it must be a boolean true
926 926
927 if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 927 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
928 { 928 {
929 ((ArrayList)objectStack.Peek()).Add(true); 929 ((ArrayList)objectStack.Peek()).Add(true);
930 } 930 }
931 else 931 else
932 { 932 {
933 ((Hashtable)objectStack.Peek()).Add(currentKey,true); 933 ((Hashtable)objectStack.Peek()).Add(currentKey,true);
934 currentKey=null; 934 currentKey=null;
935 } 935 }
936 936
937 //advance the counter to the letter 'e' 937 //advance the counter to the letter 'e'
938 i = i+3; 938 i = i+3;
939 break; 939 break;
940 case 'f': // we've found a character start not in quotes, it must be a boolean false 940 case 'f': // we've found a character start not in quotes, it must be a boolean false
941 941
942 if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 942 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
943 { 943 {
944 ((ArrayList)objectStack.Peek()).Add(false); 944 ((ArrayList)objectStack.Peek()).Add(false);
945 } 945 }
946 else 946 else
@@ -960,53 +960,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
960 default: 960 default:
961 // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately 961 // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately
962 // but for now we'll just do them as strings 962 // but for now we'll just do them as strings
963 963
964 string numberValue=""; 964 string numberValue="";
965 965
966 // just loop through until the next known marker quote mark storing the string 966 // just loop through until the next known marker quote mark storing the string
967 while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') 967 while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ')
968 { 968 {
969 numberValue+=""+JSON[i++]; 969 numberValue+=""+JSON[i++];
970 } 970 }
971 971
972 i--; // we want to process this caracter that marked the end of this string in the main loop 972 i--; // we want to process this caracter that marked the end of this string in the main loop
973 973
974 // ok we've got a string, if we've got an array on the top of the stack then we store it 974 // ok we've got a string, if we've got an array on the top of the stack then we store it
975 if (objectStack.Peek().ToString()=="System.Collections.ArrayList") 975 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
976 { 976 {
977 ((ArrayList)objectStack.Peek()).Add(numberValue); 977 ((ArrayList)objectStack.Peek()).Add(numberValue);
978 } 978 }
979 else 979 else
980 { 980 {
981 // we have a key so lets store this value 981 // we have a key so lets store this value
982 ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); 982 ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue);
983 // now lets clear the key, we're done with it and moving on 983 // now lets clear the key, we're done with it and moving on
984 currentKey=null; 984 currentKey=null;
985 } 985 }
986 986
987 break; 987 break;
988 } 988 }
989 } 989 }
990 } 990 }
991 catch(Exception) 991 catch(Exception)
992 { 992 {
993 OSSLError("osParseJSON: The JSON string is not valid " + JSON) ; 993 OSSLError("osParseJSON: The JSON string is not valid " + JSON) ;
994 } 994 }
995 995
996 return jsondata; 996 return jsondata;
997 } 997 }
998 998
999 // send a message to to object identified by the given UUID, a script in the object must implement the dataserver function 999 // send a message to to object identified by the given UUID, a script in the object must implement the dataserver function
1000 // the dataserver function is passed the ID of the calling function and a string message 1000 // the dataserver function is passed the ID of the calling function and a string message
1001 public void osMessageObject(LSL_Key objectUUID, string message) 1001 public void osMessageObject(LSL_Key objectUUID, string message)
1002 { 1002 {
1003 CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); 1003 CheckThreatLevel(ThreatLevel.Low, "osMessageObject");
1004 m_host.AddScriptLPS(1); 1004 m_host.AddScriptLPS(1);
1005 1005
1006 object[] resobj = new object[] { new LSL_Types.LSLString(m_host.UUID.ToString()), new LSL_Types.LSLString(message) }; 1006 object[] resobj = new object[] { new LSL_Types.LSLString(m_host.UUID.ToString()), new LSL_Types.LSLString(message) };
1007 1007
1008 SceneObjectPart sceneOP = World.GetSceneObjectPart(new UUID(objectUUID)); 1008 SceneObjectPart sceneOP = World.GetSceneObjectPart(new UUID(objectUUID));
1009 1009
1010 m_ScriptEngine.PostObjectEvent( 1010 m_ScriptEngine.PostObjectEvent(
1011 sceneOP.LocalId, new EventParams( 1011 sceneOP.LocalId, new EventParams(
1012 "dataserver", resobj, new DetectParams[0])); 1012 "dataserver", resobj, new DetectParams[0]));
@@ -1024,10 +1024,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1024 1024
1025 // Create new asset 1025 // Create new asset
1026 AssetBase asset = new AssetBase(); 1026 AssetBase asset = new AssetBase();
1027 asset.Name = notecardName; 1027 asset.Metadata.Name = notecardName;
1028 asset.Description = "Script Generated Notecard"; 1028 asset.Metadata.Description = "Script Generated Notecard";
1029 asset.Type = 7; 1029 asset.Metadata.Type = 7;
1030 asset.FullID = UUID.Random(); 1030 asset.Metadata.FullID = UUID.Random();
1031 string notecardData = ""; 1031 string notecardData = "";
1032 1032
1033 for (int i = 0; i < contents.Length; i++) { 1033 for (int i = 0; i < contents.Length; i++) {
@@ -1035,7 +1035,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1035 } 1035 }
1036 1036
1037 int textLength = notecardData.Length; 1037 int textLength = notecardData.Length;
1038 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " 1038 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
1039 + textLength.ToString() + "\n" + notecardData + "}\n"; 1039 + textLength.ToString() + "\n" + notecardData + "}\n";
1040 1040
1041 asset.Data = Encoding.ASCII.GetBytes(notecardData); 1041 asset.Data = Encoding.ASCII.GetBytes(notecardData);
@@ -1047,8 +1047,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1047 taskItem.ResetIDs(m_host.UUID); 1047 taskItem.ResetIDs(m_host.UUID);
1048 taskItem.ParentID = m_host.UUID; 1048 taskItem.ParentID = m_host.UUID;
1049 taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); 1049 taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
1050 taskItem.Name = asset.Name; 1050 taskItem.Name = asset.Metadata.Name;
1051 taskItem.Description = asset.Description; 1051 taskItem.Description = asset.Metadata.Description;
1052 taskItem.Type = 7; 1052 taskItem.Type = 7;
1053 taskItem.InvType = 7; 1053 taskItem.InvType = 7;
1054 taskItem.OwnerID = m_host.OwnerID; 1054 taskItem.OwnerID = m_host.OwnerID;
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1062 taskItem.Flags = 0; 1062 taskItem.Flags = 0;
1063 taskItem.PermsGranter = UUID.Zero; 1063 taskItem.PermsGranter = UUID.Zero;
1064 taskItem.PermsMask = 0; 1064 taskItem.PermsMask = 0;
1065 taskItem.AssetID = asset.FullID; 1065 taskItem.AssetID = asset.Metadata.FullID;
1066 1066
1067 m_host.Inventory.AddInventoryItem(taskItem, false); 1067 m_host.Inventory.AddInventoryItem(taskItem, false);
1068 } 1068 }