Fix SRV support

This commit is contained in:
rtm516 2023-08-26 22:57:45 +01:00
parent 0c2304e662
commit 3bfe81b4fe
No known key found for this signature in database
GPG key ID: 331715B8B007C67A
3 changed files with 17 additions and 9 deletions

View file

@ -27,16 +27,16 @@ repositories {
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
compileOnly 'org.geysermc.geyser:api:2.1.1-SNAPSHOT'
compileOnly('org.geysermc.geyser:core:2.1.1-SNAPSHOT') {
compileOnly 'org.geysermc.geyser:api:2.2.0-SNAPSHOT'
compileOnly('org.geysermc.geyser:core:2.2.0-SNAPSHOT') {
exclude group: 'io.netty'
}
implementation 'org.xerial:sqlite-jdbc:3.41.2.2'
implementation 'com.mysql:mysql-connector-j:8.0.33'
implementation 'org.xerial:sqlite-jdbc:3.42.0.0'
implementation 'com.mysql:mysql-connector-j:8.1.0'
}
jar {

View file

@ -48,7 +48,6 @@ import org.geysermc.geyser.api.util.PlatformType;
import org.geysermc.geyser.session.GeyserSession;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;
public class GeyserConnect implements Extension {
@ -160,7 +159,7 @@ public class GeyserConnect implements Extension {
return;
}
Collection<GeyserSession> sessions = GeyserImpl.getInstance().getSessionManager().getSessions().values();
GeyserSession[] sessions = getGeyserSessions();
switch (type) {
case "chat":
@ -208,7 +207,7 @@ public class GeyserConnect implements Extension {
}
}
for (GeyserSession session : GeyserImpl.getInstance().getSessionManager().getSessions().values()) {
for (GeyserSession session : getGeyserSessions()) {
String sessionIp = ip;
// If we are passing with a vhost construct the vhost
@ -231,4 +230,8 @@ public class GeyserConnect implements Extension {
})
.build());
}
private GeyserSession[] getGeyserSessions() {
return this.geyserApi().onlineConnections().stream().map(connection -> (GeyserSession) connection).toList()
}
}

View file

@ -54,6 +54,11 @@ public record Server(
return this.online ? AuthType.ONLINE : AuthType.OFFLINE;
}
@Override
public boolean resolveSrv() {
return true;
}
@JsonIgnore
public FormImage formImage() {
if (imageUrl != null && !imageUrl.isEmpty()) {