Package org.cloudburstmc.netty.signaling
Class ProviderClient
java.lang.Object
org.cloudburstmc.netty.signaling.ProviderClient
- All Implemented Interfaces:
AutoCloseable
One asynchronous, serialized control lifecycle per backend, never one poller per player.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe Bedrock protocols the host accepts at login, which a provider may advertise from.static final classWhat the client registers and runs with.static final recordSampled actual players on this runtime; keep counting existing players while not accepting new ones.static enumstatic enumThe game's verdict on an admitted player.static final recordCapacity and connectedPlayers describe the same observation.static final recordWhere the operator says the host runs: a country, coordinates or both.static final recordA link the provider offers the host's operator.static final classstatic final recordWhat the provider last acknowledged to hand joining players.static final recordThe assigned runtime identity.static final recordThe host software and its version, as the provider should show them. -
Constructor Summary
ConstructorsConstructorDescriptionProviderClient(ProviderClient.Configuration config, ProviderStateStore store, ProviderTransport transport, Supplier<ServerStatus> statusSupplier, Supplier<ProviderClient.Health> healthSupplier, Consumer<ProviderDiagnostic> diagnostics) -
Method Summary
Modifier and TypeMethodDescriptionlongHow far this machine's clock is from the provider's, as its replies tell it: positive when this machine is behind.voidclose()drain()CompletableFuture<com.google.gson.JsonObject>extensionRequest(String namespace, String operation, String method, com.google.gson.JsonObject body) Explicit application request to an advertised extension operation, never automatic execution.CompletableFuture<com.google.gson.JsonObject>Opaque registration metadata; the application decides what it means.Carrier of the last successful signed operation, independent of advertised configuration.The provider's current link for the host's operator, requesting a fresh one when a heartbeat said it is offered.The endpoints the provider last acknowledged to hand joining players.CompletableFuture<com.google.gson.JsonObject>Refresh through the ordinary heartbeat and return its readiness observation.booleanreportGameOutcome(String ticketId, ProviderClient.GameOutcome outcome, String reason) Queues a game outcome for an admitted ticket without blocking.voidWake local observation on join/leave/reload; unchanged snapshots never create network traffic.start()Registers, or recovers the saved registration, and starts checking in.stop()updateHeartbeatExtensions(com.google.gson.JsonObject extensions) Replace optional application observations and promptly send them when running.
-
Constructor Details
-
ProviderClient
public ProviderClient(ProviderClient.Configuration config, ProviderStateStore store, ProviderTransport transport, Supplier<ServerStatus> statusSupplier, Supplier<ProviderClient.Health> healthSupplier, Consumer<ProviderDiagnostic> diagnostics)
-
-
Method Details
-
lastControlCarrier
Carrier of the last successful signed operation, independent of advertised configuration. -
clockOffsetMillis
public long clockOffsetMillis()How far this machine's clock is from the provider's, as its replies tell it: positive when this machine is behind. Zero until a reply says otherwise, or while the difference is within tolerance. Requests are still signed with this machine's clock, so one too far off has them refused; the difference is only measured and warned about, for the operator to set the clock right. -
publishedEndpoints
The endpoints the provider last acknowledged to hand joining players. Safe to call from any thread, and never waits for a heartbeat.- Returns:
- The last acknowledged endpoints, empty before the first acknowledgement, while a changed profile is being published again, and once stopping
-
start
Registers, or recovers the saved registration, and starts checking in. When the provider refuses a registration only for now, withrate_limitedorcapacity_reachedand aRetry-After, it warns and tries again once that has passed. Stopping ends the wait, failing the returned future with that refusal. -
requestStatusRefresh
public void requestStatusRefresh()Wake local observation on join/leave/reload; unchanged snapshots never create network traffic. -
readiness
Refresh through the ordinary heartbeat and return its readiness observation. -
updateHeartbeatExtensions
Replace optional application observations and promptly send them when running. An omitted extension is not an application-level instruction to clear an earlier observation. -
reportGameOutcome
public boolean reportGameOutcome(String ticketId, ProviderClient.GameOutcome outcome, String reason) Queues a game outcome for an admitted ticket without blocking. RequiresProviderClient.Configuration.Builder.gameOutcomes.- Parameters:
ticketId- The ticket ID from the authenticated admission carrierreason- A code of at most 128 characters, or null; never player identity or disconnect text- Returns:
- false when the client is stopping or the queue is full, so the outcome was dropped
-
operatorAction
The provider's current link for the host's operator, requesting a fresh one when a heartbeat said it is offered. -
extensions
Opaque registration metadata; the application decides what it means. -
extensionRequest
public CompletableFuture<com.google.gson.JsonObject> extensionRequest(String namespace, String operation, String method, com.google.gson.JsonObject body) Explicit application request to an advertised extension operation, never automatic execution. -
deregister
-
rotateAdmissionKey
-
rotateMachineKey
-
drain
-
stop
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-