接入ResLogin.otherPlayers

This commit is contained in:
janing
2025-12-18 16:04:56 +08:00
parent 03276fe1f6
commit 8f58b890be
21 changed files with 861 additions and 87 deletions

View File

@@ -11,7 +11,7 @@ export interface MsgPlayerJoin {
/** 玩家昵称 */
playerName: string;
/** 玩家位置 */
/** 玩家位置客户端坐标放大1000倍后的整数 */
position: Position;
/** 是否新玩家 */

View File

@@ -11,7 +11,7 @@ export interface MsgPlayerMove {
/** 玩家昵称 */
playerName: string;
/** 移动后的位置 */
/** 移动后的位置客户端坐标放大1000倍后的整数 */
position: Position;
/** 移动时间戳 */

View File

@@ -2,9 +2,9 @@
* 移动请求消息
*/
export interface MsgReqMove {
/** X坐标 */
/** X坐标放大1000倍后取整服务器内部除以1000作为实际坐标 */
x: number;
/** Y坐标 */
/** Y坐标放大1000倍后取整服务器内部除以1000作为实际坐标 */
y: number;
}

View File

@@ -10,10 +10,10 @@ export interface PlayerInfo {
/** 玩家昵称 */
name: string;
/** 当前位置 */
/** 当前位置客户端坐标放大1000倍后的整数 */
position: Position;
/** 出生点 */
/** 出生点客户端坐标放大1000倍后的整数 */
spawnPoint: Position;
/** 当前生命值 */
@@ -47,4 +47,7 @@ export interface MsgResLogin {
/** 是否新玩家 */
isNewPlayer?: boolean;
/** 房间内其他在线玩家信息 */
otherPlayers?: PlayerInfo[];
}

View File

@@ -10,6 +10,6 @@ export interface MsgResMove {
/** 消息 */
message: string;
/** 新位置(成功时返回) */
/** 新位置(成功时返回客户端坐标放大1000倍后的整数 */
position?: Position;
}

View File

@@ -15,7 +15,7 @@ export interface BaseMessage {
}
/**
* 位置坐标
* 位置坐标客户端使用放大1000倍后的整数坐标
*/
export interface Position {
x: number;

View File

@@ -27,7 +27,7 @@ export interface ServiceType {
}
export const serviceProto: ServiceProto<ServiceType> = {
"version": 5,
"version": 6,
"services": [
{
"id": 0,
@@ -273,6 +273,18 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": "Boolean"
},
"optional": true
},
{
"id": 4,
"name": "otherPlayers",
"type": {
"type": "Array",
"elementType": {
"type": "Reference",
"target": "MsgResLogin/PlayerInfo"
}
},
"optional": true
}
]
},