blob: ec0deb4f4207be14bfcf14a201316ea80a707d4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package kz.ilotterytea.frogartha.exceptions;
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);
}
public static PlayerKickException loggedIn() {
return new PlayerKickException("You logged in from another location");
}
public static PlayerKickException internalServerError() {
return new PlayerKickException("Internal Server Error");
}
public static PlayerKickException jumpSpam() {
return new PlayerKickException("Kicked for jump spamming");
}
@Override
public void serialize(Serializer serializer) throws SerializationException {
serializer.serializeString(getMessage());
}
@Override
public PlayerKickException deserialize(Deserializer deserializer) throws SerializationException {
return new PlayerKickException(deserializer.deserializeString());
}
}
|