diff --git a/src/main/java/dev/emortal/minestom/core/module/kubernetes/KubernetesModule.java b/src/main/java/dev/emortal/minestom/core/module/kubernetes/KubernetesModule.java index 665e178..885ac6a 100644 --- a/src/main/java/dev/emortal/minestom/core/module/kubernetes/KubernetesModule.java +++ b/src/main/java/dev/emortal/minestom/core/module/kubernetes/KubernetesModule.java @@ -116,15 +116,15 @@ private void loadAgones() { private void loadAgonesCountsAndLists() { MinecraftServer.getGlobalEventHandler().addListener(AsyncPlayerConfigurationEvent.class, event -> { - this.updateCounter("players", 1); - this.addToList("players", event.getPlayer().getUuid().toString()); + this.updateAgonesCounter("players", 1); + this.addToAgonesList("players", event.getPlayer().getUuid().toString()); }).addListener(PlayerDisconnectEvent.class, event -> { - this.updateCounter("players", -1); - this.removeFromList("players", event.getPlayer().getUuid().toString()); + this.updateAgonesCounter("players", -1); + this.removeFromAgonesList("players", event.getPlayer().getUuid().toString()); }); } - private void updateCounter(String name, long diff) { + public void updateAgonesCounter(String name, long diff) { this.betaSdk.updateCounter(BetaAgonesSDKProto.UpdateCounterRequest.newBuilder() .setCounterUpdateRequest(BetaAgonesSDKProto.CounterUpdateRequest.newBuilder() .setName(name) @@ -132,14 +132,14 @@ private void updateCounter(String name, long diff) { .build(), new IgnoredStreamObserver<>()); } - private void addToList(String listName, String value) { + public void addToAgonesList(String listName, String value) { this.betaSdk.addListValue(BetaAgonesSDKProto.AddListValueRequest.newBuilder() .setName(listName) .setValue(value) .build(), new IgnoredStreamObserver<>()); } - private void removeFromList(String listName, String value) { + public void removeFromAgonesList(String listName, String value) { this.betaSdk.removeListValue(BetaAgonesSDKProto.RemoveListValueRequest.newBuilder() .setName(listName) .setValue(value) @@ -178,7 +178,11 @@ private void readyAgones() { return this.protoClient; } - public @Nullable SDKGrpc.SDKStub getSdk() { + public @Nullable SDKGrpc.SDKStub getAgonesSdk() { return this.sdk; } + + public @Nullable dev.agones.sdk.beta.SDKGrpc.SDKStub getAgonesBetaSdk() { + return this.betaSdk; + } }