You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
🆙 Added disconnects through Cloudflare fix
Thanks to Cyb3rBlu3
This commit is contained in:
@@ -140,6 +140,7 @@ public final class Emulator {
|
|||||||
Emulator.gameEnvironment.load();
|
Emulator.gameEnvironment.load();
|
||||||
Emulator.gameServer.initializePipeline();
|
Emulator.gameServer.initializePipeline();
|
||||||
Emulator.gameServer.connect();
|
Emulator.gameServer.connect();
|
||||||
|
Emulator.getGameServer().getGameClientManager().CFKeepAlive();
|
||||||
Emulator.rconServer.initializePipeline();
|
Emulator.rconServer.initializePipeline();
|
||||||
Emulator.rconServer.connect();
|
Emulator.rconServer.connect();
|
||||||
Emulator.badgeImager = new BadgeImager();
|
Emulator.badgeImager = new BadgeImager();
|
||||||
|
|||||||
@@ -107,6 +107,12 @@ public class GameClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendKeepAlive() {
|
||||||
|
if (this.channel != null && this.channel.isOpen()) {
|
||||||
|
this.channel.writeAndFlush(new ServerMessage(-1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
try {
|
try {
|
||||||
this.channel.close();
|
this.channel.close();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.eu.habbo.habbohotel.gameclients;
|
package com.eu.habbo.habbohotel.gameclients;
|
||||||
|
|
||||||
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import com.eu.habbo.messages.outgoing.MessageComposer;
|
import com.eu.habbo.messages.outgoing.MessageComposer;
|
||||||
@@ -162,4 +163,15 @@ public class GameClientManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CFKeepAlive() {
|
||||||
|
Emulator.getThreading().run(() -> {
|
||||||
|
for (GameClient client : this.clients.values()) {
|
||||||
|
if (client != null && client.getChannel().isActive()) {
|
||||||
|
client.sendKeepAlive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CFKeepAlive();
|
||||||
|
}, 30000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user