4
4
import org .wowtools .hppt .common .server .LoginClientService ;
5
5
import org .wowtools .hppt .common .server .ServerSessionManager ;
6
6
import org .wowtools .hppt .common .server .ServerTalker ;
7
- import org .wowtools .hppt .common .util .BytesUtil ;
8
7
import org .wowtools .hppt .common .util .GridAesCipherUtil ;
9
8
import org .wowtools .hppt .run .ss .pojo .SsConfig ;
10
9
import org .wowtools .hppt .run .ss .util .SsUtil ;
@@ -27,7 +26,6 @@ private final class ClientCell {
27
26
LoginClientService .Client client ;
28
27
volatile boolean running = true ;
29
28
volatile boolean actived = true ;
30
- final String reConnectToken = UUID .randomUUID ().toString ();
31
29
32
30
CTX ctx ;
33
31
final LoginClientService .ClientActiveWatcher clientActiveWatcher = new LoginClientService .ClientActiveWatcher () {
@@ -133,36 +131,6 @@ public void receiveClientBytes(CTX ctx, byte[] bytes) {
133
131
login = GridAesCipherUtil .encrypt (login );
134
132
sendBytesToClient (ctx , login );
135
133
break ;
136
- case "reConnect" :
137
- byte [] base64Bytes = BytesUtil .base642bytes (cmd [1 ]);
138
- ClientCell currentClientCell = null ;
139
- for (Map .Entry <CTX , ClientCell > entry : ctxClientCellMap .entrySet ()) {
140
- ClientCell clientCell1 = entry .getValue ();
141
- try {
142
- byte [] decryptBytes = clientCell1 .client .aesCipherUtil .descriptor .decrypt (base64Bytes );
143
- String [] codes = new String (decryptBytes , StandardCharsets .UTF_8 ).split (" " , 2 );
144
- String reConnectCode = codes [0 ];
145
- if (!clientCell1 .reConnectToken .equals (reConnectCode )) {
146
- log .info ("重连token不匹配" );
147
- continue ;
148
- }
149
- long st = Long .valueOf (codes [1 ]);
150
- long now = System .currentTimeMillis ();
151
- if (Math .abs (now - st ) > 60000 ) {
152
- log .info ("重连时差过大 st {} now {}" , st , now );
153
- continue ;
154
- }
155
- } catch (Exception e ) {
156
- continue ;
157
- }
158
- currentClientCell = clientCell1 ;
159
- break ;
160
- }
161
- if (currentClientCell != null ) {
162
- ctxClientCellMap .put (ctx , currentClientCell );
163
- log .info ("客户端重连成功 {}" , currentClientCell .client .clientId );
164
- }
165
- break ;
166
134
default :
167
135
log .warn ("未知命令 {} " , s );
168
136
removeCtx (ctx );
0 commit comments