diff --git a/Plugins/Mineplex.Core/src/mineplex/core/party/constants/JoinResponseReason.java b/Plugins/Mineplex.Core/src/mineplex/core/party/constants/JoinResponseReason.java index 6a32c3672..56cd100e2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/party/constants/JoinResponseReason.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/party/constants/JoinResponseReason.java @@ -8,16 +8,14 @@ import mineplex.core.common.util.F; public enum JoinResponseReason { - CANNOT_JOIN_FULL(F.main("Party", "Your party cannot join full servers!"), "no"), - SUCCESS("", "yes"); + CANNOT_JOIN_FULL(F.main("Party", "Your party cannot join full servers!")), + SUCCESS(""); private String _message; - private String _code; - JoinResponseReason(String message, String code) + JoinResponseReason(String message) { _message = message; - _code = code; } public String getMessage() @@ -25,8 +23,4 @@ public enum JoinResponseReason return _message; } - public String getCode() - { - return _code; - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyJoinManager.java b/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyJoinManager.java index 8f8502a83..9226ce9c6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyJoinManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyJoinManager.java @@ -71,12 +71,12 @@ public class PartyJoinManager //Max number of people on. if (!canJoinFull) { - _plugin.getRedisManager().publish(serverFrom, RedisMessageType.PREJOIN_SERVER_RESPONSE, initiator, JoinResponseReason.CANNOT_JOIN_FULL.name(), JoinResponseReason.CANNOT_JOIN_FULL.getCode(), _plugin.getServerName()); + _plugin.getRedisManager().publish(serverFrom, RedisMessageType.PREJOIN_SERVER_RESPONSE, initiator, JoinResponseReason.CANNOT_JOIN_FULL.name(), _plugin.getServerName()); return; } } - _plugin.getRedisManager().publish(serverFrom, RedisMessageType.PREJOIN_SERVER_RESPONSE, initiator, JoinResponseReason.SUCCESS.name(), JoinResponseReason.SUCCESS.getCode(), _plugin.getServerName()); + _plugin.getRedisManager().publish(serverFrom, RedisMessageType.PREJOIN_SERVER_RESPONSE, initiator, JoinResponseReason.SUCCESS.name(), _plugin.getServerName()); } @@ -84,11 +84,10 @@ public class PartyJoinManager * Manages a received response * * @param playerSender The player who sent the request - * @param response The String response * @param server The server responding * @param reason The reason for the response */ - public void handleJoinResponse(String playerSender, String response, String server, JoinResponseReason reason) + public void handleJoinResponse(String playerSender, String server, JoinResponseReason reason) { Player player = Bukkit.getPlayer(playerSender); if (player == null) @@ -100,7 +99,7 @@ public class PartyJoinManager { return; } - if (response.equalsIgnoreCase(JoinResponseReason.CANNOT_JOIN_FULL.getCode())) + if (reason != JoinResponseReason.SUCCESS) { party.sendMessage(reason.getMessage()); return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyRedisManager.java b/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyRedisManager.java index 7dde209b8..d657d3214 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyRedisManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/party/manager/PartyRedisManager.java @@ -148,7 +148,7 @@ public class PartyRedisManager break; case PREJOIN_SERVER_RESPONSE: - _plugin.getJoinManager().handleJoinResponse(first, third, contents[3], JoinResponseReason.valueOf(second.toUpperCase())); + _plugin.getJoinManager().handleJoinResponse(first, third, JoinResponseReason.valueOf(second.toUpperCase())); break; } }); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/party/redis/RedisMessageType.java b/Plugins/Mineplex.Core/src/mineplex/core/party/redis/RedisMessageType.java index 073285ed8..341e121a6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/party/redis/RedisMessageType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/party/redis/RedisMessageType.java @@ -19,8 +19,8 @@ public enum RedisMessageType //Message: SERVER_FROM,PLAYER_INITIATING,PARTY_SIZE,_CAN_JOIN_FULL PREJOIN_SERVER_REQUEST(5, "{0},{1},{2},{3}"), - //Message: PLAYER_INITIATING,RESPONSE,REASON,SERVER - PREJOIN_SERVER_RESPONSE(6, "{0},{1},{2},{3}"), + //Message: PLAYER_INITIATING,REASON,SERVER + PREJOIN_SERVER_RESPONSE(6, "{0},{1},{2}"), //Message: JSON Party PARTY_INFO(7, "{0}"),