Beispiel #1
0
        /// <summary>
        /// Called to deal with LogoutReply packet and fires off callback
        /// </summary>
        /// <param name="packet">Full packet of type LogoutReplyPacket</param>
        /// <param name="simulator"></param>
        private void LogoutReplyHandler(Packet packet, Simulator simulator)
        {
            LogoutReplyPacket logout = (LogoutReplyPacket)packet;

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

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

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

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

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

            LogoutReplyPacket reply = new LogoutReplyPacket();
            reply.AgentData.AgentID = agent.AgentID;
            reply.AgentData.SessionID = agent.SessionID;
            reply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
            reply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
            reply.InventoryData[0].ItemID = UUID.Zero;

            lock (server.Agents)
            {
                if (server.Agents.ContainsKey(agent.Address))
                {
                    KillObjectPacket kill = new KillObjectPacket();
                    kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
                    kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
                    kill.ObjectData[0].ID = agent.Avatar.LocalID;

                    server.Agents.Remove(agent.Address);

                    foreach (Agent recipient in server.Agents.Values)
                        recipient.SendPacket(kill);
                }
            }
        }
Beispiel #3
0
        private void LogoutRequestHandler(Packet packet, LLAgent agent)
        {
            LogoutReplyPacket reply = new LogoutReplyPacket();

            reply.AgentData.AgentID       = agent.ID;
            reply.AgentData.SessionID     = agent.SessionID;
            reply.InventoryData           = new LogoutReplyPacket.InventoryDataBlock[1];
            reply.InventoryData[0]        = new LogoutReplyPacket.InventoryDataBlock();
            reply.InventoryData[0].ItemID = UUID.Zero;

            m_udp.SendPacket(agent, reply, ThrottleCategory.Task, false);

            agent.Shutdown();
        }
        void LogoutRequestHandler(Packet packet, Agent agent)
        {
            LogoutRequestPacket request = (LogoutRequestPacket)packet;

            LogoutReplyPacket reply = new LogoutReplyPacket();

            reply.AgentData.AgentID       = agent.AgentID;
            reply.AgentData.SessionID     = agent.SessionID;
            reply.InventoryData           = new LogoutReplyPacket.InventoryDataBlock[1];
            reply.InventoryData[0]        = new LogoutReplyPacket.InventoryDataBlock();
            reply.InventoryData[0].ItemID = UUID.Zero;

            server.UDP.SendPacket(agent.AgentID, reply, PacketCategory.Transaction);

            server.DisconnectClient(agent);
        }
        protected virtual bool Logout(SimClient simClient, Packet packet)
        {
            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
            //send reply to let the client logout
            LogoutReplyPacket logReply = new LogoutReplyPacket();

            logReply.AgentData.AgentID       = this.AgentID;
            logReply.AgentData.SessionID     = this.SessionID;
            logReply.InventoryData           = new LogoutReplyPacket.InventoryDataBlock[1];
            logReply.InventoryData[0]        = new LogoutReplyPacket.InventoryDataBlock();
            logReply.InventoryData[0].ItemID = LLUUID.Zero;
            OutPacket(logReply);
            //tell all clients to kill our object
            KillObjectPacket kill = new KillObjectPacket();

            kill.ObjectData       = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0]    = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);

            /*lock (m_world.Entities)
             * {
             *  m_world.Entities.Remove(this.AgentID);
             * }*/
            m_world.RemoveViewerAgent(this);
            //need to do other cleaning up here too
            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
            return(true);
        }
        protected virtual bool Logout(SimClient simClient, Packet packet)
        {
            OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
            //send reply to let the client logout
            LogoutReplyPacket logReply = new LogoutReplyPacket();
            logReply.AgentData.AgentID = this.AgentID;
            logReply.AgentData.SessionID = this.SessionID;
            logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
            logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
            logReply.InventoryData[0].ItemID = LLUUID.Zero;
            OutPacket(logReply);
            //tell all clients to kill our object
            KillObjectPacket kill = new KillObjectPacket();
            kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
            kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
            kill.ObjectData[0].ID = this.ClientAvatar.localid;
            foreach (SimClient client in m_clientThreads.Values)
            {
                client.OutPacket(kill);
            }
            if (this.m_userServer != null)
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
            }
            else
            {
                this.m_inventoryCache.ClientLeaving(this.AgentID, null);
            }

            m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
            /*lock (m_world.Entities)
            {
                m_world.Entities.Remove(this.AgentID);
            }*/
            m_world.RemoveViewerAgent(this);
            //need to do other cleaning up here too
            m_clientThreads.Remove(this.CircuitCode);
            m_application.RemoveClientCircuit(this.CircuitCode);
            this.ClientThread.Abort();
            return true;
        }
Beispiel #7
0
        private void LogoutRequestHandler(Packet packet, LLAgent agent)
        {
            LogoutReplyPacket reply = new LogoutReplyPacket();
            reply.AgentData.AgentID = agent.ID;
            reply.AgentData.SessionID = agent.SessionID;
            reply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
            reply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
            reply.InventoryData[0].ItemID = UUID.Zero;

            m_udp.SendPacket(agent, reply, ThrottleCategory.Task, false);

            agent.Shutdown();
        }