update tsrpc-browser
This commit is contained in:
parent
906c355348
commit
5c588ea56e
@ -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)
|
||||
}
|
||||
}
|
@ -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({
|
||||
|
@ -7,6 +7,7 @@
|
||||
"version": "3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"tsrpc-base-client": "^1.2.3",
|
||||
"tsrpc-browser": "^3.1.3"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user