fix port parsing

This commit is contained in:
j 2023-10-12 12:29:02 +01:00
parent b2efaf8ece
commit 7e3088ae1d

View file

@ -92,7 +92,7 @@ class Player(Thread):
def ping(self): def ping(self):
data = 'NEXT' data = 'NEXT'
if ':' in self.peer: if ':' in self.peer[0]:
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
else: else:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@ -108,7 +108,7 @@ class Player(Thread):
def get_position(self): def get_position(self):
try: try:
if ':' in self.peer: if ':' in self.peer[0]:
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
else: else:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)