...strip newlines from server messages.

This commit is contained in:
Firepup Sixfifty 2024-08-07 03:15:52 +00:00
parent 9ff812a7b3
commit 5805d5efcc
Signed by: Firepup650
SSH key fingerprint: SHA256:U0Zp8EhEe3CMqFSrC79CqatzaEiL4sjta80/RSX2XrY

View file

@ -284,7 +284,7 @@ Please note that this is not network level statistics.\r\n""".encode(
while 1:
try:
rawMsg = await asyncio.wait_for(reader.read(967), 0.1)
buffer = rawMsg.decode("utf8")
buffer = rawMsg.decode("utf8").strip()
match buffer[0]:
case "S": # Server notice
G.msgs.extend([log(buffer[2:])])
@ -473,7 +473,7 @@ async def connectServer(hostname: str, port: int):
while 1:
try:
rawMsg = await asyncio.wait_for(reader.read(1024), 0.1)
buffer = rawMsg.decode("utf8")
buffer = rawMsg.decode("utf8").strip()
match buffer[0]:
case "S":
G.msgs.extend([log(buffer[2:])])