Merge pull request #10 from CodePanter/master
Fixed a bug (wrong IP in broadcast packets when user assigns an IP in code and gives one on the cli) and improved a feature to allow custom sleeps in sendpixels.
This commit is contained in:
commit
51ced30a23
1 changed files with 5 additions and 5 deletions
10
vloed.py
10
vloed.py
|
|
@ -36,8 +36,8 @@ class Canvas(object):
|
||||||
self.pixeloffset = 2
|
self.pixeloffset = 2
|
||||||
self.fps = 30
|
self.fps = 30
|
||||||
self.screen = None
|
self.screen = None
|
||||||
self.udp_ip = UDP_IP
|
self.udp_ip = options.ip if options.ip else UDP_IP
|
||||||
self.udp_port = UDP_PORT
|
self.udp_port = options.port if options.port else UDP_PORT
|
||||||
self.factor = options.factor if options.factor else 1
|
self.factor = options.factor if options.factor else 1
|
||||||
self.width = options.width if options.width else DEFAULT_WIDTH
|
self.width = options.width if options.width else DEFAULT_WIDTH
|
||||||
self.height = options.height if options.height else DEFAULT_HEIGHT
|
self.height = options.height if options.height else DEFAULT_HEIGHT
|
||||||
|
|
@ -217,16 +217,16 @@ class PixelVloedClient(object):
|
||||||
"""Sleeps the designated amount of time"""
|
"""Sleeps the designated amount of time"""
|
||||||
time.sleep(duration if duration else self.sleep)
|
time.sleep(duration if duration else self.sleep)
|
||||||
|
|
||||||
def SendPacket(self, message, sleep=True):
|
def SendPacket(self, message, sleep=0.01):
|
||||||
"""Sends the message to the udp server
|
"""Sends the message to the udp server
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
message: (str, 140)
|
message: (str, 140)
|
||||||
sleep: (bool) True, should the client sleep for a while?
|
sleep: (float) 0.01, duration of time the client should sleep
|
||||||
"""
|
"""
|
||||||
self.sock.sendto(message, (self.ipaddress, self.port))
|
self.sock.sendto(message, (self.ipaddress, self.port))
|
||||||
if sleep:
|
if sleep:
|
||||||
self.Sleep()
|
self.Sleep(duration=0.01)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def DiscoverServers(returnfirst=False, timeout=5):
|
def DiscoverServers(returnfirst=False, timeout=5):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue