aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs82
1 files changed, 63 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 89cde05..3e11db3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -591,6 +591,15 @@ namespace OpenSim.Region.Framework.Scenes
591 get { return m_sceneGraph.Entities; } 591 get { return m_sceneGraph.Entities; }
592 } 592 }
593 593
594 // can be closest/random/sequence
595 private string m_SpawnPointRouting = "closest";
596 // used in sequence see: SpawnPoint()
597 private int m_SpawnPoint;
598 public string SpawnPointRouting
599 {
600 get { return m_SpawnPointRouting; }
601 }
602
594 #endregion Properties 603 #endregion Properties
595 604
596 #region Constructors 605 #region Constructors
@@ -608,7 +617,7 @@ namespace OpenSim.Region.Framework.Scenes
608 617
609 Random random = new Random(); 618 Random random = new Random();
610 619
611 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4); 620 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
612 m_moduleLoader = moduleLoader; 621 m_moduleLoader = moduleLoader;
613 m_authenticateHandler = authen; 622 m_authenticateHandler = authen;
614 m_sceneGridService = sceneGridService; 623 m_sceneGridService = sceneGridService;
@@ -728,6 +737,8 @@ namespace OpenSim.Region.Framework.Scenes
728 m_maxPhys = RegionInfo.PhysPrimMax; 737 m_maxPhys = RegionInfo.PhysPrimMax;
729 } 738 }
730 739
740 m_SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest");
741
731 // Here, if clamping is requested in either global or 742 // Here, if clamping is requested in either global or
732 // local config, it will be used 743 // local config, it will be used
733 // 744 //
@@ -2684,10 +2695,10 @@ namespace OpenSim.Region.Framework.Scenes
2684 { 2695 {
2685 SceneObjectGroup grp = sceneObject; 2696 SceneObjectGroup grp = sceneObject;
2686 2697
2687 m_log.DebugFormat( 2698// m_log.DebugFormat(
2688 "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID); 2699// "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID);
2689 m_log.DebugFormat( 2700// m_log.DebugFormat(
2690 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); 2701// "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2691 2702
2692 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2703 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2693 2704
@@ -3554,7 +3565,7 @@ namespace OpenSim.Region.Framework.Scenes
3554 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup) 3565 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
3555 { 3566 {
3556 bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || 3567 bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
3557 (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); 3568 (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
3558 bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); 3569 bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0);
3559 bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); 3570 bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0);
3560 3571
@@ -3570,8 +3581,17 @@ namespace OpenSim.Region.Framework.Scenes
3570 // Don't disable this log message - it's too helpful 3581 // Don't disable this log message - it's too helpful
3571 m_log.DebugFormat( 3582 m_log.DebugFormat(
3572 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})", 3583 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})",
3573 RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname, 3584 RegionInfo.RegionName,
3574 agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, ((TPFlags)teleportFlags).ToString(), agent.startpos); 3585 (agent.child ? "child" : "root"),
3586 agent.firstname,
3587 agent.lastname,
3588 agent.AgentID,
3589 agent.circuitcode,
3590 agent.IPAddress,
3591 agent.Viewer,
3592 ((TPFlags)teleportFlags).ToString(),
3593 agent.startpos
3594 );
3575 3595
3576 if (LoginsDisabled) 3596 if (LoginsDisabled)
3577 { 3597 {
@@ -3586,7 +3606,11 @@ namespace OpenSim.Region.Framework.Scenes
3586 // We have a zombie from a crashed session. 3606 // We have a zombie from a crashed session.
3587 // Or the same user is trying to be root twice here, won't work. 3607 // Or the same user is trying to be root twice here, won't work.
3588 // Kill it. 3608 // Kill it.
3589 m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); 3609 m_log.DebugFormat(
3610 "[SCENE]: Zombie scene presence detected for {0} in {1}",
3611 agent.AgentID,
3612 RegionInfo.RegionName
3613 );
3590 sp.ControllingClient.Close(); 3614 sp.ControllingClient.Close();
3591 sp = null; 3615 sp = null;
3592 } 3616 }
@@ -3613,8 +3637,7 @@ namespace OpenSim.Region.Framework.Scenes
3613 { 3637 {
3614 if (!VerifyUserPresence(agent, out reason)) 3638 if (!VerifyUserPresence(agent, out reason))
3615 return false; 3639 return false;
3616 } 3640 } catch (Exception e)
3617 catch (Exception e)
3618 { 3641 {
3619 m_log.ErrorFormat( 3642 m_log.ErrorFormat(
3620 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); 3643 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
@@ -3649,8 +3672,7 @@ namespace OpenSim.Region.Framework.Scenes
3649 CapsModule.SetAgentCapsSeeds(agent); 3672 CapsModule.SetAgentCapsSeeds(agent);
3650 CapsModule.CreateCaps(agent.AgentID); 3673 CapsModule.CreateCaps(agent.AgentID);
3651 } 3674 }
3652 } 3675 } else
3653 else
3654 { 3676 {
3655 // Let the SP know how we got here. This has a lot of interesting 3677 // Let the SP know how we got here. This has a lot of interesting
3656 // uses down the line. 3678 // uses down the line.
@@ -3673,7 +3695,7 @@ namespace OpenSim.Region.Framework.Scenes
3673 agent.teleportFlags = teleportFlags; 3695 agent.teleportFlags = teleportFlags;
3674 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 3696 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
3675 3697
3676 if (vialogin) 3698 if (vialogin)
3677 { 3699 {
3678// CleanDroppedAttachments(); 3700// CleanDroppedAttachments();
3679 3701
@@ -3714,8 +3736,7 @@ namespace OpenSim.Region.Framework.Scenes
3714 agent.startpos.Z = 720; 3736 agent.startpos.Z = 720;
3715 } 3737 }
3716 } 3738 }
3717 } 3739 } else
3718 else
3719 { 3740 {
3720 if (agent.startpos.X > EastBorders[0].BorderLine.Z) 3741 if (agent.startpos.X > EastBorders[0].BorderLine.Z)
3721 { 3742 {
@@ -3741,10 +3762,19 @@ namespace OpenSim.Region.Framework.Scenes
3741 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); 3762 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
3742 // Can have multiple SpawnPoints 3763 // Can have multiple SpawnPoints
3743 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); 3764 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
3744 if ( spawnpoints.Count > 1) 3765 if (spawnpoints.Count > 1)
3745 { 3766 {
3746 // We have multiple SpawnPoints, Route the agent to a random one 3767 // We have multiple SpawnPoints, Route the agent to a random or sequential one
3747 agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 3768 if (SpawnPointRouting == "random")
3769 agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count) - 1].GetLocation(
3770 telehub.AbsolutePosition,
3771 telehub.GroupRotation
3772 );
3773 else
3774 agent.startpos = spawnpoints[SpawnPoint()].GetLocation(
3775 telehub.AbsolutePosition,
3776 telehub.GroupRotation
3777 );
3748 } 3778 }
3749 else 3779 else
3750 { 3780 {
@@ -5640,5 +5670,19 @@ Environment.Exit(1);
5640 } 5670 }
5641 } 5671 }
5642 } 5672 }
5673
5674 // manage and select spawn points in sequence
5675 public int SpawnPoint()
5676 {
5677 int spawnpoints = RegionInfo.RegionSettings.SpawnPoints().Count;
5678
5679 if (spawnpoints == 0)
5680 return 0;
5681
5682 m_SpawnPoint++;
5683 if (m_SpawnPoint > spawnpoints)
5684 m_SpawnPoint = 1;
5685 return m_SpawnPoint - 1;
5686 }
5643 } 5687 }
5644} 5688}