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

1.13-1.16 version client team packet modification exception #50

Closed
MeowRay opened this issue Aug 2, 2020 · 2 comments
Closed

1.13-1.16 version client team packet modification exception #50

MeowRay opened this issue Aug 2, 2020 · 2 comments

Comments

@MeowRay
Copy link

MeowRay commented Aug 2, 2020

After modifying the prefix of team packet, the client works normally under 1.13 version, but above 1.13, the client json error occurs and there is no server console error
QQ截图20200802122820

code:

@Override
    public ParseResult<Team> tran(Stream stream, Team packet, ProxiedPlayer player) {
        if (packet.getPrefix() != null) {
            String s = packet.getPrefix().replace("喵喵喵", "meowwwwww");
            if (s != null) {
                if (s.length() > 16) s = s.substring(0, 16);
                packet.setPrefix(s);
                modfiy = true;
            }
        }
        if (modfiy) {
            return new ParseResult<>(packet, true, false);
        }
        return (ParseResult<Team>) NO_MODIFY;
    }

@MeowRay
Copy link
Author

MeowRay commented Aug 2, 2020

Oh, it seems that prefix and suffix are in the form of json in version 1.13 and above, I am still testing...

@MeowRay
Copy link
Author

MeowRay commented Aug 2, 2020

Okay.. bungeecord client version 1.8-1.13 team packet prefix is a text, 1.13-1.16 is json. I need to write two parsing methods

@MeowRay MeowRay closed this as completed Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant