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; } }
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; } }
public void UnpackWrongMessage() { var message = new SceneReadyMessage(); var data = MessagePacker.Pack(message); Assert.Throws <FormatException>(() => { _ = MessagePacker.Unpack <AddCharacterMessage>(data); }); }
/// <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); }
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); }
internal void ClientSceneReadyMessage(INetworkConnection conn, SceneReadyMessage msg) { logger.Log("ClientSceneReadyMessage"); asyncOperation.allowSceneActivation = true; }
/// <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; } }