conqp / mcipc

A Minecraft server inter-process communication library.
GNU General Public License v3.0
81 stars 11 forks source link

list with colors returns Invalid Paper string #23

Closed MikaelStave closed 3 years ago

MikaelStave commented 3 years ago

It seems like colors is whats causing the problem When trying to return a list of players I get the following message:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "/python/Big Brain Bot/cogs/minecraft.py", line 69, in mcserver response = client.list().encode("ISO-8859_1") File "/usr/local/lib/python3.8/dist-packages/mcipc/rcon/functions.py", line 56, in inner return parser(function(*args, **kwargs)) File "/usr/local/lib/python3.8/dist-packages/mcipc/rcon/response_types/players.py", line 103, in parse return from_paper(match) File "/usr/local/lib/python3.8/dist-packages/mcipc/rcon/response_types/players.py", line 93, in from_paper return Players(int(online), int(max_), list(players)) File "/usr/local/lib/python3.8/dist-packages/mcipc/rcon/response_types/players.py", line 75, in players_from_paper_names yield player_from_paper_name(name) File "/usr/local/lib/python3.8/dist-packages/mcipc/rcon/response_types/players.py", line 65, in player_from_paper_name raise ValueError(f'Invalid Paper server string: {name}') ValueError: Invalid Paper server string: §6username§r:

script: with Client("ip", port, passwd="passwd") as client: response = client.list()

conqp commented 3 years ago

The strangely formatted output from Paper servers has caused issues in the past. Since I do not run Paper servers myself, I have little motivation in debugging this further. If you are interested in support for this, you are welcome to debug this issue and provide a pull request that fixes this - preferably with appropriate unit tests.