mancala/apps/backend-quarkus/src/main/java/app/playmancala/model/UserConnectionInfo.java
Halit Aksoy f0246cca61 feat(backend): add the wire types, the game loop and token verification
Records for the JSON the clients read, leaving out only the fields
TypeScript leaves undefined. GameLoop is the single thread that owns live
state; ManualScheduler replaces Jest's fake timers in tests. Keycloak
tokens are verified with jose4j and the same checks as before.
2026-10-16 11:09:16 +03:00

16 lines
555 B
Java

package app.playmancala.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
public record UserConnectionInfo(
String userId,
@JsonInclude(JsonInclude.Include.NON_NULL) String name,
@JsonProperty("isGuest") boolean isGuest,
@JsonProperty("isOnline") boolean isOnline) {
public static UserConnectionInfo of(PlayerSummary player, boolean isOnline) {
return new UserConnectionInfo(player.userId(), player.name(), player.isGuest(), isOnline);
}
}