Token导航 LogoToken导航

Agent Skill · 开发

authoritative-server(权威服务器)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

authoritative-server 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 16,648。

总安装 485周安装 20GitHub Stars 13下载 158核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:authoritative-server(权威服务器)
来源仓库:https://github.com/dcl-regenesislabs/opendcl
仓库路径:skills/authoritative-server
安装命令:
npx skills add https://github.com/dcl-regenesislabs/opendcl --skill authoritative-server
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dcl-regenesislabs/opendcl --skill authoritative-server

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

构建多人去中心化场景的权威服务器控制逻辑,防止作弊并验证状态变更。同一代码库运行于服务端与客户端,服务端拥有完全裁决权。适用于 Decentraland 多人游戏、实时协作编辑等高一致性要求场景。安装需通过 npx skills add 添加 opendcl 仓库中的 authoritative-server 技能。

必须使用 @dcl/sdk@auth-server 分支 SDK,普通版本不包含服务端 API。

来源仓库内路径:skills/authoritative-server

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dcl-regenesislabs/opendcl --skill authoritativ…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

authoritative-server 怎么安装?

在终端执行 npx skills add https://github.com/dcl-regenesislabs/opendcl --skill authoritative-server。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

authoritative-server 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

authoritative-server 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

authoritative-server 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

authoritative-server 用的人多吗?

公开数据是累计安装 485 次,近一周安装 20 次,下载 158 次,GitHub 13 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

authoritative-server 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
authoritative-server

权威服务器 · 本页

48513接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Authoritative Server Pattern

Build multiplayer Decentraland scenes where a headless server controls game state, validates changes, and prevents cheating. The same codebase runs on both server and client, with the server having full authority.

For basic CRDT multiplayer (no server), see the multiplayer-sync skill instead.

Setup

1. Install the auth-server SDK branch (MANDATORY)

You must use the auth-server tag — the standard @dcl/sdk does NOT include authoritative server APIs (isServer, registerMessages, Storage, EnvVar, etc.):

npm install @dcl/sdk@auth-server

2. Configure scene.json

Your scene.json must include these properties:

  • authoritativeMultiplayer: true — enables the authoritative server runtime.
  • worldConfiguration.name — identifies the world for deployment, Storage, and EnvVar.
  • logsPermissions — array of wallet addresses allowed to see server logs in the console. Without this, server console.log() output is hidden.
{
  "authoritativeMultiplayer": true,
  "worldConfiguration": {
    "name": "my-world-name.dcl.eth"
  },
  "logsPermissions": ["0xYourWalletAddress"]
}

3. Run the scene

Just use the normal preview — it automatically starts the authoritative server in the background when authoritativeMultiplayer: true is set in scene.json.

Debugging note (do NOT tell the user to run this): Under the hood, the preview runs npx @dcl/hammurabi-server@next. If the auth server isn't starting, check that the hammurabi process is running and look for errors in its output.

Server/Client Branching

Use isServer() to branch logic in a single codebase:

import { isServer } from '@dcl/sdk/network'

export async function main() {
  if (isServer()) {
    // Server-only: game logic, validation, state management
    const { server } = await import('./server/server')
    server()
    return
  }

  // Client-only: UI, input, message sending
  setupClient()
  setupUi()
}

The server runs your scene code headlessly (no rendering). It has access to all player positions via PlayerIdentityData and manages all authoritative game state.

Synced Components with Validation

Define custom components that sync from server to all clients. Always use validateBeforeChange() to prevent clients from modifying server-authoritative state.

Custom Components (Global Validation)

import { engine, Schemas } from '@dcl/sdk/ecs'
import { AUTH_SERVER_PEER_ID } from '@dcl/sdk/network/message-bus-sync'

export const GameState = engine.defineComponent('game:State', {
  phase: Schemas.String,
  score: Schemas.Number,
  timeRemaining: Schemas.Number
})

// Restrict ALL modifications to server only
GameState.validateBeforeChange((value) => {
  return value.senderAddress === AUTH_SERVER_PEER_ID
})

Built-in Components (Per-Entity Validation)

For built-in components like Transform and GltfContainer, use per-entity validation so you don't block client-side transforms on the player's own entities:

import { Entity, Transform, GltfContainer } from '@dcl/sdk/ecs'
import { AUTH_SERVER_PEER_ID } from '@dcl/sdk/network/message-bus-sync'

type ComponentWithValidation = {
  validateBeforeChange: (entity: Entity, cb: (value: { senderAddress: string }) => boolean) => void
}

function protectServerEntity(entity: Entity, components: ComponentWithValidation[]) {
  for (const component of components) {
    component.validateBeforeChange(entity, (value) => {
      return value.senderAddress === AUTH_SERVER_PEER_ID
    })
  }
}

// Usage: after creating a server-managed entity
const entity = engine.addEntity()
Transform.create(entity, { position: Vector3.create(10, 5, 10) })
GltfContainer.create(entity, { src: 'assets/model.glb' })
protectServerEntity(entity, [Transform, GltfContainer])

Syncing Entities

After creating and protecting an entity, sync it to all clients:

import { syncEntity } from '@dcl/sdk/network'

syncEntity(entity, [Transform.componentId, GameState.componentId])

Messages

Use registerMessages() for client-to-server and server-to-client communication:

Define Messages

import { Schemas } from '@dcl/sdk/ecs'
import { registerMessages } from '@dcl/sdk/network'

export const Messages = {
  // Client -> Server
  playerJoin: Schemas.Map({ displayName: Schemas.String }),
  playerAction: Schemas.Map({ actionType: Schemas.String, data: Schemas.Number }),

  // Server -> Client
  gameEvent: Schemas.Map({ eventType: Schemas.String, playerName: Schemas.String })
}

export const room = registerMessages(Messages)

Send Messages

// Client sends to server
room.send('playerJoin', { displayName: 'Alice' })

// Server sends to ALL clients
room.send('gameEvent', { eventType: 'ROUND_START', playerName: '' })

// Server sends to ONE client
room.send('gameEvent', { eventType: 'YOU_WIN', playerName: 'Alice' }, { to: [playerAddress] })

Receive Messages

// Server receives from client
room.onMessage('playerJoin', (data, context) => {
  if (!context) return
  const playerAddress = context.from  // Wallet address of sender
  console.log(`[Server] Player joined: ${data.displayName} (${playerAddress})`)
})

// Client receives from server
room.onMessage('gameEvent', (data) => {
  console.log(`Event: ${data.eventType}`)
})

Wait for State Sync

Before sending messages from the client, wait until state is synchronized:

import { isStateSyncronized } from '@dcl/sdk/network'

engine.addSystem(() => {
  if (!isStateSyncronized()) return

  // Safe to send messages now
  room.send('playerJoin', { displayName: 'Player' })
})

Server Reading Player Positions

The server can read actual player positions — critical for anti-cheat:

import { engine, PlayerIdentityData, Transform } from '@dcl/sdk/ecs'

engine.addSystem(() => {
  for (const [entity, identity] of engine.getEntitiesWith(PlayerIdentityData)) {
    const transform = Transform.getOrNull(entity)
    if (!transform) continue

    const address = identity.address
    const position = transform.position
    // Use actual server-verified position, not client-reported data
  }
})

Never trust client-reported positions. Always read PlayerIdentityData + Transform on the server.

Storage

Persist data across server restarts. Server-only — guard with isServer().

import { Storage } from '@dcl/sdk/server'

World Storage (Global)

Shared across all players:

// Store
await Storage.world.set('leaderboard', JSON.stringify(leaderboardData))

// Retrieve
const data = await Storage.world.get<string>('leaderboard')
if (data) {
  const leaderboard = JSON.parse(data)
}

// Delete
await Storage.world.delete('oldKey')

Player Storage (Per-Player)

Keyed by player wallet address:

// Store
await Storage.player.set(playerAddress, 'highScore', String(score))

// Retrieve
const saved = await Storage.player.get<string>(playerAddress, 'highScore')
const highScore = saved ? parseInt(saved) : 0

// Delete
await Storage.player.delete(playerAddress, 'highScore')

Storage only accepts strings. Use JSON.stringify()/JSON.parse() for objects and String()/parseInt() for numbers.

Local development storage is at node_modules/@dcl/sdk-commands/.runtime-data/server-storage.json.

Environment Variables

Configure your scene without hardcoding values. Server-only — guard with isServer().

import { EnvVar } from '@dcl/sdk/server'

// Read a variable with default
const maxPlayers = parseInt((await EnvVar.get('MAX_PLAYERS')) || '4')
const debugMode = ((await EnvVar.get('DEBUG')) || 'false') === 'true'

Local Development

Create a .env file in your project root:

MAX_PLAYERS=8
GAME_DURATION=300
DEBUG=true

Add .env to your .gitignore.

Deploy to Production

# Set a variable
npx sdk-commands deploy-env MAX_PLAYERS --value 8

# Delete a variable
npx sdk-commands deploy-env OLD_VAR --delete

Deployed env vars take precedence over .env file values.

Recommended Project Structure

src/
├── index.ts              # Entry point — isServer() branching
├── client/
│   ├── setup.ts          # Client initialization, message handlers
│   └── ui.tsx            # React ECS UI reading synced state
├── server/
│   ├── server.ts         # Server init, systems, message handlers
│   └── gameState.ts      # Server state management class
└── shared/
    ├── schemas.ts        # Synced component definitions + validateBeforeChange
    └── messages.ts       # Message definitions via registerMessages()

Put synced components and messages in shared/ so both server and client import the same definitions. Keep server logic (Storage, EnvVar, game systems) in server/. Keep UI and client input in client/.

Testing & Debugging

  • Log prefixes: Use [Server] and [Client] prefixes in console.log() to distinguish server and client output in the terminal.
  • Stale CRDT files: If you see "Outside of the bounds of written data" errors, delete main.crdt and main1.crdt files and restart.
  • Storage inspection: Check node_modules/@dcl/sdk-commands/.runtime-data/server-storage.json to inspect persisted data during local development.
  • Timers: setTimeout/setInterval are available via runtime polyfill. For game logic, prefer engine.addSystem() with a delta-time accumulator to stay in sync with the frame loop.
  • Entity sync issues: Verify you call syncEntity(entity, [componentIds]) with the correct component IDs (MyComponent.componentId).

Important Notes

  • Use Schemas.Int64 for timestamps: Schemas.Number corrupts large numbers (13+ digits). Always use Schemas.Int64 for values like Date.now().
  • State sync readiness: Clients must wait for isStateSyncronized() (from @dcl/sdk/network) to return true before sending messages. Note the intentional SDK typo: "Syncronized" not "Synchronized".
  • Custom vs built-in validation: Custom components use global validateBeforeChange((value) =>...). Built-in components (Transform, GltfContainer) use per-entity validateBeforeChange(entity, (value) =>...).
  • Single codebase: Both server and client run the same index.ts entry point. Use isServer() to branch.
  • No Node.js APIs: The DCL runtime uses sandboxed QuickJS — no fs, http, etc. setTimeout/setInterval are supported. Use SDK-provided APIs (Storage, EnvVar, engine systems) for server-side operations.
  • SDK branch (MANDATORY): The auth-server pattern requires npm install @dcl/sdk@auth-server, not the standard @dcl/sdk. Without it, isServer(), registerMessages(), Storage, and EnvVar are unavailable.
  • scene.json required fields: authoritativeMultiplayer: true must be set, and logsPermissions: ["0xWalletAddress"] must list wallet addresses that should see server logs.
  • For basic CRDT multiplayer without a server, see the multiplayer-sync skill.

For complete server setup examples, authentication flow, state reconciliation, Storage patterns, and EnvVar usage, see {baseDir}/references/server-patterns.md.

平台分布

Codex

38.03%
按下载量换算60

Claude

28.72%
按下载量换算45

Cursor

20.26%
按下载量换算32

Gemini CLI

9.23%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills