* Purged 'Regions' code pending Agent layer grok.
* Changed so prims aren't loaded until AFTER parcels. * The region startup flow is still an ungodly rats nest.afrisby
parent
8dda11d17e
commit
b3eeb5a8dc
|
@ -147,7 +147,7 @@ namespace OpenSim
|
||||||
Directory.CreateDirectory(Util.logDir());
|
Directory.CreateDirectory(Util.logDir());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent);
|
m_log = CreateLog();
|
||||||
MainLog.Instance = m_log;
|
MainLog.Instance = m_log;
|
||||||
|
|
||||||
base.StartUp();
|
base.StartUp();
|
||||||
|
|
|
@ -70,8 +70,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
ScenePresence.CreateDefaultTextureEntry();
|
|
||||||
|
|
||||||
m_httpServer = new BaseHttpServer(m_httpServerPort);
|
m_httpServer = new BaseHttpServer(m_httpServerPort);
|
||||||
|
|
||||||
m_log.Verbose("Starting HTTP server");
|
m_log.Verbose("Starting HTTP server");
|
||||||
|
@ -112,7 +110,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
scene.PhysScene = GetPhysicsScene();
|
scene.PhysScene = GetPhysicsScene();
|
||||||
scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
|
scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
|
||||||
scene.LoadPrimsFromStorage();
|
|
||||||
|
|
||||||
//Master Avatar Setup
|
//Master Avatar Setup
|
||||||
UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword);
|
UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword);
|
||||||
|
@ -128,7 +125,9 @@ namespace OpenSim.Region.ClientStack
|
||||||
scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
|
scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
|
||||||
//TODO: Load parcels from storageManager
|
//TODO: Load parcels from storageManager
|
||||||
}
|
}
|
||||||
|
|
||||||
scene.LandManager.resetSimLandObjects();
|
scene.LandManager.resetSimLandObjects();
|
||||||
|
scene.LoadPrimsFromStorage();
|
||||||
|
|
||||||
scene.performParcelPrimCountUpdate();
|
scene.performParcelPrimCountUpdate();
|
||||||
scene.StartTimer();
|
scene.StartTimer();
|
||||||
|
|
|
@ -87,8 +87,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool landPrimCountTainted = false;
|
public bool landPrimCountTainted = false;
|
||||||
|
|
||||||
private Scene m_scene;
|
private readonly Scene m_scene;
|
||||||
private RegionInfo m_regInfo;
|
private readonly RegionInfo m_regInfo;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Terrain;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Regions
|
|
||||||
{
|
|
||||||
public class Region
|
|
||||||
{
|
|
||||||
// This is a temporary (and real ugly) construct to emulate us really having a separate list
|
|
||||||
// of region subscribers. It should be removed ASAP, like.
|
|
||||||
|
|
||||||
private readonly Scene m_scene;
|
|
||||||
private Dictionary<LLUUID, RegionSubscription> m_regionSubscriptions
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Dictionary<LLUUID, RegionSubscription> subscriptions = new Dictionary<LLUUID, RegionSubscription>( );
|
|
||||||
|
|
||||||
foreach( ScenePresence presence in m_scene.GetScenePresences() )
|
|
||||||
{
|
|
||||||
subscriptions.Add( presence.UUID, new RegionSubscription( presence.ControllingClient ));
|
|
||||||
}
|
|
||||||
|
|
||||||
return subscriptions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Region( Scene scene )
|
|
||||||
{
|
|
||||||
m_scene = scene; // The Scene reference should be removed.
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void Broadcast( Action<IClientAPI> whatToDo )
|
|
||||||
{
|
|
||||||
foreach (RegionSubscription subscription in m_regionSubscriptions.Values )
|
|
||||||
{
|
|
||||||
whatToDo(subscription.Client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void Remove(LLUUID agentID)
|
|
||||||
{
|
|
||||||
// TODO : Well, remove it!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Regions
|
|
||||||
{
|
|
||||||
public class RegionSubscription
|
|
||||||
{
|
|
||||||
private readonly IClientAPI m_client;
|
|
||||||
|
|
||||||
public RegionSubscription(IClientAPI client )
|
|
||||||
{
|
|
||||||
m_client = client;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IClientAPI Client
|
|
||||||
{
|
|
||||||
get { return m_client; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Regions
|
|
||||||
{
|
|
||||||
public class RegionSubscriptionManager
|
|
||||||
{
|
|
||||||
private Dictionary<uint, Region> m_regions;
|
|
||||||
|
|
||||||
public RegionSubscriptionManager( )
|
|
||||||
{
|
|
||||||
m_regions = new Dictionary<uint, Region>( );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -49,7 +49,6 @@ using OpenSim.Region.Environment.Types;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Physics.Manager;
|
||||||
using OpenSim.Region.Terrain;
|
using OpenSim.Region.Terrain;
|
||||||
using Timer = System.Timers.Timer;
|
using Timer = System.Timers.Timer;
|
||||||
using OpenSim.Region.Environment.Regions;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -64,8 +63,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// publicized so it can be accessed from SceneObjectGroup.
|
/// publicized so it can be accessed from SceneObjectGroup.
|
||||||
protected float timeStep = 0.1f;
|
protected float timeStep = 0.1f;
|
||||||
|
|
||||||
private Regions.Region m_region;
|
|
||||||
|
|
||||||
private Random Rand = new Random();
|
private Random Rand = new Random();
|
||||||
private uint _primCount = 702000;
|
private uint _primCount = 702000;
|
||||||
private readonly Mutex _primAllocateMutex = new Mutex(false);
|
private readonly Mutex _primAllocateMutex = new Mutex(false);
|
||||||
|
@ -162,8 +159,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
updateLock = new Mutex(false);
|
updateLock = new Mutex(false);
|
||||||
|
|
||||||
m_region = new Regions.Region(this);
|
|
||||||
|
|
||||||
m_moduleLoader = moduleLoader;
|
m_moduleLoader = moduleLoader;
|
||||||
authenticateHandler = authen;
|
authenticateHandler = authen;
|
||||||
commsManager = commsMan;
|
commsManager = commsMan;
|
||||||
|
@ -373,7 +368,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal void Broadcast(Action<IClientAPI> whatToDo)
|
internal void Broadcast(Action<IClientAPI> whatToDo)
|
||||||
{
|
{
|
||||||
m_region.Broadcast(whatToDo);
|
ForEachScenePresence( delegate( ScenePresence presence )
|
||||||
|
{
|
||||||
|
whatToDo(presence.ControllingClient);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -458,7 +456,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the World's objects
|
/// Loads the World's objects
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void LoadPrimsFromStorage()
|
public virtual void LoadPrimsFromStorage()
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("Loading objects from datastore");
|
MainLog.Instance.Verbose("Loading objects from datastore");
|
||||||
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID);
|
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID);
|
||||||
|
@ -790,11 +788,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_scenePresences.Remove(agentID);
|
m_scenePresences.Remove(agentID);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (m_region)
|
|
||||||
{
|
|
||||||
m_region.Remove(agentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (Entities)
|
lock (Entities)
|
||||||
{
|
{
|
||||||
Entities.Remove(agentID);
|
Entities.Remove(agentID);
|
||||||
|
|
|
@ -35,7 +35,6 @@ using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Physics.Manager;
|
||||||
using OpenSim.Region.Environment.Regions;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -214,13 +213,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
set { m_isChildAgent = value; }
|
set { m_isChildAgent = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private RegionSubscription m_regionSubscription;
|
|
||||||
|
|
||||||
public RegionSubscription RegionSubscription
|
|
||||||
{
|
|
||||||
get { return m_regionSubscription; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor(s)
|
#region Constructor(s)
|
||||||
|
@ -234,8 +226,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="regionDat"></param>
|
/// <param name="regionDat"></param>
|
||||||
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
|
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
m_regionSubscription = new RegionSubscription( client );
|
|
||||||
|
|
||||||
m_scene = world;
|
m_scene = world;
|
||||||
m_uuid = client.AgentId;
|
m_uuid = client.AgentId;
|
||||||
|
|
||||||
|
@ -881,7 +871,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CreateDefaultTextureEntry()
|
static ScenePresence()
|
||||||
{
|
{
|
||||||
LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
|
LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
|
||||||
textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");
|
textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");
|
||||||
|
|
|
@ -1,23 +1,16 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework.Communications.Caches;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Region.Physics.Manager;
|
|
||||||
|
|
||||||
using OpenSim.Region.Capabilities;
|
|
||||||
using OpenSim.Region.ClientStack;
|
using OpenSim.Region.ClientStack;
|
||||||
using OpenSim.Region.Communications.Local;
|
using OpenSim.Region.Communications.Local;
|
||||||
using OpenSim.Framework.Communications.Caches;
|
|
||||||
using System.Timers;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Framework.Data;
|
|
||||||
using OpenSim.Region.Environment;
|
using OpenSim.Region.Environment;
|
||||||
using System.IO;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
namespace SimpleApp
|
namespace SimpleApp
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue