multiplayer-game

작성자: rivet-dev

멀티플레이어 게임 구축을 위한 실용적 패턴: 매치메이킹, 틱 루프, 실시간 상태, 관심 관리, 검증. 10가지 게임 유형(배틀로얄, 아레나, IO 스타일, 오픈 월드, 파티, 물리 2D/3D, 랭크, 턴제, 방치형)에 대한 시작 코드와 아키텍처 패턴, 액터 토폴로지, 생명주기 다이어그램, 넷코드 전략 포함. 고정 실시간 루프 대 액션 기반 업데이트, 물리 엔진 선택(Rapier 2D/3D), 공간... 등 서버 시뮬레이션 기본 사항 다룸.

npx skills add https://github.com/rivet-dev/skills --skill multiplayer-game

Multiplayer Game

IMPORTANT: Before doing anything, you MUST read BASE_SKILL.md in this skill's directory. It contains essential guidance on debugging, error handling, state management, deployment, and project setup. Those rules and patterns apply to all RivetKit work. Everything below assumes you have already read and understood it.

Working Examples

If you need a reference implementation, read the raw working example code in these templates:

Patterns for building multiplayer games with RivetKit, intended as a practical checklist you can adapt per genre.

Starter Code

Start with one of the working examples on GitHub and adapt it to your game. Do not start from scratch for matchmaking and lifecycle flows.

Game ClassificationStarter CodeCommon Examples
Battle RoyaleGitHubFortnite, Apex Legends, PUBG, Warzone
ArenaGitHubCall of Duty TDM/FFA, Halo Slayer, Counter-Strike casual, VALORANT unrated, Overwatch Quick Play, Rocket League
IO StyleGitHubAgar.io, Slither.io, surviv.io
Open WorldGitHubMinecraft survival servers, Rust-like worlds, MMO zone/chunk worlds
PartyGitHubFall Guys private lobbies, custom game rooms, social party sessions
Physics 2DGitHubTop-down physics brawlers, 2D arena games, platform fighters
Physics 3DGitHubPhysics sandbox sessions, 3D arena games, movement playgrounds
RankedGitHubChess ladders, competitive card games, duel arena ranked queues
Turn-BasedGitHubChess correspondence, Words With Friends, async board games
IdleGitHubCookie Clicker, Idle Miner Tycoon, Adventure Capitalist

Server Simulation

Game Loop And Tick Rates

PatternUse WhenImplementation Guidance
Fixed realtime loopBattle Royale, Arena, IO Style, Open World, RankedRun in run with sleep(tickMs) and exit on c.aborted.
Action-driven updatesParty, Turn-BasedMutate and broadcast only on actions/events rather than scheduled ticks.
Coarse offline progressionAny mode with idle progressionUse c.schedule.after(...) with coarse windows (for example 5 to 15 minutes) and apply catch-up from elapsed wall clock time.

Physics

Start with custom kinematic logic for simple games. Switch to a full physics engine when you need joints, stacked bodies, high collision density, or complex shapes (rotated polygons, capsules, convex hulls, triangle meshes).

Pick one engine per simulation. Keep frontend-only libs out of backend simulation paths and treat server state as authoritative.

DimensionPrimary EngineFallback EnginesExample Code
2D@dimforge/rapier2dplanck-js, matter-jsGitHub
3D@dimforge/rapier3dcannon-es, ammo.jsGitHub

Spatial Indexing

For non-physics spatial queries, use a dedicated index instead of naive O(n^2) checks:

Index TypeRecommendation
AABB indexFor AOI, visibility, and non-collider entities, use rbush for dynamic sets or flatbush for static-ish sets.
Point indexFor nearest-neighbor or within-radius queries, use d3-quadtree.

Networking & State Sync

Netcode

ModelWhen To UseImplementation
Hybrid (client movement, server combat)Shooters, action sports, ranked duelsClient owns movement and sends capped-rate position updates. Server validates for anti-cheat. Combat (projectiles, hits, damage) is fully server-authoritative.
Server-authoritative with interpolationIO Style, persistent worldsClient sends input commands. Server simulates on fixed ticks and publishes authoritative snapshots. Client interpolates between snapshots.
Server-authoritative (basic logic)Turn-based, event-drivenServer validates and applies discrete actions (turns, phase transitions, votes). Client displays confirmed state.

Realtime Data Model

  • Snapshots and diffs: Publish state as events. Send a full snapshot on join/resync, then per-tick diffs for regular updates.
  • Batch per tick: Keep events small and typed. Batch high-frequency updates per tick.
  • Avoid UI framework state for game updates: Use requestAnimationFrame or a Canvas/Three.js loop for simulation, not React state. Reserve UI framework state for menus, HUD, and forms.
  • Broadcast vs per-connection: Use c.broadcast(...) for shared updates and conn.send(...) for private/per-player data.

Shared Simulation Logic

Shared simulation logic runs on both the client and the server. For example, an applyInput(state, input, dt) function that integrates velocity and clamps to world bounds can run on the client for prediction and on the server for validation.

  • Hybrid modes: Client runs shared movement as primary authority, server runs it for anti-cheat validation.
  • Server-authoritative modes: Client uses shared logic for interpolation and prediction only.
  • Keep it pure: Movement integration, input transforms, collision helpers, and constants only.
  • Put shared code in src/shared/: Keep deterministic helpers in src/shared/sim/* with no side effects.

Interest Management

Control what each client receives to reduce bandwidth and prevent information leaks.

Per-Player Replication Filters

  • Filter by relevance: Send each client only state relevant to that player (proximity, line-of-sight, team, or game phase).
  • Shooters and action games: Limit replication by proximity and optional field-of-view checks.
  • Server-side only: Clients should never receive data they should not see.

Sharded Worlds

  • Partition large worlds: Use chunk actors keyed by worldId:chunkX:chunkY.
  • Subscribe to nearby chunks: Clients connect only to nearby partitions (for example a 3x3 chunk window).
  • Use sparingly: Only when the world is large and state-heavy (sandbox builders, MMOs), not as a default for small matches.

Backend Infrastructure

Persistence

  • In-memory state: Best for realtime game state that changes every tick (player positions, inputs, match phase, scores).
  • SQLite (rivetkit/db): Better for large or table-like state that needs queries, indexes, or long-term persistence (tiles, inventory, matchmaking pools). Serialize DB work through a queue since multiple actions can hit the same actor concurrently.

Matchmaking Patterns

Common building blocks used across the architecture patterns below.

Actor Topology

PrimitiveUse WhenTypical Ownership
matchmaker["main"] + match[matchId]Session-based multiplayer (battle royale, arena, ranked, party, turn-based)Matchmaker owns discovery/assignment. Match owns lifecycle and gameplay state.
chunk[worldId,chunkX,chunkY]Large continuous worlds that need shardingEach chunk owns local players, chunk state, and local simulation.
world[playerId]Per-player progression loops (idle/solo world state)Per-player resources, buildings, timers, and progression.
player[username]Canonical profile/rating reused across matchesDurable player stats (for example rating and win/loss).
leaderboard["main"]Shared rankings across many matches/playersGlobal ordered score rows and top lists.

Queueing Strategy

  • Multiple players can hit the matchmaker at the same time, so actions like find/create, queue/unqueue, and close need to be serialized through actor queues to avoid races.
  • Match-local actions (gameplay, scoring) do not need queueing unless they write back to the matchmaker.

Security And Anti-Cheat

Start with this baseline, then harden further for competitive or high-risk environments.

Baseline Checklist

  • Identity: Use c.conn.id as the authoritative transport identity. Treat playerId/username in params as untrusted input and bind through server-issued assignment/join tickets.
  • Authorization: Validate the caller is allowed to mutate the target entity (room membership, turn ownership, host-only actions).
  • Input validation: Clamp sizes/lengths, validate enums, and validate usernames (length, allowed chars, avoid unbounded Unicode).
  • Rate limiting: Per-connection rate limits for spammy actions (chat, join/leave, fire, movement updates).
  • State integrity: Server recomputes derived state (scores, win conditions, placements). Never allow client-authoritative changes to inventory/currency/leaderboard totals.

Movement Validation

For any mode with client-authoritative movement (hybrid flows), clients may send position/rotation updates for smoothness, but the server must:

  • Enforce max delta per update (speed cap) based on elapsed time.
  • Reject or clamp teleports.
  • Enforce world bounds (and basic collision if applicable).
  • Rate limit update frequency (for example 20Hz max).

Architecture Patterns

Each game type below starts with a quick summary table, then details actors and lifecycle.

Battle Royale

TopicSummary
MatchmakingImmediate routing to the fullest non-started lobby (oldest tie-break); players wait in lobby until capacity, then the match starts.
NetcodeHybrid. Client owns movement, camera, and local prediction. Server owns zone state, projectiles, hit resolution, eliminations, loot, and final placement.
Tick Rate10 ticks/sec (100ms) with a fixed loop for zone progression and lifecycle checks.
PhysicsClient owns movement with server anti-cheat validation; projectiles, hits, and damage are server-authoritative. Use @dimforge/rapier3d for 3D or @dimforge/rapier2d for top-down 2D.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Finds or creates lobbies, tracks pending reservations, and maintains occupancy.

  • Actions

    • findMatch
    • pendingPlayerConnected
    • updateMatch
    • closeMatch
  • Queues

    • findMatch
    • pendingPlayerConnected
    • updateMatch
    • closeMatch
  • State

    • SQLite
    • matches
    • pending_players
    • player_count includes connected and pending players
  • Key: match[matchId]

  • Responsibility: Runs lobby/live/finished phases, owns player state, zone progression, and eliminations.

  • Actions

    • connect
    • Movement and combat actions
  • Queues

    • None
  • State

    • JSON
    • phase
    • players
    • zone
    • eliminations
    • snapshot data

Lifecycle

sequenceDiagram
	participant C as Client
	participant MM as matchmaker
	participant M as match

	C->>MM: findMatch()
	alt no open lobby
		MM->>M: create(matchId)
	end
	MM-->>C: {matchId, playerId}
	C->>M: connect(playerId)
	M->>MM: pendingPlayerConnected(matchId, playerId)
	MM-->>M: accepted
	Note over M: lobby countdown -> live
	M-->>C: snapshot + shoot events
	M->>MM: closeMatch(matchId)

Arena

TopicSummary
MatchmakingMode-based fixed-capacity queues (duo, squad, ffa) that build only full matches and pre-assign teams (except FFA).
NetcodeHybrid. Client owns movement plus prediction and smoothing. Server owns team or FFA assignment, projectiles, hit resolution, phase transitions, and scoring.
Tick Rate20 ticks/sec (50ms) with a tighter loop for live team and FFA snapshots.
PhysicsMedium to high intensity; client movement with server validation and server-authoritative combat/entities.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Runs mode queues, builds full matches, assigns teams, and publishes assignments.

  • Actions

    • queueForMatch
    • unqueueForMatch
    • matchCompleted
  • Queues

    • queueForMatch
    • unqueueForMatch
    • matchCompleted
  • State

    • SQLite
    • player_pool
    • matches
    • assignments keyed by connection and player
  • Key: match[matchId]

  • Responsibility: Runs match phases and in-match player/team state for score and win conditions.

  • Actions

    • connect
    • Gameplay actions
  • Queues

    • None
  • State

    • JSON
    • phase
    • players
    • team assignments
    • score and win state

Lifecycle

sequenceDiagram
	participant C as Client
	participant MM as matchmaker
	participant M as match

	C->>MM: queueForMatch(mode)
	Note over MM: enqueue in player_pool
	Note over MM: fill when capacity reached
	MM->>M: create(matchId, assignments)
	Note over MM: persist assignments
	MM-->>C: assignmentReady
	C->>M: connect(playerId)
	Note over M: waiting -> live when all players connect
	M->>MM: matchCompleted(matchId)

IO Style

TopicSummary
MatchmakingOpen-lobby routing to the fullest room below capacity; room counts are heartbeated and new lobbies are auto-created when needed.
NetcodeServer-authoritative with interpolation. Client sends input intents and interpolates. Server owns movement, bounds, room membership, and canonical snapshots.
Tick Rate10 ticks/sec (100ms) with lightweight periodic room snapshots.
PhysicsLow to medium intensity; server-authoritative kinematic movement, escalating to a physics engine only when collisions get complex.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Routes players into the fullest open lobby and tracks reservations and occupancy.

  • Actions

    • findLobby
    • pendingPlayerConnected
    • updateMatch
    • closeMatch
  • Queues

    • findLobby
    • pendingPlayerConnected
    • updateMatch
    • closeMatch
  • State

    • SQLite
    • matches
    • pending_players
    • Occupancy includes pending reservations
  • Key: match[matchId]

  • Responsibility: Runs per-match movement simulation and broadcasts snapshots.

  • Actions

    • connect
    • setInput
  • Queues

    • None
  • State

    • JSON
    • players
    • inputs
    • movement state
    • snapshot cache

Lifecycle

sequenceDiagram
	participant C as Client
	participant MM as matchmaker
	participant M as match

	C->>MM: findLobby()
	alt no open lobby
		MM->>M: create(matchId)
	end
	MM-->>C: {matchId, playerId}
	C->>M: connect(playerId)
	M->>MM: pendingPlayerConnected(matchId, playerId)
	MM-->>M: accepted
	Note over M: fixed tick simulation
	M-->>C: snapshot events
	M->>MM: closeMatch(matchId)

Open World

TopicSummary
MatchmakingClient-driven chunk routing from world coordinates, with nearby chunk windows preloaded via adjacent chunk connections.
NetcodeHybrid for sandbox (client movement with validation) or server-authoritative for MMO-like flows. Server owns chunk routing, persistence, and canonical world state.
Tick Rate10 ticks/sec per chunk actor (100ms), so load scales with active chunks.
PhysicsMedium to high at scale; chunk-local simulation can be server-authoritative (MMO-like) or client movement with server validation (sandbox-like).

Actors

  • Key: chunk[worldId,chunkX,chunkY]
  • Responsibility: Owns chunk-local players, blocks, movement tick, and chunk membership.
  • Actions
    • connect
    • enterChunk
    • addPlayer
    • setInput
    • leaveChunk
    • removePlayer
  • Queues
    • None
  • State
    • JSON
    • connections
    • players
    • blocks scoped to one chunk key

Lifecycle

sequenceDiagram
	participant C as Client
	participant CH as chunk

	Note over C: resolve chunk keys from world position
	loop each visible chunk
		C->>CH: connect(worldId, chunkX, chunkY, playerId)
		Note over CH: store connection metadata
	end
	C->>CH: enterChunk/addPlayer
	loop movement updates
		C->>CH: setInput(...)
		CH-->>C: snapshot
	end
	C->>CH: leaveChunk/removePlayer or disconnect
	Note over CH: remove membership and metadata

Party

TopicSummary
MatchmakingHost-created private party flow using party codes and explicit joins.
NetcodeServer-authoritative (basic logic). Server owns membership, host permissions, and phase transitions.
Tick RateNo continuous tick; updates are event-driven (join, start, finish).
PhysicsLow intensity for lobby-first flows; usually no dedicated physics or indexing unless you add realtime mini-games.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Handles party create/join flow, validates join tickets, and tracks party size.

  • Actions

    • createParty
    • joinParty
    • verifyJoin
    • updatePartySize
    • closeParty
  • Queues

    • createParty
    • joinParty
    • verifyJoin
    • updatePartySize
    • closeParty
  • State

    • SQLite
    • parties
    • join_tickets for party lookup and join validation
  • Key: match[matchId]

  • Responsibility: Owns party members, host role, ready flags, and phase transitions.

  • Actions

    • connect
    • startGame
    • finishGame
  • Queues

    • None
  • State

    • JSON
    • members
    • host
    • ready state
    • phase
    • party events

Lifecycle

Host Flow

sequenceDiagram
	participant H as Host Client
	participant MM as matchmaker
	participant M as match

	H->>MM: createParty()
	MM-->>H: {matchId, partyCode, playerId, joinToken}
	H->>M: connect(playerId, joinToken)
	M->>MM: verifyJoin(...)
	MM-->>M: allowed
	M->>MM: updatePartySize(playerCount)
	H->>M: startGame() / finishGame()
	M->>MM: closeParty(matchId)

Joiner Flow

sequenceDiagram
	participant J as Joiner Client
	participant MM as matchmaker
	participant M as match

	J->>MM: joinParty(partyCode)
	MM-->>J: {matchId, playerId, joinToken}
	J->>M: connect(playerId, joinToken)
	M->>MM: verifyJoin(...)
	MM-->>M: allowed / denied
	M->>MM: updatePartySize(playerCount)

Ranked

TopicSummary
MatchmakingELO-based queue pairing with a widening search window as wait time increases.
NetcodeHybrid. Client owns movement with local prediction and interpolation. Server owns projectiles, hit resolution, match results, and rating updates.
Tick Rate20 ticks/sec (50ms) with fixed live ticks for deterministic pacing and broadcast cadence.
PhysicsMedium to high intensity; client movement with server validation and server-authoritative combat/hit resolution.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Runs rating-based queueing, pairing, assignment persistence, and completion fanout.

  • Actions

    • queueForMatch
    • unqueueForMatch
    • matchCompleted
  • Queues

    • queueForMatch
    • unqueueForMatch
    • matchCompleted
  • State

    • SQLite
    • player_pool
    • matches
    • assignments with rating window and connection scoping
  • Key: match[matchId]

  • Responsibility: Runs ranked match phase, score, and winner reporting.

  • Actions

    • connect
    • Gameplay actions
  • Queues

    • None
  • State

    • JSON
    • phase
    • players
    • score
    • winner
    • completion payload
  • Key: player[username]

  • Responsibility: Stores canonical player MMR and win/loss profile.

  • Actions

    • initialize
    • getRating
    • applyMatchResult
  • Queues

    • None
  • State

    • JSON
    • rating
    • wins
    • losses
    • match counters
  • Key: leaderboard["main"]

  • Responsibility: Stores and serves top-ranked players.

  • Actions

    • updatePlayer
  • Queues

    • None
  • State

    • SQLite
    • Leaderboard score rows
    • Top-list ordering

Lifecycle

sequenceDiagram
	participant C as Client
	participant MM as matchmaker
	participant P as player
	participant M as match
	participant LB as leaderboard

	C->>MM: queueForMatch(username)
	MM->>P: initialize/getRating
	P-->>MM: rating
	Note over MM: store queue row + retry pairing
	MM->>M: create(matchId, assigned players)
	MM-->>C: assignmentReady
	C->>M: connect(username)
	M->>MM: matchCompleted(...)
	MM->>P: applyMatchResult(...)
	MM->>LB: updatePlayer(...)
	Note over MM: remove matches + assignments rows

Turn-Based

TopicSummary
MatchmakingAsync private-invite and public-queue pairing in the same pattern.
NetcodeServer-authoritative (basic logic). Client can draft moves before submit. Server owns turn ownership, committed move log, turn order, and completion state.
Tick RateNo continuous tick; move submission and turn transitions drive updates.
PhysicsVery low intensity; no realtime physics loop, just discrete rules validation. Indexing is optional and mostly for board or query convenience at scale.

Actors

  • Key: matchmaker["main"]

  • Responsibility: Handles private invite and public queue pairing for async matches.

  • Actions

    • createGame
    • joinByCode
    • queueForMatch
    • unqueueForMatch
    • closeMatch
  • Queues

    • createGame
    • joinByCode
    • queueForMatch
    • unqueueForMatch
    • closeMatch
  • State

    • SQLite
    • matches
    • player_pool
    • assignments for invite and queue mapping
  • Key: match[matchId]

  • Responsibility: Owns board state, turn order, move validation, and final result.

  • Actions

    • connect
    • makeMove
  • Queues

    • None
  • State

    • JSON
    • board
    • turns
    • players
    • connection presence
    • result

Lifecycle

Public Queue

sequenceDiagram
	participant A as Client A
	participant B as Client B
	participant MM as matchmaker
	participant M as match

	A->>MM: queueForMatch()
	B->>MM: queueForMatch()
	Note over MM: pair first two queued players
	MM->>M: create(matchId) + seed X/O players
	MM-->>A: assignment/match info
	MM-->>B: assignment/match info
	A->>M: connect(playerId)
	B->>M: connect(playerId)
	A->>M: makeMove()
	B->>M: makeMove()
	opt all players disconnected for timeout
		Note over M: destroy after idle timeout
	end
	M->>MM: closeMatch(matchId)

Private Invite

sequenceDiagram
	participant A as Client A
	participant B as Client B
	participant MM as matchmaker
	participant M as match

	A->>MM: createGame()
	MM-->>A: {matchId, playerId, inviteCode}
	B->>MM: joinByCode(inviteCode)
	MM->>M: create(matchId) + seed X/O players
	MM-->>A: assignment/match info
	MM-->>B: assignment/match info
	A->>M: connect(playerId)
	B->>M: connect(playerId)
	A->>M: makeMove()
	B->>M: makeMove()
	M->>MM: closeMatch(matchId)

Idle

TopicSummary
MatchmakingNo matchmaker; each player uses a direct per-player actor and a shared leaderboard actor.
NetcodeServer-authoritative (basic logic). Client owns UI and build intent. Server owns resources, production rates, building validation, and leaderboard totals.
Tick RateNo continuous tick; use c.schedule.after(...) for coarse intervals and compute offline catch-up from elapsed wall time.
PhysicsNone for standard idle loops; transitions are discrete (build, collect, upgrade) and do not need spatial indexing.

Actors

  • Key: world[playerId]

  • Responsibility: Owns one player's progression, buildings, production scheduling, and state updates.

  • Actions

    • initialize
    • build
    • collectProduction
  • Queues

    • None
  • State

    • JSON
    • Per-player buildings
    • resources
    • timers
    • progression state
  • Key: leaderboard["main"]

  • Responsibility: Stores global scores and serves leaderboard updates.

  • Actions

    • updateScore
  • Queues

    • updateScore
  • State

    • SQLite
    • scores table keyed by player
    • Current leaderboard totals

Lifecycle

sequenceDiagram
	participant C as Client
	participant W as world
	participant LB as leaderboard

	C->>W: getOrCreate(playerId) + initialize()
	Note over W: seed state + schedule collection
	W-->>C: stateUpdate
	loop gameplay loop
		C->>W: build() / collectProduction()
		W->>LB: updateScore(...)
	Note over LB: upsert scores
	LB-->>C: leaderboardUpdate
	W-->>C: stateUpdate
	end

Reference Map

Actors

Cli

Clients

Cookbook

Deploy

General

Self Hosting

rivet-dev의 다른 스킬

rivetkit-actors
rivet-dev
Rivet Actors로 상태 저장형 백엔드 구축: 고성능, 장기 실행, 인메모리, 지속형 프로세스. HTTP, 데이터베이스, 큐의 한계를 넘어설 때 사용하세요.…
official
agent-browser
rivet-dev
웹 테스트, 양식 작성, 스크린샷, 데이터 추출을 위한 브라우저 상호작용을 자동화합니다. 사용자가 웹사이트를 탐색하거나 웹과 상호작용해야 할 때 사용하세요.
official
rivetkit
rivet-dev
AI 에이전트, 멀티플레이어 앱, 워크플로 자동화를 위한 장기 실행 상태 저장 컴퓨팅입니다. 액터는 데이터베이스 왕복 없이 요청 간 상태를 유지하는 영구적인 인메모리 프로세스로, 0에서 수백만 개의 동시 인스턴스까지 자동 확장됩니다. WebSocket 및 이벤트를 통한 내장 실시간 통신, 순서가 지정된 메시지 처리를 위한 내구성 있는 큐, 구조화된 데이터 쿼리를 위한 SQLite를 제공합니다. 상태는 Rivet Cloud 또는 자체 호스팅을 통해 재시작 및 충돌 후에도 유지됩니다...
official
rivetkit-actors
rivet-dev
Rivet Actors로 상태 저장형 백엔드 구축: 고성능, 장기 실행, 인메모리, 지속형 프로세스. HTTP, 데이터베이스, 큐의 한계를 넘어설 때 사용하세요.…
official
rivetkit-client-javascript
rivet-dev
JavaScript 클라이언트로, 무상태 또는 상태 저장 연결을 통해 Rivet Actors에 연결합니다. 브라우저, Node.js 및 Bun 환경을 지원하며, 환경 변수 또는 명시적 구성을 통한 자동 엔드포인트 감지 기능을 제공합니다. 독립적인 요청을 위한 무상태 액션 호출과 실시간 이벤트 구독이 가능한 상태 저장 연결의 두 가지 상호작용 모드를 제공합니다. onRequest 또는 onWebSocket 핸들러를 구현하는 액터를 위한 저수준 HTTP 및 WebSocket 액세스를 포함하며, 복합 배열 기반...
official
rivetkit-client-react
rivet-dev
React 클라이언트로, 훅과 실시간 상태 관리를 통해 Rivet Actors에 연결합니다. createRivetKit()으로 타입이 지정된 훅을 생성하고, useActor()로 키와 선택적 매개변수를 사용하여 액터 인스턴스에 연결합니다. useEvent()로 액터 이벤트를 구독하고, connStatus와 error 상태를 통해 연결 수명 주기를 모니터링합니다. createClient()를 사용하여 상태 비저장 단일 호출, 액터 검색 메서드(get, getOrCreate, create, getForId), 그리고 저수준 HTTP/WebSocket 액세스를 수행합니다. 복합 배열 키를 지원합니다...
official
rivetkit-client-swift
rivet-dev
Swift 클라이언트로, 무상태 및 상태 저장 연결 모드를 통해 Rivet Actors에 연결합니다. 무상태 액션 호출과 AsyncStream을 통한 실시간 이벤트 스트리밍이 가능한 지속적 WebSocket 연결을 지원합니다. 0~5개의 위치 인수를 사용한 타입화된 액션 호출과 더 많은 인수에 대한 원시 JSON 폴백을 제공합니다. 상태 변경, 오류, 열림, 닫힘 스트림을 통한 연결 수명 주기 모니터링을 포함합니다. 커스텀 onRequest 및...을 위한 저수준 HTTP 및 WebSocket 접근을 지원합니다.
official
rivetkit-client-swiftui
rivet-dev
SwiftUI 클라이언트 라이브러리로, 반응형 바인딩 및 이벤트 스트리밍을 통해 Rivet Actors에 연결합니다. 연결 수명 주기 관리를 위한 get-or-create 의미 체계의 @Actor 프로퍼티 래퍼와 환경 설정 및 이벤트 구독을 위한 뷰 모디파이어를 제공합니다. 타입화된 비동기 액션, fire-and-forget 전송, 0–5개의 타입화된 인수를 가진 AsyncStream 이벤트 구독을 지원합니다. 연결 상태 추적, ActorError를 통한 오류 처리, 계층적 액터를 위한 복합 키 지원을 포함합니다...
official