def getData(self, player): map, gamemode, size = getCurrentRound() if map in NCO_kits.keys(): def_kit1, def_kit2 = NCO_kits[map] exec('def_kit = def_kit%d' % player.getTeam()) return def_kit else: print 'NCOrifle: Can\'t find NCO kit info for map %s. Update NCOrifleData.py or provide custom map info via mapdata.py' % map return None
def send_data(self): data = cPickle.dumps((self.playtime, getCurrentRound())) x = [] x.append('POST /index/backend HTTP/1.0') x.append('host: ' + str(HOST)) #x.append('Content-type: text/html') x.append('Content-Length: ' + str(len(data))) x.append('') x.append(data) x = '\r\n'.join(x) if DEBUG: print 'Sending:' print x self.a.set_data(x)
def round_start(self, hooker): global NCO_kits map, gamemode, size = getCurrentRound() NCO_kits[map] = self.kits print 'Added custom data to NCO_kits [NCOrifleData.py]'
def startlog(self): cm = u.getCurrentRound() print 'maplint starting for: %s (%s %d)'%(cm[0].lower(), cm[1].lower(), int(cm[2])) self.f = open('mods/fh2/maplint.log', 'a') print >>self.f, 'map: %s (%s %d)'%(cm[0].lower(), cm[1].lower(), int(cm[2]))