OpenMetaverse.NetworkManager.LogoutReplyHandler C# (CSharp) Method

LogoutReplyHandler() private method

Called to deal with LogoutReply packet and fires off callback
private LogoutReplyHandler ( Packet packet, Simulator simulator ) : void
packet Packet Full packet of type LogoutReplyPacket
simulator Simulator
return void
        private void LogoutReplyHandler(Packet packet, Simulator simulator)
        {
            LogoutReplyPacket logout = (LogoutReplyPacket)packet;

            if ((logout.AgentData.SessionID == Client.Self.SessionID) && (logout.AgentData.AgentID == Client.Self.AgentID))
            {
                Logger.DebugLog("Logout reply received", Client);

                // Deal with callbacks, if any
                if (OnLogoutReply != null)
                {
                    List<UUID> itemIDs = new List<UUID>();

                    foreach (LogoutReplyPacket.InventoryDataBlock InventoryData in logout.InventoryData)
                    {
                        itemIDs.Add(InventoryData.ItemID);
                    }

                    try { OnLogoutReply(itemIDs); }
                    catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
                }

                // If we are receiving a LogoutReply packet assume this is a client initiated shutdown
                Shutdown(DisconnectType.ClientInitiated);
            }
            else
            {
                Logger.Log("Invalid Session or Agent ID received in Logout Reply... ignoring", Helpers.LogLevel.Warning, Client);
            }
        }