From 5db8688a1efde727c6c4aa4df25532d65151b215 Mon Sep 17 00:00:00 2001 From: joethei Date: Sun, 4 Jun 2017 13:36:38 +0200 Subject: [PATCH] + new way to get information about other servers in the network ~ refactoring --- .gitlab-ci.yml | 2 +- Commons.iml | 5 ++ pom.xml | 17 ++++++ .../java/eu/univento/commons/Commons.java | 2 +- .../commons/database/DatabaseManager.java | 2 - .../eu/univento/commons/database/MongoDB.java | 1 - .../eu/univento/commons/helpers/Location.java | 27 +-------- .../commons/logging/LoggingHandler.java | 37 ++----------- .../commons/messaging/MessageHandler.java | 16 +++--- .../commons/messaging/MessagingManager.java | 17 +++++- .../univento/commons/messaging/RabbitMQ.java | 4 +- .../commons/player/DatabasePlayer.java | 55 +++++++------------ .../commons/player/language/Language.java | 12 ++-- .../player/settings/PlayerSettings.java | 2 - .../commons/player/uuid/NameFetcher.java | 9 +-- .../univento/commons/server/ServerInfo.java | 46 ++++++++++++++++ .../univento/commons/server/ServerType.java | 33 +++++------ src/main/main.iml | 12 ++++ src/main/resources/config.properties | 5 +- src/test/test.iml | 13 +++++ 20 files changed, 176 insertions(+), 141 deletions(-) create mode 100644 src/main/java/eu/univento/commons/server/ServerInfo.java create mode 100644 src/main/main.iml create mode 100644 src/test/test.iml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60e4aad..b5adfa0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: maven:3-jdk-8 build: - script: "mvn clean install deploy --settings .gitlab/settings.xml" + script: "mvn clean --settings .gitlab/settings.xml" artifacts: name: "Commons" paths: diff --git a/Commons.iml b/Commons.iml index 6674208..fd94446 100644 --- a/Commons.iml +++ b/Commons.iml @@ -11,6 +11,7 @@ + @@ -43,6 +44,7 @@ + @@ -53,6 +55,9 @@ + + + diff --git a/pom.xml b/pom.xml index 95ad417..1e90df4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,10 @@ Das Commons Modul stellt alles zur Verfügung was von allen anderen Modulen benötigt wird, wie etwa Datenbank Zugriffe https://development.univento.eu/docs/Commons + + UTF-8 + + univentoEU https://univento.eu @@ -120,6 +124,12 @@ + + ai.api + libai + 1.4.8 + + org.projectlombok lombok @@ -150,6 +160,13 @@ vertx-rabbitmq-client 3.4.1 + + + org.slf4j + slf4j-api + 1.7.25 + + com.google.code.gson gson diff --git a/src/main/java/eu/univento/commons/Commons.java b/src/main/java/eu/univento/commons/Commons.java index a81ec5a..665403c 100644 --- a/src/main/java/eu/univento/commons/Commons.java +++ b/src/main/java/eu/univento/commons/Commons.java @@ -27,8 +27,8 @@ public class Commons { commons = this; vertx = Vertx.vertx(); configurationHandler = new ConfigurationHandler(); - databaseManager = new DatabaseManager(); messagingManager = new MessagingManager(); + databaseManager = new DatabaseManager(); loggingHandler = new LoggingHandler(); } diff --git a/src/main/java/eu/univento/commons/database/DatabaseManager.java b/src/main/java/eu/univento/commons/database/DatabaseManager.java index 1704926..1ea5b69 100644 --- a/src/main/java/eu/univento/commons/database/DatabaseManager.java +++ b/src/main/java/eu/univento/commons/database/DatabaseManager.java @@ -12,8 +12,6 @@ import lombok.Data; @Data public class DatabaseManager { - //TODO: add board sql back, when forum is online. - private MongoDB mongoDB; private MySQL mySQL; private Redis redis; diff --git a/src/main/java/eu/univento/commons/database/MongoDB.java b/src/main/java/eu/univento/commons/database/MongoDB.java index bac716c..34e1143 100644 --- a/src/main/java/eu/univento/commons/database/MongoDB.java +++ b/src/main/java/eu/univento/commons/database/MongoDB.java @@ -17,5 +17,4 @@ public class MongoDB { client = MongoClient.createShared(Commons.getCommons().getVertx(), new JsonObject().put("host", host).put("port", port).put("username", username).put("password", password).put("db_name", databaseName)); } - } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/helpers/Location.java b/src/main/java/eu/univento/commons/helpers/Location.java index 5d57ec4..ad36351 100644 --- a/src/main/java/eu/univento/commons/helpers/Location.java +++ b/src/main/java/eu/univento/commons/helpers/Location.java @@ -1,10 +1,13 @@ package eu.univento.commons.helpers; +import lombok.Getter; + /** * @author joethei * @version 1.0 */ +@Getter public class Location { private final String world; @@ -22,28 +25,4 @@ public class Location { this.pitch = pitch; this.yaw = yaw; } - - public String getWorld() { - return world; - } - - public double getX() { - return x; - } - - public double getY() { - return y; - } - - public double getZ() { - return z; - } - - public float getPitch() { - return pitch; - } - - public float getYaw() { - return yaw; - } } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/logging/LoggingHandler.java b/src/main/java/eu/univento/commons/logging/LoggingHandler.java index dd30f24..9144154 100644 --- a/src/main/java/eu/univento/commons/logging/LoggingHandler.java +++ b/src/main/java/eu/univento/commons/logging/LoggingHandler.java @@ -1,7 +1,7 @@ package eu.univento.commons.logging; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +import eu.univento.commons.messaging.MessageHandler; +import eu.univento.commons.server.ServerType; /** * @author joethei @@ -10,36 +10,9 @@ import org.apache.logging.log4j.Logger; public class LoggingHandler { - public Logger getCommons() { - return LogManager.getLogger("Commons"); - } + public LoggingHandler() {} - public Logger getCore() { - return LogManager.getLogger("Core"); - } - - public Logger getBungeeCore() { - return LogManager.getLogger("BungeeCore"); - } - - public Logger getLobby() { - return LogManager.getLogger("Lobby"); - } - - public Logger getTrashGames() { - return LogManager.getLogger("TrashGames"); - } - - public Logger getTeamVento() { - return LogManager.getLogger("TeamVento"); - } - - public Logger getCloudCommons() {return LogManager.getLogger("CloudCommons");} - - public Logger getCloudDaemon() {return LogManager.getLogger("CloudDaemon");} - - public Logger getCloudMaster() {return LogManager.getLogger("CloudMaster");} - - public LoggingHandler() { + public void log(ServerType type, String message) { + MessageHandler.sendMessage("log." + type.getName(), message); } } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/messaging/MessageHandler.java b/src/main/java/eu/univento/commons/messaging/MessageHandler.java index 7aab4a8..333e9e2 100644 --- a/src/main/java/eu/univento/commons/messaging/MessageHandler.java +++ b/src/main/java/eu/univento/commons/messaging/MessageHandler.java @@ -22,23 +22,23 @@ public class MessageHandler { public static void registerListener(String queue, MessageEvent event) { events.add(event); - Commons.getCommons().getMessagingManager().getRabbitMQ().getClient().basicConsume(queue, "univento." + queue, res -> { - if(!res.succeeded()) res.cause().printStackTrace(); + Commons.getCommons().getVertx().eventBus().consumer(queue, msg -> { + JsonObject json = (JsonObject) msg.body(); + event.onMessageReceived(queue, json.getString("body")); }); - Commons.getCommons().getVertx().eventBus().consumer(queue, msg -> { - JsonObject json = (JsonObject) msg.body(); - event.onMessageReceived(queue, json.getString("body")); - }); + Commons.getCommons().getMessagingManager().start().whenComplete((rabbitMQ, throwable) -> rabbitMQ.getClient().basicConsume(queue, queue, res -> { + if(!res.succeeded()) res.cause().printStackTrace(); + })); } public static void sendMessage(String queue, String message) { - Commons.getCommons().getMessagingManager().getRabbitMQ().getClient().basicPublish("", queue, new JsonObject().put("body", message), res -> { + Commons.getCommons().getMessagingManager().start().whenComplete((rabbitMQ, throwable) -> rabbitMQ.getClient().basicPublish("", queue, new JsonObject().put("body", message), res -> { if(res.succeeded()) { for(MessageEvent event : events) { event.onMessageSend(queue, message); } }else res.cause().printStackTrace(); - }); + })); } } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/messaging/MessagingManager.java b/src/main/java/eu/univento/commons/messaging/MessagingManager.java index 9c3bb20..cbe6616 100644 --- a/src/main/java/eu/univento/commons/messaging/MessagingManager.java +++ b/src/main/java/eu/univento/commons/messaging/MessagingManager.java @@ -7,7 +7,8 @@ package eu.univento.commons.messaging; import eu.univento.commons.Commons; import eu.univento.commons.configuration.ConfigurationHandler; -import lombok.Getter; + +import java.util.concurrent.CompletableFuture; /** * @author joethei @@ -15,7 +16,6 @@ import lombok.Getter; */ public class MessagingManager { - @Getter private RabbitMQ rabbitMQ; public MessagingManager() { @@ -23,4 +23,17 @@ public class MessagingManager { rabbitMQ = new RabbitMQ(config.getString("RabbitMQ.Host"), config.getInteger("RabbitMQ.Port"), config.getString("RabbitMQ.Username"), config.getString("RabbitMQ.Password"), config.getString("RabbitMQ.VirtualHost")); } + + public CompletableFuture start() { + CompletableFuture future = new CompletableFuture<>(); + if(rabbitMQ.getClient().isConnected()) future.complete(rabbitMQ); + + rabbitMQ.getClient().start(res -> { + if(res.failed()) res.cause().printStackTrace(); + else future.complete(rabbitMQ); + }); + + return future; + } + } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/messaging/RabbitMQ.java b/src/main/java/eu/univento/commons/messaging/RabbitMQ.java index a7eebd4..26344f4 100644 --- a/src/main/java/eu/univento/commons/messaging/RabbitMQ.java +++ b/src/main/java/eu/univento/commons/messaging/RabbitMQ.java @@ -19,8 +19,8 @@ public class RabbitMQ { @Getter private RabbitMQClient client; public RabbitMQ(String host, int port, String user, String password, String virtualHost) { - JsonObject config = new JsonObject().put("host", host).put("port", port).put("user", user).put("password", password).put("virtualHost", virtualHost).put("connectionTimeout", 60) - .put("requestedHeartbeat", 60).put("handshakeTimeout", 60).put("requestedChannelMax", 5).put("networkRecoveryInterval", 5).put("automaticRecoveryEnabled", true); + JsonObject config = new JsonObject().put("host", host).put("port", port).put("user", user).put("password", password).put("virtualHost", virtualHost).put("connectionTimeout", 600) + .put("requestedHeartbeat", 60).put("handshakeTimeout", 600).put("requestedChannelMax", 5).put("networkRecoveryInterval", 5).put("automaticRecoveryEnabled", true); client = RabbitMQClient.create(Commons.getCommons().getVertx(), config); } } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/player/DatabasePlayer.java b/src/main/java/eu/univento/commons/player/DatabasePlayer.java index de80ceb..7bf4656 100644 --- a/src/main/java/eu/univento/commons/player/DatabasePlayer.java +++ b/src/main/java/eu/univento/commons/player/DatabasePlayer.java @@ -37,6 +37,7 @@ public class DatabasePlayer { private Rank rank; private PlayerSettings settings; + private Language language; private boolean muted; public DatabasePlayer(UUID uuid, String name) { @@ -48,22 +49,24 @@ public class DatabasePlayer { getRankAsync().whenComplete((rank1, throwable) -> rank = rank1); getSettingsAsync().whenComplete((playerSettings, throwable) -> settings = playerSettings); isMutedAsync().whenComplete((aBoolean, throwable) -> muted = aBoolean); + getLanguageAsync().whenComplete((language1, throwable) -> language = language1); } public Language getLanguage() { - return Language.getLanguage(Locale.forLanguageTag(getSettings().getLanguage())); + return Language.getLanguage(getSettings().getLanguage()); } public CompletableFuture getLanguageAsync() { CompletableFuture future = new CompletableFuture<>(); - getSettingsAsync().whenComplete((playerSettings, throwable) -> future.complete(Language.getLanguage(Locale.forLanguageTag(playerSettings.getLanguage())))); + getSettingsAsync().whenComplete((playerSettings, throwable) -> future.complete(Language.getLanguage(playerSettings.getLanguage()))); return future; } public CompletableFuture getSettingsAsync() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("Settings").whenComplete((entries, throwable) -> future.complete(new PlayerSettings(this, entries))); + getObjectFromDatabase("Settings").whenComplete((entries, throwable) -> + future.complete(new PlayerSettings(this, entries.getJsonObject("Settings")))); return future; } @@ -94,13 +97,7 @@ public class DatabasePlayer { MongoClient client = Commons.getCommons().getDatabaseManager().getMongoDB().getClient(); client.insert("bans", obj, res -> { - if (res.failed()) { - try { - throw res.cause(); - } catch (Throwable throwable1) { - throwable1.printStackTrace(); - } - } + if (res.failed()) res.cause().printStackTrace(); }); }); @@ -110,7 +107,9 @@ public class DatabasePlayer { CompletableFuture future = new CompletableFuture<>(); MongoClient client = Commons.getCommons().getDatabaseManager().getMongoDB().getClient(); client.findOne("bans", new JsonObject().put("uuid", uuid.toString()), null, res -> { + if(res.failed()) future.complete(null); JsonObject result = res.result(); + if(result.isEmpty()) future.complete(null); BanData data = new BanData(BanReason.valueOf(result.getString("reason")), UUID.fromString(result.getString("banner")), result.getString("customMessage"), @@ -323,7 +322,7 @@ public class DatabasePlayer { public CompletableFuture hasPlayedBefore() { CompletableFuture future = new CompletableFuture<>(); MongoClient client = Commons.getCommons().getDatabaseManager().getMongoDB().getClient(); - client.findOne("players", new JsonObject().put("uuid", uuid.toString()), new JsonObject("uuid"), res -> future.complete(res.succeeded())); + client.findOne("players", new JsonObject().put("uuid", uuid.toString()), null, res -> future.complete(res.succeeded())); return future; } @@ -342,65 +341,49 @@ public class DatabasePlayer { public CompletableFuture getFirstLogin() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("firstLogin").whenComplete((entries, throwable) -> { - future.complete(entries.getInstant("firstLogin")); - }); + getObjectFromDatabase("firstLogin").whenComplete((entries, throwable) -> future.complete(entries.getInstant("firstLogin"))); return future; } public CompletableFuture getLastLogin() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("lastLogin").whenComplete((entries, throwable) -> { - future.complete(entries.getInstant("lastLogin")); - }); + getObjectFromDatabase("lastLogin").whenComplete((entries, throwable) -> future.complete(entries.getInstant("lastLogin"))); return future; } public CompletableFuture getLastOnline() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("lastOnline").whenComplete((entries, throwable) -> { - future.complete(entries.getInstant("lastOnline")); - }); + getObjectFromDatabase("lastOnline").whenComplete((entries, throwable) -> future.complete(entries.getInstant("lastOnline"))); return future; } public CompletableFuture getLastIP() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("lastIP").whenComplete((entries, throwable) -> { - future.complete(entries.getString("lastIP")); - }); + getObjectFromDatabase("lastIP").whenComplete((entries, throwable) -> future.complete(entries.getString("lastIP"))); return future; } public CompletableFuture getTSID() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("tsid").whenComplete((entries, throwable) -> { - future.complete(entries.getString("tsid")); - }); + getObjectFromDatabase("tsid").whenComplete((entries, throwable) -> future.complete(entries.getString("tsid"))); return future; } public CompletableFuture getTimesJoined() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("timesJoined").whenComplete((entries, throwable) -> { - future.complete(entries.getInteger("TimesJoined")); - }); + getObjectFromDatabase("timesJoined").whenComplete((entries, throwable) -> future.complete(entries.getInteger("TimesJoined"))); return future; } public CompletableFuture getCoins() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("coins").whenComplete((entries, throwable) -> { - future.complete(entries.getInteger("coins")); - }); + getObjectFromDatabase("coins").whenComplete((entries, throwable) -> future.complete(entries.getInteger("coins"))); return future; } public CompletableFuture getExperience() { CompletableFuture future = new CompletableFuture<>(); - getObjectFromDatabase("experience").whenComplete((entries, throwable) -> { - future.complete(entries.getInteger("experience")); - }); + getObjectFromDatabase("experience").whenComplete((entries, throwable) -> future.complete(entries.getInteger("experience"))); return future; } @@ -482,7 +465,7 @@ public class DatabasePlayer { public void setInDatabase(String name, Object obj) { MongoClient client = Commons.getCommons().getDatabaseManager().getMongoDB().getClient(); - client.findOneAndUpdate("players", new JsonObject().put("uuid", uuid.toString()), + client.update("players", new JsonObject().put("uuid", uuid.toString()), new JsonObject().put("$set", new JsonObject().put(name, obj)), res -> { if (res.failed()) { try { diff --git a/src/main/java/eu/univento/commons/player/language/Language.java b/src/main/java/eu/univento/commons/player/language/Language.java index 4280c22..9cd2653 100644 --- a/src/main/java/eu/univento/commons/player/language/Language.java +++ b/src/main/java/eu/univento/commons/player/language/Language.java @@ -37,11 +37,11 @@ public class Language { Commons.getCommons().getDatabaseManager().getMySQL().getClient().getConnection(res -> { if(res.succeeded()) { SQLConnection connection = res.result(); - connection.query("SELECT identifier, " + locale.getISO3Language() + " FROM translations;", result -> { + connection.query("SELECT identifier, " + locale.getLanguage() + " FROM translations;", result -> { if(result.succeeded()) { ResultSet rs = result.result(); for(JsonObject json : rs.getRows()) { - translations.put(json.getString("translations"), json.getString(locale.getISO3Language())); + translations.put(json.getString("identifier"), json.getString(locale.getLanguage())); } }else result.cause().printStackTrace(); @@ -50,9 +50,9 @@ public class Language { }); } - public static Language getLanguage(Locale locale) { + public static Language getLanguage(String locale) { for(Language language : languages) { - if(language.getLocale().equals(locale)) return language; + if(language.getLocale().getLanguage().equals(locale)) return language; } return null; } @@ -61,7 +61,7 @@ public class Language { return getWord(constant.getName()); } - public String getWord(String constant) { - return translations.get(constant); + public String getWord(String identifier) { + return translations.get(identifier); } } \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/player/settings/PlayerSettings.java b/src/main/java/eu/univento/commons/player/settings/PlayerSettings.java index d79d833..1d9df17 100644 --- a/src/main/java/eu/univento/commons/player/settings/PlayerSettings.java +++ b/src/main/java/eu/univento/commons/player/settings/PlayerSettings.java @@ -69,8 +69,6 @@ public class PlayerSettings { return json.getBoolean("nicked"); } - - public void setPlayerVisibility(String visibility) { json.put("playerVisibility", visibility); update(); diff --git a/src/main/java/eu/univento/commons/player/uuid/NameFetcher.java b/src/main/java/eu/univento/commons/player/uuid/NameFetcher.java index 9af3d65..eb2344a 100644 --- a/src/main/java/eu/univento/commons/player/uuid/NameFetcher.java +++ b/src/main/java/eu/univento/commons/player/uuid/NameFetcher.java @@ -1,6 +1,7 @@ package eu.univento.commons.player.uuid; import eu.univento.commons.Commons; +import eu.univento.commons.server.ServerType; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -27,7 +28,7 @@ public class NameFetcher { String uniqueId = (String) response.get("uuid"); if (uniqueId.length() == 0) - Commons.getCommons().getLoggingHandler().getCommons().error("A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); + Commons.getCommons().getLoggingHandler().log(ServerType.getServerType() ,"A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); return (String) response.get("username"); } catch (IOException |ParseException e) { @@ -42,17 +43,17 @@ public class NameFetcher { String name = (String) response.get("name"); if (name == null) - Commons.getCommons().getLoggingHandler().getCommons().error("A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); + Commons.getCommons().getLoggingHandler().log(ServerType.getServerType(),"A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); String cause = (String) response.get("cause"); String errorMessage = (String) response.get("errorMessage"); if (cause != null && cause.length() > 0) { - Commons.getCommons().getLoggingHandler().getCommons().error(errorMessage); + Commons.getCommons().getLoggingHandler().log(ServerType.getServerType(), errorMessage); } return name; } catch (IOException | ParseException e) { e.printStackTrace(); - Commons.getCommons().getLoggingHandler().getCommons().error("A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); + Commons.getCommons().getLoggingHandler().log(ServerType.getServerType(), "A Username for UUID '" + uuid.toString() + "' was not found in the database! Is the account not premium?"); } return null; } diff --git a/src/main/java/eu/univento/commons/server/ServerInfo.java b/src/main/java/eu/univento/commons/server/ServerInfo.java new file mode 100644 index 0000000..a67ca7a --- /dev/null +++ b/src/main/java/eu/univento/commons/server/ServerInfo.java @@ -0,0 +1,46 @@ +package eu.univento.commons.server; + +import eu.univento.commons.event.MessageEvent; +import eu.univento.commons.messaging.MessageHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.regex.Pattern; + +/** + * @author joethei + * @version 1.0 + */ + +@AllArgsConstructor +@Getter +public class ServerInfo { + + public static CompletableFuture getServerInfo(String server) { + CompletableFuture future = new CompletableFuture<>(); + UUID uuid = UUID.randomUUID(); + MessageHandler.sendMessage("cloud.servers", uuid.toString() + "|INFO|" + server); + MessageHandler.registerListener("cloud.servers", new MessageEvent() { + @Override + public void onMessageReceived(String queue, String message) { + String[] info = message.split(Pattern.quote("|")); + if(info[0].equals(uuid.toString())) { + future.complete(new ServerInfo(info[1], ServerType.valueOf(info[2]), Integer.getInteger(info[3]))); + } + } + @Override + public void onMessageSend(String queue, String message) { + + } + }); + + return future; + } + + private String name; + private ServerType type; + private int players; + +} \ No newline at end of file diff --git a/src/main/java/eu/univento/commons/server/ServerType.java b/src/main/java/eu/univento/commons/server/ServerType.java index d21ff63..3446771 100644 --- a/src/main/java/eu/univento/commons/server/ServerType.java +++ b/src/main/java/eu/univento/commons/server/ServerType.java @@ -1,16 +1,24 @@ package eu.univento.commons.server; +import lombok.Getter; +import lombok.Setter; + /** * @author joethei - * @version 0.1 + * @version 1.0 */ +@Getter public enum ServerType { - LOBBY(0, "Lobby", "§6Lobby"), - SECRET_GAME_FREE4ALL(1, "Free4All", "§6Free4All"), - SECRET_GAME_TRASHGAMES(2, "TrashGames", "§6TrashGames"), - GAME_WOOLGET(3, "WoolGet", "§6WoolGet"), - GAME_MAYA(4, "Maya", "§6Maya"); + NONE(0, "None", "None"), + PROXY(1, "Proxy", "§6Proxy"), + LOBBY(2, "Lobby", "§6Lobby"), + TEAM_BUILD(3, "TeamVento", "§6TeamVento"), + SECRET_GAME_FREE4ALL(4, "Free4All", "§6Free4All"), + SECRET_GAME_TRASHGAMES(5, "TrashGames", "§6TrashGames"), + GAME_WOOLGET(6, "WoolGet", "§6WoolGet"), + GAME_MAYA(7, "Maya", "§6Maya"), + GAME_IMPACT(8, "Impact", "§6Impact"); private int id; private String name; @@ -21,16 +29,5 @@ public enum ServerType { this.name = name; this.prefix = prefix; } - - public String getName() { - return name; - } - - public String getPrefix() { - return prefix; - } - - public int getID() { - return id; - } + @Getter @Setter private static ServerType serverType; } \ No newline at end of file diff --git a/src/main/main.iml b/src/main/main.iml new file mode 100644 index 0000000..301081b --- /dev/null +++ b/src/main/main.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/config.properties b/src/main/resources/config.properties index 24a1abe..e57e00b 100644 --- a/src/main/resources/config.properties +++ b/src/main/resources/config.properties @@ -22,9 +22,10 @@ TS3.Username = serveradmin TS3.Password = Wb69cypb499CTP4vtaJPKpKZELUbPD Slack.hook_url = https://hooks.slack.com/services/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 RabbitMQ.Host = vps.joethei.de -RabbitMQ.Port = 5672 +RabbitMQ.Port = 5673 RabbitMQ.Username = univento RabbitMQ.Password = tYRHXZNm4exW@QB6rMm72pHnafrT8wQ5ebGPEetJDBVU2mj25kTVXuYeQavb#EYr RabbitMQ.VirtualHost = univento Gitlab.Host = https://gitlab.com/ -Gitlab.token = add token here \ No newline at end of file +Gitlab.token = add token here +api.ai.token = e1c97924577a4743800b3fefb16dd527 \ No newline at end of file diff --git a/src/test/test.iml b/src/test/test.iml new file mode 100644 index 0000000..684b6b7 --- /dev/null +++ b/src/test/test.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file