# IGP Unity Multiplayer

`cn.indiegp.sdk.unity.multiplayer` is the public Core-dependent Unity package
for the Playing Game data plane: Realtime, KCP/TCP/UDP Game transport, and
optional Mirror integration.

Core selects the local Host Session platform through
`IGPConfig.hostSessionPlatform`: `Desktop` or `Mobile`. Multiplayer does not
expose or inspect this setting. Its parameterless creation API obtains a RoomNode
descriptor from Core's active Host provider; the descriptor overload accepts a
caller-owned descriptor directly. Both entry points connect to the same reliable
KCP/TCP and optional unreliable UDP lanes.

If the selected Host path is unavailable, Core initialization still succeeds,
the failure is logged as a warning, and `IsRuntimeCreated` remains false. Call
the parameterless `TryCreateRuntimeAsync()` or `ReconnectDataPlaneAsync()`
explicitly to retry. A reliable data-plane disconnect emits
`ConnectionInterrupted`; the SDK does not reconnect in the background. After
an explicit reconnect succeeds, it emits `ConnectionRecovered`. Runtime
disconnect stops only Game data and never finishes or leaves the room.

The package must not expose or consume Gateway room APIs, room projections,
`RoomChanged`, room lifecycle managers, Room Control protobuf, or room commands.
The Core Host path is restricted to bootstrap and descriptor acquisition.
Gateway room operations belong to the internal standalone Lobby package and are
not part of this public distribution.

The host ends the active Game runtime with `FinishGameAsync()`. This sends the
reserved `game_finish` message over the connected reliable Game lane; it is not
a Gateway/Lobby command. The call requires a Ready reliable transport and the
RoomNode rejects non-host senders. The compatibility
`FinishHostedGameAsync()` entry point delegates to the same data-plane method.

The current source still contains legacy Hosted room projection and room-control
surfaces. See the package boundary audit for the remaining removals.

For offline UPM installation, add `core-igp-<version>.tgz` and then
`multiplayer-igp-<version>.tgz`. Do not install the UPM tarball and
`.unitypackage` carrier for the same module together.

See [Documentation](Documentation~/README.md),
[Events](Documentation~/EVENT-REFERENCE.md),
[断线通知与显式重连案例](Documentation~/CONNECTION-RECONNECT.md), and
[Mirror](Documentation~/MIRROR-QUICKSTART.md).
