aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJeff Ames2008-03-18 15:30:38 +0000
committerJeff Ames2008-03-18 15:30:38 +0000
commite5b91442822df211f9f8277aaf0c40e1339810f3 (patch)
tree116ac977981e7bea0b7dd4c8f9cbad87e02c5b65 /OpenSim/Region/Environment/Scenes/Scene.cs
parent* Applying Mantis Patch #518.2 - State not persisted in MySQL DataStore (diff)
downloadopensim-SC-e5b91442822df211f9f8277aaf0c40e1339810f3.zip
opensim-SC-e5b91442822df211f9f8277aaf0c40e1339810f3.tar.gz
opensim-SC-e5b91442822df211f9f8277aaf0c40e1339810f3.tar.bz2
opensim-SC-e5b91442822df211f9f8277aaf0c40e1339810f3.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs130
1 files changed, 65 insertions, 65 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1204020..6984d8f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -227,6 +227,7 @@ namespace OpenSim.Region.Environment.Scenes
227 get { return m_innerScene.RestorePresences; } 227 get { return m_innerScene.RestorePresences; }
228 set { m_innerScene.RestorePresences = value; } 228 set { m_innerScene.RestorePresences = value; }
229 } 229 }
230
230 #endregion 231 #endregion
231 232
232 #region Constructors 233 #region Constructors
@@ -395,15 +396,15 @@ namespace OpenSim.Region.Environment.Scenes
395 try 396 try
396 { 397 {
397 ForEachScenePresence(delegate(ScenePresence agent) 398 ForEachScenePresence(delegate(ScenePresence agent)
399 {
400 // If agent is a root agent.
401 if (!agent.IsChildAgent)
398 { 402 {
399 // If agent is a root agent. 403 //agent.ControllingClient.new
400 if (!agent.IsChildAgent) 404 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
401 { 405 InformClientOfNeighbor(agent, otherRegion);
402 //agent.ControllingClient.new
403 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
404 InformClientOfNeighbor(agent, otherRegion);
405 }
406 } 406 }
407 }
407 ); 408 );
408 } 409 }
409 catch (NullReferenceException) 410 catch (NullReferenceException)
@@ -463,7 +464,7 @@ namespace OpenSim.Region.Environment.Scenes
463 { 464 {
464 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) 465 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
465 SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + 466 SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " +
466 ((8 - m_RestartTimerCounter) * 15) + " seconds"); 467 ((8 - m_RestartTimerCounter) * 15) + " seconds");
467 468
468 // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + 469 // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) +
469 //" seconds"); 470 //" seconds");
@@ -505,15 +506,15 @@ namespace OpenSim.Region.Environment.Scenes
505 try 506 try
506 { 507 {
507 ForEachScenePresence(delegate(ScenePresence agent) 508 ForEachScenePresence(delegate(ScenePresence agent)
509 {
510 // If agent is a root agent.
511 if (!agent.IsChildAgent)
508 { 512 {
509 // If agent is a root agent. 513 //agent.ControllingClient.new
510 if (!agent.IsChildAgent) 514 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
511 { 515 InformClientOfNeighbor(agent, region);
512 //agent.ControllingClient.new
513 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
514 InformClientOfNeighbor(agent, region);
515 }
516 } 516 }
517 }
517 ); 518 );
518 } 519 }
519 catch (NullReferenceException) 520 catch (NullReferenceException)
@@ -580,16 +581,16 @@ namespace OpenSim.Region.Environment.Scenes
580 m_log.Warn("[SCENE]: Closing down the single simulator: " + RegionInfo.RegionName); 581 m_log.Warn("[SCENE]: Closing down the single simulator: " + RegionInfo.RegionName);
581 // Kick all ROOT agents with the message, 'The simulator is going down' 582 // Kick all ROOT agents with the message, 'The simulator is going down'
582 ForEachScenePresence(delegate(ScenePresence avatar) 583 ForEachScenePresence(delegate(ScenePresence avatar)
583 { 584 {
584 if (avatar.KnownChildRegions.Contains(RegionInfo.RegionHandle)) 585 if (avatar.KnownChildRegions.Contains(RegionInfo.RegionHandle))
585 avatar.KnownChildRegions.Remove(RegionInfo.RegionHandle); 586 avatar.KnownChildRegions.Remove(RegionInfo.RegionHandle);
586 587
587 if (!avatar.IsChildAgent) 588 if (!avatar.IsChildAgent)
588 avatar.ControllingClient.Kick("The simulator is going down."); 589 avatar.ControllingClient.Kick("The simulator is going down.");
589 590
590 avatar.ControllingClient.OutPacket(PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator), 591 avatar.ControllingClient.OutPacket(PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator),
591 ThrottleOutPacketType.Task); 592 ThrottleOutPacketType.Task);
592 }); 593 });
593 594
594 // Wait here, or the kick messages won't actually get to the agents before the scene terminates. 595 // Wait here, or the kick messages won't actually get to the agents before the scene terminates.
595 Thread.Sleep(500); 596 Thread.Sleep(500);
@@ -793,7 +794,7 @@ namespace OpenSim.Region.Environment.Scenes
793 { 794 {
794 tmpval = tmpval - (tmpval - 1.0f); 795 tmpval = tmpval - (tmpval - 1.0f);
795 } 796 }
796 m_timedilation = tmpval; 797 m_timedilation = tmpval;
797 798
798 m_lastupdate = DateTime.Now; 799 m_lastupdate = DateTime.Now;
799 } 800 }
@@ -884,9 +885,9 @@ namespace OpenSim.Region.Environment.Scenes
884 { 885 {
885 List<MapBlockData> mapBlocks = 886 List<MapBlockData> mapBlocks =
886 m_sceneGridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9), 887 m_sceneGridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9),
887 (int)(RegionInfo.RegionLocY - 9), 888 (int)(RegionInfo.RegionLocY - 9),
888 (int)(RegionInfo.RegionLocX + 9), 889 (int)(RegionInfo.RegionLocX + 9),
889 (int)(RegionInfo.RegionLocY + 9)); 890 (int)(RegionInfo.RegionLocY + 9));
890 List<AssetBase> textures = new List<AssetBase>(); 891 List<AssetBase> textures = new List<AssetBase>();
891 List<Image> bitImages = new List<Image>(); 892 List<Image> bitImages = new List<Image>();
892 893
@@ -1048,7 +1049,6 @@ namespace OpenSim.Region.Environment.Scenes
1048 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 1049 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
1049 } 1050 }
1050 1051
1051
1052 /// <summary> 1052 /// <summary>
1053 /// Returns a new unallocated primitive ID 1053 /// Returns a new unallocated primitive ID
1054 /// </summary> 1054 /// </summary>
@@ -1134,7 +1134,7 @@ namespace OpenSim.Region.Environment.Scenes
1134 } 1134 }
1135 1135
1136 public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, 1136 public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position,
1137 Tree treeType, bool newTree) 1137 Tree treeType, bool newTree)
1138 { 1138 {
1139 LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID; 1139 LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID;
1140 PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); 1140 PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
@@ -1228,7 +1228,7 @@ namespace OpenSim.Region.Environment.Scenes
1228 { 1228 {
1229 pos.Y = ((pos.Y - Constants.RegionSize)); 1229 pos.Y = ((pos.Y - Constants.RegionSize));
1230 newRegionHandle = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize)); 1230 newRegionHandle = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize));
1231 // y + 1 1231 // y + 1
1232 } 1232 }
1233 else if (position.Y < -1f) 1233 else if (position.Y < -1f)
1234 { 1234 {
@@ -1269,12 +1269,14 @@ namespace OpenSim.Region.Environment.Scenes
1269 } 1269 }
1270 } 1270 }
1271 } 1271 }
1272
1272 public void IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData) 1273 public void IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData)
1273 { 1274 {
1274 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); 1275 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor");
1275 m_sceneXmlLoader.LoadGroupFromXml2String(objXMLData); 1276 m_sceneXmlLoader.LoadGroupFromXml2String(objXMLData);
1276 1277
1277 } 1278 }
1279
1278 #endregion 1280 #endregion
1279 1281
1280 #region Add/Remove Avatar Methods 1282 #region Add/Remove Avatar Methods
@@ -1301,11 +1303,11 @@ namespace OpenSim.Region.Environment.Scenes
1301 1303
1302 m_innerScene.AddScenePresence(presence); 1304 m_innerScene.AddScenePresence(presence);
1303 1305
1304 lock (m_restorePresences) 1306 lock (m_restorePresences)
1305 { 1307 {
1306 Monitor.PulseAll(m_restorePresences); 1308 Monitor.PulseAll(m_restorePresences);
1307 } 1309 }
1308 } 1310 }
1309 else 1311 else
1310 { 1312 {
1311 m_log.Info("[REGION]: Add New Scene Presence"); 1313 m_log.Info("[REGION]: Add New Scene Presence");
@@ -1382,8 +1384,8 @@ namespace OpenSim.Region.Environment.Scenes
1382 client.OnMoveInventoryItem += MoveInventoryItem; 1384 client.OnMoveInventoryItem += MoveInventoryItem;
1383 client.OnRemoveInventoryItem += RemoveInventoryItem; 1385 client.OnRemoveInventoryItem += RemoveInventoryItem;
1384 client.OnRemoveInventoryFolder += RemoveInventoryFolder; 1386 client.OnRemoveInventoryFolder += RemoveInventoryFolder;
1385 // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; 1387 // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
1386 // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; 1388 // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
1387 client.OnRezScript += RezScript; 1389 client.OnRezScript += RezScript;
1388 1390
1389 client.OnRequestTaskInventory += RequestTaskInventory; 1391 client.OnRequestTaskInventory += RequestTaskInventory;
@@ -1452,8 +1454,8 @@ namespace OpenSim.Region.Environment.Scenes
1452 { 1454 {
1453 m_innerScene.removeUserCount(true); 1455 m_innerScene.removeUserCount(true);
1454 m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, 1456 m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle,
1455 avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, 1457 avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y,
1456 avatar.AbsolutePosition.Z); 1458 avatar.AbsolutePosition.Z);
1457 List<ulong> childknownRegions = new List<ulong>(); 1459 List<ulong> childknownRegions = new List<ulong>();
1458 List<ulong> ckn = avatar.GetKnownRegionList(); 1460 List<ulong> ckn = avatar.GetKnownRegionList();
1459 for (int i = 0; i < ckn.Count; i++) 1461 for (int i = 0; i < ckn.Count; i++)
@@ -1477,16 +1479,16 @@ namespace OpenSim.Region.Environment.Scenes
1477 } 1479 }
1478 m_eventManager.TriggerOnRemovePresence(agentID); 1480 m_eventManager.TriggerOnRemovePresence(agentID);
1479 Broadcast(delegate(IClientAPI client) 1481 Broadcast(delegate(IClientAPI client)
1482 {
1483 try
1484 {
1485 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
1486 }
1487 catch (System.NullReferenceException)
1480 { 1488 {
1481 try 1489 //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
1482 { 1490 }
1483 client.SendKillObject(avatar.RegionHandle, avatar.LocalId); 1491 });
1484 }
1485 catch (System.NullReferenceException)
1486 {
1487 //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
1488 }
1489 });
1490 1492
1491 ForEachScenePresence( 1493 ForEachScenePresence(
1492 delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); 1494 delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
@@ -1903,8 +1905,6 @@ namespace OpenSim.Region.Environment.Scenes
1903 } 1905 }
1904 } 1906 }
1905 1907
1906
1907
1908 #endregion 1908 #endregion
1909 1909
1910 #region Other Methods 1910 #region Other Methods
@@ -2152,10 +2152,10 @@ namespace OpenSim.Region.Environment.Scenes
2152 { 2152 {
2153 2153
2154 ClientManager.ForEachClient(delegate(IClientAPI controller) 2154 ClientManager.ForEachClient(delegate(IClientAPI controller)
2155 { 2155 {
2156 controller.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message); 2156 controller.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message);
2157 } 2157 }
2158 ); 2158 );
2159 } 2159 }
2160 2160
2161 /// <summary> 2161 /// <summary>
@@ -2180,27 +2180,27 @@ namespace OpenSim.Region.Environment.Scenes
2180 if (agentID == kickUserID) 2180 if (agentID == kickUserID)
2181 { 2181 {
2182 ClientManager.ForEachClient(delegate(IClientAPI controller) 2182 ClientManager.ForEachClient(delegate(IClientAPI controller)
2183 { 2183 {
2184 if (controller.AgentId != godID) 2184 if (controller.AgentId != godID)
2185 controller.Kick(Helpers.FieldToUTF8String(reason)); 2185 controller.Kick(Helpers.FieldToUTF8String(reason));
2186 2186
2187 2187
2188 2188
2189 } 2189 }
2190 ); 2190 );
2191 // This is a bit crude. It seems the client will be null before it actually stops the thread 2191 // This is a bit crude. It seems the client will be null before it actually stops the thread
2192 // The thread will kill itself eventually :/ 2192 // The thread will kill itself eventually :/
2193 // Is there another way to make sure *all* clients get this 'inter region' message? 2193 // Is there another way to make sure *all* clients get this 'inter region' message?
2194 ClientManager.ForEachClient(delegate(IClientAPI controller) 2194 ClientManager.ForEachClient(delegate(IClientAPI controller)
2195 { 2195 {
2196 ScenePresence p = GetScenePresence(controller.AgentId); 2196 ScenePresence p = GetScenePresence(controller.AgentId);
2197 bool childagent = !p.Equals(null) && p.IsChildAgent; 2197 bool childagent = !p.Equals(null) && p.IsChildAgent;
2198 if (controller.AgentId != godID && !childagent) 2198 if (controller.AgentId != godID && !childagent)
2199 // Do we really want to kick the initiator of this madness? 2199 // Do we really want to kick the initiator of this madness?
2200 { 2200 {
2201 controller.Close(true); 2201 controller.Close(true);
2202 }
2203 } 2202 }
2203 }
2204 ); 2204 );
2205 } 2205 }
2206 else 2206 else