forked from git-mirrors/GeyserConnect
Fix SRV support
This commit is contained in:
parent
0c2304e662
commit
3bfe81b4fe
3 changed files with 17 additions and 9 deletions
|
@ -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()
|
||||
}
|
||||
}
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue