From d263a044b1ebb13477b2b391637ccc2da4368838 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 25 Nov 2007 04:52:14 +0000 Subject: * 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. --- OpenSim/Region/Environment/EstateManager.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region/Environment/EstateManager.cs') diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index c569fc5..b847e4f 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs @@ -171,6 +171,12 @@ namespace OpenSim.Region.Environment if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) estateSetRegionTerrainHandler(packet); break; + case "restart": + if (m_scene.PermissionsMngr.CanRestartSim(remote_client.AgentId)) + { + estateRestartSim(packet); + } + break; default: MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); break; @@ -322,6 +328,19 @@ namespace OpenSim.Region.Environment } } } + private void estateRestartSim(EstateOwnerMessagePacket packet) + { + // There's only 1 block in the estateResetSim.. and that's the number of seconds till restart. + foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) + { + float timeSeconds = 0; + timeSeconds = BitConverter.ToInt16(block.Parameter, 1); + timeSeconds = (int)((timeSeconds / 100) - 3); + m_scene.Restart(timeSeconds); + + } + } + #endregion -- cgit v1.1