diff options
author | Adam Frisby | 2008-02-14 12:16:33 +0000 |
---|---|---|
committer | Adam Frisby | 2008-02-14 12:16:33 +0000 |
commit | f3afa68a2af6ad5999e6efe3e4725cb17293108d (patch) | |
tree | 4253a44bee39976d6b3dd6813439f5966cf12632 /OpenSim/Grid | |
parent | * Exposed AddHandlers in response to mantis #534. Thanks, kmeisthax! (diff) | |
download | opensim-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/Grid')
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 28 | ||||
-rw-r--r-- | OpenSim/Grid/MessagingServer/MessageService.cs | 2 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 10 |
3 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 0ccffd9..efab4fc 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -203,13 +203,13 @@ namespace OpenSim.Grid.GridServer | |||
203 | { | 203 | { |
204 | if ( | 204 | if ( |
205 | getRegion( | 205 | getRegion( |
206 | Util.UIntsToLong((uint) ((central_region.regionLocX + x)*256), | 206 | Util.UIntsToLong((uint)((central_region.regionLocX + x) * Constants.RegionSize), |
207 | (uint) (central_region.regionLocY + y)*256)) != null) | 207 | (uint)(central_region.regionLocY + y) * Constants.RegionSize)) != null) |
208 | { | 208 | { |
209 | neighbour = | 209 | neighbour = |
210 | getRegion( | 210 | getRegion( |
211 | Util.UIntsToLong((uint) ((central_region.regionLocX + x)*256), | 211 | Util.UIntsToLong((uint)((central_region.regionLocX + x) * Constants.RegionSize), |
212 | (uint) (central_region.regionLocY + y)*256)); | 212 | (uint)(central_region.regionLocY + y) * Constants.RegionSize)); |
213 | response += "<neighbour>"; | 213 | response += "<neighbour>"; |
214 | response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>"; | 214 | response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>"; |
215 | response += "<sim_port>" + neighbour.serverPort.ToString() + "</sim_port>"; | 215 | response += "<sim_port>" + neighbour.serverPort.ToString() + "</sim_port>"; |
@@ -303,7 +303,7 @@ namespace OpenSim.Grid.GridServer | |||
303 | } | 303 | } |
304 | catch (KeyNotFoundException) { } | 304 | catch (KeyNotFoundException) { } |
305 | 305 | ||
306 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); | 306 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * Constants.RegionSize), (TheSim.regionLocY * Constants.RegionSize)); |
307 | TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; | 307 | TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; |
308 | 308 | ||
309 | TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/"; | 309 | TheSim.httpServerURI = "http://" + TheSim.serverIP + ":" + TheSim.httpPort + "/"; |
@@ -416,13 +416,13 @@ namespace OpenSim.Grid.GridServer | |||
416 | { | 416 | { |
417 | if ( | 417 | if ( |
418 | getRegion( | 418 | getRegion( |
419 | Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), | 419 | Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * Constants.RegionSize), |
420 | (uint)(TheSim.regionLocY + y) * 256)) != null) | 420 | (uint)(TheSim.regionLocY + y) * Constants.RegionSize)) != null) |
421 | { | 421 | { |
422 | neighbour = | 422 | neighbour = |
423 | getRegion( | 423 | getRegion( |
424 | Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), | 424 | Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * Constants.RegionSize), |
425 | (uint)(TheSim.regionLocY + y) * 256)); | 425 | (uint)(TheSim.regionLocY + y) * Constants.RegionSize)); |
426 | 426 | ||
427 | NeighbourBlock = new Hashtable(); | 427 | NeighbourBlock = new Hashtable(); |
428 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(neighbour.serverIP).ToString(); | 428 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(neighbour.serverIP).ToString(); |
@@ -604,7 +604,7 @@ namespace OpenSim.Grid.GridServer | |||
604 | { | 604 | { |
605 | for (int y = ymin; y < ymax + 1; y++) | 605 | for (int y = ymin; y < ymax + 1; y++) |
606 | { | 606 | { |
607 | ulong regHandle = Helpers.UIntsToLong((uint) (x*256), (uint) (y*256)); | 607 | ulong regHandle = Helpers.UIntsToLong((uint)(x * Constants.RegionSize), (uint)(y * Constants.RegionSize)); |
608 | simProfile = getRegion(regHandle); | 608 | simProfile = getRegion(regHandle); |
609 | if (simProfile != null) | 609 | if (simProfile != null) |
610 | { | 610 | { |
@@ -764,12 +764,12 @@ namespace OpenSim.Grid.GridServer | |||
764 | 764 | ||
765 | case "region_locx": | 765 | case "region_locx": |
766 | TheSim.regionLocX = Convert.ToUInt32((string) simnode.ChildNodes[i].InnerText); | 766 | TheSim.regionLocX = Convert.ToUInt32((string) simnode.ChildNodes[i].InnerText); |
767 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX*256), (TheSim.regionLocY*256)); | 767 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * Constants.RegionSize), (TheSim.regionLocY * Constants.RegionSize)); |
768 | break; | 768 | break; |
769 | 769 | ||
770 | case "region_locy": | 770 | case "region_locy": |
771 | TheSim.regionLocY = Convert.ToUInt32((string) simnode.ChildNodes[i].InnerText); | 771 | TheSim.regionLocY = Convert.ToUInt32((string) simnode.ChildNodes[i].InnerText); |
772 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX*256), (TheSim.regionLocY*256)); | 772 | TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * Constants.RegionSize), (TheSim.regionLocY * Constants.RegionSize)); |
773 | break; | 773 | break; |
774 | } | 774 | } |
775 | } | 775 | } |
@@ -787,9 +787,9 @@ namespace OpenSim.Grid.GridServer | |||
787 | return "ERROR! Servers must register with public addresses."; | 787 | return "ERROR! Servers must register with public addresses."; |
788 | } | 788 | } |
789 | 789 | ||
790 | if (requireValid && (TheSim.serverIP.StartsWith("0."))) | 790 | if (requireValid && (TheSim.serverIP.StartsWith("0.") || TheSim.serverIP.StartsWith("255."))) |
791 | { | 791 | { |
792 | return "ERROR! 0.*.*.* Addresses are invalid, please check your server config and try again"; | 792 | return "ERROR! 0.*.*.* / 255.*.*.* Addresses are invalid, please check your server config and try again"; |
793 | } | 793 | } |
794 | 794 | ||
795 | 795 | ||
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index c2669b0..059a6b0 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs | |||
@@ -451,7 +451,7 @@ namespace OpenSim.Grid.MessagingServer | |||
451 | regionProfile = new RegionProfileData(); | 451 | regionProfile = new RegionProfileData(); |
452 | regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]); | 452 | regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]); |
453 | regionProfile.httpServerURI = "http://" + internalIpStr + ":" + regionProfile.httpPort + "/"; | 453 | regionProfile.httpServerURI = "http://" + internalIpStr + ":" + regionProfile.httpPort + "/"; |
454 | regionProfile.regionHandle = Helpers.UIntsToLong((regX * 256), (regY * 256)); | 454 | regionProfile.regionHandle = Helpers.UIntsToLong((regX * Constants.RegionSize), (regY * Constants.RegionSize)); |
455 | regionProfile.regionLocX = regX; | 455 | regionProfile.regionLocX = regX; |
456 | regionProfile.regionLocY = regY; | 456 | regionProfile.regionLocY = regY; |
457 | 457 | ||
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index af234e2..09cd9fd 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -82,8 +82,8 @@ namespace OpenSim.Grid.UserServer | |||
82 | // Customise the response | 82 | // Customise the response |
83 | //CFK: This is redundant and the next message should always appear. | 83 | //CFK: This is redundant and the next message should always appear. |
84 | //CFK: m_log.Info("[LOGIN]: Home Location"); | 84 | //CFK: m_log.Info("[LOGIN]: Home Location"); |
85 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + | 85 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + |
86 | (SimInfo.regionLocY*256).ToString() + "], " + | 86 | (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + |
87 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + | 87 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + |
88 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | 88 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + |
89 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + | 89 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + |
@@ -144,7 +144,7 @@ namespace OpenSim.Grid.UserServer | |||
144 | // Send him to default region instead | 144 | // Send him to default region instead |
145 | // Load information from the gridserver | 145 | // Load information from the gridserver |
146 | 146 | ||
147 | ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256); | 147 | ulong defaultHandle = (((ulong)m_config.DefaultX * Constants.RegionSize) << 32) | ((ulong)m_config.DefaultY * Constants.RegionSize); |
148 | 148 | ||
149 | m_log.Warn( | 149 | m_log.Warn( |
150 | "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString()); | 150 | "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString()); |
@@ -158,8 +158,8 @@ namespace OpenSim.Grid.UserServer | |||
158 | 158 | ||
159 | // Customise the response | 159 | // Customise the response |
160 | m_log.Info("[LOGIN]: Home Location"); | 160 | m_log.Info("[LOGIN]: Home Location"); |
161 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + | 161 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + |
162 | (SimInfo.regionLocY*256).ToString() + "], " + | 162 | (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + |
163 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + | 163 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + |
164 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | 164 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + |
165 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + | 165 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + |