Skip to content

Commit 206c034

Browse files
committed
Send isConnected true/false
1 parent 49eb54f commit 206c034

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/dev/zenith/ppapi/api/PPApiServer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.common.cache.Cache;
55
import com.google.common.cache.CacheBuilder;
66
import com.zenith.Globals;
7+
import com.zenith.Proxy;
78
import com.zenith.command.api.CommandContext;
89
import com.zenith.command.api.CommandOutputHelper;
910
import dev.zenith.ppapi.api.model.ApiErrorResponse;
@@ -125,7 +126,8 @@ private Javalin createServer() {
125126
result.pearls(),
126127
result.output(),
127128
botInfo.minecraftServer(),
128-
botInfo.botUsername()
129+
botInfo.botUsername(),
130+
botInfo.botConnected()
129131
));
130132
ctx.status(200);
131133
})
@@ -235,6 +237,7 @@ private record ConfigPearlResult(
235237
private BotInfo readZenithBotInfo() {
236238
String server = null;
237239
String username = null;
240+
boolean connected = Proxy.getInstance().isConnected();
238241
var config = Globals.CONFIG;
239242
if (config != null) {
240243
if (config.authentication != null) {
@@ -247,11 +250,12 @@ private BotInfo readZenithBotInfo() {
247250
}
248251
}
249252
}
250-
return new BotInfo(server, username);
253+
return new BotInfo(server, username, connected);
251254
}
252255

253256
private record BotInfo(
254257
String minecraftServer,
255-
String botUsername
258+
String botUsername,
259+
boolean botConnected
256260
) { }
257261
}

src/main/java/dev/zenith/ppapi/api/model/PearlStatusResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ public record PearlStatusResponse(
66
List<String> pearls,
77
List<String> output,
88
String minecraftServer,
9-
String botUsername
9+
String botUsername,
10+
boolean botConnected
1011
) { }

0 commit comments

Comments
 (0)