From d7ec786244cce8b856233090349d85b4aec76206 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 24 Nov 2007 00:19:48 +0000 Subject: [PATCH] * Added a nice 'The Region is going down.' message to the user when the sim owner issues 'shutdown' on the console. --- OpenSim/Region/Application/OpenSimMain.cs | 3 +- .../ClientStack/ClientView.ProcessPackets.cs | 41 +++++++++++++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 3 +- .../Region/Environment/Scenes/SceneManager.cs | 2 +- .../Environment/Scenes/ScenePresence.cs | 14 +++++++ 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index cae0b4128c..fd8b941d1c 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -461,11 +461,12 @@ namespace OpenSim /// public virtual void Shutdown() { + if (m_startupCommandsFile != "") { RunCommandScript(m_shutdownCommandsFile); } - + m_log.Verbose("SHUTDOWN", "Closing all threads"); m_log.Verbose("SHUTDOWN", "Killing listener thread"); m_log.Verbose("SHUTDOWN", "Killing clients"); diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 8c4dba65ad..64f5b6df91 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -1065,6 +1065,47 @@ namespace OpenSim.Region.ClientStack #endregion #region unimplemented handlers + case PacketType.RequestGodlikePowers: + //RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack; + //RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; + //LLUUID token = rblock.Token; + //RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; + + + //GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); + //GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock(); + //GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock(); + + //adb.AgentID = ablock.AgentID; + //adb.SessionID = ablock.SessionID; + + //gdb.GodLevel = (byte)100; + //gdb.Token = token; + //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock; + //respondPacket.GrantData = gdb; + //respondPacket.AgentData = adb; + //OutPacket(respondPacket, ThrottleOutPacketType.Task); + break; + case PacketType.GodKickUser: + //GodKickUserPacket gkupack = (GodKickUserPacket) Pack; + //gkupack.UserInfo.GodID; + //gkupack.UserInfo.AgentID; + //gkupack.UserInfo.KickFlags; + //gkupack.UserInfo.Reason; + //KickUserPacket kupack = new KickUserPacket(); + //KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo; + + //kupack.UserInfo.AgentID = gkupack.UserInfo.AgentID; + //kupack.UserInfo.SessionID = gkupack.UserInfo.GodSessionID; + + //kupack.TargetBlock.TargetIP = (uint)0; + //kupack.TargetBlock.TargetPort = (ushort)0; + //kupack.UserInfo.Reason = gkupack.UserInfo.Reason; + + + //OutPacket(kupack, ThrottleOutPacketType.Task); + break; + case PacketType.StartPingCheck: // Send the client the ping response back // Pass the same PingID in the matching packet diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ea3283da62..7bcd7bdb1b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -257,6 +257,7 @@ namespace OpenSim.Region.Environment.Scenes { ForEachScenePresence(delegate(ScenePresence avatar) { + avatar.Kick("The region is going down."); avatar.ControllingClient.Stop(); }); @@ -638,7 +639,7 @@ namespace OpenSim.Region.Environment.Scenes { // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision - // in the direction the client supplies (the ground level that we clicked) + // in the direction the client supplies (the ground level that we clicked) // This function is pretty crappy right now.. so we're not affecting where the newly rezzed objects go // Test it if you like. The console will write where it guesses a collision took place. if it thinks one did. // It's wrong many times though. diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index da553bcc2c..e71d94679d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes { ForEachCurrentScene(delegate(Scene scene) { scene.Backup(); }); } - + public void HandleAlertCommandOnCurrentScene(string[] cmdparams) { ForEachCurrentScene(delegate(Scene scene) { scene.HandleAlertCommand(cmdparams); }); diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 850d3a4cee..0cc3a7e855 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1219,6 +1219,20 @@ namespace OpenSim.Region.Environment.Scenes #endregion + public void Kick(string message) + { + KickUserPacket kupack = new KickUserPacket(); + KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo; + + kupack.UserInfo.AgentID = UUID; + kupack.UserInfo.SessionID = this.ControllingClient.SessionId; + + kupack.TargetBlock.TargetIP = (uint)0; + kupack.TargetBlock.TargetPort = (ushort)0; + kupack.UserInfo.Reason = Helpers.StringToField(message); + ControllingClient.OutPacket(kupack, ThrottleOutPacketType.Task); + + } /// /// ///