Merge branch 'master' into bulletsim4
commit
1ffa69f691
|
@ -115,6 +115,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<IScene> createdScenes = new List<IScene>();
|
||||||
|
|
||||||
for (int i = 0; i < regionsToLoad.Length; i++)
|
for (int i = 0; i < regionsToLoad.Length; i++)
|
||||||
{
|
{
|
||||||
IScene scene;
|
IScene scene;
|
||||||
|
@ -123,12 +125,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
")");
|
")");
|
||||||
|
|
||||||
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||||
|
|
||||||
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
||||||
|
createdScenes.Add(scene);
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
regionsToLoad[i].EstateSettings.Save();
|
regionsToLoad[i].EstateSettings.Save();
|
||||||
|
}
|
||||||
|
|
||||||
if (scene != null)
|
foreach (IScene scene in createdScenes)
|
||||||
{
|
{
|
||||||
|
scene.Start();
|
||||||
|
|
||||||
m_newRegionCreatedHandler = OnNewRegionCreated;
|
m_newRegionCreatedHandler = OnNewRegionCreated;
|
||||||
if (m_newRegionCreatedHandler != null)
|
if (m_newRegionCreatedHandler != null)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +144,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|
|
@ -700,6 +700,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
|
|
||||||
IScene newScene;
|
IScene newScene;
|
||||||
m_application.CreateRegion(region, out newScene);
|
m_application.CreateRegion(region, out newScene);
|
||||||
|
newScene.Start();
|
||||||
|
|
||||||
// If an access specification was provided, use it.
|
// If an access specification was provided, use it.
|
||||||
// Otherwise accept the default.
|
// Otherwise accept the default.
|
||||||
|
|
|
@ -136,5 +136,10 @@ namespace OpenSim.Framework
|
||||||
ISceneObject DeserializeObject(string representation);
|
ISceneObject DeserializeObject(string representation);
|
||||||
|
|
||||||
bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
|
bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start the scene and associated scripts within it.
|
||||||
|
/// </summary>
|
||||||
|
void Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -425,9 +425,6 @@ namespace OpenSim
|
||||||
|
|
||||||
mscene = scene;
|
mscene = scene;
|
||||||
|
|
||||||
scene.Start();
|
|
||||||
scene.StartScripts();
|
|
||||||
|
|
||||||
return clientServers;
|
return clientServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,6 +748,7 @@ namespace OpenSim
|
||||||
ShutdownClientServer(whichRegion);
|
ShutdownClientServer(whichRegion);
|
||||||
IScene scene;
|
IScene scene;
|
||||||
CreateRegion(whichRegion, true, out scene);
|
CreateRegion(whichRegion, true, out scene);
|
||||||
|
scene.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
# region Setup methods
|
# region Setup methods
|
||||||
|
|
|
@ -142,20 +142,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
|
|
||||||
scene.RegisterModuleInterface<IGridService>(this);
|
scene.RegisterModuleInterface<IGridService>(this);
|
||||||
|
|
||||||
|
lock (m_LocalCache)
|
||||||
|
{
|
||||||
if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
|
if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
|
||||||
m_log.ErrorFormat("[LOCAL GRID SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
|
m_log.ErrorFormat("[LOCAL GRID SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
|
||||||
else
|
else
|
||||||
m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
|
m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
||||||
{
|
{
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
lock (m_LocalCache)
|
||||||
|
{
|
||||||
m_LocalCache[scene.RegionInfo.RegionID].Clear();
|
m_LocalCache[scene.RegionInfo.RegionID].Clear();
|
||||||
m_LocalCache.Remove(scene.RegionInfo.RegionID);
|
m_LocalCache.Remove(scene.RegionInfo.RegionID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void RegionLoaded(Scene scene)
|
public void RegionLoaded(Scene scene)
|
||||||
{
|
{
|
||||||
|
@ -191,6 +197,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
|
|
||||||
// First see if it's a neighbour, even if it isn't on this sim.
|
// First see if it's a neighbour, even if it isn't on this sim.
|
||||||
// Neighbour data is cached in memory, so this is fast
|
// Neighbour data is cached in memory, so this is fast
|
||||||
|
|
||||||
|
lock (m_LocalCache)
|
||||||
|
{
|
||||||
foreach (RegionCache rcache in m_LocalCache.Values)
|
foreach (RegionCache rcache in m_LocalCache.Values)
|
||||||
{
|
{
|
||||||
region = rcache.GetRegionByPosition(x, y);
|
region = rcache.GetRegionByPosition(x, y);
|
||||||
|
@ -199,6 +208,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Then try on this sim (may be a lookup in DB if this is using MySql).
|
// Then try on this sim (may be a lookup in DB if this is using MySql).
|
||||||
return m_GridService.GetRegionByPosition(scopeID, x, y);
|
return m_GridService.GetRegionByPosition(scopeID, x, y);
|
||||||
|
@ -245,6 +255,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
{
|
{
|
||||||
System.Text.StringBuilder caps = new System.Text.StringBuilder();
|
System.Text.StringBuilder caps = new System.Text.StringBuilder();
|
||||||
|
|
||||||
|
lock (m_LocalCache)
|
||||||
|
{
|
||||||
foreach (KeyValuePair<UUID, RegionCache> kvp in m_LocalCache)
|
foreach (KeyValuePair<UUID, RegionCache> kvp in m_LocalCache)
|
||||||
{
|
{
|
||||||
caps.AppendFormat("*** Neighbours of {0} ({1}) ***\n", kvp.Value.RegionName, kvp.Key);
|
caps.AppendFormat("*** Neighbours of {0} ({1}) ***\n", kvp.Value.RegionName, kvp.Key);
|
||||||
|
@ -252,6 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
foreach (GridRegion r in regions)
|
foreach (GridRegion r in regions)
|
||||||
caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize);
|
caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MainConsole.Instance.Output(caps.ToString());
|
MainConsole.Instance.Output(caps.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,10 +389,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
if (!m_active)
|
if (!m_active)
|
||||||
Start();
|
Start(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// This appears assymetric with Start() above but is not - setting m_active = false stops the loops
|
||||||
|
// XXX: Possibly this should be in an explicit Stop() method for symmetry.
|
||||||
m_active = false;
|
m_active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1331,10 +1333,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Start()
|
||||||
|
{
|
||||||
|
Start(true);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start the scene
|
/// Start the scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Start()
|
/// <param name='startScripts'>
|
||||||
|
/// Start the scripts within the scene.
|
||||||
|
/// </param>
|
||||||
|
public void Start(bool startScripts)
|
||||||
{
|
{
|
||||||
m_active = true;
|
m_active = true;
|
||||||
|
|
||||||
|
@ -1353,6 +1363,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_heartbeatThread
|
m_heartbeatThread
|
||||||
= Watchdog.StartThread(
|
= Watchdog.StartThread(
|
||||||
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
||||||
|
|
||||||
|
StartScripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -561,6 +561,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return false; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void Start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
// This has to be here to fire the event
|
// This has to be here to fire the event
|
||||||
|
|
Loading…
Reference in New Issue