Skip to content

Commit 75ef9f1

Browse files
Resolve Source Protocol issue
1 parent f7e90b9 commit 75ef9f1

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

opengsq/protocols/source.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def __parse_from_info_detailed(self, br: BinaryReader) -> GoldSourceInfo:
138138
info["players"] = br.read_byte()
139139
info["max_players"] = br.read_byte()
140140
info["protocol"] = br.read_byte()
141-
info["server_type"] = ServerType(br.read_byte())
142-
info["environment"] = Environment(br.read_byte())
141+
info["server_type"] = ServerType(ord(chr(br.read_byte()).lower()))
142+
info["environment"] = Environment(ord(chr(br.read_byte()).lower()))
143143
info["visibility"] = Visibility(br.read_byte())
144144
info["mod"] = br.read_byte()
145145

opengsq/responses/source/gold_source_info.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from __future__ import annotations
2+
13
from dataclasses import dataclass
4+
from typing import Optional
25
from .partial_info import PartialInfo
36

47

@@ -18,26 +21,26 @@ class GoldSourceInfo(PartialInfo):
1821
1 for Half-Life mod
1922
"""
2023

21-
link: str
24+
link: Optional[str] = None
2225
"""URL to mod website."""
2326

24-
download_link: str
27+
download_link: Optional[str] = None
2528
"""URL to download the mod."""
2629

27-
version: int
30+
version: Optional[int] = None
2831
"""Version of mod installed on server."""
2932

30-
size: int
33+
size: Optional[int] = None
3134
"""Space (in bytes) the mod takes up."""
3235

33-
type: int
36+
type: Optional[int] = None
3437
"""
3538
Indicates the type of mod:
3639
0 for single and multiplayer mod
3740
1 for multiplayer only mod
3841
"""
3942

40-
dll: int
43+
dll: Optional[int] = None
4144
"""
4245
Indicates whether mod uses its own DLL:
4346
0 if it uses the Half-Life DLL

opengsq/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.0.6'
1+
__version__ = '3.0.7'

0 commit comments

Comments
 (0)