diff options
author | Justin Clark-Casey (justincc) | 2012-01-24 20:36:16 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-01-24 20:36:16 +0000 |
commit | a704d444f2f1a4887598cd9eb2f59c0b4c595f2b (patch) | |
tree | 066a47464322b9e73687f60d8308e34efbb45568 /OpenSim/Region/CoreModules | |
parent | Restrict accessible of ODECharacter Shell and Body. Add method doc and some ... (diff) | |
parent | Teleport routing, part 1 (diff) | |
download | opensim-SC-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.zip opensim-SC-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.gz opensim-SC-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.bz2 opensim-SC-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 84 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | 95 |
2 files changed, 178 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 58d9455..2e1487f 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
53 | protected EstateManagementCommands m_commands; | 53 | protected EstateManagementCommands m_commands; |
54 | 54 | ||
55 | private EstateTerrainXferHandler TerrainUploader; | 55 | private EstateTerrainXferHandler TerrainUploader; |
56 | public TelehubManager m_Telehub; | ||
56 | 57 | ||
57 | public event ChangeDelegate OnRegionInfoChange; | 58 | public event ChangeDelegate OnRegionInfoChange; |
58 | public event ChangeDelegate OnEstateInfoChange; | 59 | public event ChangeDelegate OnEstateInfoChange; |
@@ -599,6 +600,50 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
599 | } | 600 | } |
600 | } | 601 | } |
601 | 602 | ||
603 | public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1) | ||
604 | { | ||
605 | uint ObjectLocalID; | ||
606 | SceneObjectPart part; | ||
607 | |||
608 | switch (cmd) | ||
609 | { | ||
610 | case "info ui": | ||
611 | break; | ||
612 | |||
613 | case "connect": | ||
614 | // Add the Telehub | ||
615 | part = Scene.GetSceneObjectPart((uint)param1); | ||
616 | if (part == null) | ||
617 | return; | ||
618 | SceneObjectGroup grp = part.ParentGroup; | ||
619 | |||
620 | m_Telehub.Connect(grp); | ||
621 | break; | ||
622 | |||
623 | case "delete": | ||
624 | // Disconnect Telehub | ||
625 | m_Telehub.Disconnect(); | ||
626 | break; | ||
627 | |||
628 | case "spawnpoint add": | ||
629 | // Add SpawnPoint to the Telehub | ||
630 | part = Scene.GetSceneObjectPart((uint)param1); | ||
631 | if (part == null) | ||
632 | return; | ||
633 | m_Telehub.AddSpawnPoint(part.AbsolutePosition); | ||
634 | break; | ||
635 | |||
636 | case "spawnpoint remove": | ||
637 | // Remove SpawnPoint from Telehub | ||
638 | m_Telehub.RemoveSpawnPoint((int)param1); | ||
639 | break; | ||
640 | |||
641 | default: | ||
642 | break; | ||
643 | } | ||
644 | SendTelehubInfo(client); | ||
645 | } | ||
646 | |||
602 | private void SendSimulatorBlueBoxMessage( | 647 | private void SendSimulatorBlueBoxMessage( |
603 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) | 648 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) |
604 | { | 649 | { |
@@ -1055,7 +1100,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1055 | Scene.RegisterModuleInterface<IEstateModule>(this); | 1100 | Scene.RegisterModuleInterface<IEstateModule>(this); |
1056 | Scene.EventManager.OnNewClient += EventManager_OnNewClient; | 1101 | Scene.EventManager.OnNewClient += EventManager_OnNewClient; |
1057 | Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; | 1102 | Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; |
1058 | 1103 | ||
1104 | m_Telehub = new TelehubManager(scene); | ||
1105 | |||
1059 | m_commands = new EstateManagementCommands(this); | 1106 | m_commands = new EstateManagementCommands(this); |
1060 | m_commands.Initialise(); | 1107 | m_commands.Initialise(); |
1061 | } | 1108 | } |
@@ -1109,6 +1156,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1109 | client.OnEstateRestartSimRequest += handleEstateRestartSimRequest; | 1156 | client.OnEstateRestartSimRequest += handleEstateRestartSimRequest; |
1110 | client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest; | 1157 | client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest; |
1111 | client.OnEstateChangeInfo += handleEstateChangeInfo; | 1158 | client.OnEstateChangeInfo += handleEstateChangeInfo; |
1159 | client.OnEstateManageTelehub += handleOnEstateManageTelehub; | ||
1112 | client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest; | 1160 | client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest; |
1113 | client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage; | 1161 | client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage; |
1114 | client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; | 1162 | client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; |
@@ -1243,5 +1291,39 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1243 | if (onmessage != null) | 1291 | if (onmessage != null) |
1244 | onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message); | 1292 | onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message); |
1245 | } | 1293 | } |
1294 | |||
1295 | |||
1296 | private void SendTelehubInfo(IClientAPI client) | ||
1297 | { | ||
1298 | RegionSettings settings = | ||
1299 | this.Scene.RegionInfo.RegionSettings; | ||
1300 | |||
1301 | SceneObjectGroup telehub = null; | ||
1302 | if (settings.TelehubObject != UUID.Zero && | ||
1303 | (telehub = Scene.GetSceneObjectGroup(settings.TelehubObject)) != null) | ||
1304 | { | ||
1305 | List<Vector3> spawnPoints = new List<Vector3>(); | ||
1306 | |||
1307 | foreach (SpawnPoint sp in settings.SpawnPoints()) | ||
1308 | { | ||
1309 | spawnPoints.Add(sp.GetLocation(Vector3.Zero, Quaternion.Identity)); | ||
1310 | } | ||
1311 | |||
1312 | client.SendTelehubInfo(settings.TelehubObject, | ||
1313 | telehub.Name, | ||
1314 | telehub.AbsolutePosition, | ||
1315 | telehub.GroupRotation, | ||
1316 | spawnPoints); | ||
1317 | } | ||
1318 | else | ||
1319 | { | ||
1320 | client.SendTelehubInfo(UUID.Zero, | ||
1321 | String.Empty, | ||
1322 | Vector3.Zero, | ||
1323 | Quaternion.Identity, | ||
1324 | new List<Vector3>()); | ||
1325 | } | ||
1326 | } | ||
1246 | } | 1327 | } |
1247 | } | 1328 | } |
1329 | |||
diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs new file mode 100644 index 0000000..8bc831f --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using OpenMetaverse; | ||
31 | using System.Collections.Generic; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Region.Framework.Scenes; | ||
34 | using log4net; | ||
35 | |||
36 | namespace OpenSim.Region.CoreModules.World.Estate | ||
37 | { | ||
38 | public class TelehubManager | ||
39 | { | ||
40 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
42 | Scene m_Scene; | ||
43 | |||
44 | public TelehubManager(Scene scene) | ||
45 | { | ||
46 | m_Scene = scene; | ||
47 | } | ||
48 | |||
49 | // Connect the Telehub | ||
50 | public void Connect(SceneObjectGroup grp) | ||
51 | { | ||
52 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); | ||
53 | |||
54 | m_Scene.RegionInfo.RegionSettings.TelehubObject = grp.UUID; | ||
55 | m_Scene.RegionInfo.RegionSettings.Save(); | ||
56 | } | ||
57 | |||
58 | // Disconnect the Telehub: | ||
59 | public void Disconnect() | ||
60 | { | ||
61 | if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) | ||
62 | return; | ||
63 | |||
64 | m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; | ||
65 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); | ||
66 | m_Scene.RegionInfo.RegionSettings.Save(); | ||
67 | } | ||
68 | |||
69 | // Add a SpawnPoint to the Telehub | ||
70 | public void AddSpawnPoint(Vector3 point) | ||
71 | { | ||
72 | if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) | ||
73 | return; | ||
74 | |||
75 | SceneObjectGroup grp = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject); | ||
76 | if (grp == null) | ||
77 | return; | ||
78 | |||
79 | SpawnPoint sp = new SpawnPoint(); | ||
80 | sp.SetLocation(grp.AbsolutePosition, grp.GroupRotation, point); | ||
81 | m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(sp); | ||
82 | m_Scene.RegionInfo.RegionSettings.Save(); | ||
83 | } | ||
84 | |||
85 | // Remove a SpawnPoint from the Telehub | ||
86 | public void RemoveSpawnPoint(int spawnpoint) | ||
87 | { | ||
88 | if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) | ||
89 | return; | ||
90 | |||
91 | m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint); | ||
92 | m_Scene.RegionInfo.RegionSettings.Save(); | ||
93 | } | ||
94 | } | ||
95 | } | ||