aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs5
-rw-r--r--OpenSim/Framework/General/Types/RegionInfo.cs102
2 files changed, 68 insertions, 39 deletions
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
index d538e23..4167b65 100644
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ b/OpenSim/Framework/Communications/IGridServices.cs
@@ -27,6 +27,9 @@
27*/ 27*/
28 28
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net;
31using libsecondlife;
32
30using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
31 34
32namespace OpenSim.Framework.Communications 35namespace OpenSim.Framework.Communications
@@ -34,7 +37,7 @@ namespace OpenSim.Framework.Communications
34 public interface IGridServices 37 public interface IGridServices
35 { 38 {
36 RegionCommsListener RegisterRegion(RegionInfo regionInfos); 39 RegionCommsListener RegisterRegion(RegionInfo regionInfos);
37 List<RegionInfo> RequestNeighbours(RegionInfo regionInfo); 40 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
38 RegionInfo RequestNeighbourInfo(ulong regionHandle); 41 RegionInfo RequestNeighbourInfo(ulong regionHandle);
39 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); 42 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
40 } 43 }
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs
index 5054510..77109aa 100644
--- a/OpenSim/Framework/General/Types/RegionInfo.cs
+++ b/OpenSim/Framework/General/Types/RegionInfo.cs
@@ -40,20 +40,51 @@ using OpenSim.Framework.Configuration;
40 40
41namespace OpenSim.Framework.Types 41namespace OpenSim.Framework.Types
42{ 42{
43 public class RegionInfo 43 public class SimpleRegionInfo
44 { 44 {
45 public LLUUID SimUUID = new LLUUID(); 45 public SimpleRegionInfo()
46 public string RegionName = ""; 46 {
47 }
47 48
48 private IPEndPoint m_internalEndPoint; 49 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
49 public IPEndPoint InternalEndPoint 50 {
51
52 m_regionLocX = regionLocX;
53 m_regionLocY = regionLocY;
54
55 m_internalEndPoint = internalEndPoint;
56 m_externalHostName = externalUri;
57 }
58
59 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port)
60 {
61
62 m_regionLocX = regionLocX;
63 m_regionLocY = regionLocY;
64
65 m_externalHostName = externalUri;
66
67 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port);
68 }
69
70 public LLUUID RegionID = new LLUUID();
71
72 private uint m_remotingPort;
73 public uint RemotingPort
50 { 74 {
51 get 75 get
52 { 76 {
53 return m_internalEndPoint; 77 return m_remotingPort;
78 }
79 set
80 {
81 m_remotingPort = value;
54 } 82 }
55 } 83 }
56 84
85 public string RemotingAddress;
86
87
57 public IPEndPoint ExternalEndPoint 88 public IPEndPoint ExternalEndPoint
58 { 89 {
59 get 90 get
@@ -86,9 +117,14 @@ namespace OpenSim.Framework.Types
86 117
87 return new IPEndPoint(ia, m_internalEndPoint.Port); 118 return new IPEndPoint(ia, m_internalEndPoint.Port);
88 } 119 }
120
121 set
122 {
123 m_externalHostName = value.ToString();
124 }
89 } 125 }
90 126
91 private string m_externalHostName; 127 protected string m_externalHostName;
92 public string ExternalHostName 128 public string ExternalHostName
93 { 129 {
94 get 130 get
@@ -97,51 +133,45 @@ namespace OpenSim.Framework.Types
97 } 133 }
98 } 134 }
99 135
100 private uint? m_regionLocX; 136 protected IPEndPoint m_internalEndPoint;
101 public uint RegionLocX 137 public IPEndPoint InternalEndPoint
102 { 138 {
103 get 139 get
104 { 140 {
105 return m_regionLocX.Value; 141 return m_internalEndPoint;
106 } 142 }
107 } 143 }
108 144
109 private uint? m_regionLocY; 145 protected uint? m_regionLocX;
110 public uint RegionLocY 146 public uint RegionLocX
111 { 147 {
112 get 148 get
113 { 149 {
114 return m_regionLocY.Value; 150 return m_regionLocX.Value;
115 } 151 }
116 } 152 }
117 153
118 private ulong? m_regionHandle; 154 protected uint? m_regionLocY;
119 public ulong RegionHandle 155 public uint RegionLocY
120 { 156 {
121 get 157 get
122 { 158 {
123 if (!m_regionHandle.HasValue) 159 return m_regionLocY.Value;
124 {
125 m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
126 }
127
128 return m_regionHandle.Value;
129 } 160 }
130 } 161 }
131 162
132 private uint m_remotingPort; 163 public ulong RegionHandle
133 public uint RemotingPort
134 { 164 {
135 get 165 get
136 { 166 {
137 return m_remotingPort; 167 return Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
138 }
139 set
140 {
141 m_remotingPort = value;
142 } 168 }
143 } 169 }
144 public string RemotingAddress; 170 }
171
172 public class RegionInfo : SimpleRegionInfo
173 {
174 public string RegionName = "";
145 175
146 public string DataStore = ""; 176 public string DataStore = "";
147 public bool isSandbox = false; 177 public bool isSandbox = false;
@@ -161,15 +191,11 @@ namespace OpenSim.Framework.Types
161 configMember.performConfigurationRetrieve(); 191 configMember.performConfigurationRetrieve();
162 } 192 }
163 193
164 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 194 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) :
195 base(regionLocX, regionLocY, internalEndPoint, externalUri)
165 { 196 {
166 197
167 estateSettings = new EstateSettings(); 198 estateSettings = new EstateSettings();
168 m_regionLocX = regionLocX;
169 m_regionLocY = regionLocY;
170
171 m_internalEndPoint = internalEndPoint;
172 m_externalHostName = externalUri;
173 } 199 }
174 200
175 public void LoadFromNiniSource(IConfigSource source) 201 public void LoadFromNiniSource(IConfigSource source)
@@ -180,7 +206,7 @@ namespace OpenSim.Framework.Types
180 public void LoadFromNiniSource(IConfigSource source, string sectionName) 206 public void LoadFromNiniSource(IConfigSource source, string sectionName)
181 { 207 {
182 string errorMessage = ""; 208 string errorMessage = "";
183 this.SimUUID = new LLUUID(source.Configs[sectionName].GetString("sim_UUID", LLUUID.Random().ToStringHyphenated())); 209 this.RegionID = new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToStringHyphenated()));
184 this.RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test"); 210 this.RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test");
185 this.m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000")); 211 this.m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000"));
186 this.m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000")); 212 this.m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000"));
@@ -220,7 +246,7 @@ namespace OpenSim.Framework.Types
220 246
221 public void loadConfigurationOptions() 247 public void loadConfigurationOptions()
222 { 248 {
223 configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "UUID of Simulator (Default is recommended, random UUID)", LLUUID.Random().ToString(), true); 249 configMember.addConfigurationOption("Region_ID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "UUID of Simulator (Default is recommended, random UUID)", LLUUID.Random().ToString(), true);
224 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false); 250 configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Simulator Name", "OpenSim Test", false);
225 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); 251 configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false);
226 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); 252 configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false);
@@ -238,7 +264,7 @@ namespace OpenSim.Framework.Types
238 switch (configuration_key) 264 switch (configuration_key)
239 { 265 {
240 case "sim_UUID": 266 case "sim_UUID":
241 this.SimUUID = (LLUUID)configuration_result; 267 this.RegionID = (LLUUID)configuration_result;
242 break; 268 break;
243 case "sim_name": 269 case "sim_name":
244 this.RegionName = (string)configuration_result; 270 this.RegionName = (string)configuration_result;