Commit bf018d46 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 55ebbadc
Pipeline #16081 passed with stages
in 38 seconds
...@@ -39,19 +39,17 @@ export class Router { ...@@ -39,19 +39,17 @@ export class Router {
} }
onMessage(socket: Socket, data: Report) { onMessage(socket: Socket, data: Report) {
// 客户端重启 if (data.ack == this.seq + 1) {
if (data.ack === 0) { this.time = Date.now();
if (data.peers) this.peers = data.peers;
if (Router.updating === this) Router.updating = undefined;
} else if (data.ack === 0) { // 客户端重启
this.reset(); this.reset();
this.time = Date.now(); this.time = Date.now();
this.send(socket, {}, {}); this.send(socket, {}, {});
// 服务器重启或客户端下线 } else if (this.seq == 0) { // 服务器重启或客户端下线
} else if (this.seq == 0) {
this.time = Date.now(); this.time = Date.now();
this.send(socket, {}, {}); this.send(socket, {}, {});
} else if (data.ack == this.seq + 1) {
this.time = Date.now();
if (data.peers) this.peers = data.peers;
if (Router.updating === this) Router.updating = undefined;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment