...strip newlines from server messages.
This commit is contained in:
parent
9ff812a7b3
commit
5805d5efcc
1 changed files with 2 additions and 2 deletions
|
@ -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:])])
|
||||
|
|
Loading…
Reference in a new issue