FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix broken hybrid spawn tests by ShadauxCat · Pull Request #4061 · Unity-Technologies/com.unity.netcode.gameobjects · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .asmdef  (1) .cs  (4) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,10 @@ internal static void ResetSingleton()
/// </summary>
public void SetSingleton()
{
Singleton = this;
if (!Singleton || !Singleton.IsServer)
{
Singleton = this;
}

OnSingletonReady?.Invoke();
}
Expand Down Expand Up @@ -1401,7 +1404,14 @@ internal void InitializeNetcodeWorld()
/// !! Initialize worlds here !!
/// Worlds are created here: <see cref="UnifiedBootStrap.Initialize"/>
UnifiedBootstrap.CurrentNetworkManagerForInitialization = this;
DefaultWorldInitialization.Initialize("Default World", false);
if (UnifiedBootstrap.Instance != null)
{
UnifiedBootstrap.Instance.Initialize("Default World");
}
else
{
DefaultWorldInitialization.Initialize("Default World", false);
}
}

/// <summary>
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3736,7 +3736,13 @@ private void Start()

private void InitGhost()
{
if (!NetworkManager.IsListening)
if (!HasGhost || !NetworkObjectBridge || GhostAdapter.IsPrefab())
{
// Nothing to register
return;
}

if (!NetworkManager || !NetworkManager.IsListening)
{
if (NetworkManager.LogLevel == LogLevel.Developer)
{
Expand All @@ -3745,12 +3751,6 @@ private void InitGhost()
return;
}

if (!HasGhost || !NetworkObjectBridge || GhostAdapter.IsPrefab())
{
// Nothing to register
return;
}

// All instances with Ghosts are automatically registered
if (NetworkManager.LogLevel == LogLevel.Developer)
{
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2449,14 +2449,6 @@ internal void SpawnInstanceWithOwnership(NetworkObject networkObjectToSpawn, Net
}
else
{
#if UNIFIED_NETCODE
// TODO-FixMe: NetCode.Netcode.Instance is a singleton and might cause issues
// assigning this.
if (networkObjectToSpawn.HasGhost)
{
NetCode.Netcode.Instance.m_ActiveWorld = m_ServerNetworkManager.NetcodeWorld;
}
#endif
networkObjectToSpawn.NetworkManagerOwner = m_ServerNetworkManager; // Required to assure the server does the spawning
if (spawnAuthority == m_ServerNetworkManager)
{
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
#if UNIFIED_NETCODE
using Unity.NetCode;
#endif

namespace TestProject.RuntimeTests
{
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"Unity.Mathematics",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"Unity.Netcode.Runtime.Tests"
"Unity.Netcode.Runtime.Tests",
"Unity.NetCode"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Loading

Back | FazBrowse Home | New Git URL