Browse Source

Add local_address property

pull/63/head
lopezloo 8 years ago
parent
commit
715dd83f48
  1. 2
      steam/client/__init__.py
  2. 4
      steam/core/connection.py

2
steam/client/__init__.py

@ -491,7 +491,7 @@ class SteamClient(CMClient, BuiltinBase):
if login_id is None:
obfuscationMask = 0xBAADF00D
local_address_int = ip_to_int(self.connection.socket.getsockname()[0])
local_address_int = ip_to_int(self.connection.local_address)
message.body.obfustucated_private_ip = local_address_int ^ obfuscationMask
else:
message.body.obfustucated_private_ip = login_id

4
steam/core/connection.py

@ -28,6 +28,10 @@ class Connection(object):
self.event_connected = event.Event()
@property
def local_address(self):
return self.socket.getsockname()[0] if self.event_connected.is_set() else None
def connect(self, server_addr):
self._new_socket()

Loading…
Cancel
Save