From 84a41297a1d8ca67f9393c5b88d378ab64418b3c Mon Sep 17 00:00:00 2001 From: schneider Date: Tue, 27 Dec 2011 18:46:26 +0100 Subject: [PATCH] rem0te: added massgame and reader support --- tools/game/r0ketrem0te/game.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/game/r0ketrem0te/game.py b/tools/game/r0ketrem0te/game.py index 8df5f70..b074201 100644 --- a/tools/game/r0ketrem0te/game.py +++ b/tools/game/r0ketrem0te/game.py @@ -12,8 +12,9 @@ class Player(): self.timeout = 10 self.active = False +# set shortpackets=True if you want to announce a game to be read with OpenBeacon readers class Game: - def __init__(self, device, gameName, gameChannel, announcechannel, announcemac, maxplayer=0, askname=False): + def __init__(self, device, gameName, gameChannel, announcechannel, announcemac, maxplayer=0, askname=False, shortpackets=False): self.gameName = gameName self.channel = gameChannel self.gamemac = [int(random.random()*254) for x in range(1,6)] @@ -21,9 +22,14 @@ class Game: self.playermac[4]+=1 self.gameid = int(random.random()*(2**15)) + flags = 0 + if maxplayer == 0: + flags = 1 + if shortpackets: + flags += 2 self.bridge = bridge.Bridge(device, self.channel, self.gamemac) self.announce = packets.Announce(self.gamemac, self.channel, - self.gameid, 0, self.gameName) + self.gameid, flags, self.gameName) self.announcequeue = Queue.Queue() self.bridge.registerQueue(self.announcequeue)