Ejemplo n.º 1
0
        /// <summary>
        /// Handles screen activation, which occurs every time the screen becomes the current
        /// active screen. Objects in here often will want to be destroyed on <see cref="GameScreen.Deactivate"/>().
        /// </summary>
        public override void Activate()
        {
            base.Activate();

            SetMessage(null);

            // If we are already connected to the server for some reason, disconnect
            if (_sockets.IsConnected)
            {
                _sockets.Disconnect();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles screen activation, which occurs every time the screen becomes the current
        /// active screen. Objects in here often will want to be destroyed on Deactivate().
        /// </summary>
        public override void Activate()
        {
            base.Activate();

            // No reason to be connected while at the login screen
            if (_sockets.IsConnected)
            {
                _sockets.Disconnect();
            }

            SetError(null);
        }