@@ -148,44 +148,32 @@ public Set<CachedPlayer> getCachedPlayers() {
148148 * @param messageParts String message parts to send
149149 * @return The number of servers that received the message
150150 */
151+ // TODO: remove this method, use only (List<String> messageParts)
151152 public synchronized long publish (String dest , String channel , String ... messageParts ) {
152153 return publish (dest , channel , Arrays .asList (messageParts ));
153154 }
154155
155156 /**
156157 * Publishes a string message using Redis PubSub
157- * <p>See {@link Servers} for special destination values.</p>
158158 *
159- * @param dest Server name that message should go to
160159 * @param channel Custom channel name for the message
161160 * @param messageParts String message parts to send
162161 * @return The number of servers that received the message
163162 */
164- public synchronized long publish (@ NonNull String dest , @ NonNull String channel , @ NonNull List <String > messageParts ) {
165- plugin .debug ("DeltaRedisCommandSender.publish()" );
166-
167- List <String > updatedList = new ArrayList <>(messageParts .size () + 2 );
168- updatedList .add (serverName );
169- updatedList .add (channel );
170-
171- // Add the rest of the message parts
172- // Why: {dest, channel, {escaped parts}} vs. {dest, channel, part1, part2, ...}
173- updatedList .addAll (messageParts );
174-
175- String escaped = EscapeAndDelimiterUtil .DELTA_SEPARATED .escapeAndDelimit (updatedList );
176-
177- plugin .debug ("Sending message: " + escaped );
178- return connection .sync ().publish (bungeeName + ':' + dest , escaped );
163+ public synchronized long publish (@ NonNull String channel , @ NonNull List <String > messageParts ) {
164+ return publish (Servers .SPIGOT , channel , messageParts );
179165 }
180166
181167 /**
182168 * Publishes a string message using Redis PubSub
169+ * <p>See {@link Servers} for special destination values.</p>
183170 *
171+ * @param dest Server name that message should go to
184172 * @param channel Custom channel name for the message
185173 * @param messageParts String message parts to send
186174 * @return The number of servers that received the message
187175 */
188- public synchronized long publish (@ NonNull String channel , @ NonNull List <String > messageParts ) {
176+ public synchronized long publish (@ NonNull String dest , @ NonNull String channel , @ NonNull List <String > messageParts ) {
189177 plugin .debug ("DeltaRedisCommandSender.publish()" );
190178
191179 List <String > updatedList = new ArrayList <>(messageParts .size () + 2 );
@@ -199,7 +187,7 @@ public synchronized long publish(@NonNull String channel, @NonNull List<String>
199187 String escaped = EscapeAndDelimiterUtil .DELTA_SEPARATED .escapeAndDelimit (updatedList );
200188
201189 plugin .debug ("Sending message: " + escaped );
202- return connection .sync ().publish (bungeeName + ":*" , escaped );
190+ return connection .sync ().publish (bungeeName + ':' + dest , escaped );
203191 }
204192
205193 /**
0 commit comments