From d7ec786244cce8b856233090349d85b4aec76206 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 24 Nov 2007 00:19:48 +0000 Subject: * Added a nice 'The Region is going down.' message to the user when the sim owner issues 'shutdown' on the console. --- OpenSim/Region/Environment/Scenes/Scene.cs | 3 ++- OpenSim/Region/Environment/Scenes/SceneManager.cs | 2 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ea3283d..7bcd7bd 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 da553bc..e71d946 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 850d3a4..0cc3a7e 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); + + } /// /// /// -- cgit v1.1