Browse Source

update SteamID.is_valid method

pull/169/head
Rossen Georgiev 7 years ago
parent
commit
830272fd85
  1. 21
      steam/steamid.py

21
steam/steamid.py

@ -192,20 +192,27 @@ class SteamID(intBase):
:rtype: :py:class:`bool` :rtype: :py:class:`bool`
""" """
if self.id == 0:
return False
if self.type == EType.Invalid or self.type >= EType.Max: if self.type == EType.Invalid or self.type >= EType.Max:
return False return False
if self.universe == EUniverse.Invalid or self.universe >= EUniverse.Max: if self.universe == EUniverse.Invalid or self.universe >= EUniverse.Max:
return False return False
if self.type == EType.Individual and self.instance > 4: if self.type == EType.Individual:
return False if self.id == 0 or self.instance > 4:
return False
if self.type == EType.Clan and self.instance != 0: if self.type == EType.Clan:
return False if self.id == 0 or self.instance != 0:
return False
if self.type == EType.GameServer:
if self.id == 0:
return False
if self.type == EType.AnonGameServer:
if self.id == 0 and self.instance == 0:
return False
return True return True

Loading…
Cancel
Save