diff --git a/src/main/java/net/krakatoaapi/KrakatoaAPI.java b/src/main/java/net/krakatoaapi/KrakatoaAPI.java index 97bd3a3..0f10134 100755 --- a/src/main/java/net/krakatoaapi/KrakatoaAPI.java +++ b/src/main/java/net/krakatoaapi/KrakatoaAPI.java @@ -14,11 +14,6 @@ import earth.krakatoa.core.config.RedisConfig; import earth.krakatoa.core.mongo.MongoManager; import earth.krakatoa.core.redis.RedisManager; 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 net.krakatoaapi.command.KrakataoCommand; import net.krakatoaapi.config.ConfigHandler; @@ -30,6 +25,12 @@ import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.plugin.PluginManager; 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 public class KrakatoaAPI extends JavaPlugin { @@ -63,31 +64,33 @@ public class KrakatoaAPI extends JavaPlugin { this.kraSocketClientProtocol = new KraSocketClientProtocol(); KraSocketClientConfig kraSocketClientConfig = new KraSocketClientConfig( - this.configHandler.getWebSocketProtocol(), this.configHandler.getWebSocketHost(), - this.configHandler.getWebSocketPort(), this.configHandler.getWebSocketAccessKey(), - CloudNetDriver.getInstance().getComponentName(), - this.configHandler.getWebSocketAckTimeouts()); + this.configHandler.getWebSocketProtocol(), this.configHandler.getWebSocketHost(), + this.configHandler.getWebSocketPort(), this.configHandler.getWebSocketAccessKey(), + CloudNetDriver.getInstance().getComponentName(), + this.configHandler.getWebSocketAckTimeouts()); this.kraSocketClientEventInitiater = new KraSocketClientEventInitiater(); this.kraSocketClientEventInterface = new SocketClientMessageListener(); try { this.kraSocketClient = new KraSocketClient(kraSocketClientConfig, - this.kraSocketClientEventInterface, this.kraSocketClientProtocol); + this.kraSocketClientEventInterface, this.kraSocketClientProtocol); } catch (URISyntaxException e) { e.printStackTrace(); } this.kraSocketClient.getSocketClient().connect(); + this.getLogger().info("testaa"); + this.mongoManager = new MongoManager(new MongoConfig(this.configHandler.getMongodbHost(), - this.configHandler.getMongodbPort(), this.configHandler.getMongodbUsername(), - this.configHandler.getMongodbPassword(), - this.configHandler.getMongodbDatabase())); + this.configHandler.getMongodbPort(), this.configHandler.getMongodbUsername(), + this.configHandler.getMongodbPassword(), + this.configHandler.getMongodbDatabase())); this.mongoManager.connect(); this.redisManager = new RedisManager( - new RedisConfig(this.configHandler.getRedisHost(), this.getConfigHandler().getRedisPort())); + new RedisConfig(this.configHandler.getRedisHost(), this.getConfigHandler().getRedisPort())); this.redisManager.connect(); 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 Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> { KraSocketClientProtocolMessage kraSocketClientProtocolMessage = new KraSocketClientProtocolMessage( - KraSocketClientProtocolStatus.SEND.getStatus(), 0, - KraSocketClientProtocolDest.PROXY.getStatus(), - UUID.fromString("c7b023ac-0303-4275-923d-3a1028e887a0"), - (short) 59739, - CloudNetDriver.getInstance().getComponentName(), null); + KraSocketClientProtocolStatus.SEND.getStatus(), 0, + KraSocketClientProtocolDest.PROXY.getStatus(), + UUID.fromString("c7b023ac-0303-4275-923d-3a1028e887a0"), + (short) 59739, + CloudNetDriver.getInstance().getComponentName(), null); this.kraSocketClient.getSocketClient().SendMessage(kraSocketClientProtocolMessage); }, 3 * 20);