diff options
Diffstat (limited to 'OpenSim/Services')
9 files changed, 85 insertions, 53 deletions
diff --git a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs index 30a73a4..644331a 100644 --- a/OpenSim/Services/Connectors/Land/LandServicesConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Services.Connectors | |||
78 | try | 78 | try |
79 | { | 79 | { |
80 | uint xpos = 0, ypos = 0; | 80 | uint xpos = 0, ypos = 0; |
81 | Utils.LongToUInts(regionHandle, out xpos, out ypos); | 81 | Util.RegionHandleToWorldLoc(regionHandle, out xpos, out ypos); |
82 | GridRegion info = m_GridService.GetRegionByPosition(scopeID, (int)xpos, (int)ypos); | 82 | GridRegion info = m_GridService.GetRegionByPosition(scopeID, (int)xpos, (int)ypos); |
83 | if (info != null) // just to be sure | 83 | if (info != null) // just to be sure |
84 | { | 84 | { |
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 774fe2a..beead97 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors | |||
69 | public virtual GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | 69 | public virtual GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) |
70 | { | 70 | { |
71 | uint x = 0, y = 0; | 71 | uint x = 0, y = 0; |
72 | Utils.LongToUInts(regionHandle, out x, out y); | 72 | Util.RegionHandleToWorldLoc(regionHandle, out x, out y); |
73 | GridRegion regInfo = m_GridService.GetRegionByPosition(thisRegion.ScopeID, (int)x, (int)y); | 73 | GridRegion regInfo = m_GridService.GetRegionByPosition(thisRegion.ScopeID, (int)x, (int)y); |
74 | if ((regInfo != null) && | 74 | if ((regInfo != null) && |
75 | // Don't remote-call this instance; that's a startup hickup | 75 | // Don't remote-call this instance; that's a startup hickup |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index c928f16..6b59f94 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
101 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) | 101 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
102 | { | 102 | { |
103 | Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); | 103 | Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); |
104 | Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | 104 | Vector3d maxPosition = minPosition + new Vector3d(regionInfo.RegionSizeX, regionInfo.RegionSizeY, Constants.RegionHeight); |
105 | 105 | ||
106 | OSDMap extraData = new OSDMap | 106 | OSDMap extraData = new OSDMap |
107 | { | 107 | { |
@@ -156,15 +156,15 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
156 | 156 | ||
157 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 157 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
158 | { | 158 | { |
159 | const int NEIGHBOR_RADIUS = 128; | ||
160 | |||
161 | GridRegion region = GetRegionByUUID(scopeID, regionID); | 159 | GridRegion region = GetRegionByUUID(scopeID, regionID); |
162 | 160 | ||
161 | int NEIGHBOR_RADIUS = Math.Max(region.RegionSizeX, region.RegionSizeY) / 2; | ||
162 | |||
163 | if (region != null) | 163 | if (region != null) |
164 | { | 164 | { |
165 | List<GridRegion> regions = GetRegionRange(scopeID, | 165 | List<GridRegion> regions = GetRegionRange(scopeID, |
166 | region.RegionLocX - NEIGHBOR_RADIUS, region.RegionLocX + (int)Constants.RegionSize + NEIGHBOR_RADIUS, | 166 | region.RegionLocX - NEIGHBOR_RADIUS, region.RegionLocX + region.RegionSizeX + NEIGHBOR_RADIUS, |
167 | region.RegionLocY - NEIGHBOR_RADIUS, region.RegionLocY + (int)Constants.RegionSize + NEIGHBOR_RADIUS); | 167 | region.RegionLocY - NEIGHBOR_RADIUS, region.RegionLocY + region.RegionSizeY + NEIGHBOR_RADIUS); |
168 | 168 | ||
169 | for (int i = 0; i < regions.Count; i++) | 169 | for (int i = 0; i < regions.Count; i++) |
170 | { | 170 | { |
@@ -229,7 +229,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
229 | else | 229 | else |
230 | { | 230 | { |
231 | // m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}", | 231 | // m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}", |
232 | // x / Constants.RegionSize, y / Constants.RegionSize); | 232 | // Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); |
233 | return null; | 233 | return null; |
234 | } | 234 | } |
235 | } | 235 | } |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index 504fcaf..2cbf967 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs | |||
@@ -100,6 +100,11 @@ namespace OpenSim.Services.Connectors | |||
100 | return m_database.LoadObjects(regionUUID); | 100 | return m_database.LoadObjects(regionUUID); |
101 | } | 101 | } |
102 | 102 | ||
103 | public void StoreTerrain(TerrainData terrain, UUID regionID) | ||
104 | { | ||
105 | m_database.StoreTerrain(terrain, regionID); | ||
106 | } | ||
107 | |||
103 | public void StoreTerrain(double[,] terrain, UUID regionID) | 108 | public void StoreTerrain(double[,] terrain, UUID regionID) |
104 | { | 109 | { |
105 | m_database.StoreTerrain(terrain, regionID); | 110 | m_database.StoreTerrain(terrain, regionID); |
@@ -110,6 +115,11 @@ namespace OpenSim.Services.Connectors | |||
110 | return m_database.LoadTerrain(regionID); | 115 | return m_database.LoadTerrain(regionID); |
111 | } | 116 | } |
112 | 117 | ||
118 | public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) | ||
119 | { | ||
120 | return m_database.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); | ||
121 | } | ||
122 | |||
113 | public void StoreLandObject(ILandObject Parcel) | 123 | public void StoreLandObject(ILandObject Parcel) |
114 | { | 124 | { |
115 | m_database.StoreLandObject(Parcel); | 125 | m_database.StoreLandObject(Parcel); |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 137ce04..8198592 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -313,6 +313,7 @@ namespace OpenSim.Services.GridService | |||
313 | if (region != null) | 313 | if (region != null) |
314 | { | 314 | { |
315 | // Not really? Maybe? | 315 | // Not really? Maybe? |
316 | // The adjacent regions are presumed to be the same size as the current region | ||
316 | List<RegionData> rdatas = m_Database.Get( | 317 | List<RegionData> rdatas = m_Database.Get( |
317 | region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, | 318 | region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, |
318 | region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); | 319 | region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); |
@@ -643,20 +644,20 @@ namespace OpenSim.Services.GridService | |||
643 | return; | 644 | return; |
644 | } | 645 | } |
645 | 646 | ||
646 | int x, y; | 647 | uint x, y; |
647 | if (!int.TryParse(cmd[3], out x)) | 648 | if (!uint.TryParse(cmd[3], out x)) |
648 | { | 649 | { |
649 | MainConsole.Instance.Output("x-coord must be an integer"); | 650 | MainConsole.Instance.Output("x-coord must be an integer"); |
650 | return; | 651 | return; |
651 | } | 652 | } |
652 | 653 | ||
653 | if (!int.TryParse(cmd[4], out y)) | 654 | if (!uint.TryParse(cmd[4], out y)) |
654 | { | 655 | { |
655 | MainConsole.Instance.Output("y-coord must be an integer"); | 656 | MainConsole.Instance.Output("y-coord must be an integer"); |
656 | return; | 657 | return; |
657 | } | 658 | } |
658 | 659 | ||
659 | RegionData region = m_Database.Get(x * (int)Constants.RegionSize, y * (int)Constants.RegionSize, UUID.Zero); | 660 | RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); |
660 | if (region == null) | 661 | if (region == null) |
661 | { | 662 | { |
662 | MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); | 663 | MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 4024295..4ebfd5c 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -183,8 +183,8 @@ namespace OpenSim.Services.GridService | |||
183 | public GridRegion LinkRegion(UUID scopeID, string regionDescriptor) | 183 | public GridRegion LinkRegion(UUID scopeID, string regionDescriptor) |
184 | { | 184 | { |
185 | string reason = string.Empty; | 185 | string reason = string.Empty; |
186 | int xloc = random.Next(0, Int16.MaxValue) * (int)Constants.RegionSize; | 186 | uint xloc = Util.RegionToWorldLoc((uint)random.Next(0, Int16.MaxValue)); |
187 | return TryLinkRegionToCoords(scopeID, regionDescriptor, xloc, 0, out reason); | 187 | return TryLinkRegionToCoords(scopeID, regionDescriptor, (int)xloc, 0, out reason); |
188 | } | 188 | } |
189 | 189 | ||
190 | private static Random random = new Random(); | 190 | private static Random random = new Random(); |
@@ -260,7 +260,7 @@ namespace OpenSim.Services.GridService | |||
260 | { | 260 | { |
261 | m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}", | 261 | m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}", |
262 | ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), | 262 | ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), |
263 | remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); | 263 | remoteRegionName, Util.WorldToRegionLoc((uint)xloc), Util.WorldToRegionLoc((uint)yloc)); |
264 | 264 | ||
265 | reason = string.Empty; | 265 | reason = string.Empty; |
266 | Uri uri = null; | 266 | Uri uri = null; |
@@ -311,7 +311,7 @@ namespace OpenSim.Services.GridService | |||
311 | if (region != null) | 311 | if (region != null) |
312 | { | 312 | { |
313 | m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", | 313 | m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", |
314 | regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize, | 314 | Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY), |
315 | region.RegionName, region.RegionID); | 315 | region.RegionName, region.RegionID); |
316 | reason = "Coordinates are already in use"; | 316 | reason = "Coordinates are already in use"; |
317 | return false; | 317 | return false; |
@@ -347,7 +347,7 @@ namespace OpenSim.Services.GridService | |||
347 | if (region != null) | 347 | if (region != null) |
348 | { | 348 | { |
349 | m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", | 349 | m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", |
350 | region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); | 350 | Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY)); |
351 | regInfo = region; | 351 | regInfo = region; |
352 | return true; | 352 | return true; |
353 | } | 353 | } |
@@ -424,10 +424,10 @@ namespace OpenSim.Services.GridService | |||
424 | // { | 424 | // { |
425 | // uint ux = 0, uy = 0; | 425 | // uint ux = 0, uy = 0; |
426 | // Utils.LongToUInts(realHandle, out ux, out uy); | 426 | // Utils.LongToUInts(realHandle, out ux, out uy); |
427 | // x = ux / Constants.RegionSize; | 427 | // x = Util.WorldToRegionLoc(ux); |
428 | // y = uy / Constants.RegionSize; | 428 | // y = Util.WorldToRegionLoc(uy); |
429 | // | 429 | // |
430 | // const uint limit = (4096 - 1) * Constants.RegionSize; | 430 | // const uint limit = Util.RegionToWorldLoc(4096 - 1); |
431 | // uint xmin = ux - limit; | 431 | // uint xmin = ux - limit; |
432 | // uint xmax = ux + limit; | 432 | // uint xmax = ux + limit; |
433 | // uint ymin = uy - limit; | 433 | // uint ymin = uy - limit; |
@@ -502,9 +502,14 @@ namespace OpenSim.Services.GridService | |||
502 | MainConsole.Instance.Output(new string('-', 72)); | 502 | MainConsole.Instance.Output(new string('-', 72)); |
503 | foreach (RegionData r in regions) | 503 | foreach (RegionData r in regions) |
504 | { | 504 | { |
505 | MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n", | 505 | MainConsole.Instance.Output( |
506 | r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY, | 506 | String.Format("{0}\n{2,-32} {1}\n", |
507 | r.posX / Constants.RegionSize, r.posY / Constants.RegionSize))); | 507 | r.RegionName, r.RegionID, |
508 | String.Format("{0},{1} ({2},{3})", r.posX, r.posY, | ||
509 | Util.WorldToRegionLoc((uint)r.posX), Util.WorldToRegionLoc((uint)r.posY) | ||
510 | ) | ||
511 | ) | ||
512 | ); | ||
508 | } | 513 | } |
509 | return; | 514 | return; |
510 | } | 515 | } |
@@ -529,8 +534,8 @@ namespace OpenSim.Services.GridService | |||
529 | int xloc, yloc; | 534 | int xloc, yloc; |
530 | string serverURI; | 535 | string serverURI; |
531 | string remoteName = null; | 536 | string remoteName = null; |
532 | xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; | 537 | xloc = (int)Util.RegionToWorldLoc((uint)Convert.ToInt32(cmdparams[0])); |
533 | yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; | 538 | yloc = (int)Util.RegionToWorldLoc((uint)Convert.ToInt32(cmdparams[1])); |
534 | serverURI = cmdparams[2]; | 539 | serverURI = cmdparams[2]; |
535 | if (cmdparams.Length > 3) | 540 | if (cmdparams.Length > 3) |
536 | remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3); | 541 | remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3); |
@@ -601,13 +606,13 @@ namespace OpenSim.Services.GridService | |||
601 | { | 606 | { |
602 | // old format | 607 | // old format |
603 | GridRegion regInfo; | 608 | GridRegion regInfo; |
604 | int xloc, yloc; | 609 | uint xloc, yloc; |
605 | uint externalPort; | 610 | uint externalPort; |
606 | string externalHostName; | 611 | string externalHostName; |
607 | try | 612 | try |
608 | { | 613 | { |
609 | xloc = Convert.ToInt32(cmdparams[0]); | 614 | xloc = Convert.ToUInt32(cmdparams[0]); |
610 | yloc = Convert.ToInt32(cmdparams[1]); | 615 | yloc = Convert.ToUInt32(cmdparams[1]); |
611 | externalPort = Convert.ToUInt32(cmdparams[3]); | 616 | externalPort = Convert.ToUInt32(cmdparams[3]); |
612 | externalHostName = cmdparams[2]; | 617 | externalHostName = cmdparams[2]; |
613 | //internalPort = Convert.ToUInt32(cmdparams[4]); | 618 | //internalPort = Convert.ToUInt32(cmdparams[4]); |
@@ -621,10 +626,11 @@ namespace OpenSim.Services.GridService | |||
621 | } | 626 | } |
622 | 627 | ||
623 | // Convert cell coordinates given by the user to meters | 628 | // Convert cell coordinates given by the user to meters |
624 | xloc = xloc * (int)Constants.RegionSize; | 629 | xloc = Util.RegionToWorldLoc(xloc); |
625 | yloc = yloc * (int)Constants.RegionSize; | 630 | yloc = Util.RegionToWorldLoc(yloc); |
626 | string reason = string.Empty; | 631 | string reason = string.Empty; |
627 | if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) | 632 | if (TryCreateLink(UUID.Zero, (int)xloc, (int)yloc, |
633 | string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) | ||
628 | { | 634 | { |
629 | // What is this? The GridRegion instance will be discarded anyway, | 635 | // What is this? The GridRegion instance will be discarded anyway, |
630 | // which effectively ignores any local name given with the command. | 636 | // which effectively ignores any local name given with the command. |
@@ -704,13 +710,13 @@ namespace OpenSim.Services.GridService | |||
704 | private void ReadLinkFromConfig(IConfig config) | 710 | private void ReadLinkFromConfig(IConfig config) |
705 | { | 711 | { |
706 | GridRegion regInfo; | 712 | GridRegion regInfo; |
707 | int xloc, yloc; | 713 | uint xloc, yloc; |
708 | uint externalPort; | 714 | uint externalPort; |
709 | string externalHostName; | 715 | string externalHostName; |
710 | uint realXLoc, realYLoc; | 716 | uint realXLoc, realYLoc; |
711 | 717 | ||
712 | xloc = Convert.ToInt32(config.GetString("xloc", "0")); | 718 | xloc = Convert.ToUInt32(config.GetString("xloc", "0")); |
713 | yloc = Convert.ToInt32(config.GetString("yloc", "0")); | 719 | yloc = Convert.ToUInt32(config.GetString("yloc", "0")); |
714 | externalPort = Convert.ToUInt32(config.GetString("externalPort", "0")); | 720 | externalPort = Convert.ToUInt32(config.GetString("externalPort", "0")); |
715 | externalHostName = config.GetString("externalHostName", ""); | 721 | externalHostName = config.GetString("externalHostName", ""); |
716 | realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0")); | 722 | realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0")); |
@@ -718,18 +724,19 @@ namespace OpenSim.Services.GridService | |||
718 | 724 | ||
719 | if (m_enableAutoMapping) | 725 | if (m_enableAutoMapping) |
720 | { | 726 | { |
721 | xloc = (int)((xloc % 100) + m_autoMappingX); | 727 | xloc = (xloc % 100) + m_autoMappingX; |
722 | yloc = (int)((yloc % 100) + m_autoMappingY); | 728 | yloc = (yloc % 100) + m_autoMappingY; |
723 | } | 729 | } |
724 | 730 | ||
725 | if (((realXLoc == 0) && (realYLoc == 0)) || | 731 | if (((realXLoc == 0) && (realYLoc == 0)) || |
726 | (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && | 732 | (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && |
727 | ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) | 733 | ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) |
728 | { | 734 | { |
729 | xloc = xloc * (int)Constants.RegionSize; | 735 | xloc = Util.RegionToWorldLoc(xloc); |
730 | yloc = yloc * (int)Constants.RegionSize; | 736 | yloc = Util.RegionToWorldLoc(yloc); |
731 | string reason = string.Empty; | 737 | string reason = string.Empty; |
732 | if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) | 738 | if (TryCreateLink(UUID.Zero, (int)xloc, (int)yloc, |
739 | string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) | ||
733 | { | 740 | { |
734 | regInfo.RegionName = config.GetString("localName", ""); | 741 | regInfo.RegionName = config.GetString("localName", ""); |
735 | } | 742 | } |
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 739e279..8e6279e 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -175,12 +175,12 @@ namespace OpenSim.Services.Interfaces | |||
175 | /// <summary> | 175 | /// <summary> |
176 | /// The co-ordinate of this region. | 176 | /// The co-ordinate of this region. |
177 | /// </summary> | 177 | /// </summary> |
178 | public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } | 178 | public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } } |
179 | 179 | ||
180 | /// <summary> | 180 | /// <summary> |
181 | /// The co-ordinate of this region | 181 | /// The co-ordinate of this region |
182 | /// </summary> | 182 | /// </summary> |
183 | public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } | 183 | public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } } |
184 | 184 | ||
185 | /// <summary> | 185 | /// <summary> |
186 | /// The location of this region in meters. | 186 | /// The location of this region in meters. |
@@ -259,8 +259,8 @@ namespace OpenSim.Services.Interfaces | |||
259 | 259 | ||
260 | public GridRegion(uint xcell, uint ycell) | 260 | public GridRegion(uint xcell, uint ycell) |
261 | { | 261 | { |
262 | m_regionLocX = (int)(xcell * Constants.RegionSize); | 262 | m_regionLocX = (int)Util.RegionToWorldLoc(xcell); |
263 | m_regionLocY = (int)(ycell * Constants.RegionSize); | 263 | m_regionLocY = (int)Util.RegionToWorldLoc(ycell); |
264 | RegionSizeX = (int)Constants.RegionSize; | 264 | RegionSizeX = (int)Constants.RegionSize; |
265 | RegionSizeY = (int)Constants.RegionSize; | 265 | RegionSizeY = (int)Constants.RegionSize; |
266 | } | 266 | } |
@@ -268,8 +268,8 @@ namespace OpenSim.Services.Interfaces | |||
268 | public GridRegion(RegionInfo ConvertFrom) | 268 | public GridRegion(RegionInfo ConvertFrom) |
269 | { | 269 | { |
270 | m_regionName = ConvertFrom.RegionName; | 270 | m_regionName = ConvertFrom.RegionName; |
271 | m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); | 271 | m_regionLocX = (int)(ConvertFrom.WorldLocX); |
272 | m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); | 272 | m_regionLocY = (int)(ConvertFrom.WorldLocY); |
273 | RegionSizeX = (int)ConvertFrom.RegionSizeX; | 273 | RegionSizeX = (int)ConvertFrom.RegionSizeX; |
274 | RegionSizeY = (int)ConvertFrom.RegionSizeY; | 274 | RegionSizeY = (int)ConvertFrom.RegionSizeY; |
275 | m_internalEndPoint = ConvertFrom.InternalEndPoint; | 275 | m_internalEndPoint = ConvertFrom.InternalEndPoint; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 5256b74..e67ecf0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -258,7 +258,7 @@ namespace OpenSim.Services.LLLoginService | |||
258 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); | 258 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); |
259 | 259 | ||
260 | FillOutRegionData(destination); | 260 | FillOutRegionData(destination); |
261 | // m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | 261 | m_log.DebugFormat("[LOGIN RESPONSE] LLLoginResponse create. sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY); |
262 | 262 | ||
263 | FillOutSeedCap(aCircuit, destination, clientIP); | 263 | FillOutSeedCap(aCircuit, destination, clientIP); |
264 | 264 | ||
@@ -361,7 +361,8 @@ namespace OpenSim.Services.LLLoginService | |||
361 | 361 | ||
362 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) | 362 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) |
363 | { | 363 | { |
364 | int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; | 364 | int x = (int)Util.RegionToWorldLoc(1000); |
365 | int y = (int)Util.RegionToWorldLoc(1000); | ||
365 | if (home != null) | 366 | if (home != null) |
366 | { | 367 | { |
367 | x = home.RegionLocX; | 368 | x = home.RegionLocX; |
@@ -435,10 +436,23 @@ namespace OpenSim.Services.LLLoginService | |||
435 | ErrorReason = "key"; | 436 | ErrorReason = "key"; |
436 | welcomeMessage = "Welcome to OpenSim!"; | 437 | welcomeMessage = "Welcome to OpenSim!"; |
437 | seedCapability = String.Empty; | 438 | seedCapability = String.Empty; |
438 | home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + | 439 | home = "{'region_handle':[" |
439 | userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + | 440 | + "r" + Util.RegionToWorldLoc(1000).ToString() |
440 | userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + | 441 | + "," |
441 | userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; | 442 | + "r" + Util.RegionToWorldLoc(1000).ToString() |
443 | + "], 'position':[" | ||
444 | + "r" + userProfile.homepos.X.ToString() | ||
445 | + "," | ||
446 | + "r" + userProfile.homepos.Y.ToString() | ||
447 | + "," | ||
448 | + "r" + userProfile.homepos.Z.ToString() | ||
449 | + "], 'look_at':[" | ||
450 | + "r" + userProfile.homelookat.X.ToString() | ||
451 | + "," | ||
452 | + "r" + userProfile.homelookat.Y.ToString() | ||
453 | + "," | ||
454 | + "r" + userProfile.homelookat.Z.ToString() | ||
455 | + "]}"; | ||
442 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 456 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
443 | RegionX = (uint) 255232; | 457 | RegionX = (uint) 255232; |
444 | RegionY = (uint) 254976; | 458 | RegionY = (uint) 254976; |
@@ -533,7 +547,7 @@ namespace OpenSim.Services.LLLoginService | |||
533 | responseData["region_y"] = (Int32)(RegionY); | 547 | responseData["region_y"] = (Int32)(RegionY); |
534 | responseData["region_size_x"] = (Int32)RegionSizeX; | 548 | responseData["region_size_x"] = (Int32)RegionSizeX; |
535 | responseData["region_size_y"] = (Int32)RegionSizeY; | 549 | responseData["region_size_y"] = (Int32)RegionSizeY; |
536 | // m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX=<{0},{1}>", RegionSizeX, RegionSizeY); | 550 | m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY); |
537 | 551 | ||
538 | if (searchURL != String.Empty) | 552 | if (searchURL != String.Empty) |
539 | responseData["search"] = searchURL; | 553 | responseData["search"] = searchURL; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index e2f9966..150c2c0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -684,7 +684,7 @@ namespace OpenSim.Services.LLLoginService | |||
684 | private GridRegion FindAlternativeRegion(UUID scopeID) | 684 | private GridRegion FindAlternativeRegion(UUID scopeID) |
685 | { | 685 | { |
686 | List<GridRegion> hyperlinks = null; | 686 | List<GridRegion> hyperlinks = null; |
687 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize); | 687 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000)); |
688 | if (regions != null && regions.Count > 0) | 688 | if (regions != null && regions.Count > 0) |
689 | { | 689 | { |
690 | hyperlinks = m_GridService.GetHyperlinks(scopeID); | 690 | hyperlinks = m_GridService.GetHyperlinks(scopeID); |