文档

​
​

Development

User Acquisition

Monetization

工业

Multiplayer Services SDK

All Services

Multiplayer Services SDK

此页面不支持所选语言。
Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
  • Manage sessions
    • Lobby events
    • Rate limits
    • Information management in sessions
    • Synchronize player names in a session
    • Access control
    • Session error messages
  • Connect players through a relay
  • Networking
  • Matchmaking
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Access control

Configure visibility and access permissions to control who can discover and join your sessions.
阅读时间1 分钟
最后更新于 23 天前

By default, the Multiplayer Services SDK accepts API calls from either an Authenticated Player or a Service Account. In some cases, you might want more control over how sessions are created or joined. In those cases you can use Access Control.

Service Account controlled sessions

In the following example, sessions can only be created and players can only join via a Service Account. Service accounts allow you to control the session by restricting write access for Players.
Creating project policies via CLI with the following JSON definition will
Deny
all write access to session service APIs, except the Reconnect and Tokens endpoints. Note that any API that requires read access (HTTP GETs) is still accessible.
{ "statements": [ { "Sid": "DenyPlayerSessionWrites", "Resource": "urn:ugs:lobby:/v1/*", "Principal": "Player", "Action": ["Write"], "Effect": "Deny" }, { "Sid": "AllowPlayerSessionReconnect", "Resource": "urn:ugs:lobby:/v1/*/reconnect", "Principal": "Player", "Action": ["*"], "Effect": "Allow" }, { "Sid": "AllowPlayerSessionTokens", "Resource": "urn:ugs:lobby:/v1/*/tokens", "Principal": "Player", "Action": ["*"], "Effect": "Allow" } ]}
Upsert the policies with
ugs access upsert-project-policy -p <project-id> -e <env-name> <file-path>
. Any API call that violates the policy will be rejected with a
403 - Forbidden
error.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Service Account controlled sessions


报告此页面的问题