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

Client#readStringUntil only ever returns first element #23

Open
DarkEyeDragon opened this issue Dec 18, 2020 · 0 comments
Open

Client#readStringUntil only ever returns first element #23

DarkEyeDragon opened this issue Dec 18, 2020 · 0 comments

Comments

@DarkEyeDragon
Copy link

When testing the following code i came to the conclusion that only ever one element is returned for Client#readStringUntil

client.readByteAlways(opCode -> {
    if (opCode == 2) {
        List<String> tempWarps = new ArrayList<>();
        client.readString(s -> {
            client.readInt(warpSize -> {
                AtomicInteger count = new AtomicInteger(0);
               //this part
                client.readStringUntil(s1 -> {
                    tempWarps.add(s1);
                    return warpSize < count.getAndIncrement();
                });
            });
            serverWarps.put(s, tempWarps);
        });
    }
});

it seems to ignore the return value. if i swap < for > the result is the same.

I also tried using client.readStringAlways but this messes up when new packets are received as they're still getting handled in the readStringAlways

@DarkEyeDragon DarkEyeDragon changed the title Client.readStringUntil only ever returns first element Client#readStringUntil only ever returns first element Dec 18, 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