Skip to content

Commit

Permalink
Merge branch 'nightly' into fix/npc-spawns
Browse files Browse the repository at this point in the history
  • Loading branch information
0utplay committed Jun 15, 2023
2 parents 4217268 + c37d489 commit 94d9f43
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void registerDatabaseProvider(@NonNull ServiceRegistry serviceRegistry) {
"root",
"123456",
"mysql",
List.of(new MySQLConnectionEndpoint(false, "cloudnet", new HostAndPort("127.0.0.1", 3306)))),
List.of(new MySQLConnectionEndpoint("cloudnet", new HostAndPort("127.0.0.1", 3306)))),
DocumentFactory.json());

serviceRegistry.registerProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public final class MySQLDatabaseProvider extends SQLDatabaseProvider {

private static final String CONNECT_URL_FORMAT = "jdbc:mysql://%s:%d/%s?serverTimezone=UTC&useSSL=%b&trustServerCertificate=%b";
private static final String CONNECT_URL_FORMAT = "jdbc:mysql://%s:%d/%s?serverTimezone=UTC";

private final MySQLConfiguration config;
private volatile HikariDataSource hikariDataSource;
Expand All @@ -56,9 +56,7 @@ public boolean init() {

hikariConfig.setJdbcUrl(String.format(
CONNECT_URL_FORMAT,
endpoint.address().host(), endpoint.address().port(),
endpoint.database(), endpoint.useSsl(), endpoint.useSsl()
));
endpoint.address().host(), endpoint.address().port(), endpoint.database()));
hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
hikariConfig.setUsername(this.config.username());
hikariConfig.setPassword(this.config.password());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
import eu.cloudnetservice.driver.network.HostAndPort;
import lombok.NonNull;

public record MySQLConnectionEndpoint(boolean useSsl, @NonNull String database, @NonNull HostAndPort address) {
public record MySQLConnectionEndpoint(@NonNull String database, @NonNull HostAndPort address) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class MySQLDatabaseTest {

@Container
private final GenericContainer<?> mysqlContainer = new GenericContainer<>("mariadb:latest")
private final GenericContainer<?> mysqlContainer = new GenericContainer<>("mariadb:11.1.1-rc")
.withExposedPorts(3306)
.withEnv("MYSQL_USER", "test")
.withEnv("MYSQL_PASSWORD", "test")
Expand All @@ -51,7 +51,6 @@ void setup() {
"test",
"mysql",
List.of(new MySQLConnectionEndpoint(
false,
"cn_testing",
new HostAndPort(this.mysqlContainer.getHost(), this.mysqlContainer.getFirstMappedPort())))),
null);
Expand Down

0 comments on commit 94d9f43

Please sign in to comment.