Phoenix616 / ResourcepacksPlugins

Set resource packs on whole proxy, per server and per world!
https://ci.minebench.de/job/ResourcepacksPlugins/
GNU General Public License v3.0
77 stars 16 forks source link

BungeeResourcePacks Causing Preview Snapshot Client to be Disconnected #49

Closed Xuwznln closed 2 years ago

Xuwznln commented 3 years ago

Used Version

BungeeResoourcepacks dev build 361 and 386.

Config

debug: true
default-language: en
disable-metrics: true
autogeneratehashes: true
usepack-is-temporary: true
stored-packs-override-assignments: false
permanent-pack-remove-time: 30
packs:
  scia:
    url: https://*.zip
    hash: d68f179e5366ba8d3e7a680a2ab6a45ab2879090
    format: 4
    restricted: false
    permission: bungeeresourcepacks.pack.lobbypack
  ra:
    url: https://*.zip
    hash: bfc64572e5343e4008b87af5049663d3054218aa
    restricted: false
    permission: bungeeresourcepacks.pack.lobbypack
empty:
  url: https://*.zip
  hash: 67256f3a3daa33bb8e4daa81e81a3631c5158fc7
global:
  secondary:
  - scia
  - ra
  send-delay: 20
servers:
  survival:
    pack: scia
    regex: Survival.*
  rts:
    pack: ra
    regex: RTS.*

Environment description

Waterfall with 1.17 support version. (link: https://github.com/PaperMC/Waterfall/pull/582)

Full Log

No error log, simply disconnect info.

What other programs/plugins are you running?

I have a plugin created by myself to prevent snapshot clients use resourcepacks, here is the main part code.

    @EventHandler
    public void on(ResourcePackSelectEvent e){
        if(e.getStatus()==SUCCESS){
            if(proxyServer.getPlayer(e.getPlayerId()).getPendingConnection().getVersion()>=1073741829){
                e.setStatus(WRONG_VERSION);
            }
        }
    }

What is happening?

Preview snapshot client will disconnect when his potion effect is expired. I have no idea why this would happen. But after I remove brp, they can play normally. This happens on all downstream servers whether it is fabric or paper servers with viaversion-dev-21w03a.

Phoenix616 commented 3 years ago

Well generally speaking snapshots aren't supported, especially as there are no official proxies available for it anyways and I'm not going to waste tons of time on something that will potentially break again next week.

Anyways: Without the error/log there is nothing that can be done about this, please provide that.

Xuwznln commented 3 years ago

There is no exact log that brp provides(already enabled debug), only these disconnect logs when the potion effect is expired:

[10:36:34 WARN]: [/127.0.0.1:3314|Xu_wznln] <-> DownstreamBridge <-> [AuthT] - bad packet ID, are mods in use!? No more bytes reading varint.
[10:41:14 INFO]: [/127.0.0.1:3655|Xu_wznln] <-> DownstreamBridge <-> [AuthT] has disconnected.
Xuwznln commented 3 years ago

I tried using old version one by one, and the last version that wont cause this problem is build328, hope this could help you fix this problem.

Phoenix616 commented 3 years ago

I don't think such an old build can fix anything, it would be lacking support for tons of versions.

It looks like the resource pack send packet was changed which is most likely the cause of this. You can test manually adding the correct ID mapping to the config (which should stop the disconnects) but it might require a code modification to get pack sending to work seeing as they added a new parameter. This will be looked into once the release protocol specification is available.

Xuwznln commented 3 years ago

I tried this way and fixed this problem: step1. add a constant SNAPSHOT_PROTOCOL in MinecraftVersion.java step2. change method like this:

    public String toConfigString() {
        return this == UNKNOWN||this == SNAPSHOT_PROTOCOL ? name() : name().toLowerCase().substring("MINECRAFT_".length()).replace('_', '.');
    }

step3. add " 'SNAPSHOT_PROTOCOL': 0x39" in the packetmap.yml

Phoenix616 commented 3 years ago

It should not be necessary to edit the source it all, you can just add the protocol version directly to the packetmap.yml.

Xuwznln commented 3 years ago

It seems the version only contains in the waterfall that I use. I wont let snapshot players use any resourcepack, I simply dont want them always disconnected from the server.