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

According to wiki.vg this data type is wrong. And how to respond to tab completes? #187

Open
ajh123 opened this issue Dec 6, 2022 · 7 comments

Comments

@ajh123
Copy link

ajh123 commented Dec 6, 2022

out += cls.pack_string(node['parser'])

Wiki.vg says the parser id is a Varint, above we are treating it as a string, Is this a change past 1.13?. When using my code I get the error below because the parser ID is not meant to be a string (because it's too big?)

image

@ajh123
Copy link
Author

ajh123 commented Dec 6, 2022

BTW, I'm using 1.19.2 vanilla

@ajh123
Copy link
Author

ajh123 commented Dec 7, 2022

Solved by writing my own command node packer. I wish it could be implemented into quarry.

@ajh123 ajh123 changed the title According to wiki.vg this data type is wrong. According to wiki.vg this data type is wrong. And how to respond to tab completes? Dec 7, 2022
@ajh123
Copy link
Author

ajh123 commented Dec 7, 2022

I have been trying to send this packet (under quarry it's called "tab_complete") to the client but I can't seem how to construct its array properly.

class TabCompleteProtocol(ChatProtocol): # <-- Just a normal ServerProtocol
    def packet_tab_complete(self, buff: Buffer1_19_1): # <-- Buffer1_19_1 is there just for type hints
        trans_id = buff.unpack_varint()
        msg = buff.unpack_string()

        array = []
        array.append(("msg", False))
        array.append(("123", False))

        output = b""
        for e in array:
            output+=self.buff_type.pack_string(e[0])
            output+=self.buff_type.pack("?", e[1])

        self.send_packet(
            "tab_complete",
            self.buff_type.pack_varint(trans_id),
            self.buff_type.pack_varint(3), # Start of the text to replace.
            self.buff_type.pack_varint(3), # Length of the text to replace.
            self.buff_type.pack_varint(len(array)), # Number of elements in the following array.
            self.buff_type.pack_byte_array(output)
        )

The problem is I can't seem to figure out how to construct the array. Or are my Varints wrong?

@davidawesome02
Copy link

the packet name might be wrong, this program is outdated af for names

@davidawesome02
Copy link

Solved by writing my own command node packer. I wish it could be implemented into quarry.

NICE JOB BRO, that is cool

@davidawesome02
Copy link

Also make a pull request and try to merge it, if owner ever gets active he might

@ajh123
Copy link
Author

ajh123 commented Jan 23, 2023

the packet name might be wrong, this program is outdated af for names

It's not the name because that's what Qurray calls it in it's files. The problem is how I'm adding the data to the packet.

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

2 participants