ProxioDev / ValioBungee

Synchronize players data between BungeeCord / Velocity proxies
Eclipse Public License 1.0
191 stars 50 forks source link

Replacement of registerPubSubChannels to register channels events #104

Open Elikill58 opened 1 month ago

Elikill58 commented 1 month ago

Your question?

What is the replacement for registerPubSubChannels ? I tried to do it myself with RedisBungeeAPI.getRedisBungeeApi().getJedisPool().getResource() but it seems to block the thread or something.

ham1255 commented 1 month ago

there is no need to register it its just done automatically for any channel you send

ham1255 commented 1 month ago

eh maybe you didn't close connections and Also don't use JedisPool instead use as UnifiedJedis as an alternative

Elikill58 commented 1 month ago

there is no need to register it its just done automatically for any channel you send

And it's well registering for events ? I just need to send like a fake message to make it registered in reading ?

ham1255 commented 1 month ago

Its done automatically Event will fire just normal no need to send message to register.

Elikill58 commented 1 month ago

This doesn't works. I'm sending something on a channel, and I'm waiting for answer. I can't get it, but while listening on redis-cli, I well see the published content.

Also, methods to get the UnifiedJedis are deprecated.

Finally, this event seems most to say which message are sent from this proxy to others, not the opposite

ham1255 commented 1 month ago

Also, methods to get the UnifiedJedis are deprecated.

see the wiki it has better way https://github.com/ProxioDev/ValioBungee/wiki/API#relocation--access-built-in-unifiedjedis

This doesn't works. I'm sending something on a channel, and I'm waiting for answer. I can't get it, but while listening on redis-cli, I well see the published content.

did you register the listener? because if its not working then internals of redisbungee should be failing since its used for players events etc.

// code used in velocity proxy
@Subscribe
    public void onPubSubMessageEvent(PubSubMessageEvent event) {
        System.out.println("handling: " + event.getChannel());
        handlePubSubMessageEvent(event);
    }
[22:00:49 INFO]: handling: redisbungee-player-join
[22:00:49 INFO]: handling: redisbungee-player-join
[22:00:49 INFO]: handling: redisbungee-serverchange
[22:00:49 INFO]: handling: redisbungee-serverchange