Merge branch 'master' of github.com:r0ket/r0ket

This commit is contained in:
Stefan `Sec` Zehl 2011-12-27 22:02:53 +01:00
commit 13a1cb9521
4 changed files with 11 additions and 3 deletions

View File

@ -137,4 +137,5 @@ o_set_shader
o_identity
o_transform
getrelease
nrf_set_strength
#Add stuff here

View File

@ -116,6 +116,7 @@ void ram(void)
config.channel = ANNOUNCE_CHANNEL;
memcpy(config.mac0, ANNOUNCE_MAC, 5);
nrf_config_set(&config);
nrf_set_strength(3);
id = getRandom();
ctr = 1;

View File

@ -77,5 +77,5 @@ int main(void) {
}
int getrelease(void){
return 0x00000105;
return 0x00000106;
};

View File

@ -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)