mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-14 07:35:12 +01:00
Randomize at start, then use an index
This commit is contained in:
parent
6e32f8eaef
commit
2bff881744
@ -448,7 +448,8 @@ class Peer:
|
||||
if entry.get_key() == self.screenshot_key:
|
||||
print "Save it all"
|
||||
try:
|
||||
which = random.randrange(0,12)
|
||||
which = self.srv.next_image_nr
|
||||
self.srv.next_image_nr = (self.srv.next_image_nr + 1) % 12
|
||||
f = open("%s%d.png" % (self.srv.image_dir, which), "w")
|
||||
f.write(entry.get_data())
|
||||
f.close()
|
||||
@ -581,6 +582,7 @@ class Broker(SocketServer.UDPServer):
|
||||
self.image_dir = image_dir
|
||||
|
||||
self.data_key = DATA_KEY_RANGE
|
||||
self.next_image_nr = random.randrange(0,12)
|
||||
|
||||
stats.load(self.stat_data)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user