From 3f6b3f6b59c04dbbfe05ad43fcc9a7de24bc0ebc Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 18 Sep 2007 23:37:43 +0000 Subject: [PATCH] * Moved SendLogoutPacket back to IClientAPI. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 1 + .../Region/ClientStack/ClientView.ProcessPackets.cs | 12 ++++++++++++ OpenSim/Region/ClientStack/PacketServer.cs | 8 +------- OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 10 +++++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 5fd5adf701..344a55c9b8 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -254,5 +254,6 @@ namespace OpenSim.Framework.Interfaces event ViewerEffectEventHandler OnViewerEffect; event Action OnLogout; event Action OnConnectionClosed; + void SendLogoutPacket(); } } diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 009ddac322..3bb7c03b37 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -677,5 +677,17 @@ namespace OpenSim.Region.ClientStack shape.TextureEntry = ntex.ToBytes(); return shape; } + + public void SendLogoutPacket() + { + LogoutReplyPacket logReply = new LogoutReplyPacket(); + logReply.AgentData.AgentID = AgentId; + logReply.AgentData.SessionID = SessionId; + logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1]; + logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); + logReply.InventoryData[0].ItemID = LLUUID.Zero; + + OutPacket(logReply); + } } } diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 28f25bde8d..3b26a5919b 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs @@ -149,13 +149,7 @@ namespace OpenSim.Region.ClientStack public void LogoutHandler(IClientAPI client) { - LogoutReplyPacket logReply = new LogoutReplyPacket(); - logReply.AgentData.AgentID = client.AgentId; - logReply.AgentData.SessionID = client.SessionId; - logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1]; - logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock(); - logReply.InventoryData[0].ItemID = LLUUID.Zero; - client.OutPacket(logReply); + client.SendLogoutPacket(); CloseClient( client ); } diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 9839b0ce0e..d2dce6bfa0 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -8,6 +8,7 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; using OpenSim.Region.Environment.Scenes; +using System; namespace SimpleApp { @@ -20,6 +21,9 @@ namespace SimpleApp #pragma warning disable 67 + public event Action OnLogout; + public event Action OnConnectionClosed; + public event ImprovedInstantMessage OnInstantMessage; public event ChatFromViewer OnChatFromViewer; public event RezObject OnRezObject; @@ -246,8 +250,8 @@ namespace SimpleApp } } - public event System.Action OnLogout; - - public event System.Action OnConnectionClosed; + public void SendLogoutPacket() + { + } } }