aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/RegionProfileData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/RegionProfileData.cs')
-rw-r--r--OpenSim/Data/RegionProfileData.cs337
1 files changed, 0 insertions, 337 deletions
diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs
deleted file mode 100644
index 90713d2..0000000
--- a/OpenSim/Data/RegionProfileData.cs
+++ /dev/null
@@ -1,337 +0,0 @@
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 System.Collections;
30using Nwc.XmlRpc;
31using OpenMetaverse;
32using OpenSim.Framework;
33
34namespace OpenSim.Data
35{
36 /// <summary>
37 /// A class which contains information known to the grid server about a region
38 /// </summary>
39 [Serializable]
40 public class RegionProfileData
41 {
42 /// <summary>
43 /// The name of the region
44 /// </summary>
45 public string regionName = String.Empty;
46
47 /// <summary>
48 /// A 64-bit number combining map position into a (mostly) unique ID
49 /// </summary>
50 public ulong regionHandle;
51
52 /// <summary>
53 /// OGS/OpenSim Specific ID for a region
54 /// </summary>
55 public UUID UUID;
56
57 /// <summary>
58 /// Coordinates of the region
59 /// </summary>
60 public uint regionLocX;
61 public uint regionLocY;
62 public uint regionLocZ; // Reserved (round-robin, layers, etc)
63
64 /// <summary>
65 /// Authentication secrets
66 /// </summary>
67 /// <remarks>Not very secure, needs improvement.</remarks>
68 public string regionSendKey = String.Empty;
69 public string regionRecvKey = String.Empty;
70 public string regionSecret = String.Empty;
71
72 /// <summary>
73 /// Whether the region is online
74 /// </summary>
75 public bool regionOnline;
76
77 /// <summary>
78 /// Information about the server that the region is currently hosted on
79 /// </summary>
80 public string serverIP = String.Empty;
81 public uint serverPort;
82 public string serverURI = String.Empty;
83
84 public uint httpPort;
85 public uint remotingPort;
86 public string httpServerURI = String.Empty;
87
88 /// <summary>
89 /// Set of optional overrides. Can be used to create non-eulicidean spaces.
90 /// </summary>
91 public ulong regionNorthOverrideHandle;
92 public ulong regionSouthOverrideHandle;
93 public ulong regionEastOverrideHandle;
94 public ulong regionWestOverrideHandle;
95
96 /// <summary>
97 /// Optional: URI Location of the region database
98 /// </summary>
99 /// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks>
100 public string regionDataURI = String.Empty;
101
102 /// <summary>
103 /// Region Asset Details
104 /// </summary>
105 public string regionAssetURI = String.Empty;
106
107 public string regionAssetSendKey = String.Empty;
108 public string regionAssetRecvKey = String.Empty;
109
110 /// <summary>
111 /// Region Userserver Details
112 /// </summary>
113 public string regionUserURI = String.Empty;
114
115 public string regionUserSendKey = String.Empty;
116 public string regionUserRecvKey = String.Empty;
117
118 /// <summary>
119 /// Region Map Texture Asset
120 /// </summary>
121 public UUID regionMapTextureID = new UUID("00000000-0000-1111-9999-000000000006");
122
123 /// <summary>
124 /// this particular mod to the file provides support within the spec for RegionProfileData for the
125 /// owner_uuid for the region
126 /// </summary>
127 public UUID owner_uuid = UUID.Zero;
128
129 /// <summary>
130 /// OGS/OpenSim Specific original ID for a region after move/split
131 /// </summary>
132 public UUID originUUID;
133
134 /// <summary>
135 /// The Maturity rating of the region
136 /// </summary>
137 public uint maturity;
138
139 //Data Wrappers
140 public string RegionName
141 {
142 get { return regionName; }
143 set { regionName = value; }
144 }
145 public ulong RegionHandle
146 {
147 get { return regionHandle; }
148 set { regionHandle = value; }
149 }
150 public UUID Uuid
151 {
152 get { return UUID; }
153 set { UUID = value; }
154 }
155 public uint RegionLocX
156 {
157 get { return regionLocX; }
158 set { regionLocX = value; }
159 }
160 public uint RegionLocY
161 {
162 get { return regionLocY; }
163 set { regionLocY = value; }
164 }
165 public uint RegionLocZ
166 {
167 get { return regionLocZ; }
168 set { regionLocZ = value; }
169 }
170 public string RegionSendKey
171 {
172 get { return regionSendKey; }
173 set { regionSendKey = value; }
174 }
175 public string RegionRecvKey
176 {
177 get { return regionRecvKey; }
178 set { regionRecvKey = value; }
179 }
180 public string RegionSecret
181 {
182 get { return regionSecret; }
183 set { regionSecret = value; }
184 }
185 public bool RegionOnline
186 {
187 get { return regionOnline; }
188 set { regionOnline = value; }
189 }
190 public string ServerIP
191 {
192 get { return serverIP; }
193 set { serverIP = value; }
194 }
195 public uint ServerPort
196 {
197 get { return serverPort; }
198 set { serverPort = value; }
199 }
200 public string ServerURI
201 {
202 get { return serverURI; }
203 set { serverURI = value; }
204 }
205 public uint ServerHttpPort
206 {
207 get { return httpPort; }
208 set { httpPort = value; }
209 }
210 public uint ServerRemotingPort
211 {
212 get { return remotingPort; }
213 set { remotingPort = value; }
214 }
215
216 public ulong NorthOverrideHandle
217 {
218 get { return regionNorthOverrideHandle; }
219 set { regionNorthOverrideHandle = value; }
220 }
221 public ulong SouthOverrideHandle
222 {
223 get { return regionSouthOverrideHandle; }
224 set { regionSouthOverrideHandle = value; }
225 }
226 public ulong EastOverrideHandle
227 {
228 get { return regionEastOverrideHandle; }
229 set { regionEastOverrideHandle = value; }
230 }
231 public ulong WestOverrideHandle
232 {
233 get { return regionWestOverrideHandle; }
234 set { regionWestOverrideHandle = value; }
235 }
236 public string RegionDataURI
237 {
238 get { return regionDataURI; }
239 set { regionDataURI = value; }
240 }
241 public string RegionAssetURI
242 {
243 get { return regionAssetURI; }
244 set { regionAssetURI = value; }
245 }
246 public string RegionAssetSendKey
247 {
248 get { return regionAssetSendKey; }
249 set { regionAssetSendKey = value; }
250 }
251 public string RegionAssetRecvKey
252 {
253 get { return regionAssetRecvKey; }
254 set { regionAssetRecvKey = value; }
255 }
256 public string RegionUserURI
257 {
258 get { return regionUserURI; }
259 set { regionUserURI = value; }
260 }
261 public string RegionUserSendKey
262 {
263 get { return regionUserSendKey; }
264 set { regionUserSendKey = value; }
265 }
266 public string RegionUserRecvKey
267 {
268 get { return regionUserRecvKey; }
269 set { regionUserRecvKey = value; }
270 }
271 public UUID RegionMapTextureID
272 {
273 get { return regionMapTextureID; }
274 set { regionMapTextureID = value; }
275 }
276 public UUID Owner_uuid
277 {
278 get { return owner_uuid; }
279 set { owner_uuid = value; }
280 }
281 public UUID OriginUUID
282 {
283 get { return originUUID; }
284 set { originUUID = value; }
285 }
286 public uint Maturity
287 {
288 get { return maturity; }
289 set { maturity = value; }
290 }
291
292 public byte AccessLevel
293 {
294 get { return Util.ConvertMaturityToAccessLevel(maturity); }
295 }
296
297
298 public RegionInfo ToRegionInfo()
299 {
300 return RegionInfo.Create(UUID, regionName, regionLocX, regionLocY, serverIP, httpPort, serverPort, remotingPort, serverURI);
301 }
302
303 public static RegionProfileData FromRegionInfo(RegionInfo regionInfo)
304 {
305 if (regionInfo == null)
306 {
307 return null;
308 }
309
310 return Create(regionInfo.RegionID, regionInfo.RegionName, regionInfo.RegionLocX,
311 regionInfo.RegionLocY, regionInfo.ExternalHostName,
312 (uint) regionInfo.ExternalEndPoint.Port, regionInfo.HttpPort, regionInfo.RemotingPort,
313 regionInfo.ServerURI, regionInfo.AccessLevel);
314 }
315
316 public static RegionProfileData Create(UUID regionID, string regionName, uint locX, uint locY, string externalHostName, uint regionPort, uint httpPort, uint remotingPort, string serverUri, byte access)
317 {
318 RegionProfileData regionProfile;
319 regionProfile = new RegionProfileData();
320 regionProfile.regionLocX = locX;
321 regionProfile.regionLocY = locY;
322 regionProfile.regionHandle =
323 Utils.UIntsToLong((regionProfile.regionLocX * Constants.RegionSize),
324 (regionProfile.regionLocY*Constants.RegionSize));
325 regionProfile.serverIP = externalHostName;
326 regionProfile.serverPort = regionPort;
327 regionProfile.httpPort = httpPort;
328 regionProfile.remotingPort = remotingPort;
329 regionProfile.serverURI = serverUri;
330 regionProfile.httpServerURI = "http://" + externalHostName + ":" + httpPort + "/";
331 regionProfile.UUID = regionID;
332 regionProfile.regionName = regionName;
333 regionProfile.maturity = access;
334 return regionProfile;
335 }
336 }
337}