diff options
author | Jeff Ames | 2009-05-05 09:59:15 +0000 |
---|---|---|
committer | Jeff Ames | 2009-05-05 09:59:15 +0000 |
commit | 8ea12ad6c06ec9cce4bc470b40079546f18b61c8 (patch) | |
tree | 7040d88a5dc67e31495d4de802ce5bba8f9b1df8 /OpenSim/Region | |
parent | Update svn properties. (diff) | |
download | opensim-SC-8ea12ad6c06ec9cce4bc470b40079546f18b61c8.zip opensim-SC-8ea12ad6c06ec9cce4bc470b40079546f18b61c8.tar.gz opensim-SC-8ea12ad6c06ec9cce4bc470b40079546f18b61c8.tar.bz2 opensim-SC-8ea12ad6c06ec9cce4bc470b40079546f18b61c8.tar.xz |
Add copyright header. Formatting cleanup. Ignore some generated files.
Diffstat (limited to 'OpenSim/Region')
4 files changed, 61 insertions, 73 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 1882005..aef0ada 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -36,13 +36,13 @@ using System.Reflection; | |||
36 | 36 | ||
37 | namespace OpenSim.Region.ClientStack.LindenUDP | 37 | namespace OpenSim.Region.ClientStack.LindenUDP |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// We use this class to store image data and associated request data and attributes | 40 | /// We use this class to store image data and associated request data and attributes |
41 | /// </summary> | 41 | /// </summary> |
42 | public class J2KImage | 42 | public class J2KImage |
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | public double m_designatedPriorityKey; | 46 | public double m_designatedPriorityKey; |
47 | public double m_requestedPriority = 0.0d; | 47 | public double m_requestedPriority = 0.0d; |
48 | public uint m_lastSequence = 0; | 48 | public uint m_lastSequence = 0; |
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
55 | public AssetBase m_MissingSubstitute = null; | 55 | public AssetBase m_MissingSubstitute = null; |
56 | public bool m_decoded = false; | 56 | public bool m_decoded = false; |
57 | public bool m_completedSendAtCurrentDiscardLevel; | 57 | public bool m_completedSendAtCurrentDiscardLevel; |
58 | 58 | ||
59 | private sbyte m_discardLevel=-1; | 59 | private sbyte m_discardLevel=-1; |
60 | private uint m_packetNumber; | 60 | private uint m_packetNumber; |
61 | private bool m_decoderequested = false; | 61 | private bool m_decoderequested = false; |
@@ -135,6 +135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
135 | { | 135 | { |
136 | return ((bytePosition - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1; | 136 | return ((bytePosition - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1; |
137 | } | 137 | } |
138 | |||
138 | public int LastPacketSize() | 139 | public int LastPacketSize() |
139 | { | 140 | { |
140 | if (m_packetNumber == 1) | 141 | if (m_packetNumber == 1) |
@@ -146,8 +147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
146 | lastsize = cImagePacketSize; | 147 | lastsize = cImagePacketSize; |
147 | } | 148 | } |
148 | return lastsize; | 149 | return lastsize; |
149 | } | 150 | } |
150 | |||
151 | 151 | ||
152 | public int CurrentBytePosition() | 152 | public int CurrentBytePosition() |
153 | { | 153 | { |
@@ -215,7 +215,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
215 | complete = true; | 215 | complete = true; |
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | // It's concievable that the client might request packet one | 219 | // It's concievable that the client might request packet one |
220 | // from a one packet image, which is really packet 0, | 220 | // from a one packet image, which is really packet 0, |
221 | // which would leave us with a negative imagePacketSize.. | 221 | // which would leave us with a negative imagePacketSize.. |
@@ -234,7 +234,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
234 | 234 | ||
235 | //Send the packet | 235 | //Send the packet |
236 | client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData); | 236 | client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData); |
237 | |||
238 | } | 237 | } |
239 | if (complete) | 238 | if (complete) |
240 | { | 239 | { |
@@ -257,7 +256,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
257 | { | 256 | { |
258 | if (m_packetNumber <= m_stopPacket) | 257 | if (m_packetNumber <= m_stopPacket) |
259 | { | 258 | { |
260 | |||
261 | bool SendMore = true; | 259 | bool SendMore = true; |
262 | if (!m_sentinfo || (m_packetNumber == 0)) | 260 | if (!m_sentinfo || (m_packetNumber == 0)) |
263 | { | 261 | { |
@@ -273,8 +271,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
273 | { | 271 | { |
274 | m_packetNumber = 2; | 272 | m_packetNumber = 2; |
275 | } | 273 | } |
276 | 274 | ||
277 | int count=0; | 275 | int count = 0; |
278 | while (SendMore && count < 5 && m_packetNumber <= m_stopPacket) | 276 | while (SendMore && count < 5 && m_packetNumber <= m_stopPacket) |
279 | { | 277 | { |
280 | count++; | 278 | count++; |
@@ -284,13 +282,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
284 | 282 | ||
285 | if (m_packetNumber > m_stopPacket) | 283 | if (m_packetNumber > m_stopPacket) |
286 | { | 284 | { |
287 | |||
288 | return true; | 285 | return true; |
289 | |||
290 | } | 286 | } |
291 | |||
292 | } | 287 | } |
293 | |||
294 | } | 288 | } |
295 | return false; | 289 | return false; |
296 | } | 290 | } |
@@ -343,12 +337,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
343 | } | 337 | } |
344 | else | 338 | else |
345 | { | 339 | { |
346 | |||
347 | |||
348 | //discardLevel of -1 means just update the priority | 340 | //discardLevel of -1 means just update the priority |
349 | if (m_requestedDiscardLevel != -1) | 341 | if (m_requestedDiscardLevel != -1) |
350 | { | 342 | { |
351 | |||
352 | //Evaluate the discard level | 343 | //Evaluate the discard level |
353 | //First, is it positive? | 344 | //First, is it positive? |
354 | if (m_requestedDiscardLevel >= 0) | 345 | if (m_requestedDiscardLevel >= 0) |
@@ -361,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
361 | { | 352 | { |
362 | m_discardLevel = m_requestedDiscardLevel; | 353 | m_discardLevel = m_requestedDiscardLevel; |
363 | } | 354 | } |
364 | 355 | ||
365 | //Calculate the m_stopPacket | 356 | //Calculate the m_stopPacket |
366 | if (Layers.Length > 0) | 357 | if (Layers.Length > 0) |
367 | { | 358 | { |
@@ -382,18 +373,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
382 | { | 373 | { |
383 | m_packetNumber = m_requestedPacketNumber; | 374 | m_packetNumber = m_requestedPacketNumber; |
384 | } | 375 | } |
385 | 376 | ||
386 | if (m_packetNumber <= m_stopPacket) | 377 | if (m_packetNumber <= m_stopPacket) |
387 | { | 378 | { |
388 | m_completedSendAtCurrentDiscardLevel = false; | 379 | m_completedSendAtCurrentDiscardLevel = false; |
389 | } | 380 | } |
390 | |||
391 | } | 381 | } |
392 | |||
393 | } | 382 | } |
394 | } | 383 | } |
395 | } | 384 | } |
396 | } | 385 | } |
397 | |||
398 | } | 386 | } |
399 | } | 387 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 9ffff97..9b39292 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | |||
@@ -248,7 +248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
248 | 248 | ||
249 | public void Cancel(uint sequence) | 249 | public void Cancel(uint sequence) |
250 | { | 250 | { |
251 | while(contents.Remove(sequence)) | 251 | while (contents.Remove(sequence)) |
252 | ; | 252 | ; |
253 | } | 253 | } |
254 | 254 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 924d6d9..b5c0d86 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
47 | public class InventoryArchiveWriteRequest | 47 | public class InventoryArchiveWriteRequest |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | /// <value> | 51 | /// <value> |
52 | /// Used to select all inventory nodes in a folder but not the folder itself | 52 | /// Used to select all inventory nodes in a folder but not the folder itself |
53 | /// </value> | 53 | /// </value> |
@@ -58,12 +58,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
58 | private string m_invPath; | 58 | private string m_invPath; |
59 | protected TarArchiveWriter m_archive; | 59 | protected TarArchiveWriter m_archive; |
60 | protected UuidGatherer m_assetGatherer; | 60 | protected UuidGatherer m_assetGatherer; |
61 | 61 | ||
62 | /// <value> | 62 | /// <value> |
63 | /// Used to collect the uuids of the assets that we need to save into the archive | 63 | /// Used to collect the uuids of the assets that we need to save into the archive |
64 | /// </value> | 64 | /// </value> |
65 | protected Dictionary<UUID, int> m_assetUuids = new Dictionary<UUID, int>(); | 65 | protected Dictionary<UUID, int> m_assetUuids = new Dictionary<UUID, int>(); |
66 | 66 | ||
67 | /// <value> | 67 | /// <value> |
68 | /// Used to collect the uuids of the users that we need to save into the archive | 68 | /// Used to collect the uuids of the users that we need to save into the archive |
69 | /// </value> | 69 | /// </value> |
@@ -125,16 +125,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
125 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path) | 125 | protected void SaveInvItem(InventoryItemBase inventoryItem, string path) |
126 | { | 126 | { |
127 | string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); | 127 | string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); |
128 | 128 | ||
129 | // Record the creator of this item for user record purposes (which might go away soon) | 129 | // Record the creator of this item for user record purposes (which might go away soon) |
130 | m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; | 130 | m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; |
131 | 131 | ||
132 | InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); | 132 | InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); |
133 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); | 133 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); |
134 | 134 | ||
135 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); | 135 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); |
136 | m_archive.WriteFile(filename, serialization); | 136 | m_archive.WriteFile(filename, serialization); |
137 | 137 | ||
138 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); | 138 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); |
139 | } | 139 | } |
140 | 140 | ||
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
154 | inventoryFolder.Name, | 154 | inventoryFolder.Name, |
155 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, | 155 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, |
156 | inventoryFolder.ID); | 156 | inventoryFolder.ID); |
157 | 157 | ||
158 | // We need to make sure that we record empty folders | 158 | // We need to make sure that we record empty folders |
159 | m_archive.WriteDir(path); | 159 | m_archive.WriteDir(path); |
160 | } | 160 | } |
@@ -225,12 +225,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
225 | } | 225 | } |
226 | 226 | ||
227 | bool foundStar = false; | 227 | bool foundStar = false; |
228 | 228 | ||
229 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl | 229 | // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl |
230 | // itself (possibly at a small loss in efficiency). | 230 | // itself (possibly at a small loss in efficiency). |
231 | string[] components | 231 | string[] components |
232 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | 232 | = m_invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); |
233 | 233 | ||
234 | int maxComponentIndex = components.Length - 1; | 234 | int maxComponentIndex = components.Length - 1; |
235 | 235 | ||
236 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the | 236 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
240 | foundStar = true; | 240 | foundStar = true; |
241 | maxComponentIndex--; | 241 | maxComponentIndex--; |
242 | } | 242 | } |
243 | 243 | ||
244 | m_invPath = String.Empty; | 244 | m_invPath = String.Empty; |
245 | for (int i = 0; i <= maxComponentIndex; i++) | 245 | for (int i = 0; i <= maxComponentIndex; i++) |
246 | { | 246 | { |
@@ -296,24 +296,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
296 | //recurse through all dirs getting dirs and files | 296 | //recurse through all dirs getting dirs and files |
297 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); | 297 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); |
298 | } | 298 | } |
299 | 299 | ||
300 | SaveUsers(); | 300 | SaveUsers(); |
301 | new AssetsRequest(m_assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); | 301 | new AssetsRequest(m_assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); |
302 | } | 302 | } |
303 | 303 | ||
304 | /// <summary> | 304 | /// <summary> |
305 | /// Save information for the users that we've collected. | 305 | /// Save information for the users that we've collected. |
306 | /// </summary> | 306 | /// </summary> |
307 | protected void SaveUsers() | 307 | protected void SaveUsers() |
308 | { | 308 | { |
309 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving user information for {0} users", m_userUuids.Count); | 309 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving user information for {0} users", m_userUuids.Count); |
310 | 310 | ||
311 | foreach (UUID creatorId in m_userUuids.Keys) | 311 | foreach (UUID creatorId in m_userUuids.Keys) |
312 | { | 312 | { |
313 | // Record the creator of this item | 313 | // Record the creator of this item |
314 | CachedUserInfo creator | 314 | CachedUserInfo creator |
315 | = m_module.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); | 315 | = m_module.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); |
316 | 316 | ||
317 | if (creator != null) | 317 | if (creator != null) |
318 | { | 318 | { |
319 | m_archive.WriteFile( | 319 | m_archive.WriteFile( |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4dc1661..a516a5a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1861,7 +1861,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1861 | { | 1861 | { |
1862 | bool welcome = true; | 1862 | bool welcome = true; |
1863 | 1863 | ||
1864 | if(m_regInfo.EstateSettings.IsBanned(client.AgentId) && (!Permissions.IsGod(client.AgentId))) | 1864 | if (m_regInfo.EstateSettings.IsBanned(client.AgentId) && (!Permissions.IsGod(client.AgentId))) |
1865 | { | 1865 | { |
1866 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", | 1866 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", |
1867 | client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName); | 1867 | client.AgentId, client.FirstName, client.LastName, RegionInfo.RegionName); |
@@ -1876,7 +1876,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1876 | welcome = false; | 1876 | welcome = false; |
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | if(!welcome) | 1879 | if (!welcome) |
1880 | { | 1880 | { |
1881 | try | 1881 | try |
1882 | { | 1882 | { |
@@ -1899,46 +1899,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
1899 | } | 1899 | } |
1900 | else | 1900 | else |
1901 | { | 1901 | { |
1902 | SubscribeToClientEvents(client); | 1902 | SubscribeToClientEvents(client); |
1903 | ScenePresence presence; | 1903 | ScenePresence presence; |
1904 | 1904 | ||
1905 | if (m_restorePresences.ContainsKey(client.AgentId)) | 1905 | if (m_restorePresences.ContainsKey(client.AgentId)) |
1906 | { | 1906 | { |
1907 | m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); | 1907 | m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); |
1908 | 1908 | ||
1909 | presence = m_restorePresences[client.AgentId]; | 1909 | presence = m_restorePresences[client.AgentId]; |
1910 | m_restorePresences.Remove(client.AgentId); | 1910 | m_restorePresences.Remove(client.AgentId); |
1911 | 1911 | ||
1912 | // This is one of two paths to create avatars that are | 1912 | // This is one of two paths to create avatars that are |
1913 | // used. This tends to get called more in standalone | 1913 | // used. This tends to get called more in standalone |
1914 | // than grid, not really sure why, but as such needs | 1914 | // than grid, not really sure why, but as such needs |
1915 | // an explicity appearance lookup here. | 1915 | // an explicity appearance lookup here. |
1916 | AvatarAppearance appearance = null; | 1916 | AvatarAppearance appearance = null; |
1917 | GetAvatarAppearance(client, out appearance); | 1917 | GetAvatarAppearance(client, out appearance); |
1918 | presence.Appearance = appearance; | 1918 | presence.Appearance = appearance; |
1919 | 1919 | ||
1920 | presence.initializeScenePresence(client, RegionInfo, this); | 1920 | presence.initializeScenePresence(client, RegionInfo, this); |
1921 | 1921 | ||
1922 | m_sceneGraph.AddScenePresence(presence); | 1922 | m_sceneGraph.AddScenePresence(presence); |
1923 | 1923 | ||
1924 | lock (m_restorePresences) | 1924 | lock (m_restorePresences) |
1925 | { | 1925 | { |
1926 | Monitor.PulseAll(m_restorePresences); | 1926 | Monitor.PulseAll(m_restorePresences); |
1927 | } | 1927 | } |
1928 | } | 1928 | } |
1929 | else | 1929 | else |
1930 | { | 1930 | { |
1931 | m_log.DebugFormat( | 1931 | m_log.DebugFormat( |
1932 | "[SCENE]: Adding new child agent for {0} in {1}", | 1932 | "[SCENE]: Adding new child agent for {0} in {1}", |
1933 | client.Name, RegionInfo.RegionName); | 1933 | client.Name, RegionInfo.RegionName); |
1934 | 1934 | ||
1935 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 1935 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
1936 | 1936 | ||
1937 | CreateAndAddScenePresence(client); | 1937 | CreateAndAddScenePresence(client); |
1938 | } | 1938 | } |
1939 | 1939 | ||
1940 | m_LastLogin = Environment.TickCount; | 1940 | m_LastLogin = Environment.TickCount; |
1941 | EventManager.TriggerOnNewClient(client); | 1941 | EventManager.TriggerOnNewClient(client); |
1942 | } | 1942 | } |
1943 | } | 1943 | } |
1944 | 1944 | ||