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/GridServer | |
parent | * Exposed AddHandlers in response to mantis #534. Thanks, kmeisthax! (diff) | |
download | opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.zip opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.gz opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.bz2 opensim-SC-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/GridServer')
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 28 |
1 files changed, 14 insertions, 14 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 | ||