Netzwerkkomponente(#9)

main
Johannes Hochwart 3 years ago
parent 50eb22219b
commit 1183283889

@ -1,26 +0,0 @@
package eu.jonahbauer.wizard.common.messages.server;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import java.util.UUID;
@Getter
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = true)
public final class KickVotedMessage extends ServerMessage {
/**
* UUID of the voting player
*/
private final @NonNull UUID voter;
/**
* UUID of player who is supposed to be kicked
*/
private final @NonNull UUID player;
/**
* Time until the vote ends in {@link System#currentTimeMillis() UNIX time}
*/
private final long timeout;
}

@ -1,18 +0,0 @@
package eu.jonahbauer.wizard.common.messages.server;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import java.util.UUID;
@Getter
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = true)
public final class KickedMessage extends ServerMessage {
/**
* UUID of player who was kicked
*/
private final @NonNull UUID player;
}

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.SneakyThrows;
@EqualsAndHashCode
public abstract sealed class ServerMessage permits AckMessage, GameMessage, KickVotedMessage, KickedMessage, NackMessage, PlayerLeftMessage, PlayerModifiedMessage, SessionJoinedMessage, SessionListMessage, SessionModifiedMessage, SessionRemovedMessage, StartingGameMessage {
public abstract sealed class ServerMessage permits AckMessage, GameMessage, NackMessage, PlayerLeftMessage, PlayerModifiedMessage, SessionJoinedMessage, SessionListMessage, SessionModifiedMessage, SessionRemovedMessage, StartingGameMessage {
private static final ObjectMapper MAPPER = SerializationUtil.newObjectMapper(ServerMessage.class, ObserverMessage.class);
public static ServerMessage parse(String json) throws ParseException {

Loading…
Cancel
Save