debug msg
parent
6db503c240
commit
ea1f9801d8
|
@ -14,11 +14,6 @@ import earth.krakatoa.core.config.RedisConfig;
|
||||||
import earth.krakatoa.core.mongo.MongoManager;
|
import earth.krakatoa.core.mongo.MongoManager;
|
||||||
import earth.krakatoa.core.redis.RedisManager;
|
import earth.krakatoa.core.redis.RedisManager;
|
||||||
import earth.krakatoa.core.util.Formatter;
|
import earth.krakatoa.core.util.Formatter;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.krakatoaapi.command.KrakataoCommand;
|
import net.krakatoaapi.command.KrakataoCommand;
|
||||||
import net.krakatoaapi.config.ConfigHandler;
|
import net.krakatoaapi.config.ConfigHandler;
|
||||||
|
@ -30,6 +25,12 @@ import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public class KrakatoaAPI extends JavaPlugin {
|
public class KrakatoaAPI extends JavaPlugin {
|
||||||
|
|
||||||
|
@ -63,31 +64,33 @@ public class KrakatoaAPI extends JavaPlugin {
|
||||||
this.kraSocketClientProtocol = new KraSocketClientProtocol();
|
this.kraSocketClientProtocol = new KraSocketClientProtocol();
|
||||||
|
|
||||||
KraSocketClientConfig kraSocketClientConfig = new KraSocketClientConfig(
|
KraSocketClientConfig kraSocketClientConfig = new KraSocketClientConfig(
|
||||||
this.configHandler.getWebSocketProtocol(), this.configHandler.getWebSocketHost(),
|
this.configHandler.getWebSocketProtocol(), this.configHandler.getWebSocketHost(),
|
||||||
this.configHandler.getWebSocketPort(), this.configHandler.getWebSocketAccessKey(),
|
this.configHandler.getWebSocketPort(), this.configHandler.getWebSocketAccessKey(),
|
||||||
CloudNetDriver.getInstance().getComponentName(),
|
CloudNetDriver.getInstance().getComponentName(),
|
||||||
this.configHandler.getWebSocketAckTimeouts());
|
this.configHandler.getWebSocketAckTimeouts());
|
||||||
|
|
||||||
this.kraSocketClientEventInitiater = new KraSocketClientEventInitiater();
|
this.kraSocketClientEventInitiater = new KraSocketClientEventInitiater();
|
||||||
this.kraSocketClientEventInterface = new SocketClientMessageListener();
|
this.kraSocketClientEventInterface = new SocketClientMessageListener();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.kraSocketClient = new KraSocketClient(kraSocketClientConfig,
|
this.kraSocketClient = new KraSocketClient(kraSocketClientConfig,
|
||||||
this.kraSocketClientEventInterface, this.kraSocketClientProtocol);
|
this.kraSocketClientEventInterface, this.kraSocketClientProtocol);
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.kraSocketClient.getSocketClient().connect();
|
this.kraSocketClient.getSocketClient().connect();
|
||||||
|
|
||||||
|
this.getLogger().info("testaa");
|
||||||
|
|
||||||
this.mongoManager = new MongoManager(new MongoConfig(this.configHandler.getMongodbHost(),
|
this.mongoManager = new MongoManager(new MongoConfig(this.configHandler.getMongodbHost(),
|
||||||
this.configHandler.getMongodbPort(), this.configHandler.getMongodbUsername(),
|
this.configHandler.getMongodbPort(), this.configHandler.getMongodbUsername(),
|
||||||
this.configHandler.getMongodbPassword(),
|
this.configHandler.getMongodbPassword(),
|
||||||
this.configHandler.getMongodbDatabase()));
|
this.configHandler.getMongodbDatabase()));
|
||||||
this.mongoManager.connect();
|
this.mongoManager.connect();
|
||||||
|
|
||||||
this.redisManager = new RedisManager(
|
this.redisManager = new RedisManager(
|
||||||
new RedisConfig(this.configHandler.getRedisHost(), this.getConfigHandler().getRedisPort()));
|
new RedisConfig(this.configHandler.getRedisHost(), this.getConfigHandler().getRedisPort()));
|
||||||
this.redisManager.connect();
|
this.redisManager.connect();
|
||||||
|
|
||||||
this.formatter = new Formatter();
|
this.formatter = new Formatter();
|
||||||
|
@ -98,11 +101,11 @@ public class KrakatoaAPI extends JavaPlugin {
|
||||||
// call to proxy that the server is only for the auto restart system
|
// call to proxy that the server is only for the auto restart system
|
||||||
Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> {
|
Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> {
|
||||||
KraSocketClientProtocolMessage kraSocketClientProtocolMessage = new KraSocketClientProtocolMessage(
|
KraSocketClientProtocolMessage kraSocketClientProtocolMessage = new KraSocketClientProtocolMessage(
|
||||||
KraSocketClientProtocolStatus.SEND.getStatus(), 0,
|
KraSocketClientProtocolStatus.SEND.getStatus(), 0,
|
||||||
KraSocketClientProtocolDest.PROXY.getStatus(),
|
KraSocketClientProtocolDest.PROXY.getStatus(),
|
||||||
UUID.fromString("c7b023ac-0303-4275-923d-3a1028e887a0"),
|
UUID.fromString("c7b023ac-0303-4275-923d-3a1028e887a0"),
|
||||||
(short) 59739,
|
(short) 59739,
|
||||||
CloudNetDriver.getInstance().getComponentName(), null);
|
CloudNetDriver.getInstance().getComponentName(), null);
|
||||||
|
|
||||||
this.kraSocketClient.getSocketClient().SendMessage(kraSocketClientProtocolMessage);
|
this.kraSocketClient.getSocketClient().SendMessage(kraSocketClientProtocolMessage);
|
||||||
}, 3 * 20);
|
}, 3 * 20);
|
||||||
|
|
Loading…
Reference in New Issue