You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ac42e0d
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: remove Linq from the CLI query layer and its tests (MTT-16534)
- Loops and List/Array methods (Find, FindAll, Exists, ConvertAll, GetRange) replace every Linq call in Editor/CliQueries and Tests/Editor/Cli.
- New helpers keep the output unchanged: StableSort keeps OrderBy's tie order for managers, spawned objects and stats messages. WithoutDuplicates keeps Distinct's first-seen order. JoinNames builds the comma-separated lists in messages.
- Session's IsConnected and CountOtherClients replace the hidden Linq Contains and Count on ConnectedClientsIds.
@@ -38,7 +37,7 @@ internal static CreateNetworkManagerResult CreateNetworkManager(string name, Net
38
37
varexisting=FindManagers();
39
38
if(existing.Count>0)
40
39
{
41
-
thrownewInvalidOperationException($"The open scenes already have a NetworkManager ({string.Join(", ",existing.Select(m =>$"{GetHierarchyPath(m.transform)} in {SceneLabel(m.gameObject.scene)}"))}). A session uses one; inspect it with netcode.gameobjects.config get.");
40
+
thrownewInvalidOperationException($"The open scenes already have a NetworkManager ({JoinNames(existing,m =>$"{GetHierarchyPath(m.transform)} in {SceneLabel(m.gameObject.scene)}")}). A session uses one; inspect it with netcode.gameobjects.config get.");
42
41
}
43
42
44
43
varscene=SceneManager.GetActiveScene();
@@ -83,7 +82,7 @@ internal static CreateNetworkManagerResult CreateNetworkManager(string name, Net
thrownewArgumentException($"The scene's NetworkManagers use several lists. Pass list with one of: {string.Join(", ",managerLists.Select(AssetDatabase.GetAssetPath))}.");
322
+
thrownewArgumentException($"The scene's NetworkManagers use several lists. Pass list with one of: {JoinNames(managerLists,AssetDatabase.GetAssetPath)}.");
thrownewArgumentException($"Several prefabs are named '{prefab}': {string.Join(", ",matches)}. Pass the path instead.");
652
698
}
653
-
path=matches.FirstOrDefault();
699
+
path=matches.Count>0?matches[0]:null;
654
700
}
655
701
656
702
varasset=(string.IsNullOrEmpty(path)?null:AssetDatabase.LoadAssetAtPath<GameObject>(path))??thrownewArgumentException($"No prefab found for '{prefab}'. Search with asset find, or list network prefabs with netcode.gameobjects list_prefabs.");
add("warning","SCENE_NOT_IN_BUILD",where,$"Scene management is on and {scene.path} isn't in the build's scene list, so clients can't load it. Entering play mode opens a dialog asking to add it; add it first with scene add_to_build, or turn scene management off (netcode.gameobjects.config set enable_scene_management false).");
0 commit comments