From 5cae57139c5e9e543dff9168b2dd2eb7f0fe93b8 Mon Sep 17 00:00:00 2001 From: delvh Date: Fri, 7 Feb 2020 23:29:22 +0100 Subject: [PATCH] Added default reasons to HandshakeRejectionEvent --- .../envoy/event/HandshakeRejectionEvent.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/envoy/event/HandshakeRejectionEvent.java b/src/main/java/envoy/event/HandshakeRejectionEvent.java index aca655e..5537a18 100644 --- a/src/main/java/envoy/event/HandshakeRejectionEvent.java +++ b/src/main/java/envoy/event/HandshakeRejectionEvent.java @@ -1,5 +1,7 @@ package envoy.event; +import envoy.data.LoginCredentials; + /** * Signifies to the client that the handshake failed for the attached * reason.
@@ -13,6 +15,28 @@ package envoy.event; */ public class HandshakeRejectionEvent implements Event { + /** + * Select this value if a given password hash was incorrect + */ + public static final String WRONG_PASSWORD = "an incorrect password was entered"; + + /** + * Select this value if a given {@link LoginCredentials} pointed at a client who + * is already online + */ + public static final String ALREADY_ONLINE = "user is already online"; + + /** + * Select this value if a given {@link LoginCredentials} pointed at a client who + * does not exist + */ + public static final String USER_DOES_NOT_EXIST = "user does not exist"; + + /** + * Select this value if an unknown error occurred + */ + public static final String UNKNOWN_REASON = "cause of failure is unknown"; + private final String reason; private static final long serialVersionUID = -8723270093452609197L;