def add_defender(grid, coord, player): # Rename the defending coord db.rename(coord.dbid, "def:" + coord.dbid) coord['type'] = 8 coord['health'] = 25 coord['player'] = player['pid'] db.zadd(grid.dbid + ":def", str(coord), int(time())) UpdateManager.sendCoord(grid, coord) return True
def add_infector(grid, coord, player): db.zadd(grid.dbid + ":inf", str(coord), int(time())) return True