Skip to content

Commit

Permalink
Update gamespy1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Mar 4, 2023
1 parent 500f3dd commit 98af37b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions opengsq/protocols/gamespy1.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ def __parse_as_key_values(self, br: BinaryReader, is_status=False):
while br.length() > 0:
key = br.read_string(b'\\').lower()

if is_status and (items := key.split('_')) and len(items) > 1 and items[1].isdigit():
# Read already, so add it back
br.prepend_bytes(key.encode() + b'\\')
break
# Check is the end of key_values
if is_status:
items = key.split('_')

if len(items) > 1 and items[1].isdigit():
# Read already, so add it back
br.prepend_bytes(key.encode() + b'\\')
break

value = br.read_string(b'\\')
kv[key] = value.strip()
Expand Down

0 comments on commit 98af37b

Please sign in to comment.