예제 #1
0
        /// <summary>
        /// This is called when a server is stopped - including when a host is stopped.
        /// </summary>
        public override void OnStopServer()
        {
            NodeListServerAdapter nlsAdapter = GetComponent <NodeListServerAdapter>();

            if (nlsAdapter != null)
            {
                nlsAdapter.DeregisterServer();
            }
        }
예제 #2
0
        /// <summary>
        /// This is invoked when a server is started - including when a host is started.
        /// <para>StartServer has multiple signatures, but they all cause this hook to be called.</para>
        /// </summary>
        public override void OnStartServer()
        {
            NodeListServerAdapter nlsAdapter = GetComponent <NodeListServerAdapter>();

            if (nlsAdapter != null)
            {
                nlsAdapter.CurrentServerInfo.PlayerCount    = NetworkServer.connections.Count;
                nlsAdapter.CurrentServerInfo.PlayerCapacity = maxConnections;
                nlsAdapter.RegisterServer();
            }
        }