aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-01-21 19:52:33 +0000
committerMelanie2012-01-21 19:52:33 +0000
commitba3b0c69f11aaa3b4305cddd57099e98325a146d (patch)
treecf70355a8cac0579354e67eeb3632a6706d41012 /OpenSim/Region/CoreModules
parentAdd some logging (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-ba3b0c69f11aaa3b4305cddd57099e98325a146d.zip
opensim-SC_OLD-ba3b0c69f11aaa3b4305cddd57099e98325a146d.tar.gz
opensim-SC_OLD-ba3b0c69f11aaa3b4305cddd57099e98325a146d.tar.bz2
opensim-SC_OLD-ba3b0c69f11aaa3b4305cddd57099e98325a146d.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs65
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs130
4 files changed, 197 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index a945fc2..0b22598 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -100,12 +100,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
100 options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; }); 100 options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; });
101 101
102 // Send a message to the region ready module 102 // Send a message to the region ready module
103 /* bluewall* Disable this for the time being
103 IRegionReadyModule rready = m_scene.RequestModuleInterface<IRegionReadyModule>(); 104 IRegionReadyModule rready = m_scene.RequestModuleInterface<IRegionReadyModule>();
104 105
105 if (rready != null) 106 if (rready != null)
106 { 107 {
107 rready.OarLoadingAlert("load"); 108 rready.OarLoadingAlert("load");
108 } 109 }
110 */
109 111
110 List<string> mainParams = options.Parse(cmdparams); 112 List<string> mainParams = options.Parse(cmdparams);
111 113
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e798e5e..eec3c1b 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -344,7 +344,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
344 { 344 {
345 using (BinaryReader br = new BinaryReader(resource)) 345 using (BinaryReader br = new BinaryReader(resource))
346 { 346 {
347 // FIXME: Use the inspector insteadthere are so many forums and lists already, though admittedly none of them are suitable for cross virtual-enivornemnt discussion 347 // FIXME: Use the inspector instead
348 soundData = br.ReadBytes(99999999); 348 soundData = br.ReadBytes(99999999);
349 UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001"); 349 UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001");
350 string soundAssetFileName 350 string soundAssetFileName
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 30695ff..35ad939 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
55 protected EstateManagementCommands m_commands; 55 protected EstateManagementCommands m_commands;
56 56
57 private EstateTerrainXferHandler TerrainUploader; 57 private EstateTerrainXferHandler TerrainUploader;
58 private TelehubManager m_Telehub;
58 59
59 public event ChangeDelegate OnRegionInfoChange; 60 public event ChangeDelegate OnRegionInfoChange;
60 public event ChangeDelegate OnEstateInfoChange; 61 public event ChangeDelegate OnEstateInfoChange;
@@ -614,6 +615,65 @@ namespace OpenSim.Region.CoreModules.World.Estate
614 } 615 }
615 } 616 }
616 617
618 private void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
619 {
620 uint ObjectLocalID;
621 SceneObjectPart part;
622 // UUID EstateID = Scene.RegionInfo.EstateSettings.EstateID;
623 TelehubManager.Telehub telehub;
624
625 switch (cmd)
626 {
627 case "info ui":
628 // Send info:
629 if (m_Telehub.HasTelehub)
630 {
631 telehub = m_Telehub.TelehubVals();
632 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition,
633 telehub.ObjectRotation, telehub.SpawnPoint);
634 }
635 else
636 {
637 return;
638 }
639 break;
640
641 case "connect":
642 // Add the Telehub
643 part = Scene.GetSceneObjectPart((uint)param1);
644 telehub = m_Telehub.Connect(part);
645 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition,
646 telehub.ObjectRotation, telehub.SpawnPoint);
647 break;
648
649 case "delete":
650 // Disconnect Telehub
651 part = Scene.GetSceneObjectPart((uint)param1);
652 telehub = m_Telehub.DisConnect(part);
653 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition,
654 telehub.ObjectRotation, telehub.SpawnPoint);
655 break;
656
657 case "spawnpoint add":
658 // Add SpawnPoint to the Telehub
659 part = Scene.GetSceneObjectPart((uint)param1);
660 telehub = m_Telehub.AddSpawnPoint(part.AbsolutePosition);
661 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition,
662 telehub.ObjectRotation, telehub.SpawnPoint);
663 break;
664
665 case "spawnpoint remove":
666 // Remove SpawnPoint from Telehub
667 telehub = m_Telehub.RemoveSpawnPoint((int)param1);
668 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition,
669 telehub.ObjectRotation, telehub.SpawnPoint);
670 break;
671
672 default:
673 break;
674 }
675 }
676
617 private void SendSimulatorBlueBoxMessage( 677 private void SendSimulatorBlueBoxMessage(
618 IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) 678 IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
619 { 679 {
@@ -1084,7 +1144,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
1084 Scene.RegisterModuleInterface<IEstateModule>(this); 1144 Scene.RegisterModuleInterface<IEstateModule>(this);
1085 Scene.EventManager.OnNewClient += EventManager_OnNewClient; 1145 Scene.EventManager.OnNewClient += EventManager_OnNewClient;
1086 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; 1146 Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
1087 1147
1148 m_Telehub = new TelehubManager(scene);
1149
1088 m_commands = new EstateManagementCommands(this); 1150 m_commands = new EstateManagementCommands(this);
1089 m_commands.Initialise(); 1151 m_commands.Initialise();
1090 } 1152 }
@@ -1138,6 +1200,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
1138 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest; 1200 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
1139 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest; 1201 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
1140 client.OnEstateChangeInfo += handleEstateChangeInfo; 1202 client.OnEstateChangeInfo += handleEstateChangeInfo;
1203 client.OnEstateManageTelehub += handleOnEstateManageTelehub;
1141 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest; 1204 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
1142 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage; 1205 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
1143 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; 1206 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs
new file mode 100644
index 0000000..c99c9ba
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs
@@ -0,0 +1,130 @@
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
28using System;
29using OpenMetaverse;
30using System.Collections.Generic;
31using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes;
33
34namespace OpenSim.Region.CoreModules.World.Estate
35{
36 public class TelehubManager
37 {
38 public struct Telehub
39 {
40 public UUID ObjectID;
41 public string ObjectName;
42 public Vector3 ObjectPosition;
43 public Quaternion ObjectRotation;
44 public List<Vector3> SpawnPoint;
45 };
46
47 private UUID ObjectID;
48 private string ObjectName;
49 private Vector3 ObjectPosition;
50 Quaternion ObjectRotation;
51 List<Vector3> SpawnPoint = new List<Vector3>();
52 UUID EstateID;
53 bool m_HasTelehub = false;
54 Scene m_Scene;
55 // This will get an option...
56 Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,-3.0f);
57
58 public bool HasTelehub
59 {
60 get { return m_HasTelehub; }
61 }
62
63 public TelehubManager(Scene scene)
64 {
65 m_Scene = scene;
66 }
67
68 // Fill our Telehub struct with values
69 public Telehub TelehubVals()
70 {
71 Telehub telehub = new Telehub();
72
73 telehub.ObjectID = ObjectID;
74 telehub.ObjectName = ObjectName;
75 telehub.ObjectPosition = ObjectPosition;
76 telehub.ObjectRotation = ObjectRotation;
77 telehub.SpawnPoint = SpawnPoint;
78 return telehub;
79 }
80
81 // Connect the Telehub
82 public Telehub Connect(SceneObjectPart part)
83 {
84 ObjectID = part.UUID;
85 ObjectName = part.Name;
86 ObjectPosition = part.AbsolutePosition;
87 ObjectRotation = part.GetWorldRotation();
88 // Clear this for now
89 SpawnPoint.Clear();
90 SpawnPoint.Add(InitialSpawnPoint);
91 m_HasTelehub = true;
92
93 return TelehubVals();
94 }
95
96 // Disconnect the Telehub
97 public Telehub DisConnect(SceneObjectPart part)
98 {
99 ObjectID = UUID.Zero;
100 ObjectName = String.Empty;
101 ObjectPosition = Vector3.Zero;
102 ObjectRotation = Quaternion.Identity;
103 SpawnPoint.Clear();
104 m_HasTelehub = false;
105
106 return TelehubVals();
107 }
108
109 // Add a SpawnPoint to the Telehub
110 public Telehub AddSpawnPoint(Vector3 point)
111 {
112 float dist = (float) Util.GetDistanceTo(ObjectPosition, point);
113
114 Vector3 nvec = Util.GetNormalizedVector(point - ObjectPosition);
115
116 Vector3 spoint = nvec * dist;
117
118 SpawnPoint.Add(spoint);
119 return TelehubVals();
120 }
121
122 // Remove a SpawnPoint from the Telehub
123 public Telehub RemoveSpawnPoint(int spawnpoint)
124 {
125 SpawnPoint.RemoveAt(spawnpoint);
126
127 return TelehubVals();
128 }
129 }
130} \ No newline at end of file