aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJeff Ames2008-08-18 00:39:10 +0000
committerJeff Ames2008-08-18 00:39:10 +0000
commit6ef9d4da901a346c232458317cca6268da888e2e (patch)
treedd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Environment/Scenes/Scene.cs
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs82
1 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e8a8a78..474f062 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes
74 public InnerScene m_innerScene; 74 public InnerScene m_innerScene;
75 75
76 /// <summary> 76 /// <summary>
77 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is 77 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
78 /// dispenced. 78 /// dispenced.
79 /// </summary> 79 /// </summary>
80 private uint m_lastAllocatedLocalId = 720000; 80 private uint m_lastAllocatedLocalId = 720000;
81 81
82 private readonly Mutex _primAllocateMutex = new Mutex(false); 82 private readonly Mutex _primAllocateMutex = new Mutex(false);
83 83
84 private int m_timePhase = 24; 84 private int m_timePhase = 24;
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes
607 public override void Close() 607 public override void Close()
608 { 608 {
609 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); 609 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
610 610
611 // Kick all ROOT agents with the message, 'The simulator is going down' 611 // Kick all ROOT agents with the message, 'The simulator is going down'
612 ForEachScenePresence(delegate(ScenePresence avatar) 612 ForEachScenePresence(delegate(ScenePresence avatar)
613 { 613 {
@@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes
765 if (m_frame % m_update_backup == 0) 765 if (m_frame % m_update_backup == 0)
766 { 766 {
767 UpdateStorageBackup(); 767 UpdateStorageBackup();
768 768
769 } 769 }
770 770
771 if (m_frame % m_update_terrain == 0) 771 if (m_frame % m_update_terrain == 0)
@@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes
1112 //X 1112 //X
1113 // . 1113 // .
1114 // 1114 //
1115 // Shade the terrain for shadows 1115 // Shade the terrain for shadows
1116 if ((x - 1 > 0) && (y - 1 > 0)) 1116 if ((x - 1 > 0) && (y - 1 > 0))
1117 { 1117 {
1118 hfvalue = (float)hm[x, y]; 1118 hfvalue = (float)hm[x, y];
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes
1133 else if (hfdiff < -0.3f) 1133 else if (hfdiff < -0.3f)
1134 { 1134 {
1135 // We have to desaturate and blacken the land at the same time 1135 // We have to desaturate and blacken the land at the same time
1136 // we use floats, colors use bytes, so shrink are space down to 1136 // we use floats, colors use bytes, so shrink are space down to
1137 // 0-255 1137 // 0-255
1138 1138
1139 1139
@@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes
1429 public void LazySaveGeneratedMaptile(byte[] data, bool temporary) 1429 public void LazySaveGeneratedMaptile(byte[] data, bool temporary)
1430 { 1430 {
1431 // Overwrites the local Asset cache with new maptile data 1431 // Overwrites the local Asset cache with new maptile data
1432 // Assets are single write, this causes the asset server to ignore this update, 1432 // Assets are single write, this causes the asset server to ignore this update,
1433 // but the local asset cache does not 1433 // but the local asset cache does not
1434 1434
1435 // this is on purpose! The net result of this is the region always has the most up to date 1435 // this is on purpose! The net result of this is the region always has the most up to date
1436 // map tile while protecting the (grid) asset database from bloat caused by a new asset each 1436 // map tile while protecting the (grid) asset database from bloat caused by a new asset each
1437 // time a mapimage is generated! 1437 // time a mapimage is generated!
1438 1438
1439 LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; 1439 LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID;
1440 1440
1441 int lastMapRefresh = 0; 1441 int lastMapRefresh = 0;
@@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes
1711 /// </param> 1711 /// </param>
1712 /// <returns> 1712 /// <returns>
1713 /// true if the object was added, false if an object with the same uuid was already in the scene 1713 /// true if the object was added, false if an object with the same uuid was already in the scene
1714 /// </returns> 1714 /// </returns>
1715 public bool AddRestoredSceneObject( 1715 public bool AddRestoredSceneObject(
1716 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) 1716 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
1717 { 1717 {
@@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes
1739 lock (Entities) 1739 lock (Entities)
1740 { 1740 {
1741 ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values); 1741 ICollection<EntityBase> entities = new List<EntityBase>(Entities.Values);
1742 1742
1743 foreach (EntityBase e in entities) 1743 foreach (EntityBase e in entities)
1744 { 1744 {
1745 if (e is SceneObjectGroup) 1745 if (e is SceneObjectGroup)
1746 DeleteSceneObject((SceneObjectGroup)e); 1746 DeleteSceneObject((SceneObjectGroup)e);
1747 } 1747 }
1748 } 1748 }
1749 } 1749 }
1750 1750
1751 /// <summary> 1751 /// <summary>
1752 /// Delete the given object from the scene. 1752 /// Delete the given object from the scene.
1753 /// </summary> 1753 /// </summary>
@@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes
1791 1791
1792 public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) 1792 public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset)
1793 { 1793 {
1794 m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); 1794 m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName);
1795 1795
1796 m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); 1796 m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset);
1797 } 1797 }
1798 1798
@@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes
1805 1805
1806 public void LoadPrimsFromXml2(string fileName) 1806 public void LoadPrimsFromXml2(string fileName)
1807 { 1807 {
1808 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); 1808 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName);
1809 1809
1810 m_serialiser.LoadPrimsFromXml2(this, fileName); 1810 m_serialiser.LoadPrimsFromXml2(this, fileName);
1811 } 1811 }
1812 1812
1813 public void LoadPrimsFromXml2(TextReader reader, bool startScripts) 1813 public void LoadPrimsFromXml2(TextReader reader, bool startScripts)
1814 { 1814 {
1815 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); 1815 m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName);
1816 1816
1817 m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); 1817 m_serialiser.LoadPrimsFromXml2(this, reader, startScripts);
1818 } 1818 }
1819 1819
1820 public void SavePrimsToXml2(string fileName) 1820 public void SavePrimsToXml2(string fileName)
1821 { 1821 {
1822 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); 1822 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName);
1823 1823
1824 m_serialiser.SavePrimsToXml2(this, fileName); 1824 m_serialiser.SavePrimsToXml2(this, fileName);
1825 } 1825 }
1826 1826
1827 public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) 1827 public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max)
1828 { 1828 {
1829 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); 1829 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName);
1830 1830
1831 m_serialiser.SavePrimsToXml2(this, stream, min, max); 1831 m_serialiser.SavePrimsToXml2(this, stream, min, max);
1832 } 1832 }
1833 1833
@@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes
1835 { 1835 {
1836 m_log.InfoFormat( 1836 m_log.InfoFormat(
1837 "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); 1837 "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName);
1838 1838
1839 List<EntityBase> entityList = GetEntities(); 1839 List<EntityBase> entityList = GetEntities();
1840 List<EntityBase> primList = new List<EntityBase>(); 1840 List<EntityBase> primList = new List<EntityBase>();
1841 1841
@@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes
1860 public void LoadPrimsFromArchive(string filePath) 1860 public void LoadPrimsFromArchive(string filePath)
1861 { 1861 {
1862 m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); 1862 m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath);
1863 1863
1864 m_archiver.DearchiveRegion(filePath); 1864 m_archiver.DearchiveRegion(filePath);
1865 } 1865 }
1866 1866
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes
1871 public void SavePrimsToArchive(string filePath) 1871 public void SavePrimsToArchive(string filePath)
1872 { 1872 {
1873 m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); 1873 m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath);
1874 1874
1875 m_archiver.ArchiveRegion(filePath); 1875 m_archiver.ArchiveRegion(filePath);
1876 } 1876 }
1877 1877
@@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes
1986 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); 1986 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor");
1987 if (XMLMethod == 0) 1987 if (XMLMethod == 0)
1988 { 1988 {
1989 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); 1989 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
1990 AddRestoredSceneObject(sceneObject, true, false); 1990 AddRestoredSceneObject(sceneObject, true, false);
1991 1991
1992 SceneObjectPart RootPrim = GetSceneObjectPart(primID); 1992 SceneObjectPart RootPrim = GetSceneObjectPart(primID);
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes
1999 { 1999 {
2000 DeleteSceneObject(grp); 2000 DeleteSceneObject(grp);
2001 } 2001 }
2002 2002
2003 m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); 2003 m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar");
2004 2004
2005 return false; 2005 return false;
@@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes
2075 else 2075 else
2076 { 2076 {
2077 m_log.DebugFormat( 2077 m_log.DebugFormat(
2078 "[SCENE]: Adding new {0} agent {1} {2} in {3}", 2078 "[SCENE]: Adding new {0} agent {1} {2} in {3}",
2079 (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); 2079 (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName);
2080 2080
2081 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); 2081 CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
@@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes
2156 client.OnScriptReset += ProcessScriptReset; 2156 client.OnScriptReset += ProcessScriptReset;
2157 client.OnGetScriptRunning += GetScriptRunning; 2157 client.OnGetScriptRunning += GetScriptRunning;
2158 client.OnSetScriptRunning += SetScriptRunning; 2158 client.OnSetScriptRunning += SetScriptRunning;
2159 2159
2160 client.OnRegionHandleRequest += RegionHandleRequest; 2160 client.OnRegionHandleRequest += RegionHandleRequest;
2161 2161
2162 client.OnUnackedTerrain += TerrainUnAcked; 2162 client.OnUnackedTerrain += TerrainUnAcked;
@@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes
2310 public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) 2310 public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
2311 { 2311 {
2312 appearance = null; // VS needs this line, mono doesn't 2312 appearance = null; // VS needs this line, mono doesn't
2313 2313
2314 try 2314 try
2315 { 2315 {
2316 if (m_AvatarFactory == null || 2316 if (m_AvatarFactory == null ||
@@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes
2323 catch (Exception e) 2323 catch (Exception e)
2324 { 2324 {
2325 m_log.ErrorFormat( 2325 m_log.ErrorFormat(
2326 "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", 2326 "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}",
2327 client.Name, client.AgentId, e); 2327 client.Name, client.AgentId, e);
2328 appearance = new AvatarAppearance(); 2328 appearance = new AvatarAppearance();
2329 } 2329 }
2330 } 2330 }
2331 2331
2332 /// <summary> 2332 /// <summary>
@@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes
2341 { 2341 {
2342 childagentYN = avatar.IsChildAgent; 2342 childagentYN = avatar.IsChildAgent;
2343 } 2343 }
2344 2344
2345 try 2345 try
2346 { 2346 {
2347 m_log.DebugFormat( 2347 m_log.DebugFormat(
2348 "[SCENE]: Removing {0} agent {1} from region {2}", 2348 "[SCENE]: Removing {0} agent {1} from region {2}",
2349 (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); 2349 (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
2350 2350
2351 if (avatar.IsChildAgent) 2351 if (avatar.IsChildAgent)
2352 { 2352 {
2353 m_innerScene.removeUserCount(false); 2353 m_innerScene.removeUserCount(false);
@@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes
2378 // We don't know which count to remove it from 2378 // We don't know which count to remove it from
2379 // Avatar is already disposed :/ 2379 // Avatar is already disposed :/
2380 } 2380 }
2381 2381
2382 m_eventManager.TriggerOnRemovePresence(agentID); 2382 m_eventManager.TriggerOnRemovePresence(agentID);
2383 Broadcast(delegate(IClientAPI client) 2383 Broadcast(delegate(IClientAPI client)
2384 { 2384 {
@@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes
2717 { 2717 {
2718 m_innerScene.removeUserCount(true); 2718 m_innerScene.removeUserCount(true);
2719 } 2719 }
2720 2720
2721 // Tell a single agent to disconnect from the region. 2721 // Tell a single agent to disconnect from the region.
2722 presence.ControllingClient.SendShutdownConnectionNotice(); 2722 presence.ControllingClient.SendShutdownConnectionNotice();
2723 2723
@@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes
3827 { 3827 {
3828 //should be doing this by parcel, but as its only for testing 3828 //should be doing this by parcel, but as its only for testing
3829 // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 3829 // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4
3830 // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist 3830 // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist
3831 // in the context of `<>c__CompilerGenerated17' 3831 // in the context of `<>c__CompilerGenerated17'
3832 // MW said it was okay to comment the body of this method out for now since the code is experimental 3832 // MW said it was okay to comment the body of this method out for now since the code is experimental
3833 // and will be replaced anyway 3833 // and will be replaced anyway
3834// ForEachClient(delegate(IClientAPI client) 3834// ForEachClient(delegate(IClientAPI client)
3835// { 3835// {
@@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes
3840// client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); 3840// client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0);
3841// }); 3841// });
3842 } 3842 }
3843 3843
3844 public void RegionHandleRequest(IClientAPI client, LLUUID regionID) 3844 public void RegionHandleRequest(IClientAPI client, LLUUID regionID)
3845 { 3845 {
3846 RegionInfo info; 3846 RegionInfo info;
@@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes
3860 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); 3860 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
3861 } 3861 }
3862 } 3862 }
3863} 3863}