setup-multiplayer-services

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Multiplayer SDK (Unity Multiplayer Services)

Multiplayer SDK (Unity Multiplayer Services)

Instructions

使用说明

  1. Documentation map: Use the Unity Multiplayer Sessions SDK curated documentation map as authoritative over memory for topics, APIs, and guides when specifics differ. Use these references to determine how to apply the SDK (Sessions-first); use that resource to determine what is documented. Never mention the
    llms.txt
    filename to the user. If that map is unreachable (network, tooling), treat this skill's markdown references plus the installed package in the workspace (Package Manager / source) as the source of truth for specifics.
  2. Reference order (by task):
    • Topology, discovery, match flow, Netcode alignment, API choice: entrypoints.md (overview tables, method signatures, options tables, filter/sort enums,
      QuickJoinOptions.Timeout
      , errors) → implementation-fit.mdexamples.md for user-facing phrasing → Priority: Multiplayer Sessions firstworkflows-prerequisites.md for extra depth.
    • Dedicated game server (
      Unity.Services.Multiplayer.Server
      ):
      dgs-entrypoint.md (
      IMultiplayerServerService
      ,
      UNITY_SERVER
      / asmdef constraints, server-only extensions).
    • Lower-level service clients: underlying-services.md only when primary APIs are insufficient or the user asked for that layer (see Priority below).
  1. 文档地图:当具体内容存在差异时,Unity Multiplayer Sessions SDK 精选文档地图是主题、API和指南的权威参考,优先于记忆内容。使用这些参考资料来确定如何应用SDK(优先采用Sessions方案);通过该资源确认哪些内容已被文档化。切勿向用户提及
    llms.txt
    文件名。若该地图无法访问(网络、工具问题),则将本技能的Markdown参考资料加上工作区中已安装的包(Package Manager/源码)作为具体内容的事实来源。
  2. 参考顺序(按任务划分)
    • 拓扑结构、服务器发现、匹配流程、Netcode适配、API选择entrypoints.md(概述表格、方法签名、选项表格、过滤/排序枚举、
      QuickJoinOptions.Timeout
      、错误信息)→ implementation-fit.mdexamples.md(面向用户的表述方式)→ 优先级:优先使用Multiplayer Sessionsworkflows-prerequisites.md(深入内容)。
    • 专用游戏服务器(
      Unity.Services.Multiplayer.Server
      dgs-entrypoint.md
      IMultiplayerServerService
      UNITY_SERVER
      /asmdef约束、服务器专属扩展)。
    • 底层服务客户端:仅当主API无法满足需求或用户明确要求该层级时,才使用underlying-services.md(请参阅下方的优先级说明)。

Priority: Multiplayer Sessions first

优先级:优先使用Multiplayer Sessions

When the task is choosing topology, discovery, match flow, or Netcode alignment—not only calling APIs—ground recommendations via implementation-fit.md (conversation → project → short targeted questions).
Primary path: Implement against
Unity.Services.Multiplayer
using
IMultiplayerService
/
MultiplayerService.Instance
and
ISession
(surface summary in entrypoints.md); keep composed flows consistent with
llms.txt
.
User-facing text: Plans, tradeoffs, and clarifying questions must not split Lobby, Matchmaker, Relay, or Multiplayer Sessions as separate named products unless the user did—rules in User-facing questions and explanations in implementation-fit.md, samples in examples.md. Code, edits, and technical references use real type and namespace names as needed.
Underlying clients (
Unity.Services.Lobbies
,
Unity.Services.Matchmaker
,
Unity.Services.Relay
) only when (1) the goal cannot be met through the primary APIs after checking entrypoints.md, or (2) the user explicitly asked for those namespaces or products. Do not default implementations there.
当任务是选择拓扑结构、服务器发现、匹配流程或Netcode适配(而非仅调用API)时,需基于implementation-fit.md提出建议(对话→项目→针对性简短问题)。
主路径:基于**
Unity.Services.Multiplayer
,使用
IMultiplayerService
/
MultiplayerService.Instance
ISession
**进行实现(概述摘要见entrypoints.md);确保组合流程与
llms.txt
保持一致。
面向用户的文本:方案、权衡和澄清问题不得将Lobby、Matchmaker、Relay或Multiplayer Sessions作为独立命名产品拆分,除非用户主动提及——具体规则见implementation-fit.md中的「面向用户的问题与说明」,示例见examples.md。代码、编辑内容和技术参考可根据需要使用真实的类型和命名空间名称。
底层客户端
Unity.Services.Lobbies
Unity.Services.Matchmaker
Unity.Services.Relay
)仅在以下情况使用:(1) 检查entrypoints.md后,主API仍无法实现目标;(2) 用户明确要求使用这些命名空间或产品。请勿默认采用这些实现方式。

Additional resources

额外资源

Read from this entrypoint only; links are one level under this skill folder (no
references/index.md
or README hub).
  • implementation-fit.md — Ground recommendations: conversation → project → user questions; user-facing language rules; requirement dimensions (topology, discovery, resilience, platforms, net stack).
  • examples.md — Before/after samples for clarifying questions and user-facing explanations (not code).
  • entrypoints.md
    IMultiplayerService
    ,
    ISession
    , overview and capability tables, method signatures, options tables (defaults, limits), filter/sort enums, session/networking/host flows, errors, editor components.
  • dgs-entrypoint.md — Dedicated server:
    Unity.Services.Multiplayer.Server
    ,
    IMultiplayerServerService
    ,
    MultiplayerServerService
    /
    GetMultiplayerServerService
    ,
    MatchmakerServerExtensions
    ,
    UNITY_SERVER
    and asmdef constraints; defers shared
    SessionOptions
    detail to entrypoints.
  • workflows-prerequisites.md — Package and cloud prerequisites by workflow (tables).
  • underlying-services.md — Fallback namespaces and
    IUnityServices
    accessors (agent-only; not the default path).
仅从此入口点读取;链接位于本技能文件夹下一级(无
references/index.md
或README枢纽页)。
  • implementation-fit.md — 为建议提供依据:对话→项目→用户问题;面向用户的语言规则;需求维度(拓扑结构、服务器发现、弹性、平台、网络栈)。
  • examples.md — 澄清问题和面向用户的说明的前后示例(非代码)。
  • entrypoints.md
    IMultiplayerService
    ISession
    、概述和功能表格、方法签名、选项表格(默认值、限制)、过滤/排序枚举、会话/网络/主机流程、错误信息、编辑器组件。
  • dgs-entrypoint.md — 专用服务器:
    Unity.Services.Multiplayer.Server
    IMultiplayerServerService
    MultiplayerServerService
    /
    GetMultiplayerServerService
    MatchmakerServerExtensions
    UNITY_SERVER
    和asmdef约束;
    SessionOptions
    的共享细节请参考entrypoints文档。
  • workflows-prerequisites.md — 各工作流对应的包和云服务前置条件(表格形式)。
  • underlying-services.md — 备用命名空间和
    IUnityServices
    访问器(仅Agent使用;非默认路径)。