From 1ecd8d1d527b6b66b4746e44023b6ab3cb2ca4cc Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 21 Jan 2025 03:17:15 +0500 Subject: feat: using other serializer and gdx-websocket (because the old one doesn't support gwt) --- .../frogartha/exceptions/PlayerKickException.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'shared/src/main/java/kz/ilotterytea/frogartha/exceptions/PlayerKickException.java') 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 { + 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()); + } } -- cgit v1.2.3