From 0cc8fd818614a8836f35255c185975872bce797f Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Tue, 19 Sep 2023 12:41:45 +0800 Subject: [PATCH] =?UTF-8?q?other:=20gateway=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91=EF=BC=8C=E9=80=82=E9=85=8D=20client?= =?UTF-8?q?.Client=20=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gateway/endpoint.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/gateway/endpoint.go b/server/gateway/endpoint.go index c5376a1..a93d8d0 100644 --- a/server/gateway/endpoint.go +++ b/server/gateway/endpoint.go @@ -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 } }