aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorAdam Frisby2008-02-14 12:16:33 +0000
committerAdam Frisby2008-02-14 12:16:33 +0000
commitf3afa68a2af6ad5999e6efe3e4725cb17293108d (patch)
tree4253a44bee39976d6b3dd6813439f5966cf12632 /OpenSim/Framework
parent* Exposed AddHandlers in response to mantis #534. Thanks, kmeisthax! (diff)
downloadopensim-SC_OLD-f3afa68a2af6ad5999e6efe3e4725cb17293108d.zip
opensim-SC_OLD-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.gz
opensim-SC_OLD-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.bz2
opensim-SC_OLD-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.xz
* Made new Framework.Constants class, added RegionSize member.
* Converted all instances of "256" spotted to use RegionSize instead. Some approximations used for border crossings (ie 255.9f) are still using that value, but should be updated to use something based on RegionSize. * Moving Terrain to a RegionModule, implemented ITerrainChannel and TerrainModule - nonfunctional, but will be soon.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/LoginResponse.cs10
-rw-r--r--OpenSim/Framework/Constants.cs11
-rw-r--r--OpenSim/Framework/Data/RegionProfileData.cs4
-rw-r--r--OpenSim/Framework/RegionHandle.cs6
-rw-r--r--OpenSim/Framework/RegionInfo.cs2
-rw-r--r--OpenSim/Framework/SerializableRegionInfo.cs2
-rw-r--r--OpenSim/Framework/UserProfileData.cs2
7 files changed, 24 insertions, 13 deletions
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs
index 9036884..00b691e 100644
--- a/OpenSim/Framework/Communications/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/LoginResponse.cs
@@ -152,7 +152,7 @@ namespace OpenSim.Framework.UserManagement
152 ErrorReason = "key"; 152 ErrorReason = "key";
153 welcomeMessage = "Welcome to OpenSim!"; 153 welcomeMessage = "Welcome to OpenSim!";
154 seedCapability = String.Empty; 154 seedCapability = String.Empty;
155 home = "{'region_handle':[r" + (1000*256).ToString() + ",r" + (1000*256).ToString() + "], 'position':[r" + 155 home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" +
156 userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + 156 userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" +
157 userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + 157 userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" +
158 userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; 158 userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}";
@@ -347,8 +347,8 @@ namespace OpenSim.Framework.UserManagement
347 responseData["home"] = home; 347 responseData["home"] = home;
348 responseData["look_at"] = lookAt; 348 responseData["look_at"] = lookAt;
349 responseData["message"] = welcomeMessage; 349 responseData["message"] = welcomeMessage;
350 responseData["region_x"] = (Int32) RegionX*256; 350 responseData["region_x"] = (Int32)RegionX * Constants.RegionSize;
351 responseData["region_y"] = (Int32) RegionY*256; 351 responseData["region_y"] = (Int32)RegionY * Constants.RegionSize;
352 352
353 //responseData["inventory-lib-root"] = new ArrayList(); // todo 353 //responseData["inventory-lib-root"] = new ArrayList(); // todo
354 354
@@ -447,8 +447,8 @@ namespace OpenSim.Framework.UserManagement
447 map["home"] = LLSD.FromString(home); 447 map["home"] = LLSD.FromString(home);
448 map["look_at"] = LLSD.FromString(lookAt); 448 map["look_at"] = LLSD.FromString(lookAt);
449 map["message"] = LLSD.FromString(welcomeMessage); 449 map["message"] = LLSD.FromString(welcomeMessage);
450 map["region_x"] = LLSD.FromInteger(RegionX * 256); 450 map["region_x"] = LLSD.FromInteger(RegionX * Constants.RegionSize);
451 map["region_y"] = LLSD.FromInteger(RegionY * 256); 451 map["region_y"] = LLSD.FromInteger(RegionY * Constants.RegionSize);
452 452
453 if (m_buddyList != null) 453 if (m_buddyList != null)
454 { 454 {
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs
new file mode 100644
index 0000000..b308221
--- /dev/null
+++ b/OpenSim/Framework/Constants.cs
@@ -0,0 +1,11 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework
6{
7 public class Constants
8 {
9 public const uint RegionSize = 256;
10 }
11}
diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs
index 48d3ebc..8119d01 100644
--- a/OpenSim/Framework/Data/RegionProfileData.cs
+++ b/OpenSim/Framework/Data/RegionProfileData.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Framework.Data
169 RegionProfileData simData = new RegionProfileData(); 169 RegionProfileData simData = new RegionProfileData();
170 simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); 170 simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]);
171 simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); 171 simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]);
172 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256)); 172 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize));
173 simData.serverIP = (string) responseData["sim_ip"]; 173 simData.serverIP = (string) responseData["sim_ip"];
174 simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); 174 simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]);
175 simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); 175 simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Data
203 RegionProfileData simData = new RegionProfileData(); 203 RegionProfileData simData = new RegionProfileData();
204 simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); 204 simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]);
205 simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); 205 simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]);
206 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256)); 206 simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize));
207 simData.serverIP = (string) responseData["sim_ip"]; 207 simData.serverIP = (string) responseData["sim_ip"];
208 simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); 208 simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]);
209 simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); 209 simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
diff --git a/OpenSim/Framework/RegionHandle.cs b/OpenSim/Framework/RegionHandle.cs
index 440aaf6..9cfe53d 100644
--- a/OpenSim/Framework/RegionHandle.cs
+++ b/OpenSim/Framework/RegionHandle.cs
@@ -63,8 +63,8 @@ namespace OpenSim.Framework
63 uint ny = (uint) y; 63 uint ny = (uint) y;
64 64
65 // Multiply grid coords to get region coords 65 // Multiply grid coords to get region coords
66 nx *= 256; 66 nx *= Constants.RegionSize;
67 ny *= 256; 67 ny *= Constants.RegionSize;
68 68
69 // Stuff the IP address in too 69 // Stuff the IP address in too
70 nx = (uint) a << 16; 70 nx = (uint) a << 16;
@@ -80,7 +80,7 @@ namespace OpenSim.Framework
80 /// <param name="y">Grid Y Coordinate</param> 80 /// <param name="y">Grid Y Coordinate</param>
81 public RegionHandle(uint x, uint y) 81 public RegionHandle(uint x, uint y)
82 { 82 {
83 handle = ((x*256) << 32) | (y*256); 83 handle = ((x * Constants.RegionSize) << 32) | (y * Constants.RegionSize);
84 } 84 }
85 85
86 /// <summary> 86 /// <summary>
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index e953182..f97db5c 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Framework
156 156
157 public ulong RegionHandle 157 public ulong RegionHandle
158 { 158 {
159 get { return Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); } 159 get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); }
160 } 160 }
161 } 161 }
162 162
diff --git a/OpenSim/Framework/SerializableRegionInfo.cs b/OpenSim/Framework/SerializableRegionInfo.cs
index 0097fe4..077ed8d 100644
--- a/OpenSim/Framework/SerializableRegionInfo.cs
+++ b/OpenSim/Framework/SerializableRegionInfo.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Framework
155 155
156 public ulong RegionHandle 156 public ulong RegionHandle
157 { 157 {
158 get { return Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); } 158 get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); }
159 } 159 }
160 } 160 }
161} \ No newline at end of file 161} \ No newline at end of file
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index de44a0d..9c02d78 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Framework
70 /// </summary> 70 /// </summary>
71 public ulong homeRegion 71 public ulong homeRegion
72 { 72 {
73 get { return Helpers.UIntsToLong((homeRegionX*256), (homeRegionY*256)); } 73 get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); }
74 set 74 set
75 { 75 {
76 homeRegionX = (uint) (value >> 40); 76 homeRegionX = (uint) (value >> 40);