feat(network): 基于 TSRPC 的网络同步模块 (#318)
- network-protocols: 共享协议包,使用 TSRPC CLI 生成完整类型验证 - network: 浏览器客户端,提供 NetworkPlugin、NetworkService 和同步系统 - network-server: Node.js 服务端,提供 GameServer 和房间管理
This commit is contained in:
19
packages/network-protocols/src/shared/protocols/MsgSpawn.ts
Normal file
19
packages/network-protocols/src/shared/protocols/MsgSpawn.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 生成实体消息
|
||||
* Spawn entity message
|
||||
*/
|
||||
|
||||
import type { Vec2 } from './types';
|
||||
|
||||
export interface MsgSpawn {
|
||||
/** 网络 ID | Network ID */
|
||||
netId: number;
|
||||
/** 所有者客户端 ID | Owner client ID */
|
||||
ownerId: number;
|
||||
/** 预制体类型 | Prefab type */
|
||||
prefab: string;
|
||||
/** 初始位置 | Initial position */
|
||||
pos: Vec2;
|
||||
/** 初始旋转 | Initial rotation */
|
||||
rot: number;
|
||||
}
|
||||
Reference in New Issue
Block a user