other: gateway 优化代码逻辑,适配 client.Client 变更
This commit is contained in:
parent
3ad1330cd9
commit
0cc8fd8186
|
@ -128,12 +128,10 @@ func (slf *Endpoint) Forward(conn *server.Conn, packet []byte, callback ...func(
|
|||
}
|
||||
|
||||
var superior *client.Client
|
||||
var superiorCount = -1
|
||||
for _, cli := range slf.client {
|
||||
count := cli.GetMessageAccumulationTotal()
|
||||
if superiorCount < 0 || superiorCount > count {
|
||||
if cli.IsConnected() {
|
||||
superior = cli
|
||||
superiorCount = count
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue