aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-01-22 16:35:14 +0000
committerMelanie2012-01-22 16:35:14 +0000
commit02572ab1d3ae23205e0a2192c9b30aa22b566143 (patch)
treefe483f85a77cb00a21dd4be65a71941329f22482 /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentChange the key name I missed in last commit (diff)
downloadopensim-SC_OLD-02572ab1d3ae23205e0a2192c9b30aa22b566143.zip
opensim-SC_OLD-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.gz
opensim-SC_OLD-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.bz2
opensim-SC_OLD-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/RegionSettings.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs50
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs111
3 files changed, 104 insertions, 71 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d9dc6b7..bbaa08e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -9303,10 +9303,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9303 { 9303 {
9304 UUID invoice = messagePacket.MethodData.Invoice; 9304 UUID invoice = messagePacket.MethodData.Invoice;
9305 UUID SenderID = messagePacket.AgentData.AgentID; 9305 UUID SenderID = messagePacket.AgentData.AgentID;
9306 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 9306 UInt32 param1 = 0u;
9307 9307
9308 string command = (string)Utils.BytesToString(messagePacket.ParamList[0].Parameter); 9308 string command = (string)Utils.BytesToString(messagePacket.ParamList[0].Parameter);
9309 9309
9310 if (command != "info ui")
9311 {
9312 try
9313 {
9314 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
9315 }
9316 catch (Exception ex)
9317 {
9318
9319 }
9320 }
9321
9310 EstateManageTelehub handlerEstateManageTelehub = OnEstateManageTelehub; 9322 EstateManageTelehub handlerEstateManageTelehub = OnEstateManageTelehub;
9311 if (handlerEstateManageTelehub != null) 9323 if (handlerEstateManageTelehub != null)
9312 { 9324 {
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 35ad939..4f3b271 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -55,7 +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 public TelehubManager m_Telehub;
59 59
60 public event ChangeDelegate OnRegionInfoChange; 60 public event ChangeDelegate OnRegionInfoChange;
61 public event ChangeDelegate OnEstateInfoChange; 61 public event ChangeDelegate OnEstateInfoChange;
@@ -615,22 +615,20 @@ namespace OpenSim.Region.CoreModules.World.Estate
615 } 615 }
616 } 616 }
617 617
618 private void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1) 618 public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
619 { 619 {
620 uint ObjectLocalID; 620 uint ObjectLocalID;
621 SceneObjectPart part; 621 SceneObjectPart part;
622 // UUID EstateID = Scene.RegionInfo.EstateSettings.EstateID;
623 TelehubManager.Telehub telehub;
624 622
625 switch (cmd) 623 switch (cmd)
626 { 624 {
627 case "info ui": 625 case "info ui":
628 // Send info: 626 // Send info:
629 if (m_Telehub.HasTelehub) 627 if (Scene.RegionInfo.RegionSettings.HasTelehub)
630 { 628 {
631 telehub = m_Telehub.TelehubVals(); 629 RegionSettings settings = this.Scene.RegionInfo.RegionSettings;
632 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition, 630 client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos,
633 telehub.ObjectRotation, telehub.SpawnPoint); 631 settings.TelehubRot, settings.SpawnPoints());
634 } 632 }
635 else 633 else
636 { 634 {
@@ -641,32 +639,44 @@ namespace OpenSim.Region.CoreModules.World.Estate
641 case "connect": 639 case "connect":
642 // Add the Telehub 640 // Add the Telehub
643 part = Scene.GetSceneObjectPart((uint)param1); 641 part = Scene.GetSceneObjectPart((uint)param1);
644 telehub = m_Telehub.Connect(part); 642 if (m_Telehub.Connect(part))
645 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition, 643 {
646 telehub.ObjectRotation, telehub.SpawnPoint); 644 RegionSettings settings = this.Scene.RegionInfo.RegionSettings;
645 client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos,
646 settings.TelehubRot, settings.SpawnPoints());
647 }
647 break; 648 break;
648 649
649 case "delete": 650 case "delete":
650 // Disconnect Telehub 651 // Disconnect Telehub
651 part = Scene.GetSceneObjectPart((uint)param1); 652 part = Scene.GetSceneObjectPart((uint)param1);
652 telehub = m_Telehub.DisConnect(part); 653 if (m_Telehub.DisConnect(part))
653 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition, 654 {
654 telehub.ObjectRotation, telehub.SpawnPoint); 655 RegionSettings settings = this.Scene.RegionInfo.RegionSettings;
656 client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos,
657 settings.TelehubRot, settings.SpawnPoints());
658 }
655 break; 659 break;
656 660
657 case "spawnpoint add": 661 case "spawnpoint add":
658 // Add SpawnPoint to the Telehub 662 // Add SpawnPoint to the Telehub
659 part = Scene.GetSceneObjectPart((uint)param1); 663 part = Scene.GetSceneObjectPart((uint)param1);
660 telehub = m_Telehub.AddSpawnPoint(part.AbsolutePosition); 664 if( m_Telehub.AddSpawnPoint(part.AbsolutePosition))
661 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition, 665 {
662 telehub.ObjectRotation, telehub.SpawnPoint); 666 RegionSettings settings = this.Scene.RegionInfo.RegionSettings;
667 client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos,
668 settings.TelehubRot, settings.SpawnPoints());
669 }
663 break; 670 break;
664 671
665 case "spawnpoint remove": 672 case "spawnpoint remove":
666 // Remove SpawnPoint from Telehub 673 // Remove SpawnPoint from Telehub
667 telehub = m_Telehub.RemoveSpawnPoint((int)param1); 674 if (m_Telehub.RemoveSpawnPoint((int)param1))
668 client.SendTelehubInfo(telehub.ObjectID, telehub.ObjectName, telehub.ObjectPosition, 675 {
669 telehub.ObjectRotation, telehub.SpawnPoint); 676 RegionSettings settings = this.Scene.RegionInfo.RegionSettings;
677 client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos,
678 settings.TelehubRot, settings.SpawnPoints());
679 }
670 break; 680 break;
671 681
672 default: 682 default:
diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs
index c99c9ba..ee77ae1 100644
--- a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs
@@ -35,14 +35,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
35{ 35{
36 public class TelehubManager 36 public class TelehubManager
37 { 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 38
47 private UUID ObjectID; 39 private UUID ObjectID;
48 private string ObjectName; 40 private string ObjectName;
@@ -53,7 +45,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
53 bool m_HasTelehub = false; 45 bool m_HasTelehub = false;
54 Scene m_Scene; 46 Scene m_Scene;
55 // This will get an option... 47 // This will get an option...
56 Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,-3.0f); 48 Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,0.0f);
57 49
58 public bool HasTelehub 50 public bool HasTelehub
59 { 51 {
@@ -66,65 +58,84 @@ namespace OpenSim.Region.CoreModules.World.Estate
66 } 58 }
67 59
68 // Fill our Telehub struct with values 60 // Fill our Telehub struct with values
69 public Telehub TelehubVals() 61// public Telehub TelehubVals()
70 { 62// {
71 Telehub telehub = new Telehub(); 63// // Telehub telehub = new Telehub();
72 64// EstateSettings telehub = m_EstateSettings;
73 telehub.ObjectID = ObjectID; 65//
74 telehub.ObjectName = ObjectName; 66// telehub.TelehubObject = ObjectID;
75 telehub.ObjectPosition = ObjectPosition; 67// telehub.TelehubName = ObjectName;
76 telehub.ObjectRotation = ObjectRotation; 68// telehub.TelehubPos = ObjectPosition;
77 telehub.SpawnPoint = SpawnPoint; 69// telehub.TelehubRot = ObjectRotation;
78 return telehub; 70// telehub. = SpawnPoint;
79 } 71// return telehub;
72// }
80 73
81 // Connect the Telehub 74 // Connect the Telehub
82 public Telehub Connect(SceneObjectPart part) 75 public bool Connect(SceneObjectPart part)
83 { 76 {
84 ObjectID = part.UUID; 77 m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints();
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 78
93 return TelehubVals(); 79 m_Scene.RegionInfo.RegionSettings.TelehubObject = part.UUID;
80 m_Scene.RegionInfo.RegionSettings.TelehubName = part.Name;
81 m_Scene.RegionInfo.RegionSettings.TelehubPos = part.AbsolutePosition;
82 m_Scene.RegionInfo.RegionSettings.TelehubRot = part.GetWorldRotation();
83
84 // Clear this for now
85 m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(InitialSpawnPoint);
86 m_Scene.RegionInfo.RegionSettings.HasTelehub = true;
87 m_Scene.RegionInfo.RegionSettings.Save();
88 return true;
94 } 89 }
95 90
96 // Disconnect the Telehub 91 // Disconnect the Telehub: Clear it out for now, look at just disableing
97 public Telehub DisConnect(SceneObjectPart part) 92 public bool DisConnect(SceneObjectPart part)
98 { 93 {
99 ObjectID = UUID.Zero; 94 bool result = false;
100 ObjectName = String.Empty; 95
101 ObjectPosition = Vector3.Zero; 96 try{
102 ObjectRotation = Quaternion.Identity; 97 m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
103 SpawnPoint.Clear(); 98 m_Scene.RegionInfo.RegionSettings.TelehubName = String.Empty;
104 m_HasTelehub = false; 99 m_Scene.RegionInfo.RegionSettings.TelehubPos = Vector3.Zero;
105 100 // This is probably wrong! But, HasTelehub will block access
106 return TelehubVals(); 101 m_Scene.RegionInfo.RegionSettings.TelehubRot = Quaternion.Identity;
102 m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints();
103 m_Scene.RegionInfo.RegionSettings.HasTelehub = false;
104 m_Scene.RegionInfo.RegionSettings.Save();
105 result = true;
106 }
107 catch (Exception ex)
108 {
109 result = false;
110 }
111 finally
112 {
113
114 }
115
116 return result;
107 } 117 }
108 118
109 // Add a SpawnPoint to the Telehub 119 // Add a SpawnPoint to the Telehub
110 public Telehub AddSpawnPoint(Vector3 point) 120 public bool AddSpawnPoint(Vector3 point)
111 { 121 {
112 float dist = (float) Util.GetDistanceTo(ObjectPosition, point);
113
114 Vector3 nvec = Util.GetNormalizedVector(point - ObjectPosition);
115 122
123 float dist = (float) Util.GetDistanceTo(m_Scene.RegionInfo.RegionSettings.TelehubPos, point);
124 Vector3 nvec = Util.GetNormalizedVector(point - m_Scene.RegionInfo.RegionSettings.TelehubPos);
116 Vector3 spoint = nvec * dist; 125 Vector3 spoint = nvec * dist;
117 126
118 SpawnPoint.Add(spoint); 127 m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(spoint);
119 return TelehubVals(); 128 m_Scene.RegionInfo.RegionSettings.Save();
129 return true;
120 } 130 }
121 131
122 // Remove a SpawnPoint from the Telehub 132 // Remove a SpawnPoint from the Telehub
123 public Telehub RemoveSpawnPoint(int spawnpoint) 133 public bool RemoveSpawnPoint(int spawnpoint)
124 { 134 {
125 SpawnPoint.RemoveAt(spawnpoint); 135 m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint);
136 m_Scene.RegionInfo.RegionSettings.Save();
126 137
127 return TelehubVals(); 138 return true;
128 } 139 }
129 } 140 }
130} \ No newline at end of file 141}