@@ -283,6 +283,7 @@ private ServerPing getPingInfo(String motd, int protocol)
283
283
public void handle (StatusRequest statusRequest ) throws Exception
284
284
{
285
285
Preconditions .checkState ( thisState == State .STATUS , "Not expecting STATUS" );
286
+ thisState = null ; // don't accept multiple status requests and set state to ping in async event callback
286
287
287
288
ServerInfo forced = AbstractReconnectHandler .getForcedHost ( this );
288
289
final String motd = ( forced != null ) ? forced .getMotd () : listener .getMotd ();
@@ -306,10 +307,7 @@ public void done(ProxyPingEvent pingResult, Throwable error)
306
307
{
307
308
Gson gson = PingHandler .gson ;
308
309
unsafe .sendPacket ( new StatusResponse ( gson .toJson ( pingResult .getResponse () ) ) );
309
- if ( bungee .getConnectionThrottle () != null )
310
- {
311
- bungee .getConnectionThrottle ().unthrottle ( getSocketAddress () );
312
- }
310
+ thisState = State .PING ;
313
311
}
314
312
};
315
313
@@ -324,8 +322,6 @@ public void done(ProxyPingEvent pingResult, Throwable error)
324
322
{
325
323
pingBack .done ( getPingInfo ( motd , protocol ), null );
326
324
}
327
-
328
- thisState = State .PING ;
329
325
}
330
326
331
327
@ Override
@@ -334,6 +330,10 @@ public void handle(PingPacket ping) throws Exception
334
330
Preconditions .checkState ( thisState == State .PING , "Not expecting PING" );
335
331
unsafe .sendPacket ( ping );
336
332
disconnect ( "" );
333
+ if ( bungee .getConnectionThrottle () != null )
334
+ {
335
+ bungee .getConnectionThrottle ().unthrottle ( getSocketAddress () );
336
+ }
337
337
}
338
338
339
339
@ Override
0 commit comments