diff options
author | Melanie | 2012-01-22 11:36:04 +0000 |
---|---|---|
committer | Melanie | 2012-01-22 11:36:04 +0000 |
commit | 68365c20c0b3a3164881398f3bc3710f7960c52d (patch) | |
tree | bef00ac36c0dc8f33c1df3066c9d0e09dbb71aa9 /OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | |
parent | Telehub Support: (diff) | |
download | opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.zip opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.gz opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.bz2 opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.xz |
Move Telehub tables and data from EstateSettings to RegionSettings.
This is damage control es EstateSettings is not the place this can be put.
EstateSettings is nt unique to a region and therefore would introduce
a hard limit of one telehub per estate, completely shutting off the
option of having SL style telehubs, e.g. one per region. Whole
estate teleport routing can still be implemented id desiresd, this
way all options are open while the other way most options get closed
off.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs index 309ef13..ee77ae1 100644 --- a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs +++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | |||
@@ -44,7 +44,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
44 | UUID EstateID; | 44 | UUID EstateID; |
45 | bool m_HasTelehub = false; | 45 | bool m_HasTelehub = false; |
46 | Scene m_Scene; | 46 | Scene m_Scene; |
47 | EstateSettings m_EstateSettings; | ||
48 | // This will get an option... | 47 | // This will get an option... |
49 | Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,0.0f); | 48 | Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,0.0f); |
50 | 49 | ||
@@ -56,7 +55,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
56 | public TelehubManager(Scene scene) | 55 | public TelehubManager(Scene scene) |
57 | { | 56 | { |
58 | m_Scene = scene; | 57 | m_Scene = scene; |
59 | m_EstateSettings = m_Scene.RegionInfo.EstateSettings; | ||
60 | } | 58 | } |
61 | 59 | ||
62 | // Fill our Telehub struct with values | 60 | // Fill our Telehub struct with values |
@@ -76,17 +74,17 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
76 | // Connect the Telehub | 74 | // Connect the Telehub |
77 | public bool Connect(SceneObjectPart part) | 75 | public bool Connect(SceneObjectPart part) |
78 | { | 76 | { |
79 | m_EstateSettings.ClearSpawnPoints(); | 77 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); |
80 | 78 | ||
81 | m_EstateSettings.TelehubObject = part.UUID; | 79 | m_Scene.RegionInfo.RegionSettings.TelehubObject = part.UUID; |
82 | m_EstateSettings.TelehubName = part.Name; | 80 | m_Scene.RegionInfo.RegionSettings.TelehubName = part.Name; |
83 | m_EstateSettings.TelehubPos = part.AbsolutePosition; | 81 | m_Scene.RegionInfo.RegionSettings.TelehubPos = part.AbsolutePosition; |
84 | m_EstateSettings.TelehubRot = part.GetWorldRotation(); | 82 | m_Scene.RegionInfo.RegionSettings.TelehubRot = part.GetWorldRotation(); |
85 | 83 | ||
86 | // Clear this for now | 84 | // Clear this for now |
87 | m_EstateSettings.AddSpawnPoint(InitialSpawnPoint); | 85 | m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(InitialSpawnPoint); |
88 | m_EstateSettings.HasTelehub = true; | 86 | m_Scene.RegionInfo.RegionSettings.HasTelehub = true; |
89 | m_EstateSettings.Save(); | 87 | m_Scene.RegionInfo.RegionSettings.Save(); |
90 | return true; | 88 | return true; |
91 | } | 89 | } |
92 | 90 | ||
@@ -96,14 +94,14 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
96 | bool result = false; | 94 | bool result = false; |
97 | 95 | ||
98 | try{ | 96 | try{ |
99 | m_EstateSettings.TelehubObject = UUID.Zero; | 97 | m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; |
100 | m_EstateSettings.TelehubName = String.Empty; | 98 | m_Scene.RegionInfo.RegionSettings.TelehubName = String.Empty; |
101 | m_EstateSettings.TelehubPos = Vector3.Zero; | 99 | m_Scene.RegionInfo.RegionSettings.TelehubPos = Vector3.Zero; |
102 | // This is probably wrong! But, HasTelehub will block access | 100 | // This is probably wrong! But, HasTelehub will block access |
103 | m_EstateSettings.TelehubRot = Quaternion.Identity; | 101 | m_Scene.RegionInfo.RegionSettings.TelehubRot = Quaternion.Identity; |
104 | m_EstateSettings.ClearSpawnPoints(); | 102 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); |
105 | m_EstateSettings.HasTelehub = false; | 103 | m_Scene.RegionInfo.RegionSettings.HasTelehub = false; |
106 | m_EstateSettings.Save(); | 104 | m_Scene.RegionInfo.RegionSettings.Save(); |
107 | result = true; | 105 | result = true; |
108 | } | 106 | } |
109 | catch (Exception ex) | 107 | catch (Exception ex) |
@@ -122,22 +120,22 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
122 | public bool AddSpawnPoint(Vector3 point) | 120 | public bool AddSpawnPoint(Vector3 point) |
123 | { | 121 | { |
124 | 122 | ||
125 | float dist = (float) Util.GetDistanceTo(m_EstateSettings.TelehubPos, point); | 123 | float dist = (float) Util.GetDistanceTo(m_Scene.RegionInfo.RegionSettings.TelehubPos, point); |
126 | Vector3 nvec = Util.GetNormalizedVector(point - m_EstateSettings.TelehubPos); | 124 | Vector3 nvec = Util.GetNormalizedVector(point - m_Scene.RegionInfo.RegionSettings.TelehubPos); |
127 | Vector3 spoint = nvec * dist; | 125 | Vector3 spoint = nvec * dist; |
128 | 126 | ||
129 | m_EstateSettings.AddSpawnPoint(spoint); | 127 | m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(spoint); |
130 | m_EstateSettings.Save(); | 128 | m_Scene.RegionInfo.RegionSettings.Save(); |
131 | return true; | 129 | return true; |
132 | } | 130 | } |
133 | 131 | ||
134 | // Remove a SpawnPoint from the Telehub | 132 | // Remove a SpawnPoint from the Telehub |
135 | public bool RemoveSpawnPoint(int spawnpoint) | 133 | public bool RemoveSpawnPoint(int spawnpoint) |
136 | { | 134 | { |
137 | m_EstateSettings.RemoveSpawnPoint(spawnpoint); | 135 | m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint); |
138 | m_EstateSettings.Save(); | 136 | m_Scene.RegionInfo.RegionSettings.Save(); |
139 | 137 | ||
140 | return true; | 138 | return true; |
141 | } | 139 | } |
142 | } | 140 | } |
143 | } \ No newline at end of file | 141 | } |