Skip to content

Commit

Permalink
Merge branch 'release/v0.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Xharos committed Jul 10, 2024
2 parents 6819214 + 5700012 commit fe9b53e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "fr.islandswars"
version = "0.4.2"
version = "0.4.3"

repositories {
mavenCentral()
Expand All @@ -16,7 +16,6 @@ dependencies {
implementation("io.lettuce:lettuce-core:6.3.2.RELEASE")
implementation("com.rabbitmq:amqp-client:5.21.0")
implementation("com.github.docker-java:docker-java-core:3.3.6")
implementation("it.unimi.dsi:fastutil:8.2.1")
implementation("net.kyori:adventure-api:4.17.0")
implementation("com.github.docker-java:docker-java-transport-httpclient5:3.3.6")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/fr/islandswars/commons/service/ServiceType.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public enum ServiceType {
DOCKER_HOST("docker_host");


private static final ServiceType[] VALUES = values();
private static final String path = "/run/secrets/";
private final String secretFileName;

Expand All @@ -55,4 +56,8 @@ public String getSecretFileName() {
public String getSecretPath() {
return path + secretFileName;
}

public static ServiceType[] cachedValues() {
return VALUES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import fr.islandswars.commons.service.rabbitmq.packet.server.PingRequestPacket;
import fr.islandswars.commons.service.rabbitmq.packet.server.StatusRequestPacket;
import fr.islandswars.commons.utils.LogUtils;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;

import java.util.HashMap;
import java.util.Map;

import static fr.islandswars.commons.service.rabbitmq.packet.PacketType.Bound.*;

Expand Down Expand Up @@ -38,7 +40,7 @@
*/
public class PacketType<T extends Packet> {

protected static final Int2ObjectArrayMap<PacketType<? extends Packet>> packetList = new Int2ObjectArrayMap<>();
protected static final Map<Integer, PacketType<? extends Packet>> packetList = new HashMap<>();

private final int id;
private final Class<T> packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import fr.islandswars.commons.utils.LogUtils;
import fr.islandswars.commons.utils.Preconditions;
import io.lettuce.core.api.async.RedisAsyncCommands;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
Expand Down Expand Up @@ -40,13 +40,13 @@
public abstract class CacheManager {

private final RedisAsyncCommands<String, String> redis;
private final String keyPrefix;
private final Object2ObjectMap<String, EntryCache> fieldsCache;
private final String keyPrefix;
private final Map<String, EntryCache> fieldsCache;

public CacheManager(String keyPrefix, RedisConnection connection) {
this.redis = connection.getConnection();
this.keyPrefix = keyPrefix;
this.fieldsCache = new Object2ObjectOpenHashMap<>();
this.fieldsCache = new HashMap<>();
initializeFieldCache();
updateCache().run();
}
Expand Down

0 comments on commit fe9b53e

Please sign in to comment.