* Added the ability to restart your individual sims from within them using the estate tools.

* The sims properly restart, however they don't yet notify the existing avatars that they are up.  To see the sim again, you'll need to log-out and back in until I can figure out how to get the proper data to the sims and to the avatar so they reconnect again.
This commit is contained in:
Teravus Ovares
2007-11-25 04:52:14 +00:00
parent 21ce2b0979
commit d263a044b1
10 changed files with 336 additions and 8 deletions

View File

@@ -320,7 +320,7 @@ namespace OpenSim
plugin.Initialise(this);
m_plugins.Add(plugin);
}
// Start UDP servers
for (int i = 0; i < m_udpServers.Count; i++)
{
@@ -412,6 +412,50 @@ namespace OpenSim
m_assetCache = new AssetCache(assetServer, m_log);
// m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
m_sceneManager.OnReStartSim += handleReStartRegion;
}
public void handleReStartRegion(RegionInfo whichRegion)
{
MainLog.Instance.Error("MAIN", "Got Restart Singlal from SceneManager");
// Shutting down the UDP server
bool foundUDPServer = false;
int UDPServerElement = 0;
for (int i = 0; i < m_udpServers.Count; i++)
{
if (m_udpServers[i].RegionHandle == whichRegion.RegionHandle)
{
UDPServerElement = i;
foundUDPServer = true;
break;
}
}
if (foundUDPServer)
{
// m_udpServers[UDPServerElement].Server.End
m_udpServers[UDPServerElement].Server.Close();
m_udpServers.RemoveAt(UDPServerElement);
}
//Removing the region from the sim's database of regions..
int RegionHandleElement = -1;
for (int i = 0; i < m_regionData.Count; i++)
{
if (whichRegion.RegionHandle == m_regionData[i].RegionHandle)
{
RegionHandleElement = i;
}
}
if (RegionHandleElement >= 0)
{
m_regionData.RemoveAt(RegionHandleElement);
}
UDPServer restartingRegion = CreateRegion(whichRegion);
restartingRegion.ServerListener();
m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle);
}
protected override LogBase CreateLog()