Provide interface to prevent the client close function from sending the stop packet

avinationmerge
Tom Grimshaw 2010-05-17 14:14:19 -07:00
parent bc7d84b75c
commit 6bc7e3429f
9 changed files with 54 additions and 4 deletions

View File

@ -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)

View File

@ -438,6 +438,11 @@ namespace OpenSim.Client.Sirikata.ClientStack
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
throw new System.NotImplementedException();
}

View File

@ -445,6 +445,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
throw new System.NotImplementedException();
}

View File

@ -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);
/// <summary>

View File

@ -470,18 +470,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Client Methods
/// <summary>
/// Shut down the client view
/// </summary>
public void Close()
{
Close(true);
}
/// <summary>
/// Shut down the client view
/// </summary>
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;

View File

@ -824,6 +824,11 @@ namespace OpenSim.Region.Examples.SimpleModule
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
}

View File

@ -876,6 +876,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
Disconnect();
}

View File

@ -837,6 +837,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
}

View File

@ -881,6 +881,10 @@ namespace OpenSim.Tests.Common.Mock
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
m_scene.RemoveClient(AgentId);
}