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 { dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
compileOnly 'org.geysermc.geyser:api:2.1.1-SNAPSHOT' compileOnly 'org.geysermc.geyser:api:2.2.0-SNAPSHOT'
compileOnly('org.geysermc.geyser:core:2.1.1-SNAPSHOT') { compileOnly('org.geysermc.geyser:core:2.2.0-SNAPSHOT') {
exclude group: 'io.netty' exclude group: 'io.netty'
} }
implementation 'org.xerial:sqlite-jdbc:3.41.2.2' implementation 'org.xerial:sqlite-jdbc:3.42.0.0'
implementation 'com.mysql:mysql-connector-j:8.0.33' implementation 'com.mysql:mysql-connector-j:8.1.0'
} }
jar { jar {

View file

@ -48,7 +48,6 @@ import org.geysermc.geyser.api.util.PlatformType;
import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.GeyserSession;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class GeyserConnect implements Extension { public class GeyserConnect implements Extension {
@ -160,7 +159,7 @@ public class GeyserConnect implements Extension {
return; return;
} }
Collection<GeyserSession> sessions = GeyserImpl.getInstance().getSessionManager().getSessions().values(); GeyserSession[] sessions = getGeyserSessions();
switch (type) { switch (type) {
case "chat": 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; String sessionIp = ip;
// If we are passing with a vhost construct the vhost // If we are passing with a vhost construct the vhost
@ -231,4 +230,8 @@ public class GeyserConnect implements Extension {
}) })
.build()); .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; return this.online ? AuthType.ONLINE : AuthType.OFFLINE;
} }
@Override
public boolean resolveSrv() {
return true;
}
@JsonIgnore @JsonIgnore
public FormImage formImage() { public FormImage formImage() {
if (imageUrl != null && !imageUrl.isEmpty()) { if (imageUrl != null && !imageUrl.isEmpty()) {