62 lines
1014 B
TypeScript
62 lines
1014 B
TypeScript
|
|
import { Position } from './base';
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 登录请求
|
|||
|
|
*/
|
|||
|
|
export interface ReqLogin {
|
|||
|
|
/** 玩家ID(用于识别玩家) */
|
|||
|
|
playerId: string;
|
|||
|
|
|
|||
|
|
/** 玩家昵称(可选,新玩家时使用) */
|
|||
|
|
playerName?: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 玩家角色信息
|
|||
|
|
*/
|
|||
|
|
export interface PlayerInfo {
|
|||
|
|
/** 玩家ID */
|
|||
|
|
id: string;
|
|||
|
|
|
|||
|
|
/** 玩家昵称 */
|
|||
|
|
name: string;
|
|||
|
|
|
|||
|
|
/** 当前位置 */
|
|||
|
|
position: Position;
|
|||
|
|
|
|||
|
|
/** 出生点 */
|
|||
|
|
spawnPoint: Position;
|
|||
|
|
|
|||
|
|
/** 当前生命值 */
|
|||
|
|
hp: number;
|
|||
|
|
|
|||
|
|
/** 最大生命值 */
|
|||
|
|
maxHp: number;
|
|||
|
|
|
|||
|
|
/** 是否存活 */
|
|||
|
|
isAlive: boolean;
|
|||
|
|
|
|||
|
|
/** 创建时间 */
|
|||
|
|
createdAt: number;
|
|||
|
|
|
|||
|
|
/** 最后登录时间 */
|
|||
|
|
lastLoginAt: number;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 登录响应
|
|||
|
|
*/
|
|||
|
|
export interface ResLogin {
|
|||
|
|
/** 是否成功 */
|
|||
|
|
success: boolean;
|
|||
|
|
|
|||
|
|
/** 消息 */
|
|||
|
|
message: string;
|
|||
|
|
|
|||
|
|
/** 玩家信息 */
|
|||
|
|
player?: PlayerInfo;
|
|||
|
|
|
|||
|
|
/** 是否新玩家 */
|
|||
|
|
isNewPlayer?: boolean;
|
|||
|
|
}
|