Skip to content

Commit

Permalink
Merge branch 'nightly' into l10n_nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
0utplay authored Oct 13, 2024
2 parents cc946c2 + 8f9081b commit e3fe297
Show file tree
Hide file tree
Showing 59 changed files with 986 additions and 926 deletions.
2 changes: 1 addition & 1 deletion build-extensions/src/main/kotlin/publishing-extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ fun applyDefaultJavadocOptions(options: StandardJavadocDocletOptions) {
"https://jd.advntr.dev/api/latest/",
"https://javadoc.io/doc/com.konghq/unirest-java/latest/",
"https://javadoc.io/doc/org.jetbrains/annotations/latest/",
"https://javadoc.io/doc/cloud.commandframework/cloud-core/latest/"
"https://javadoc.io/doc/org.incendo/cloud-core/latest/"
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package eu.cloudnetservice.common.language;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multimaps;
import com.google.common.collect.SetMultimap;
import eu.cloudnetservice.common.io.FileUtil;
import eu.cloudnetservice.common.resource.ResourceResolver;
Expand All @@ -32,6 +32,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;
import lombok.NonNull;
Expand All @@ -55,7 +56,9 @@ public final class I18n {
private static final Pattern MESSAGE_FORMAT = Pattern.compile("\\{(.+?)\\$.+?\\$}");

private static final Logger LOGGER = LoggerFactory.getLogger(I18n.class);
private static final SetMultimap<String, Entry> REGISTERED_ENTRIES = HashMultimap.create();
private static final SetMultimap<String, Entry> REGISTERED_ENTRIES = Multimaps.newSetMultimap(
new ConcurrentHashMap<>(),
ConcurrentHashMap::newKeySet);
private static final AtomicReference<String> CURRENT_LANGUAGE = new AtomicReference<>("en_US");

private I18n() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import eu.cloudnetservice.driver.network.NetworkChannel;
import eu.cloudnetservice.driver.network.protocol.Packet;
import eu.cloudnetservice.driver.network.protocol.QueryPacketManager;
import java.time.Duration;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
Expand All @@ -49,7 +50,7 @@ public class DefaultQueryPacketManager implements QueryPacketManager {
public DefaultQueryPacketManager(@NonNull NetworkChannel networkChannel) {
this.networkChannel = networkChannel;
this.waitingHandlers = Caffeine.newBuilder()
.weakValues()
.expireAfterWrite(Duration.ofHours(8))
.removalListener(this.newRemovalListener())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static class Builder {
* @throws IllegalArgumentException if the given memory size is less than 50 mb.
*/
public @NonNull Builder maxHeapMemorySize(@Range(from = 50, to = Integer.MAX_VALUE) int maxHeapMemorySize) {
Preconditions.checkArgument(maxHeapMemorySize > 50, "Max heap memory must be at least 50 mb");
Preconditions.checkArgument(maxHeapMemorySize >= 50, "Max heap memory must be at least 50 mb");

this.maxHeapMemorySize = maxHeapMemorySize;
return this;
Expand Down
9 changes: 7 additions & 2 deletions driver/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT" />
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>

<logger name="tc" level="INFO"/>
<logger name="org.testcontainers" level="INFO"/>
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void applyPlatformInfo(
) {
// base values
target.add("name", pluginData.name());
target.add("version", pluginData.name());
target.add("version", pluginData.version());
target.add("main", platformMainClassName);
target.add("id", PLUGIN_ID_GENERATOR.convert(pluginData.name()));

Expand Down
46 changes: 24 additions & 22 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
[versions]

# plugins
shadow = "8.3.0"
shadow = "8.3.2"
juppiter = "0.4.0"
spotless = "6.25.0"
fabricLoom = "1.7.3"
fabricLoom = "1.8.6"
nexusPublish = "2.0.0"
checkstyleTools = "10.17.0"
checkstyleTools = "10.18.1"

# google libs
gson = "2.11.0"
guava = "33.3.0-jre"
guava = "33.3.1-jre"

# testing
junit = "5.11.0"
mockito = "5.12.0"
junitLauncher = "1.11.0"
junit = "5.11.1"
mockito = "5.14.0"
junitLauncher = "1.11.1"
testcontainers = "1.20.1"

# compile time processing
lombok = "1.18.34"
javapoet = "1.13.0"

# console
jline = "3.26.3"
cloud = "1.9.0-cn1"
jline = "3.27.0"
cloud = "2.0.0-cn1"
cloudConfirmation = "1.0.0-rc.1"
stringSimilarity = "2.0.0"

# databases
h2 = "1.4.197" # do not update, leads to database incompatibility
xodus = "2.0.1"
mongodb = "5.1.3"
hikariCp = "5.1.0"
mongodb = "5.2.0"
hikariCp = "6.0.0"
mysqlConnector = "9.0.0"

# general
oshi = "6.6.3"
oshi = "6.6.4"
vavr = "0.10.4"
sshj = "0.38.0"
sshj = "0.39.0"
aerogel = "2.1.0"
awsSdk = "2.27.9"
awsSdk = "2.28.11"
unirest = "4.4.4"
caffeine = "3.1.8"
reflexion = "1.8.0"
geantyref = "1.3.15"
geantyref = "2.0.0"
dockerJava = "3.4.0"
nightConfig = "3.8.1"
annotations = "24.1.0"
annotations = "25.0.0"
influxClient = "7.2.0"
netty = "5.0.0.Alpha5"
gulf = "1.0.0-SNAPSHOT"

# logging
slf4j = "2.0.16"
logback = "1.5.7"
logback = "1.5.8"

# platform api versions
sponge = "9.0.0"
velocity = "3.3.0-SNAPSHOT"
waterdogpe = "1.2.4"
nukkitX = "1.0-SNAPSHOT"
minestom = "d5c6126a6b"
minestom = "0651c4e401"
minestomExtensions = "1.2.0"
spigot = "1.8.8-R0.1-SNAPSHOT"
bungeecord = "1.21-R0.1-SNAPSHOT"
Expand All @@ -70,14 +71,14 @@ limboloohp = "0.7.9-ALPHA"
vault = "1.7.1"
adventure = "4.17.0"
modlauncher = "8.1.3"
npcLib = "3.0.0-beta8"
npcLib = "3.0.0-beta9"
placeholderApi = "2.11.6"
adventure-serializer-bungee = "4.3.4"
luckPermsApi = "5.4"

# fabric platform special dependencies
minecraft = "1.21"
fabricLoader = "0.16.2"
minecraft = "1.21.1"
fabricLoader = "0.16.5"


[libraries]
Expand All @@ -104,6 +105,7 @@ nightConfigJson = { group = "com.electronwill.night-config", name = "json", vers
# cloud commands
cloudCore = { group = "com.github.CloudNetService.cloud-command-framework", name = "cloud-core", version.ref = "cloud" }
cloudAnnotations = { group = "com.github.CloudNetService.cloud-command-framework", name = "cloud-annotations", version.ref = "cloud" }
cloudConfirmationProcessor = { group = "org.incendo", name = "cloud-processors-confirmation", version.ref = "cloudConfirmation" }

# junit
junitApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" }
Expand Down Expand Up @@ -201,7 +203,7 @@ npcLib = ["npcLib", "npcLibLabymod"]
unirest = ["unirest", "unirestGson"]
mysql = ["mysqlConnector", "hikariCp"]
jline = ["jlineReader", "jlineTerminal"]
cloud = ["cloudCore", "cloudAnnotations"]
cloud = ["cloudCore", "cloudAnnotations", "cloudConfirmationProcessor"]
netty = ["nettyHandler"]
junit = ["junitApi", "junitParams", "junitEngine"]
dockerJava = ["dockerJavaApi", "dockerJavaHttpclient5"]
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions launcher/java22/src/main/resources/launcher.cnl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ var cloudnet.updateRepo CloudNetService/launchermeta
# features available. (Use this branch at your own risk!)
var cloudnet.updateBranch beta

# available default log levels: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL
# available default log levels: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL
# each level includes all messages for levels lower than itself (in the above list: left to right) too
var cloudnet.logging.defaultlevel INFO
var cloudnet.log.level DEBUG

# This value sets the memory settings of the JVM for the cloudnet node.
# The value set here is to be specified in megabytes and describes -xmx as well as -xms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

package eu.cloudnetservice.modules.bridge.node.command;

import cloud.commandframework.annotations.Argument;
import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import cloud.commandframework.annotations.parsers.Parser;
import cloud.commandframework.annotations.suggestions.Suggestions;
import cloud.commandframework.context.CommandContext;
import eu.cloudnetservice.common.Named;
import eu.cloudnetservice.common.language.I18n;
import eu.cloudnetservice.driver.provider.GroupConfigurationProvider;
Expand All @@ -37,12 +31,17 @@
import jakarta.inject.Singleton;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import java.util.stream.Stream;
import lombok.NonNull;
import org.incendo.cloud.annotations.Argument;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import org.incendo.cloud.annotations.parser.Parser;
import org.incendo.cloud.annotations.suggestion.Suggestions;
import org.incendo.cloud.context.CommandInput;

@Singleton
@CommandPermission("cloudnet.command.bridge")
@Permission("cloudnet.command.bridge")
@Description("module-bridge-command-description")
public class BridgeCommand {

Expand All @@ -62,8 +61,8 @@ public BridgeCommand(
}

@Parser(name = "bridgeGroups", suggestions = "bridgeGroups")
public GroupConfiguration bridgeGroupParser(@NonNull CommandContext<?> $, @NonNull Queue<String> input) {
var name = input.remove();
public GroupConfiguration bridgeGroupParser(@NonNull CommandInput input) {
var name = input.readString();
var group = this.groupConfigurationProvider.groupConfiguration(name);
if (group == null) {
throw new ArgumentNotAvailableException(I18n.trans("command-general-group-does-not-exist"));
Expand All @@ -78,15 +77,14 @@ public GroupConfiguration bridgeGroupParser(@NonNull CommandContext<?> $, @NonNu
}

@Suggestions("bridgeGroups")
public List<String> suggestBridgeGroups(@NonNull CommandContext<?> $, String input) {
public Stream<String> suggestBridgeGroups() {
return this.groupConfigurationProvider.groupConfigurations().stream()
.map(Named::name)
.filter(group -> this.bridgeManagement.configuration().fallbackConfigurations().stream()
.noneMatch(fallback -> fallback.targetGroup().equals(group)))
.toList();
.noneMatch(fallback -> fallback.targetGroup().equals(group)));
}

@CommandMethod("bridge create entry <targetGroup>")
@Command("bridge create entry <targetGroup>")
public void createBridgeEntry(
@NonNull CommandSource source,
@NonNull @Argument(value = "targetGroup", parserName = "bridgeGroups") GroupConfiguration group
Expand All @@ -104,7 +102,7 @@ public void createBridgeEntry(
source.sendMessage(I18n.trans("module-bridge-command-create-entry-success"));
}

@CommandMethod("bridge task <task> set requiredPermission <permission>")
@Command("bridge task <task> set requiredPermission <permission>")
public void setRequiredPermission(
@NonNull CommandSource source,
@NonNull @Argument("task") Collection<ServiceTask> serviceTasks,
Expand Down
Loading

0 comments on commit e3fe297

Please sign in to comment.