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

Rewrite MOTD parser #335

Merged

Conversation

PerchunPak
Copy link
Member

@PerchunPak PerchunPak commented Jun 23, 2022

Full rewrite of MOTD parser. I also made an API for users, so they can easily write their own parser.

Closes #204.

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 2 times, most recently from fef59cd to 223d6f2 Compare June 24, 2022 09:42
@PerchunPak PerchunPak marked this pull request as ready for review June 25, 2022 10:07
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 43db85e to 4e2ff9e Compare June 25, 2022 10:15
mcstatus/tests/test_motd.py Outdated Show resolved Hide resolved
mcstatus/pinger.py Outdated Show resolved Hide resolved
mcstatus/bedrock_status.py Outdated Show resolved Hide resolved
@PerchunPak
Copy link
Member Author

Found something strange, when I read about the protocol, found that all text in MOTD can be formatted with one tag on top level. See this. Should I implement parsing for this?

@ItsDrike
Copy link
Member

Found something strange, when I read about the protocol, found that all text in MOTD can be formatted with one tag on top level. See this. Should I implement parsing for this?

That's interesting, good catch, yeah it probably should be respected, even though I don't think I've seen that before. If you are going to be adding support for that here, make sure to also add a unit-test for that. Otherwise, you can reference this comment in a new issue about this and let someone else handle it later.

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 4e2ff9e to 9618efb Compare June 28, 2022 14:51
Copy link
Member

@ItsDrike ItsDrike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a quick review of some issues I noticed when reading over the code for the first time, I'll make another review after inspecting the code in greater detail and doing some manual testing later, when these issues will be resolved.

This also needs addressing the failed unit tests and validation github workflows

NOTE: If this PR wasn't yet supposed to be reviewed, please mark it back as draft PR and feel free to ignore this review up until you think the PR will be ready.

mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/motd.py Outdated Show resolved Hide resolved
mcstatus/tests/test_motd.py Outdated Show resolved Hide resolved
@ItsDrike ItsDrike added type: enhancement Improvement to an existing feature area: API Related to core API of the project state: waiting for author Waiting for author to address a review or respond to a comment labels Jun 28, 2022
@PerchunPak
Copy link
Member Author

NOTE: If this PR wasn't yet supposed to be reviewed, please mark it back as draft PR and feel free to ignore this review up until you think the PR will be ready.

This is ready to review, but not for merge. I'm keep doing ansi and xterm-256 properties.

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 9618efb to bccee99 Compare June 30, 2022 10:19
@PerchunPak
Copy link
Member Author

I pretty sure, few big moments here still needs more work.

@PerchunPak PerchunPak marked this pull request as draft July 1, 2022 19:35
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 2 times, most recently from b09a9e2 to 4ca2f0d Compare July 2, 2022 12:46
@PerchunPak PerchunPak marked this pull request as ready for review July 2, 2022 12:52
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 4ca2f0d to 5cfd1e4 Compare July 2, 2022 14:40
@PerchunPak
Copy link
Member Author

image

Hmmmmmmm... I wonder, how many things was broken in first implementation from Iapetus-11...

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from fbb8556 to fe247ea Compare July 2, 2022 16:24
@ItsDrike ItsDrike added do-not-merge The PR can be reviewed but cannot be merged now labels Jul 2, 2022
@ItsDrike
Copy link
Member

ItsDrike commented Jul 2, 2022

Adding do-not-merge label, as requested.

This do-not-merge is here because this PR relies on renaming description to motd, which is currently a change that's not final and is still being discussed. To avoid the same discussion from happening here, a do-not-merge label is added until that discussion is resolved/306 gets merged.

Note that this PR can be still reviewed and approved, it just shouldn't yet be merged. But when reviewing, this blocking status should be taken into consideration, and some points on changes in variable naming or other inconsistencies with current code-base may not actually be inconsistencies, as this assumes the pending decision about this rename in 306 will end up on choosing to rename description to motd.

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from fe247ea to 622d58b Compare July 5, 2022 09:46
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 2 times, most recently from 2e315db to 3f458bc Compare July 5, 2022 17:14
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 3 times, most recently from 46dabec to 40774ba Compare January 15, 2023 17:39
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 4 times, most recently from d6eef53 to 6e15db5 Compare January 22, 2023 20:00
@PerchunPak
Copy link
Member Author

As flows out of this conversation, we no longer support ANSI 3-bit, 4-bit and 8-bit. At now, we only support 24-bit.

If you want this feature - implement it yourself, or raise a feature request. We can reconsider this.


Also, I found a public database with 130k servers and their answers. If you need to test this PR on real world - I can give a file with 45mb of raw answers. Just contact me.

@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 6e15db5 to 0c41416 Compare January 22, 2023 21:14
mcstatus/motd/__init__.py Outdated Show resolved Hide resolved
mcstatus/motd/__init__.py Outdated Show resolved Hide resolved
mcstatus/motd/__init__.py Outdated Show resolved Hide resolved
mcstatus/motd/__init__.py Outdated Show resolved Hide resolved
mcstatus/motd/components.py Outdated Show resolved Hide resolved
mcstatus/motd/simplifies.py Outdated Show resolved Hide resolved
mcstatus/motd/simplifies.py Outdated Show resolved Hide resolved
mcstatus/motd/simplifies.py Outdated Show resolved Hide resolved
mcstatus/motd/simplifies.py Outdated Show resolved Hide resolved
tests/test_motd/test_transformers.py Outdated Show resolved Hide resolved
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 0c41416 to a950e99 Compare January 24, 2023 10:32
@ItsDrike ItsDrike removed the do-not-merge The PR can be reviewed but cannot be merged now label Jan 25, 2023
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 2 times, most recently from fae1023 to 4277421 Compare February 19, 2023 21:27
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from 4277421 to a9e15ec Compare March 20, 2023 13:26
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch 2 times, most recently from 04dfac0 to ab53f18 Compare April 15, 2023 09:16
@PerchunPak PerchunPak force-pushed the add-more-methods-connected-to-motd branch from ab53f18 to d9666e9 Compare April 15, 2023 09:18
Copy link
Member

@ItsDrike ItsDrike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, is there something else that needs to be done before this can be merged? Do the simplify methods all work properly? Could you do some field testing to make sure that this works with most servers without issues?

@PerchunPak
Copy link
Member Author

I found a database with several hundred thousand unparsed Minecraft servers' answers, and I will run all methods on them. Although, simplifies can be improved in some situations, you said that improving of them should go as separated PR, so this PR will be merged faster.

Copy link
Member

@ItsDrike ItsDrike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the simplifies can just be updated later, forgot I mentioned that before. In that case, after the integration testing is done, assuming it passes, IMO this can be merged.

Although I would like to see @kevinkjt2000's review too for this one, since the PR is pretty big and therefore could contain something I missed.

@PerchunPak PerchunPak mentioned this pull request Apr 30, 2023
Copy link
Contributor

@kevinkjt2000 kevinkjt2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Much wow. Much feature. Much appreciate.

@kevinkjt2000 kevinkjt2000 merged commit 9db947a into py-mine:master May 3, 2023
@PerchunPak PerchunPak deleted the add-more-methods-connected-to-motd branch June 10, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Related to core API of the project status: needs review Author is waiting for someone to review and approve type: enhancement Improvement to an existing feature type: rewrite Complete or partial rewrite of a part of the codebase
Projects
None yet
4 participants