More cleaning up when deleting regions from a instance. NOTE: IGridServices.DeregisterRegion() method needs implementing for grid mode.

afrisby
MW 2007-11-16 13:39:11 +00:00
parent 76a67f45c6
commit 483377adae
8 changed files with 29 additions and 17 deletions

View File

@ -33,6 +33,7 @@ namespace OpenSim.Framework.Communications
public interface IGridServices
{
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
bool DeregisterRegion(RegionInfo regionInfo);
List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
RegionInfo RequestNeighbourInfo(ulong regionHandle);
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);

View File

@ -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;
}

View File

@ -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;
}
/// <summary>
/// </summary>
/// <param name="regionInfo"></param>
@ -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;

View File

@ -112,6 +112,11 @@ namespace OpenSim.Region.Communications.OGS1
return m_localBackend.RegisterRegion(regionInfo);
}
public bool DeregisterRegion(RegionInfo regionInfo)
{
return false;
}
/// <summary>
///
/// </summary>

View File

@ -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;

View File

@ -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;
}

View File

@ -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)

View File

@ -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)