Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] sync last server using a toggle in the config #84

Closed
jnijland opened this issue Aug 6, 2023 · 2 comments · Fixed by #86
Closed

[Feature] sync last server using a toggle in the config #84

jnijland opened this issue Aug 6, 2023 · 2 comments · Fixed by #86
Assignees
Labels
all platforms enhancement New feature or request
Milestone

Comments

@jnijland
Copy link

jnijland commented Aug 6, 2023

Describe the bug
TL;DR Not sure if this is something that is supposed to be working or not, maybe it's a new feature.

When on a multi proxy setup, with the force_default_server option set to false, the player is not sent to the latest server it was joined to. It does work when the user joins the same proxy, but not when switching proxies.

For example; player is on proxy a on server minigames_1. When relogging to proxy a player gets send to minigames_1, however when joining via proxy b it gets send to the default server of proxy b.

To Reproduce
Steps to reproduce the behavior:

  1. Have a multi proxy setup with multiple Bungeecord/Waterfall/Flamecord proxies;
  2. Set reconnect to enable in modules.yml and force_default_server to false in the config.yml;
  3. Have multiple backend servers behind the proxies;
  4. Join one of the proxies and go to a non-default backend server, disconnect;
  5. Join a different proxy, you will be sent to the default backend server;

Expected behavior
The player should be sent to the last server it was on

Redis version? it should be at least 6 and above.
6.0.16

Bungeecord version or (the bungee fork name eg: waterfall) and your plugins
Flamecord 1.5.9 but also tested on Waterfall 1.20 build 536.

@ham1255
Copy link
Member

ham1255 commented Aug 7, 2023

hmm i don't think this a thing in redisbungee, but i could include in future update, as toggle in config in-case you handle it differently

@ham1255 ham1255 added enhancement New feature or request and removed waiting labels Aug 7, 2023
@ham1255 ham1255 changed the title Joining latest server when relogging does not work [Feature] sync last server using a toggle in the config Aug 7, 2023
@jnijland
Copy link
Author

jnijland commented Aug 8, 2023

Would be awesome @ham1255! It might be an edge case since most people want players to always join in a lobby, but I'm sure there are more server owners out here who would like to use a multi proxy setup using RedisBungee with players joining their last server.

@ham1255 ham1255 added this to the 0.12.0 milestone Aug 10, 2023
@ham1255 ham1255 mentioned this issue Sep 10, 2023
ham1255 added a commit that referenced this issue Apr 28, 2024
## NOTES
data system shouldn't effect anybody, unless you do any direct query to
Redis query data, you should adapt the changes, by viewing classes
`ProxyDataManager` and `PlayerDataManager`

# Changes 
* RedisBungee is compiled with `java 17` now, Due java 11 support is
ending at end of September
* config version is now `2` which will reset your config if older
version
* Adventure API is included inside RedisBungee API
* new Language infrastructure for RedisBungee built-in messages #85
*commands not included yet*
* New data system which replaces Redis PubSub with Redis Streams *see
below*
* Ability to connect player to last server they where on using an config
option #84
* new environment variable `REDISBUNGEE_PROXY_ID` which can be set
before launch
* new environment variable `REDISBUNGEE_NETWORK_ID` which can be set
before launch
* RedisBungee requires redis version 6.2 or above  #88 
* Better command system
#93

## New data system
Due limitation of Redis PubSub in Cluster environment, Internals of
RedisBungee were changed to support Redis Streams
- Network Ids
  - networks ids used to group network proxies
    - example having 'test' network and 'main' network
- Networks in the same redis server / cluster share the same UUID cache
- Heartbeat system:
- RedisBungee old heartbeat system used hastset on redisbungee to store
the current unix time of the proxy to check what every proxy died or
not, now instead we publish the heartbeat using unix time, and online
count to proxy which proxy store it in their memory, which allow the
`get number of online players` to be faster than pooling whole list in
old data system.

- PubSub
- since redisbungee was initially designed with pubsub in mind,
registration no longer required now for event to fire, see the api
changes below.

## Commands System
* rewritten using [acf lib](https://github.com/aikar/commands) to be
platform independent
* new command `/rb` or `/redisbungee` with sub commands `help`, `info`,
'clean', 'show'.

* 'rb'
  * '/rb' and '/rb info'

![image](https://github.com/ProxioDev/RedisBungee/assets/34905970/70796ab0-b5fd-4578-8c93-c976e517df95)

  * '/rb show'
  

![image](https://github.com/ProxioDev/RedisBungee/assets/34905970/56332c37-701f-43e0-946b-6894b845fab3)

* configuration to disable or override each command from legacy to new
introduced one `/rb`
```yaml

# For redis bungee legacy commands
# either can be run using '/rbl glist' for example
# or if 'install' is set to true '/glist' can be used.
# 'install' also overrides the proxy installed commands
#
# In legacy commands each command got it own permissions since they had it own permission pre new command system,
# so it's also applied to subcommands in '/rbl'.
commands:
  # Permission redisbungee.legacy.use
  redisbungee-legacy:
    enabled: false
    subcommands:
        # Permission redisbungee.command.glist
        glist:
          enabled: false
          install: false
        # Permission redisbungee.command.find
        find:
          enabled: false
          install: false
        # Permission redisbungee.command.lastseen
        lastseen:
          enabled: false
          install: false
        # Permission redisbungee.command.ip
        ip:
          enabled: false
          install: false
        # Permission redisbungee.command.pproxy
        pproxy:
          enabled: false
          install: false
        # Permission redisbungee.command.sendtoall
        sendtoall:
          enabled: false
          install: false
        # Permission redisbungee.command.serverid
        serverid:
          enabled: false
          install: false
        # Permission redisbungee.command.serverids
        serverids:
          enabled: false
          install: false
       # Permission redisbungee.command.plist
        plist:
          enabled: false
          install: false
  # Permission redisbungee.command.use
  redisbungee:
    enabled: true
```

## API changes
- Kick api Deprecated: 
  - `kickPlayer(String playerName, String message) `
  - `kickPlayer(UUID playerUUID, String message) `

- newer where added using adventure api:
  - `kickPlayer(String playerName, Component message) `
  - `kickPlayer(UUID playerUUID, Component message) `

-  PubSub registration api Deprecated:
```java
/**
     * Register (a) PubSub channel(s), so that you may handle PubSubMessageEvent for it.
     *
     * @param channels the channels to register
     * @SInCE 0.3
     * @deprecated No longer required
     */
    @deprecated
    public final void registerPubSubChannels(String... channels) {
    }

    /**
     * Unregister (a) PubSub channel(s).
     *
     * @param channels the channels to unregister
     * @SInCE 0.3
     * @deprecated No longer required
     */
    @deprecated
    public final void unregisterPubSubChannels(String... channels) {
    }

```
# Contributors

* `summoncraft.us` for running this branch in production
* @SrBedrock for providing [Brazilian
Portuguese](https://en.wikipedia.org/wiki/Brazilian_Portuguese)
translation #87
 
# issues
closes #84 
closes #88 
closes #92 
closes #81
closes #93

---------

Signed-off-by: mohammed jasem alaajel <xrambad@gmail.com>
Co-authored-by: ThiagoROX <51332006+SrBedrock@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all platforms enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants