Zond:fix: стабилизация работы модуля в целом
This commit is contained in:
@@ -25,6 +25,7 @@ public class BridgePlugin extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
this.bridgeBukkit.sendCorrectShutdownPacket();
|
||||
this.bridgeBukkit.setNeedReconnect(false);
|
||||
this.bridgeBukkit.stopPing();
|
||||
this.bridgeBukkit.stopReconnect();
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package asys.bridge.client;
|
||||
|
||||
import asys.bridge.bukkit.TaskTicker;
|
||||
import asys.mcsmanager.packets.CS_CorrectShutdown;
|
||||
import asys.mcsmanager.packets.CS_Ping;
|
||||
import io.netty.channel.Channel;
|
||||
|
||||
public abstract class AbstractBridge implements IBridge {
|
||||
private Client client;
|
||||
@@ -39,6 +39,13 @@ public abstract class AbstractBridge implements IBridge {
|
||||
this.needReconnect = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCorrectShutdownPacket() {
|
||||
if (client != null && client.isConnected()) {
|
||||
client.sendPacket(new CS_CorrectShutdown());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopReconnect() {
|
||||
if (connectTicker != null) {
|
||||
|
||||
@@ -21,7 +21,8 @@ public class ClientPacketHandler extends ChannelInboundHandlerAdapter implements
|
||||
|
||||
private static final BiMap<Integer, Class<? extends Packet>> knownPackets = ImmutableBiMap.of(
|
||||
3, CS_Ping.class,
|
||||
5, SC_Command.class
|
||||
5, SC_Command.class,
|
||||
6, CS_CorrectShutdown.class
|
||||
);
|
||||
private IBridge bridge;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ public interface IBridge {
|
||||
void startReconnect();
|
||||
boolean isNeedReconnect();
|
||||
void setNeedReconnect(boolean value);
|
||||
void sendCorrectShutdownPacket();
|
||||
void stopReconnect();
|
||||
void startPing();
|
||||
void stopPing();
|
||||
|
||||
Reference in New Issue
Block a user