File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
src/main/java/com/tvd12/ezyfoxserver/client/handler Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 1111
1212 <artifactId >ezyfox-server-java-client</artifactId >
1313
14- <version >1.1.4 </version >
14+ <version >1.1.5 </version >
1515 <name >ezyfox-server-java-client</name >
1616 <url >https://youngmonkeys.org/</url >
1717
Original file line number Diff line number Diff line change @@ -22,15 +22,22 @@ public final void handle(EzyConnectionFailureEvent event) {
2222 client .setStatus (EzyConnectionStatus .FAILURE );
2323 if (mustReconnect )
2424 reconnecting = client .reconnect ();
25- if (! reconnecting ) {
26- control (event );
25+ if (reconnecting ) {
26+ onReconnecting (event );
2727 }
28+ else {
29+ onConnectionFailed (event );
30+ }
31+ postHandle (event );
2832 }
2933
3034 protected boolean shouldReconnect (EzyConnectionFailureEvent event ) {
3135 return true ;
3236 }
3337
34- protected void control (EzyConnectionFailureEvent event ) {
35- }
38+ protected void onReconnecting (EzyConnectionFailureEvent event ) {}
39+
40+ protected void onConnectionFailed (EzyConnectionFailureEvent event ) {}
41+
42+ protected void postHandle (EzyConnectionFailureEvent event ) {}
3643}
Original file line number Diff line number Diff line change @@ -30,13 +30,21 @@ public final void handle(EzyDisconnectionEvent event) {
3030 client .setUdpStatus (EzyConnectionStatus .DISCONNECTED );
3131 if (mustReconnect )
3232 reconnecting = client .reconnect ();
33- if (!reconnecting ) {
34- control (event );
33+ if (reconnecting ) {
34+ onReconnecting (event );
35+ }
36+ else {
37+ onDisconnected (event );
3538 }
3639 postHandle (event );
3740 }
3841
3942 protected void preHandle (EzyDisconnectionEvent event ) {}
43+
44+ protected void onReconnecting (EzyDisconnectionEvent event ) {}
45+
46+ protected void onDisconnected (EzyDisconnectionEvent event ) {}
47+
4048 protected void postHandle (EzyDisconnectionEvent event ) {}
4149
4250 protected boolean shouldReconnect (EzyDisconnectionEvent event ) {
@@ -45,6 +53,4 @@ protected boolean shouldReconnect(EzyDisconnectionEvent event) {
4553 return false ;
4654 return true ;
4755 }
48-
49- protected void control (EzyDisconnectionEvent event ) {}
5056}
You can’t perform that action at this time.
0 commit comments