File tree Expand file tree Collapse file tree 2 files changed +8
-35
lines changed
com.unity.netcode.gameobjects/Runtime Expand file tree Collapse file tree 2 files changed +8
-35
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,14 @@ public override bool Initialize(string defaultWorldName)
7878 {
7979 Instance = this ;
8080 AutoConnectPort = Port ;
81- CreateDefaultClientServerWorlds ( ) ;
81+ if ( NetworkManager . Singleton . IsServer )
82+ {
83+ CreateSingleWorldHost ( "ClientAndServerWorld" ) ;
84+ }
85+ else
86+ {
87+ CreateClientWorld ( "ClientWorld" ) ;
88+ }
8289 var initialized = base . Initialize ( defaultWorldName ) ;
8390 OnInitialized ? . Invoke ( initialized ) ;
8491 return initialized ;
Original file line number Diff line number Diff line change @@ -1054,10 +1054,6 @@ private void Awake()
10541054#endif
10551055 // Notify we have instantiated a new instance of NetworkManager.
10561056 OnInstantiated ? . Invoke ( this ) ;
1057-
1058- #if UNIFIED_NETCODE && UNITY_MULTIPLAYER_PLAYMODE
1059- MPPMCheckInternal . Initialize ( ) ;
1060- #endif
10611057 }
10621058
10631059 private void OnEnable ( )
@@ -2107,36 +2103,6 @@ internal static void OnOneTimeTearDown()
21072103 public delegate void OnDisconnectDelegate ( NetcodeConnection connection ) ;
21082104 public static OnConnectDelegate OnNetCodeConnect ;
21092105 public static OnDisconnectDelegate OnNetCodeDisconnect ;
2110-
2111- // TODO-UNIFIED: For POC only (centralizing)
2112- public static MPPMCheckInfo MPPMCheck => MPPMCheckInternal ;
2113- internal static MPPMCheckInfo MPPMCheckInternal = new MPPMCheckInfo ( ) ;
2114- public class MPPMCheckInfo
2115- {
2116- public bool Installed { get ; private set ; }
2117- public bool HasServerTag ;
2118- public bool HasClientTag ;
2119- internal void Initialize ( )
2120- {
2121- #if UNITY_MULTIPLAYER_PLAYMODE && UNITY_EDITOR
2122- Installed = true ;
2123- var tags = Multiplayer . PlayMode . CurrentPlayer . Tags ;
2124- foreach ( var tag in tags )
2125- {
2126- if ( tag == "Server" )
2127- {
2128- HasServerTag = true ;
2129- }
2130- else if ( tag == "Client" )
2131- {
2132- HasClientTag = true ;
2133- }
2134- }
2135- #else
2136- Installed = false ;
2137- #endif
2138- }
2139- }
21402106#endif
21412107 }
21422108}
You can’t perform that action at this time.
0 commit comments