Moved the SetupScene methods from RegionApplicationBase to OpenSimBase [Do we really still need RegionApplicationBase?]

Added a flag (bool m_autoCreateLindenStack = true) which says if the ClientStack will be autocreated and initialised when creating regions. This helps with moving ClientStacks to Region modules. 
Currently this flag is hardcoded to true, as it is only for testing at the moment, so you need to change the value in the code if you want to turn off auto creating.
This commit is contained in:
MW
2009-03-02 16:33:11 +00:00
parent ff76102644
commit 3c46ee9326
3 changed files with 100 additions and 95 deletions

View File

@@ -141,86 +141,5 @@ namespace OpenSim.Region.ClientStack
return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier);
}
/// <summary>
/// Create a scene and its initial base structures.
/// </summary>
/// <param name="regionInfo"></param>
/// <param name="clientServer"> </param>
/// <returns></returns>
protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer)
{
return SetupScene(regionInfo, 0, null, out clientServer);
}
/// <summary>
/// Create a scene and its initial base structures.
/// </summary>
/// TODO: Really configSource shouldn't be passed in here, but should be moved up to BaseOpenSimServer and
/// made common to all the servers.
///
/// <param name="regionInfo"></param>
/// <param name="proxyOffset"></param>
/// <param name="configSource"></param>
/// <param name="clientServer"> </param>
/// <returns></returns>
protected Scene SetupScene(
RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out IClientNetworkServer clientServer)
{
AgentCircuitManager circuitManager = new AgentCircuitManager();
IPAddress listenIP = regionInfo.InternalEndPoint.Address;
//if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
// listenIP = IPAddress.Parse("0.0.0.0");
uint port = (uint) regionInfo.InternalEndPoint.Port;
clientServer
= m_clientStackManager.CreateServer(
listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource,
m_assetCache, circuitManager);
regionInfo.InternalEndPoint.Port = (int)port;
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
clientServer.AddScene(scene);
scene.LoadWorldMap();
scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName);
scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight);
// TODO: Remove this cruft once MasterAvatar is fully deprecated
//Master Avatar Setup
UserProfileData masterAvatar;
if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero)
{
masterAvatar =
m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
scene.RegionInfo.MasterAvatarLastName,
scene.RegionInfo.MasterAvatarSandboxPassword);
}
else
{
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName;
scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName;
}
if (masterAvatar == null)
{
m_log.Info("[PARCEL]: No master avatar found, using null.");
scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero;
}
else
{
m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]",
scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName);
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID;
}
return scene;
}
}
}