Files
rougelike-demo/client/assets/scripts/Shared/protocols/PtlLogin.ts
2025-12-14 22:38:09 +08:00

62 lines
1014 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}