diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 78 |
1 files changed, 45 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index cdcea65..2789d5f 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -609,59 +609,37 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
609 | { | 609 | { |
610 | case "info ui": | 610 | case "info ui": |
611 | // Send info: | 611 | // Send info: |
612 | if (Scene.RegionInfo.RegionSettings.HasTelehub) | 612 | SendTelehubInfo(client); |
613 | { | ||
614 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; | ||
615 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | ||
616 | settings.TelehubRot, settings.SpawnPoints()); | ||
617 | } | ||
618 | else | ||
619 | { | ||
620 | return; | ||
621 | } | ||
622 | break; | 613 | break; |
623 | 614 | ||
624 | case "connect": | 615 | case "connect": |
625 | // Add the Telehub | 616 | // Add the Telehub |
626 | part = Scene.GetSceneObjectPart((uint)param1); | 617 | part = Scene.GetSceneObjectPart((uint)param1); |
627 | if (m_Telehub.Connect(part)) | 618 | if (part == null) |
628 | { | 619 | return; |
629 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; | 620 | SceneObjectGroup grp = part.ParentGroup; |
630 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 621 | |
631 | settings.TelehubRot, settings.SpawnPoints()); | 622 | if (m_Telehub.Connect(grp)) |
632 | } | 623 | SendTelehubInfo(client); |
633 | break; | 624 | break; |
634 | 625 | ||
635 | case "delete": | 626 | case "delete": |
636 | // Disconnect Telehub | 627 | // Disconnect Telehub |
637 | part = Scene.GetSceneObjectPart((uint)param1); | 628 | if (m_Telehub.Disconnect()) |
638 | if (m_Telehub.DisConnect(part)) | 629 | SendTelehubInfo(client); |
639 | { | ||
640 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; | ||
641 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | ||
642 | settings.TelehubRot, settings.SpawnPoints()); | ||
643 | } | ||
644 | break; | 630 | break; |
645 | 631 | ||
646 | case "spawnpoint add": | 632 | case "spawnpoint add": |
647 | // Add SpawnPoint to the Telehub | 633 | // Add SpawnPoint to the Telehub |
648 | part = Scene.GetSceneObjectPart((uint)param1); | 634 | part = Scene.GetSceneObjectPart((uint)param1); |
649 | if( m_Telehub.AddSpawnPoint(part.AbsolutePosition)) | 635 | if( m_Telehub.AddSpawnPoint(part.AbsolutePosition)) |
650 | { | 636 | SendTelehubInfo(client); |
651 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; | ||
652 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | ||
653 | settings.TelehubRot, settings.SpawnPoints()); | ||
654 | } | ||
655 | break; | 637 | break; |
656 | 638 | ||
657 | case "spawnpoint remove": | 639 | case "spawnpoint remove": |
658 | // Remove SpawnPoint from Telehub | 640 | // Remove SpawnPoint from Telehub |
659 | if (m_Telehub.RemoveSpawnPoint((int)param1)) | 641 | if (m_Telehub.RemoveSpawnPoint((int)param1)) |
660 | { | 642 | SendTelehubInfo(client); |
661 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; | ||
662 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | ||
663 | settings.TelehubRot, settings.SpawnPoints()); | ||
664 | } | ||
665 | break; | 643 | break; |
666 | 644 | ||
667 | default: | 645 | default: |
@@ -1316,5 +1294,39 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1316 | if (onmessage != null) | 1294 | if (onmessage != null) |
1317 | onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message); | 1295 | onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message); |
1318 | } | 1296 | } |
1297 | |||
1298 | |||
1299 | private void SendTelehubInfo(IClientAPI client) | ||
1300 | { | ||
1301 | RegionSettings settings = | ||
1302 | this.Scene.RegionInfo.RegionSettings; | ||
1303 | |||
1304 | SceneObjectGroup telehub = null; | ||
1305 | if (settings.TelehubObject != UUID.Zero && | ||
1306 | (telehub = Scene.GetSceneObjectGroup(settings.TelehubObject)) != null) | ||
1307 | { | ||
1308 | List<Vector3> spawnPoints = new List<Vector3>(); | ||
1309 | |||
1310 | foreach (SpawnPoint sp in settings.SpawnPoints()) | ||
1311 | { | ||
1312 | spawnPoints.Add(sp.GetLocation(telehub.AbsolutePosition, telehub.GroupRotation)); | ||
1313 | } | ||
1314 | |||
1315 | client.SendTelehubInfo(settings.TelehubObject, | ||
1316 | telehub.Name, | ||
1317 | telehub.AbsolutePosition, | ||
1318 | telehub.GroupRotation, | ||
1319 | spawnPoints); | ||
1320 | } | ||
1321 | else | ||
1322 | { | ||
1323 | client.SendTelehubInfo(UUID.Zero, | ||
1324 | String.Empty, | ||
1325 | Vector3.Zero, | ||
1326 | Quaternion.Identity, | ||
1327 | new List<Vector3>()); | ||
1328 | } | ||
1329 | } | ||
1319 | } | 1330 | } |
1320 | } | 1331 | } |
1332 | |||