mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
fix: cast ports to int
This commit is contained in:
1 parent
cba884da7e
commit
1be7bddbb4
2 files changed
+2
-5
No files matched your search
+1
-4
@@ -1,14 +1,11 @@
|
|||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
from typing import Optional, TYPE_CHECKING
|
from typing import Optional
|
||||||
|
|
||||||
from dzgui.const.endpoints import BM_SERVERS
|
from dzgui.const.endpoints import BM_SERVERS
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from dzgui.api.servers import Record
|
|
||||||
|
|
||||||
|
|
||||||
def get_attributes(key: str, uid: int) -> str:
|
def get_attributes(key: str, uid: int) -> str:
|
||||||
# TODO: handle if key is not set
|
# TODO: handle if key is not set
|
||||||
|
|||||||
@@ -503,4 +503,4 @@ def response_to_record(res: dict) -> Record:
|
|||||||
ip = res["addr"].split(":")[0]
|
ip = res["addr"].split(":")[0]
|
||||||
gameport = res["gameport"]
|
gameport = res["gameport"]
|
||||||
qport = res["addr"].split(":")[1]
|
qport = res["addr"].split(":")[1]
|
||||||
return Record(ip, gameport, qport)
|
return Record(ip, int(gameport), int(qport))
|
||||||
Reference in new issue
Block a user