using Unity.Collections;
using Unity.Entities;
namespace ProjectM.Simulation
{
///
/// Connection intent for the M4 LAN host/join flow. Lives in Simulation so both the server and
/// client worlds can read it. A UI (the UITK frontend menu via WorldLauncher) — or, in the editor, the auto-host system —
/// writes the desired + endpoint and sets true; the
/// per-world ConnectionControlSystem turns it into a netcode NetworkStreamRequestListen /
/// NetworkStreamRequestConnect and clears . Direct IP/LAN only for now —
/// Unity Relay is deferred to a later pass. Created per-world as a singleton.
///
/// Connection intent values (byte-const, matching the project's op/id convention — not an enum, so
/// they stay safe if a consumer is ever [BurstCompile]d). Written to .
public static class ConnectionMode
{
public const byte None = 0;
public const byte Host = 1;
public const byte Join = 2;
}
public struct ConnectionConfig : IComponentData
{
/// What to do with this world's network stream.
public byte Mode;
/// Dotted IPv4 to connect to (Join). Ignored for Host (binds AnyIpv4).
public FixedString64Bytes Address;
/// Listen/connect port.
public ushort Port;
/// Set true to request the control system act on Mode this frame; it clears the flag.
public bool Requested;
}
}