Fix SRV support

This commit is contained in:
rtm516 2023-08-26 22:57:45 +01:00
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

@ -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()) {