aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/RegionProfileData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/RegionProfileData.cs338
1 files changed, 0 insertions, 338 deletions
diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs
deleted file mode 100644
index 86d7f6b..0000000
--- a/OpenSim/Data/RegionProfileData.cs
+++ /dev/null
@@ -1,338 +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
140 //Data Wrappers
141 public string RegionName
142 {
143 get { return regionName; }
144 set { regionName = value; }
145 }
146 public ulong RegionHandle
147 {
148 get { return regionHandle; }
149 set { regionHandle = value; }
150 }
151 public UUID Uuid
152 {
153 get { return UUID; }
154 set { UUID = value; }
155 }
156 public uint RegionLocX
157 {
158 get { return regionLocX; }
159 set { regionLocX = value; }
160 }
161 public uint RegionLocY
162 {
163 get { return regionLocY; }
164 set { regionLocY = value; }
165 }
166 public uint RegionLocZ
167 {
168 get { return regionLocZ; }
169 set { regionLocZ = value; }
170 }
171 public string RegionSendKey
172 {
173 get { return regionSendKey; }
174 set { regionSendKey = value; }
175 }
176 public string RegionRecvKey
177 {
178 get { return regionRecvKey; }
179 set { regionRecvKey = value; }
180 }
181 public string RegionSecret
182 {
183 get { return regionSecret; }
184 set { regionSecret = value; }
185 }
186 public bool RegionOnline
187 {
188 get { return regionOnline; }
189 set { regionOnline = value; }
190 }
191 public string ServerIP
192 {
193 get { return serverIP; }
194 set { serverIP = value; }
195 }
196 public uint ServerPort
197 {
198 get { return serverPort; }
199 set { serverPort = value; }
200 }
201 public string ServerURI
202 {
203 get { return serverURI; }
204 set { serverURI = value; }
205 }
206 public uint ServerHttpPort
207 {
208 get { return httpPort; }
209 set { httpPort = value; }
210 }
211 public uint ServerRemotingPort
212 {
213 get { return remotingPort; }
214 set { remotingPort = value; }
215 }
216
217 public ulong NorthOverrideHandle
218 {
219 get { return regionNorthOverrideHandle; }
220 set { regionNorthOverrideHandle = value; }
221 }
222 public ulong SouthOverrideHandle
223 {
224 get { return regionSouthOverrideHandle; }
225 set { regionSouthOverrideHandle = value; }
226 }
227 public ulong EastOverrideHandle
228 {
229 get { return regionEastOverrideHandle; }
230 set { regionEastOverrideHandle = value; }
231 }
232 public ulong WestOverrideHandle
233 {
234 get { return regionWestOverrideHandle; }
235 set { regionWestOverrideHandle = value; }
236 }
237 public string RegionDataURI
238 {
239 get { return regionDataURI; }
240 set { regionDataURI = value; }
241 }
242 public string RegionAssetURI
243 {
244 get { return regionAssetURI; }
245 set { regionAssetURI = value; }
246 }
247 public string RegionAssetSendKey
248 {
249 get { return regionAssetSendKey; }
250 set { regionAssetSendKey = value; }
251 }
252 public string RegionAssetRecvKey
253 {
254 get { return regionAssetRecvKey; }
255 set { regionAssetRecvKey = value; }
256 }
257 public string RegionUserURI
258 {
259 get { return regionUserURI; }
260 set { regionUserURI = value; }
261 }
262 public string RegionUserSendKey
263 {
264 get { return regionUserSendKey; }
265 set { regionUserSendKey = value; }
266 }
267 public string RegionUserRecvKey
268 {
269 get { return regionUserRecvKey; }
270 set { regionUserRecvKey = value; }
271 }
272 public UUID RegionMapTextureID
273 {
274 get { return regionMapTextureID; }
275 set { regionMapTextureID = value; }
276 }
277 public UUID Owner_uuid
278 {
279 get { return owner_uuid; }
280 set { owner_uuid = value; }
281 }
282 public UUID OriginUUID
283 {
284 get { return originUUID; }
285 set { originUUID = value; }
286 }
287 public uint Maturity
288 {
289 get { return maturity; }
290 set { maturity = value; }
291 }
292
293 public byte AccessLevel
294 {
295 get { return Util.ConvertMaturityToAccessLevel(maturity); }
296 }
297
298
299 public RegionInfo ToRegionInfo()
300 {
301 return RegionInfo.Create(UUID, regionName, regionLocX, regionLocY, serverIP, httpPort, serverPort, remotingPort, serverURI);
302 }
303
304 public static RegionProfileData FromRegionInfo(RegionInfo regionInfo)
305 {
306 if (regionInfo == null)
307 {
308 return null;
309 }
310
311 return Create(regionInfo.RegionID, regionInfo.RegionName, regionInfo.RegionLocX,
312 regionInfo.RegionLocY, regionInfo.ExternalHostName,
313 (uint) regionInfo.ExternalEndPoint.Port, regionInfo.HttpPort, regionInfo.RemotingPort,
314 regionInfo.ServerURI, regionInfo.AccessLevel);
315 }
316
317 public static RegionProfileData Create(UUID regionID, string regionName, uint locX, uint locY, string externalHostName, uint regionPort, uint httpPort, uint remotingPort, string serverUri, byte access)
318 {
319 RegionProfileData regionProfile;
320 regionProfile = new RegionProfileData();
321 regionProfile.regionLocX = locX;
322 regionProfile.regionLocY = locY;
323 regionProfile.regionHandle =
324 Utils.UIntsToLong((regionProfile.regionLocX * Constants.RegionSize),
325 (regionProfile.regionLocY*Constants.RegionSize));
326 regionProfile.serverIP = externalHostName;
327 regionProfile.serverPort = regionPort;
328 regionProfile.httpPort = httpPort;
329 regionProfile.remotingPort = remotingPort;
330 regionProfile.serverURI = serverUri;
331 regionProfile.httpServerURI = "http://" + externalHostName + ":" + httpPort + "/";
332 regionProfile.UUID = regionID;
333 regionProfile.regionName = regionName;
334 regionProfile.maturity = access;
335 return regionProfile;
336 }
337 }
338}