From 483377adaedefb12f19b3f843dbabfd7b545bf90 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 16 Nov 2007 13:39:11 +0000 Subject: [PATCH] More cleaning up when deleting regions from a instance. NOTE: IGridServices.DeregisterRegion() method needs implementing for grid mode. --- .../Framework/Communications/IGridServices.cs | 1 + OpenSim/Region/Application/OpenSimMain.cs | 2 +- .../Local/LocalBackEndServices.cs | 17 +++++++++++++++-- .../Communications/OGS1/OGS1GridServices.cs | 5 +++++ .../Modules/TextureDownloadModule.cs | 4 ++++ .../Scenes/SceneCommunicationService.cs | 2 +- .../Region/Environment/Scenes/ScenePresence.cs | 2 ++ .../MonoSqliteDataStore.cs | 13 ------------- 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index 3d0af09fd0..c1fb9c4fb5 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs @@ -33,6 +33,7 @@ namespace OpenSim.Framework.Communications public interface IGridServices { RegionCommsListener RegisterRegion(RegionInfo regionInfos); + bool DeregisterRegion(RegionInfo regionInfo); List RequestNeighbours(uint x, uint y); RegionInfo RequestNeighbourInfo(ulong regionHandle); List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 8d56222789..c1df86c3d6 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -773,7 +773,7 @@ namespace OpenSim case "regions": m_sceneManager.ForEachScene(delegate(Scene scene) { - Console.WriteLine("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + scene.RegionInfo.RegionLocX + " , Region YLoc: " + scene.RegionInfo.RegionLocY); + m_log.Error("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + scene.RegionInfo.RegionLocX + " , Region YLoc: " + scene.RegionInfo.RegionLocY); }); break; } diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 1e7681305c..5d4e702268 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.Communications.Local public RegionCommsListener RegisterRegion(RegionInfo regionInfo) { //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); - if (!m_regions.ContainsKey((uint) regionInfo.RegionHandle)) + if (!m_regions.ContainsKey( regionInfo.RegionHandle)) { //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); m_regions.Add(regionInfo.RegionHandle, regionInfo); @@ -69,6 +69,20 @@ namespace OpenSim.Region.Communications.Local return null; } + public bool DeregisterRegion(RegionInfo regionInfo) + { + if (m_regions.ContainsKey(regionInfo.RegionHandle)) + { + m_regions.Remove(regionInfo.RegionHandle); + if (m_regionListeners.ContainsKey(regionInfo.RegionHandle)) + { + m_regionListeners.Remove(regionInfo.RegionHandle); + } + return true; + } + return false; + } + /// /// /// @@ -132,7 +146,6 @@ namespace OpenSim.Region.Communications.Local map.Y = (ushort) regInfo.RegionLocY; map.WaterHeight = (byte) regInfo.EstateSettings.waterHeight; map.MapImageId = regInfo.EstateSettings.terrainImageID; - //new LLUUID("00000000-0000-0000-9999-000000000007"); map.Agents = 1; map.RegionFlags = 72458694; map.Access = 13; diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 7ae95f1fa6..c29dd41565 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -112,6 +112,11 @@ namespace OpenSim.Region.Communications.OGS1 return m_localBackend.RegisterRegion(regionInfo); } + public bool DeregisterRegion(RegionInfo regionInfo) + { + return false; + } + /// /// /// diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 98057f9210..01a55fb44b 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -36,6 +36,10 @@ using OpenSim.Region.Environment.Scenes; namespace OpenSim.Region.Environment.Modules { + //this is first attempt to start breaking the mess thats called the assetcache up. + // basically this should be the texture sending (to clients) code moved out of assetcache + //and some small clean up + // but on first tests it didn't seem to work very well so is currently not in use. public class TextureDownloadModule : IRegionModule { private Scene m_scene; diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 9bd55e1811..4d4f78f7ec 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes regionCommsHost.OnExpectUser -= NewUserConnection; regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; regionCommsHost.OnCloseAgentConnection -= CloseConnection; - //regionCommsHost.RemoveRegion(m_regionInfo); //TODO add to method to commsManager + m_commsProvider.GridService.DeregisterRegion(m_regionInfo); regionCommsHost = null; } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index caef883510..87fa5cf2d0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -674,6 +674,7 @@ namespace OpenSim.Region.Environment.Scenes SendAnimPack(Animations.AnimsLLUUID["SIT"], 1); SendFullUpdateToAllClients(); } + public void HandleSetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun) { m_setAlwaysRun = SetAlwaysRun; @@ -683,6 +684,7 @@ namespace OpenSim.Region.Environment.Scenes } } + protected void UpdateMovementAnimations(bool update_movementflag) { if (update_movementflag) diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index e49e2250e8..a9fb869415 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -709,22 +709,9 @@ namespace OpenSim.DataStore.MonoSqlite row["ProfileEnd"] = s.ProfileEnd; row["ProfileCurve"] = s.ProfileCurve; row["ProfileHollow"] = s.ProfileHollow; - // text TODO: this isn't right] = but I'm not sure the right - // way to specify this as a blob atm - // And I couldn't work out how to save binary data either - // seems that the texture colum is being treated as a string in the Datarow - // if you do a .getType() on it, it returns string, while the other columns return correct type - // MW[10-08-07] - // Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database - // am a bit worried about adding it now as some people will have old format databases, so for now including that data in this xml data - // MW[17-08-07] row["Texture"] = s.TextureEntry; row["ExtraParams"] = s.ExtraParams; - // TextureBlock textureBlock = new TextureBlock(s.TextureEntry); - // textureBlock.ExtraParams = s.ExtraParams; - // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); - // row["Texture"] = encoding.GetBytes(textureBlock.ToXMLString()); } private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID)