36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using Unity.Collections;
|
|
using Unity.Entities;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// Connection intent for the M4 LAN host/join flow. Lives in Simulation so both the server and
|
|
/// client worlds can read it. A UI (<c>ConnectionUI</c>) — or, in the editor, the auto-host system —
|
|
/// writes the desired <see cref="Mode"/> + endpoint and sets <see cref="Requested"/> true; the
|
|
/// per-world ConnectionControlSystem turns it into a netcode <c>NetworkStreamRequestListen</c> /
|
|
/// <c>NetworkStreamRequestConnect</c> and clears <see cref="Requested"/>. Direct IP/LAN only for now —
|
|
/// Unity Relay is deferred to a later pass. Created per-world as a singleton.
|
|
/// </summary>
|
|
public enum ConnectionMode : byte
|
|
{
|
|
None,
|
|
Host,
|
|
Join,
|
|
}
|
|
|
|
public struct ConnectionConfig : IComponentData
|
|
{
|
|
/// <summary>What to do with this world's network stream.</summary>
|
|
public ConnectionMode Mode;
|
|
|
|
/// <summary>Dotted IPv4 to connect to (Join). Ignored for Host (binds AnyIpv4).</summary>
|
|
public FixedString64Bytes Address;
|
|
|
|
/// <summary>Listen/connect port.</summary>
|
|
public ushort Port;
|
|
|
|
/// <summary>Set true to request the control system act on Mode this frame; it clears the flag.</summary>
|
|
public bool Requested;
|
|
}
|
|
}
|