Subscribe to response channel before requesting quests

This commit is contained in:
cnr 2017-06-01 17:25:30 -05:00
parent b823fc62c9
commit 60a696a82e

View File

@ -40,13 +40,13 @@ public class RedisQuestSupplier implements QuestSupplier
_serverUniqueId = plugin.getConfig().getString("serverstatus.name"); _serverUniqueId = plugin.getConfig().getString("serverstatus.name");
requestActiveQuests();
// update quests sent specifically to this server when it requests them (like on startup) // update quests sent specifically to this server when it requests them (like on startup)
_pubSub.subscribe(PubSubChannels.QUEST_REQUEST_BASE + _serverUniqueId, this::updateQuests); _pubSub.subscribe(PubSubChannels.QUEST_REQUEST_BASE + _serverUniqueId, this::updateQuests);
// update quests when received // update quests when received
_pubSub.subscribe(PubSubChannels.QUEST_SUPPLIER_CHANNEL, this::updateQuests); _pubSub.subscribe(PubSubChannels.QUEST_SUPPLIER_CHANNEL, this::updateQuests);
requestActiveQuests();
} }
private void updateQuests(String channel, String message) private void updateQuests(String channel, String message)