diff options
Diffstat (limited to 'shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java')
| -rw-r--r-- | shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java b/shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java index a6d8c0a..4eaf389 100644 --- a/shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java +++ b/shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java @@ -1,6 +1,14 @@ package kz.ilotterytea.frogartha.exceptions; -public class PlayerKickException extends RuntimeException { +import com.github.czyzby.websocket.serialization.SerializationException; +import com.github.czyzby.websocket.serialization.Transferable; +import com.github.czyzby.websocket.serialization.impl.Deserializer; +import com.github.czyzby.websocket.serialization.impl.Serializer; + +public class PlayerKickException extends RuntimeException implements Transferable<PlayerKickException> { + public PlayerKickException() { + } + private PlayerKickException(String message) { super(message); } @@ -12,4 +20,14 @@ public class PlayerKickException extends RuntimeException { public static PlayerKickException internalServerError() { return new PlayerKickException("Internal Server Error"); } + + @Override + public void serialize(Serializer serializer) throws SerializationException { + serializer.serializeString(getMessage()); + } + + @Override + public PlayerKickException deserialize(Deserializer deserializer) throws SerializationException { + return new PlayerKickException(deserializer.deserializeString()); + } } |
