From 0a0b532270d7cc952648b99ed7ab7ec3b0f99676 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 25 Sep 2009 15:31:19 -0400 Subject: * Fixes teleporting within megaregions on HG enabled regions. You can teleport around now. (but it still doesn't fix the inconsistent attachment state when teleporting into region slots that are not the south west region on megaregions) --- .../Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 5c99d73..efc644d 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid if (regionHandle == m_regionInfo.RegionHandle) { // Teleport within the same region - if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) + if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) { Vector3 emergencyPos = new Vector3(128, 128, 128); @@ -89,7 +89,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid // TODO: Get proper AVG Height float localAVHeight = 1.56f; - float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; + float posZLimit = 22; + + if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize) + { + posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y]; + } + float newPosZ = posZLimit + localAVHeight; if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) { -- cgit v1.1 From 5757afe7665543e8b3ed4a322a7d6e095dafcdb3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 07:48:21 -0700 Subject: First pass at the heart surgery for grid services. Compiles and runs minimally. A few bugs to catch now. --- .../Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 5c99d73..e8e5e78 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -38,6 +38,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Capabilities; using OpenSim.Region.Framework.Interfaces; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.Framework.Scenes.Hypergrid { @@ -106,7 +107,10 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid } else { - RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); + uint x = 0, y = 0; + Utils.LongToUInts(regionHandle, out x, out y); + GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); + if (reg != null) { -- cgit v1.1 From f4bf581b96347b8d7f115eca74fa84a644eb729c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 21:00:51 -0700 Subject: Moved all HG1 operations to HGGridConnector.cs and HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo. Fixed small bugs with hyperlinked regions' map positions. --- .../Scenes/Hypergrid/HGSceneCommunicationService.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index ee5eb90..1217f9b 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -38,6 +38,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Capabilities; using OpenSim.Region.Framework.Interfaces; +using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.Framework.Scenes.Hypergrid @@ -46,11 +47,19 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public readonly IHyperlink m_hg; + private IHyperlinkService m_hg; + IHyperlinkService HyperlinkService + { + get + { + if (m_hg == null) + m_hg = m_scene.RequestModuleInterface(); + return m_hg; + } + } - public HGSceneCommunicationService(CommunicationsManager commsMan, IHyperlink hg) : base(commsMan) + public HGSceneCommunicationService(CommunicationsManager commsMan) : base(commsMan) { - m_hg = hg; } @@ -129,13 +138,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid /// Hypergrid mod start /// /// - bool isHyperLink = m_hg.IsHyperlinkRegion(reg.RegionHandle); + bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null); bool isHomeUser = true; ulong realHandle = regionHandle; CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); if (uinfo != null) { - isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); + isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID); realHandle = m_hg.FindRegionHandle(regionHandle); m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); } -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- .../Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 1217f9b..d7e62a8 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -357,7 +357,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID); m_log.DebugFormat( "[HGSceneCommService]: User {0} is going to another region, profile cache removed", - avatar.UUID); + avatar.UUID); } } else -- cgit v1.1