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