Exemple #1
0
 private static void EventSink_Disconnected( DisconnectedEventArgs e )
 {
     ChatUser.RemoveChatUser( e.Mobile );
 }
Exemple #2
0
        private static void EventSink_Disconnected( DisconnectedEventArgs e )
        {
            Mobile from = e.Mobile;
            DesignContext context = DesignContext.Find( from );

            if ( context != null )
            {
                /* Client disconnected
                 *  - Remove design context
                 *  - Eject all from house
                 *  - Restore relocated entities
                 */

                // Remove design context
                DesignContext.Remove( from );

                // Eject all from house
                from.RevealingAction();

                foreach ( Item item in context.Foundation.GetItems() )
                    item.Location = context.Foundation.BanLocation;

                foreach ( Mobile mobile in context.Foundation.GetMobiles() )
                    mobile.Location = context.Foundation.BanLocation;

                // Restore relocated entities
                context.Foundation.RestoreRelocatedEntities();
            }

            PlayerMobile pm = e.Mobile as PlayerMobile;

            if ( pm != null )
            {
                pm.m_GameTime += ( DateTime.Now - pm.m_SessionStart );

                if ( pm.m_Quest != null )
                    pm.m_Quest.StopTimer();

                pm.m_SpeechLog = null;
                pm.LastLogin = DateTime.Now;
            }
        }