diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 33017d6caa..658ddf0c59 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -826,11 +826,19 @@ namespace OpenSim.Client.MXP.ClientStack } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { m_log.Info("[MXP ClientStack] Close Called"); // Tell the client to go - SendLogoutPacket(); + if (sendStop == true) + { + SendLogoutPacket(); + } // Let MXPPacketServer clean it up if (Session.SessionState != SessionState.Disconnected) diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 1bdc4f8937..c2ddd36eee 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -438,6 +438,11 @@ namespace OpenSim.Client.Sirikata.ClientStack } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { throw new System.NotImplementedException(); } diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index f45cb44d2b..df0780792d 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -445,6 +445,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { throw new System.NotImplementedException(); } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index bcbc957731..bc8ce1a137 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1101,6 +1101,7 @@ namespace OpenSim.Framework void InPacket(object NewPack); void ProcessInPacket(Packet NewPack); void Close(); + void Close(bool sendStop); void Kick(string message); /// diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5c774b58b2..960e0a26d6 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -470,18 +470,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Client Methods + /// /// Shut down the client view /// public void Close() + { + Close(true); + } + + /// + /// Shut down the client view + /// + public void Close(bool sendStop) { m_log.DebugFormat( "[CLIENT]: Close has been called for {0} attached to scene {1}", Name, m_scene.RegionInfo.RegionName); - // Send the STOP packet - DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); - OutPacket(disable, ThrottleOutPacketType.Unknown); + if (sendStop) + { + // Send the STOP packet + DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); + OutPacket(disable, ThrottleOutPacketType.Unknown); + } IsActive = false; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index d2b0161c41..b074313e75 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -824,6 +824,11 @@ namespace OpenSim.Region.Examples.SimpleModule } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 85e3fb3e38..0b6647d0e5 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -876,6 +876,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { Disconnect(); } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index cf2076f090..938293f137 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -837,6 +837,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC } public void Close() + { + Close(true); + } + + public void Close(bool sendStop) { } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 68ac96a8f1..752e9e125d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -881,6 +881,10 @@ namespace OpenSim.Tests.Common.Mock } public void Close() + { + Close(true); + } + public void Close(bool sendStop) { m_scene.RemoveClient(AgentId); }