using Unity.Entities; using Unity.NetCode; using UnityEngine.Scripting; namespace ProjectM.Simulation { /// /// Custom Netcode for Entities bootstrap. Subclassing gives an /// explicit hook to customize world creation, tick rate, and connection. /// /// M4 (LAN co-op): auto-connect is DISABLED ( = 0). /// Listening/connecting is driven explicitly via the singleton and the /// per-world ConnectionControlSystems — from ConnectionUI (Host / Join + IP) in player builds, /// or from the editor-only EditorAutoHostSystem, which auto-hosts on loopback and connects the /// in-proc client plus any Multiplayer-PlayMode-Tools thin clients. Direct IP/LAN only for now; Unity /// Relay is deferred to a later pass. /// /// [Preserve] public class GameBootstrap : ClientServerBootstrap { public override bool Initialize(string defaultWorldName) { // No auto-connect: ConnectionConfig + the ConnectionControlSystems own listen/connect (M4). AutoConnectPort = 0; CreateDefaultClientServerWorlds(); return true; } } }