Fixed the command line specified udp_ip and udp_port not being used for broadcasting in the SDL version.

This commit is contained in:
CodePanter 2016-11-26 15:40:14 +01:00
parent d2a251430c
commit 62bfc50767

View file

@ -42,8 +42,8 @@ class Canvas(object):
self.pixeloffset = 2
self.fps = 30
self.screen = None
self.udp_ip = UDP_IP
self.udp_port = UDP_PORT
self.udp_ip = options.ip if options.ip else UDP_IP
self.udp_port = options.port if options.port else UDP_PORT
self.factor = options.factor if options.factor else 1
self.width = options.width if options.width else DEFAULT_WIDTH
self.height = options.height if options.height else DEFAULT_HEIGHT
@ -163,7 +163,7 @@ class Canvas(object):
self.broadcastsocket.sendto(
'%s:%f %s:%d %d*%d' % (
PROTOCOL_PREAMBLE, PROTOCOL_VERSION,
UDP_IP, UDP_PORT,
self.udp_ip, self.udp_port,
self.width/self.factor, self.height/self.factor),
('<broadcast>', DISCOVER_PORT))
if self.debug: