update tsrpc-browser

This commit is contained in:
k8w 2021-12-03 13:59:00 +08:00
parent 906c355348
commit 5c588ea56e
3 changed files with 4 additions and 9 deletions

View File

@ -164,6 +164,6 @@ export class GameScene extends Component {
// 显示坐标 —> 逻辑坐标
targetPos: { x: targetPos.x, y: targetPos.y },
targetTime: this.gameManager.state.now + gameConfig.arrowFlyTime
})
} as any)
}
}

View File

@ -23,7 +23,7 @@ export class GameManager {
let client = this.client = new WsClient(serviceProto, {
server: `ws://${location.hostname}:3000`,
json: true,
logger: console
// logger: console
});;
client.listenMsg('server/Frame', msg => { this._onServerSync(msg) });
@ -96,18 +96,12 @@ export class GameManager {
return;
}
console.log('sendClientInput', input, this.state.now);
let msg: MsgClientInput = {
sn: ++this.lastSN,
inputs: [input]
}
this.pendingInputMsgs.push(msg);
this.client.sendMsg('client/ClientInput', msg).then(v => {
if (!v.isSucc) {
console.error('xxxxxxxxxxxxxx', msg, v)
}
});
this.client.sendMsg('client/ClientInput', msg);
// 预测
this.gameSystem.applyInput({

View File

@ -7,6 +7,7 @@
"version": "3.3.2"
},
"dependencies": {
"tsrpc-base-client": "^1.2.3",
"tsrpc-browser": "^3.1.3"
}
}