/// <summary>
        /// cleanup resources so that we can start again
        /// </summary>
        private void Cleanup()
        {
            if (authenticator != null)
            {
                authenticator.OnServerAuthenticated -= OnAuthenticated;
#if NETSTANDARD
                Connected.RemoveListener(authenticator.OnServerAuthenticateInternal);
#else
                Connected -= authenticator.OnServerAuthenticateInternal;
#endif
            }
            else
            {
                // if no authenticator, consider every connection as authenticated
#if NETSTANDARD
                Connected.RemoveListener(OnAuthenticated);
#else
                Connected -= OnAuthenticated;
#endif
            }

            Stopped.Invoke();
            initialized = false;
            Active      = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Shut down a client.
        /// <para>This should be done when a client is no longer going to be used.</para>
        /// </summary>
        void Cleanup()
        {
            if (LogFilter.Debug)
            {
                Debug.Log("Shutting down client.");
            }

            ClearSpawners();
            DestroyAllClientObjects();
            ready           = false;
            isSpawnFinished = false;

            connectState = ConnectState.None;

            if (authenticator != null)
            {
                authenticator.OnClientAuthenticated -= OnAuthenticated;

                Connected.RemoveListener(authenticator.OnClientAuthenticateInternal);
            }
            else
            {
                // if no authenticator, consider connection as authenticated
                Connected.RemoveListener(OnAuthenticated);
            }
        }
        /// <summary>
        /// Shut down a client.
        /// <para>This should be done when a client is no longer going to be used.</para>
        /// </summary>
        void Cleanup()
        {
            logger.Log("Shutting down client.");

            hostServer = null;

            connectState = ConnectState.Disconnected;

            if (authenticator != null)
            {
                authenticator.OnClientAuthenticated -= OnAuthenticated;

#if NETSTANDARD
                Connected.RemoveListener(authenticator.OnClientAuthenticateInternal);
#else
                Connected -= authenticator.OnClientAuthenticateInternal;
#endif
            }
            else
            {
                // if no authenticator, consider connection as authenticated
#if NETSTANDARD
                Connected.RemoveListener(OnAuthenticated);
#else
                Connected -= OnAuthenticated;
#endif
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// cleanup resources so that we can start again
        /// </summary>
        private void Cleanup()
        {
            if (authenticator != null)
            {
                authenticator.OnServerAuthenticated -= OnAuthenticated;
                Connected.RemoveListener(authenticator.OnServerAuthenticateInternal);
            }
            else
            {
                // if no authenticator, consider every connection as authenticated
                Connected.RemoveListener(OnAuthenticated);
            }

            Stopped?.Invoke();
            initialized = false;
            Active      = false;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Shut down a client.
        /// <para>This should be done when a client is no longer going to be used.</para>
        /// </summary>
        void Cleanup()
        {
            logger.Log("Shutting down client.");

            IsLocalClient = false;

            connectState = ConnectState.Disconnected;

            if (authenticator != null)
            {
                authenticator.OnClientAuthenticated -= OnAuthenticated;

                Connected.RemoveListener(authenticator.OnClientAuthenticateInternal);
            }
            else
            {
                // if no authenticator, consider connection as authenticated
                Connected.RemoveListener(OnAuthenticated);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Shut down a client.
        /// <para>This should be done when a client is no longer going to be used.</para>
        /// </summary>
        void Cleanup()
        {
            logger.Log("Shutting down client.");

            ClearSpawners();
            DestroyAllClientObjects();
            isSpawnFinished = false;
            hostServer      = null;

            connectState = ConnectState.Disconnected;

            if (authenticator != null)
            {
                authenticator.OnClientAuthenticated -= OnAuthenticated;

                Connected.RemoveListener(authenticator.OnClientAuthenticateInternal);
            }
            else
            {
                // if no authenticator, consider connection as authenticated
                Connected.RemoveListener(OnAuthenticated);
            }
        }