Files
rougelike-demo/client/assets/scripts/Shared/protocols/MsgResLogin.ts
2025-12-18 16:04:56 +08:00

53 lines
999 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 PlayerInfo {
/** 玩家ID */
id: string;
/** 玩家昵称 */
name: string;
/** 当前位置客户端坐标放大1000倍后的整数 */
position: Position;
/** 出生点客户端坐标放大1000倍后的整数 */
spawnPoint: Position;
/** 当前生命值 */
hp: number;
/** 最大生命值 */
maxHp: number;
/** 是否存活 */
isAlive: boolean;
/** 创建时间 */
createdAt: number;
/** 最后登录时间 */
lastLoginAt: number;
}
/**
* 登录响应消息
*/
export interface MsgResLogin {
/** 是否成功 */
success: boolean;
/** 消息 */
message: string;
/** 玩家信息 */
player?: PlayerInfo;
/** 是否新玩家 */
isNewPlayer?: boolean;
/** 房间内其他在线玩家信息 */
otherPlayers?: PlayerInfo[];
}