aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs122
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs3
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs43
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs169
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneViewer.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
12 files changed, 218 insertions, 176 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 00a605e..6a6bd12 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2097,6 +2097,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2097 OutPacket(sendXfer, ThrottleOutPacketType.Asset); 2097 OutPacket(sendXfer, ThrottleOutPacketType.Asset);
2098 } 2098 }
2099 2099
2100 public void SendAbortXferPacket(ulong xferID)
2101 {
2102 AbortXferPacket xferItem = (AbortXferPacket)PacketPool.Instance.GetPacket(PacketType.AbortXfer);
2103 xferItem.XferID.ID = xferID;
2104 OutPacket(xferItem, ThrottleOutPacketType.Asset);
2105 }
2106
2100 public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, 2107 public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
2101 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, 2108 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
2102 int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, 2109 int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
index ef7dce8..c5a6e62 100644
--- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
@@ -40,8 +40,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
40 private Scene m_scene; 40 private Scene m_scene;
41 private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>(); 41 private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
42 private List<XferRequest> RequestTime = new List<XferRequest>(); 42 private List<XferRequest> RequestTime = new List<XferRequest>();
43 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); 43 private Dictionary<string, FileData> NewFiles = new Dictionary<string, FileData>();
44 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); 44 private Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
45 45
46 46
47 public struct XferRequest 47 public struct XferRequest
@@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
51 public string fileName; 51 public string fileName;
52 public DateTime timeStamp; 52 public DateTime timeStamp;
53 } 53 }
54
55 private class FileData
56 {
57 public byte[] Data;
58 public int Count;
59 }
54 60
55 #region IRegionModule Members 61 #region IRegionModule Members
56 62
@@ -89,20 +95,22 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
89 lock (NewFiles) 95 lock (NewFiles)
90 { 96 {
91 if (NewFiles.ContainsKey(fileName)) 97 if (NewFiles.ContainsKey(fileName))
92 { 98 NewFiles[fileName].Count++;
93 NewFiles[fileName] = data;
94 }
95 else 99 else
96 { 100 {
97 NewFiles.Add(fileName, data); 101 FileData fd = new FileData();
102 fd.Count = 1;
103 fd.Data = data;
104 NewFiles.Add(fileName, fd);
98 } 105 }
99 } 106 }
100 107
101 if (Requests.ContainsKey(fileName)) 108 // This should not be here
102 { 109 //if (Requests.ContainsKey(fileName))
103 RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName); 110 //{
104 Requests.Remove(fileName); 111 // RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName);
105 } 112 // Requests.Remove(fileName);
113 //}
106 114
107 return true; 115 return true;
108 } 116 }
@@ -113,6 +121,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
113 { 121 {
114 client.OnRequestXfer += RequestXfer; 122 client.OnRequestXfer += RequestXfer;
115 client.OnConfirmXfer += AckPacket; 123 client.OnConfirmXfer += AckPacket;
124 client.OnAbortXfer += AbortXfer;
116 } 125 }
117 126
118 /// <summary> 127 /// <summary>
@@ -125,20 +134,35 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
125 { 134 {
126 lock (NewFiles) 135 lock (NewFiles)
127 { 136 {
137 if (RequestTime.Count > 0)
138 {
139 TimeSpan ts = new TimeSpan(DateTime.UtcNow.Ticks - RequestTime[0].timeStamp.Ticks);
140 if (ts.TotalSeconds > 30)
141 {
142 ulong zxferid = RequestTime[0].xferID;
143 remoteClient.SendAbortXferPacket(zxferid);
144 RemoveXferData(zxferid);
145 RemoveOrDecrement(fileName);
146 }
147 }
148
128 if (NewFiles.ContainsKey(fileName)) 149 if (NewFiles.ContainsKey(fileName))
129 { 150 {
130 if (!Transfers.ContainsKey(xferID)) 151 if (!Transfers.ContainsKey(xferID))
131 { 152 {
132 byte[] fileData = NewFiles[fileName]; 153 byte[] fileData = NewFiles[fileName].Data;
133 XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient); 154 XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient);
134 155
135 Transfers.Add(xferID, transaction); 156 Transfers.Add(xferID, transaction);
136 NewFiles.Remove(fileName);
137 157
138 if (transaction.StartSend()) 158 if (transaction.StartSend())
139 { 159 {
140 Transfers.Remove(xferID); 160 RemoveXferData(xferID);
141 } 161 }
162
163 // The transaction for this file is either complete or on its way
164 RemoveOrDecrement(fileName);
165
142 } 166 }
143 } 167 }
144 else 168 else
@@ -150,6 +174,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
150 { 174 {
151 Requests.Remove(RequestTime[0].fileName); 175 Requests.Remove(RequestTime[0].fileName);
152 RequestTime.RemoveAt(0); 176 RequestTime.RemoveAt(0);
177 // Do we want to abort this here?
178 //remoteClient.SendAbortXfer(xferID);
153 } 179 }
154 } 180 }
155 181
@@ -165,22 +191,84 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
165 } 191 }
166 192
167 } 193 }
194
168 } 195 }
169 } 196 }
170 197
171 public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet) 198 public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet)
172 { 199 {
173 if (Transfers.ContainsKey(xferID)) 200 lock (NewFiles) // This is actually to lock Transfers
174 { 201 {
175 if (Transfers[xferID].AckPacket(packet)) 202 if (Transfers.ContainsKey(xferID))
176 { 203 {
204 XferDownLoad dl = Transfers[xferID];
205 if (Transfers[xferID].AckPacket(packet))
206 {
207 {
208 RemoveXferData(xferID);
209 RemoveOrDecrement(dl.FileName);
210 }
211 }
212 else
177 { 213 {
178 Transfers.Remove(xferID); 214
215 if (Requests.ContainsKey(dl.FileName))
216 {
217 //
218 XferRequest req = Requests[dl.FileName];
219 req.timeStamp = DateTime.UtcNow;
220 Requests[dl.FileName] = req;
221 }
179 } 222 }
180 } 223 }
181 } 224 }
182 } 225 }
183 226
227 private void RemoveXferData(ulong xferID)
228 {
229 // NewFiles must be locked!
230 if (Transfers.ContainsKey(xferID))
231 {
232 // Qualifier distinguishes between the OpenMetaverse version and the nested class
233
234 XferModule.XferDownLoad xferItem = Transfers[xferID];
235 //string filename = xferItem.FileName;
236 Transfers.Remove(xferID);
237 xferItem.Data = new byte[0]; // Clear the data
238 xferItem.DataPointer = 0;
239
240 // If the abort comes in
241
242 if (Requests.ContainsKey(xferItem.FileName))
243 Requests.Remove(xferItem.FileName);
244
245 }
246 }
247
248 public void AbortXfer(IClientAPI remoteClient, ulong xferID)
249 {
250 lock (NewFiles)
251 {
252 if (Transfers.ContainsKey(xferID))
253 RemoveOrDecrement(Transfers[xferID].FileName);
254
255 RemoveXferData(xferID);
256 }
257 }
258
259 private void RemoveOrDecrement(string fileName)
260 {
261 // NewFiles must be locked
262
263 if (NewFiles.ContainsKey(fileName))
264 {
265 if (NewFiles[fileName].Count == 1)
266 NewFiles.Remove(fileName);
267 else
268 NewFiles[fileName].Count--;
269 }
270 }
271
184 #region Nested type: XferDownLoad 272 #region Nested type: XferDownLoad
185 273
186 public class XferDownLoad 274 public class XferDownLoad
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 80adc46..a3e3b4e 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -620,8 +620,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
620 } 620 }
621 catch (WebException e) 621 catch (WebException e)
622 { 622 {
623 m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})", 623 m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0} the host didn't respond " + e.ToString(), reginfo.ServerURI.ToString());
624 reginfo.ServerURI, e.Message);
625 } 624 }
626 625
627 return false; 626 return false;
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 7441a60..a6e2c03 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -602,6 +602,12 @@ namespace OpenSim.Region.Examples.SimpleModule
602 { 602 {
603 } 603 }
604 604
605 public virtual void SendAbortXferPacket(ulong xferID)
606 {
607
608 }
609
610
605 public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, 611 public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
606 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, 612 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
607 int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, 613 int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index ed40da9..4b17b9a 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -196,13 +196,6 @@ namespace OpenSim.Region.Framework.Interfaces
196 int RemoveInventoryItem(UUID itemID); 196 int RemoveInventoryItem(UUID itemID);
197 197
198 /// <summary> 198 /// <summary>
199 /// Return the name with which a client can request a xfer of this prim's inventory metadata
200 /// </summary>
201 string GetInventoryFileName();
202
203 bool GetInventoryFileName(IClientAPI client, uint localID);
204
205 /// <summary>
206 /// Serialize all the metadata for the items in this prim's inventory ready for sending to the client 199 /// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
207 /// </summary> 200 /// </summary>
208 /// <param name="xferManager"></param> 201 /// <param name="xferManager"></param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a1f1ea5..47c574a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -951,23 +951,12 @@ namespace OpenSim.Region.Framework.Scenes
951 /// <param name="primLocalID"></param> 951 /// <param name="primLocalID"></param>
952 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) 952 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
953 { 953 {
954 SceneObjectGroup group = GetGroupByPrim(primLocalID); 954 SceneObjectPart part = GetSceneObjectPart(primLocalID);
955 if (group != null) 955 if (part == null)
956 { 956 return;
957 bool fileChange = group.GetPartInventoryFileName(remoteClient, primLocalID); 957
958 if (fileChange) 958 if (XferManager != null)
959 { 959 part.Inventory.RequestInventoryFile(remoteClient, XferManager);
960 if (XferManager != null)
961 {
962 group.RequestInventoryFile(remoteClient, primLocalID, XferManager);
963 }
964 }
965 }
966 else
967 {
968 m_log.ErrorFormat(
969 "[PRIM INVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID);
970 }
971 } 960 }
972 961
973 /// <summary> 962 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d915807..deeb817 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1093,6 +1093,7 @@ namespace OpenSim.Region.Framework.Scenes
1093 { 1093 {
1094 m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName); 1094 m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
1095 HeartbeatThread.Abort(); 1095 HeartbeatThread.Abort();
1096 Watchdog.RemoveThread(HeartbeatThread.ManagedThreadId);
1096 HeartbeatThread = null; 1097 HeartbeatThread = null;
1097 } 1098 }
1098 m_lastUpdate = Util.EnvironmentTickCount(); 1099 m_lastUpdate = Util.EnvironmentTickCount();
@@ -4801,7 +4802,7 @@ namespace OpenSim.Region.Framework.Scenes
4801 if (m_firstHeartbeat) 4802 if (m_firstHeartbeat)
4802 return; 4803 return;
4803 4804
4804 if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 2000) 4805 if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000)
4805 StartTimer(); 4806 StartTimer();
4806 } 4807 }
4807 4808
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 6cc7231..50521c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -77,49 +77,6 @@ namespace OpenSim.Region.Framework.Scenes
77 } 77 }
78 78
79 /// <summary> 79 /// <summary>
80 ///
81 /// </summary>
82 /// <param name="remoteClient"></param>
83 /// <param name="localID"></param>
84 public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID)
85 {
86 SceneObjectPart part = GetChildPart(localID);
87 if (part != null)
88 {
89 return part.Inventory.GetInventoryFileName(remoteClient, localID);
90 }
91 else
92 {
93 m_log.ErrorFormat(
94 "[PRIM INVENTORY]: " +
95 "Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
96 localID, Name, UUID);
97 }
98 return false;
99 }
100
101 /// <summary>
102 /// Return serialized inventory metadata for the given constituent prim
103 /// </summary>
104 /// <param name="localID"></param>
105 /// <param name="xferManager"></param>
106 public void RequestInventoryFile(IClientAPI client, uint localID, IXfer xferManager)
107 {
108 SceneObjectPart part = GetChildPart(localID);
109 if (part != null)
110 {
111 part.Inventory.RequestInventoryFile(client, xferManager);
112 }
113 else
114 {
115 m_log.ErrorFormat(
116 "[PRIM INVENTORY]: " +
117 "Couldn't find part {0} in object group {1}, {2} to request inventory data",
118 localID, Name, UUID);
119 }
120 }
121
122 /// <summary>
123 /// Add an inventory item to a prim in this group. 80 /// Add an inventory item to a prim in this group.
124 /// </summary> 81 /// </summary>
125 /// <param name="remoteClient"></param> 82 /// <param name="remoteClient"></param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 8fcfcc5..9412e09 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -46,7 +46,8 @@ namespace OpenSim.Region.Framework.Scenes
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 private string m_inventoryFileName = String.Empty; 48 private string m_inventoryFileName = String.Empty;
49 private int m_inventoryFileNameSerial = 0; 49 private byte[] m_inventoryFileData = new byte[0];
50 private uint m_inventoryFileNameSerial = 0;
50 51
51 private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>(); 52 private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
52 53
@@ -930,39 +931,17 @@ namespace OpenSim.Region.Framework.Scenes
930 return -1; 931 return -1;
931 } 932 }
932 933
933 public string GetInventoryFileName() 934 private bool CreateInventoryFileName()
934 { 935 {
935 if (m_inventoryFileName == String.Empty) 936 if (m_inventoryFileName == String.Empty ||
936 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp"; 937 m_inventoryFileNameSerial < m_inventorySerial)
937 if (m_inventoryFileNameSerial < m_inventorySerial)
938 { 938 {
939 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp"; 939 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
940 } 940 m_inventoryFileNameSerial = m_inventorySerial;
941 return m_inventoryFileName;
942 }
943
944 /// <summary>
945 /// Return the name with which a client can request a xfer of this prim's inventory metadata
946 /// </summary>
947 /// <param name="client"></param>
948 /// <param name="localID"></param>
949 public bool GetInventoryFileName(IClientAPI client, uint localID)
950 {
951// m_log.DebugFormat(
952// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}",
953// client.AgentId, Name, UUID);
954
955 if (m_inventorySerial > 0)
956 {
957 client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
958 Utils.StringToBytes(GetInventoryFileName()));
959 return true; 941 return true;
960 } 942 }
961 else 943
962 { 944 return false;
963 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
964 return false;
965 }
966 } 945 }
967 946
968 /// <summary> 947 /// <summary>
@@ -971,78 +950,92 @@ namespace OpenSim.Region.Framework.Scenes
971 /// <param name="xferManager"></param> 950 /// <param name="xferManager"></param>
972 public void RequestInventoryFile(IClientAPI client, IXfer xferManager) 951 public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
973 { 952 {
974 byte[] fileData = new byte[0]; 953 bool changed = CreateInventoryFileName();
975 954
976 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
977 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
978 // isn't available (such as drag from prim inventory to agent inventory)
979 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); 955 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
980 956
957 Items.LockItemsForRead(true);
958
959 if (m_inventorySerial == 0) // No inventory
960 {
961 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
962 Items.LockItemsForRead(false);
963 return;
964 }
965
966 client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
967 Util.StringToBytes256(m_inventoryFileName));
968
969 if (!changed)
970 {
971 if (m_inventoryFileData.Length > 2)
972 {
973 xferManager.AddNewFile(m_inventoryFileName,
974 m_inventoryFileData);
975 Items.LockItemsForRead(false);
976 return;
977 }
978 }
979
981 bool includeAssets = false; 980 bool includeAssets = false;
982 if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId)) 981 if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
983 includeAssets = true; 982 includeAssets = true;
984 983
985 lock (m_items) 984 foreach (TaskInventoryItem item in m_items.Values)
986 { 985 {
987 foreach (TaskInventoryItem item in m_items.Values) 986 UUID ownerID = item.OwnerID;
988 { 987 uint everyoneMask = 0;
989 UUID ownerID = item.OwnerID; 988 uint baseMask = item.BasePermissions;
990 uint everyoneMask = 0; 989 uint ownerMask = item.CurrentPermissions;
991 uint baseMask = item.BasePermissions; 990 uint groupMask = item.GroupPermissions;
992 uint ownerMask = item.CurrentPermissions; 991
993 uint groupMask = item.GroupPermissions; 992 invString.AddItemStart();
994 993 invString.AddNameValueLine("item_id", item.ItemID.ToString());
995 invString.AddItemStart(); 994 invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
996 invString.AddNameValueLine("item_id", item.ItemID.ToString()); 995
997 invString.AddNameValueLine("parent_id", m_part.UUID.ToString()); 996 invString.AddPermissionsStart();
998 997
999 invString.AddPermissionsStart(); 998 invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
1000 999 invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
1001 invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); 1000 invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
1002 invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); 1001 invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
1003 invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); 1002 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
1004 invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); 1003
1005 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); 1004 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
1006 1005 invString.AddNameValueLine("owner_id", ownerID.ToString());
1007 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 1006
1008 invString.AddNameValueLine("owner_id", ownerID.ToString()); 1007 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
1009 1008
1010 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); 1009 invString.AddNameValueLine("group_id", item.GroupID.ToString());
1011 1010 invString.AddSectionEnd();
1012 invString.AddNameValueLine("group_id", item.GroupID.ToString()); 1011
1013 invString.AddSectionEnd(); 1012 if (includeAssets)
1014 1013 invString.AddNameValueLine("asset_id", item.AssetID.ToString());
1015 if (includeAssets) 1014 else
1016 invString.AddNameValueLine("asset_id", item.AssetID.ToString()); 1015 invString.AddNameValueLine("asset_id", UUID.Zero.ToString());
1017 else 1016 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
1018 invString.AddNameValueLine("asset_id", UUID.Zero.ToString()); 1017 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
1019 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); 1018 invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
1020 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); 1019
1021 invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); 1020 invString.AddSaleStart();
1022 1021 invString.AddNameValueLine("sale_type", "not");
1023 invString.AddSaleStart(); 1022 invString.AddNameValueLine("sale_price", "0");
1024 invString.AddNameValueLine("sale_type", "not"); 1023 invString.AddSectionEnd();
1025 invString.AddNameValueLine("sale_price", "0"); 1024
1026 invString.AddSectionEnd(); 1025 invString.AddNameValueLine("name", item.Name + "|");
1027 1026 invString.AddNameValueLine("desc", item.Description + "|");
1028 invString.AddNameValueLine("name", item.Name + "|"); 1027
1029 invString.AddNameValueLine("desc", item.Description + "|"); 1028 invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
1030 1029 invString.AddSectionEnd();
1031 invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
1032 invString.AddSectionEnd();
1033 }
1034 } 1030 }
1035 int count = m_items.Count;
1036 m_items.LockItemsForRead(false);
1037 1031
1038 fileData = Utils.StringToBytes(invString.BuildString); 1032 Items.LockItemsForRead(false);
1039 1033
1040 //m_log.Debug(Utils.BytesToString(fileData)); 1034 m_inventoryFileData = Utils.StringToBytes(invString.BuildString);
1041 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData));
1042 1035
1043 if (fileData.Length > 2) 1036 if (m_inventoryFileData.Length > 2)
1044 { 1037 {
1045 xferManager.AddNewFile(m_inventoryFileName, fileData); 1038 xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData);
1046 } 1039 }
1047 } 1040 }
1048 1041
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs
index b44a010..40a73a9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes
106 g.ScheduleFullUpdateToAvatar(m_presence); 106 g.ScheduleFullUpdateToAvatar(m_presence);
107 } 107 }
108 108
109 while (m_partsUpdateQueue.Count > 0) 109 while (m_partsUpdateQueue.Count != null && m_partsUpdateQueue.Count > 0)
110 { 110 {
111 SceneObjectPart part = m_partsUpdateQueue.Dequeue(); 111 SceneObjectPart part = m_partsUpdateQueue.Dequeue();
112 112
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 276e46d..75f6441 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1123,6 +1123,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1123 1123
1124 } 1124 }
1125 1125
1126 public void SendAbortXferPacket(ulong xferID)
1127 {
1128
1129 }
1130
1126 public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent) 1131 public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
1127 { 1132 {
1128 1133
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 39c3364..51949b4 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -687,6 +687,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
687 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) 687 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
688 { 688 {
689 } 689 }
690 public virtual void SendAbortXferPacket(ulong xferID)
691 {
692
693 }
690 694
691 public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, 695 public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
692 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, 696 int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,