devwinsoft/devian/11-game-client-ts

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install devwinsoft/devian/11-game-client-ts

SKILL.md

11-game-client-ts — Game Protocol TS 클라이언트 예제

Status: ACTIVE AppliesTo: v10 Type: GUIDE


Scope / Purpose

Game protocol 기반 TypeScript 클라이언트 예제.

Devian 네트워크 클라이언트 조립 방식과 ClientRuntime 사용법을 보여준다.


경로 SSOT

구분경로
Clientframework-ts/apps/GameClient/

핵심 조립 포인트

typescript
import WebSocket from 'ws';
import { NetworkClient } from '@devian/core';
import { createClientRuntime } from '@devian/protocol-game/client-runtime';
// 1. Runtime 생성 (stub + proxy factory 반환)
const { runtime, game2CStub, c2GameProxyFactory } = createClientRuntime();
// 2. Unknown opcode 핸들러 등록 (선택)
runtime.setUnknownInboundOpcode(async (e) => {
console.warn(`Unknown opcode=${e.opcode}`);
});
// 3. WebSocket 연결
const ws = new WebSocket(WS_URL);
// 4. NetworkClient 생성
const client = new NetworkClient(runtime, {
sessionId: 0,
onError: (err) => console.error(err),
});
// 5. Inbound 핸들러 등록 (Game2C)
game2CStub.onPong((sessionId, msg) => { ... });
// 6. Outbound Proxy 생성 (C2Game)
const sendFn = (sessionId: number, frame: Uint8Array) => ws.send(frame);
const c2GameProxy = c2GameProxyFactory(sendFn);
// 7. 메시지 수신 위임
ws.on('message', (raw) => client.onWsMessage(raw));
// 8. 메시지 전송
c2GameProxy.sendPing(0, { timestamp: BigInt(Date.now()), payload: 'hello' });

코덱 전환 (USE_JSON)

typescript
import { defaultCodec as jsonCodec } from '@devian/core';
// false = Protobuf (default), true = Json
const USE_JSON = false;
const { runtime, ... } = USE_JSON ? createClientRuntime(jsonCodec) : createClientRuntime();
  • 기본값: Protobuf (바이너리, 성능 우선)
  • Json 옵션: 디버깅/테스트용

실행 방법

bash
# 서버가 실행 중이어야 함
npm -w GameClient run start

설정

항목기본값비고
URLws://localhost:8080WS_URL 환경변수로 변경 가능
Unknown opcode로깅만runtime.setUnknownInboundOpcode 훅

Related

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/devwinsoft/devian/11-game-client-ts/badge)](https://verified-skill.com/skills/devwinsoft/devian/11-game-client-ts)

Something wrong with this skill or its page? Tell us.