Esempio n. 1
0
        internal void ClientSceneReadyMessage(INetworkConnection conn, SceneReadyMessage msg)
        {
            logger.Log("ClientSceneReadyMessage");

            //Server has finished changing scene. Allow the client to finish.
            if (asyncOperation != null)
            {
                asyncOperation.allowSceneActivation = true;
            }
        }
Esempio n. 2
0
        internal void ClientSceneReadyMessage(INetworkPlayer player, SceneReadyMessage msg)
        {
            logger.Log("ClientSceneReadyMessage");

            //Server has finished changing scene. Allow the client to finish.
            if (clientLoadingOperation != null)
            {
                clientLoadingOperation.allowSceneActivation = true;
            }
        }
Esempio n. 3
0
        public void UnpackWrongMessage()
        {
            var message = new SceneReadyMessage();

            var data = MessagePacker.Pack(message);

            Assert.Throws <FormatException>(() =>
            {
                _ = MessagePacker.Unpack <AddCharacterMessage>(data);
            });
        }
Esempio n. 4
0
        /// <summary>
        /// default ready handler.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="msg"></param>
        private void HandlePlayerSceneReady(INetworkPlayer player, SceneReadyMessage msg)
        {
            if (logger.LogEnabled())
            {
                logger.Log("Default handler for ready message from " + player);
            }

            player.SceneIsReady = true;

            OnPlayerSceneReady.Invoke(player);
        }
Esempio n. 5
0
    private void ClientSceneReady(NetworkConnection connection, SceneReadyMessage message)
    {
        Scene?scene = SceneManagerExtensions.GetSceneByPathOrName(message.sceneNameOrPath);

        if (scene == null)
        {
            Debug.LogWarning($"Scene {message.sceneNameOrPath} not loaded on server despite client readying it");
            return;
        }

        PlayerForConnection(connection).MoveToScene(scene.Value);
    }
Esempio n. 6
0
        internal void ClientSceneReadyMessage(INetworkConnection conn, SceneReadyMessage msg)
        {
            logger.Log("ClientSceneReadyMessage");

            asyncOperation.allowSceneActivation = true;
        }
Esempio n. 7
0
        /// <summary>
        ///     Received message from server that it has finished loading the scene.
        ///
        ///     <para>Default implementation will set AllowSceneActivation = true and invoke event handler.
        ///     If this is not good enough intended behavior then override this method.</para>
        /// </summary>
        /// <param name="player">The player who sent the message.</param>
        /// <param name="message">The message data coming back from server.</param>
        protected internal virtual void ClientFinishedLoadingSceneMessage(INetworkPlayer player, SceneReadyMessage message)
        {
            logger.Log("[NetworkSceneManager] - ClientSceneReadyMessage");

            //Server has finished changing scene. Allow the client to finish.
            if (SceneLoadingAsyncOperationInfo != null)
            {
                SceneLoadingAsyncOperationInfo.allowSceneActivation = true;
            }
        }