def handle_pass_day(self, fetch=False): """ 处理超过一天(超过则更新数据) fetch 处理待收取 超过凌晨时更新数据 """ #判断是否已过一天 if common.is_pass_day(self.p_attr[PT_FT]): #更新时光盒数据 setting_mgr = self.player._game.setting_mgr tCoinNum = setting_mgr.setdefault(TBOX_COIN_NUM, TBOX_COIN_NUM_V) #log.debug('p_tboxs::[%s]', self.p_tboxs) for tbox in self.p_tboxs.itervalues(): tbox.data.isLives = [MONSTER_LIVE]*len(tbox.data.tbids) tbox.data.re1 = self.tbox_mgr.get_free_num(self.player.data.vip) tbox.data.re2 = tCoinNum self.update_tbox(tbox) #更新玩家属性 if not fetch: del_wids = [] for wid in self.p_attr[PT_WAITS]: #删除待收物品 self.player.wait_bag.delete(wid) del_wids.append(wid) self.p_attr[PT_CH] = 0 self.p_attr[PT_WAITS] = [] self.p_attr[PT_FT] = int(time.time()) self.p_attr[PT_VIP] = self.player.data.vip return del_wids return
def sign(self, player): p_sign = self.init_player(player) if not common.is_pass_day(p_sign.data.t): return False, errcode.EC_VALUE rs, data = p_sign.sign(self._game.rpc_store) if not rs: return rs, data return p_sign.pack_msg()
def pack_msg(self): r_d = dict() if common.is_pass_day(self.data.t) and not self.data.finish == FINISH_DAY: r_d['sign'] = 0 else: r_d['sign'] = 1 r_d['finish'] = self.data.finish return True, r_d
def deep_pass_day(self): """ 深渊数据根据每日凌晨清楚 """ if self.is_save_rank and common.is_pass_day(self.first_time): self.first_time = common.current_time() self.deep_floor_pids.clear() self.deep_pid_floor.clear() self.is_save_rank = False return True return False
def pack_msg(self): r_d = dict() if common.is_pass_day( self.data.t) and not self.data.finish == FINISH_DAY: r_d['sign'] = 0 else: r_d['sign'] = 1 r_d['finish'] = self.data.finish return True, r_d
def handle_pass_day(self): """ 处理超过一天(超过则更新数据) """ if common.is_pass_day(self.feteData.ft): self.feteData.ft = int(time.time()) self.feteData.n1 = 0 self.feteData.n2 = 0 self.feteData.db = 0 return True return False
def handle_pass_day(self, player): """ 处理超过一天(超过则更新数据) """ if common.is_pass_day(self.data.flt): self.data.zero_chum_num() self.data.update_attr(player) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
def handle_pass_day(self): if self.player.no_game: return if common.is_pass_day(self.data_dict['t']): for obj in self.pass_days_objs: obj.pass_day(self, self.player) obj.updata_attr() self.data_dict['t'] = common.current_time() self.update_attr()
def pass_day(self): """ 玩家数据是否过期 """ if not is_pass_day(self.data.t): return self.modified = True self.rival_id = None self.data.coin1 = 0 self.data.train = 0 self.data.c = 0 self.data.t = current_time()
def pass_day(self, mgr, player): """ 玩家数据是否过期 """ if not common.is_pass_day(self.data.ft): #TODO 暂时屏蔽vip每日深渊刷新次数 #p_t = common.current_time() - int(self.data.ft) #if p_t >= mgr.reset_time: # self._reset_check(mgr) return False self._reset_check(mgr) return True
def handle_pass_day(self, fetch=False): """ 处理超过一天(超过则更新数据) """ #判断是否已过一天 if common.is_pass_day(self.hitFateData.fTime): self.hitFateData = HitFateData() #删除待收物品 if not fetch: return self.player.wait_bag.deletes(WAITBAG_TYPE_HITFATE) return True return False
def handle_pass_day(self): """ 处理超过一天(超过则更新数据) """ if not self.first_time: data = self._game.rpc_status_mgr.get(STATUS_DEEP_FT) if data: self.first_time = data['ft'] self.box = data['box'] self.box_total = len(self.box) if self.first_time is None or common.is_pass_day(self.first_time): data = self._game.rpc_client.sync_exec(handle_pass_day, None, _pickle=True) self.first_time = data['ft'] self.box = data['box'] self.box_total = len(self.box) self._enter_floor_max.clear()
def handle_pass_day(): """ 当天服宝箱设置 """ status_mgr = Game.rpc_status_mgr with _deep_lock: data = status_mgr.get(STATUS_DEEP_FT) if not (data is None or common.is_pass_day(data['ft'])): return data data = dict(ft=int(time.time()), box={}) boxs = data['box'] for box in Game.res_mgr.deep_boxs.itervalues(): floor = box.random_floor() if isinstance(floor, (list, tuple)): for fl in floor: boxs[str(fl)] = box.id else: boxs[str(floor)] = box.id status_mgr.set(STATUS_DEEP_FT, data) return data
def handle_pass_day(self): """ 处理超过一天 """ ctime = self.day_lucky.data.d[PLAYER_ATTR_CTIME] if is_pass_day(ctime): #判断是否是昨天(用来验证是否连续登陆) now = current_time() mdraw = self.day_lucky.data.d[PLAYER_ATTR_MDRAW] if is_yesterday(ctime): if self.day_lucky.data.d.has_key(PLAYER_ATTR_STATE) and \ not self.day_lucky.data.d[PLAYER_ATTR_STATE] and \ self.get_state: mdraw += 1 self.day_lucky.data.d[PLAYER_ATTR_MDRAW] = mdraw + 1 if self.day_lucky.data.d[PLAYER_ATTR_MDRAW] > self.fetch_mdraw: self.day_lucky.data.d[PLAYER_ATTR_MDRAW] = self.fetch_mdraw else: self.day_lucky.data.d[PLAYER_ATTR_MDRAW] = self.fetch_draw self.day_lucky.data.d[PLAYER_ATTR_CTIME] = now self.day_lucky.data.d[PLAYER_ATTR_DRAW] = 0 self.day_lucky.data.d[PLAYER_ATTR_STATE] = self.get_state self.day_lucky.data.ps = MAX_BOXES * [0] self.day_lucky.data.items = None
def handle_pass_day(self): """ 处理超过一天(超过则更新数据) """ #判断是否已过一天 if common.is_pass_day(self.bfTaskData.ft): #是否是兵符任务且是否过期更新 btid = 0 for t in self.player.task.tasks.itervalues(): tResTask = self.player._game.res_mgr.tasks.get(t.data.tid) if tResTask.type == TT_OFFER: btid = t.data.id accept_tid = t.data.tid break accept_index = -1 if btid: #已接任务不处理,其他任务刷新 for index, state in enumerate(self.bfTaskData.ss): if state == BFTASK_ALREADY_ACCEPT: accept_index = index break self._produce_bf_task(BF_RE_PASS, accept_index) if accept_index in self.bfTaskData.tids and accept_tid != self.bfTaskData.tids[accept_index]: self.bfTaskData.tids[accept_index] = accept_tid else: #无任务全部刷新 self.bfTaskData.tids = [] self.bfTaskData.ss = [] self.bfTaskData.qs = [] self.bfTaskData.exps = [] boxes = self._get_box_nums() self.bfTaskData.ft = int(time.time()) #兵符宝箱的累计计算 self.bfTaskData.bs = boxes self.bfTaskData.bsm = boxes self.bfTaskData.btid = btid self.bfTaskData.n1 = self.fetch_bf_renum self.bfTaskData.bt = BF_RE_PASS return True return False
def handle_pass_day(self, time, func): """ 超过一天清理招财的数据 """ if common.is_pass_day(time): func()
def handle_pass_day(self): if common.is_pass_day(self.data.ft): self.data.zero()
def _pass_day(self): """ 处理过一天 """ if not self.attr.has_key(FN_P_ATTR_DAY) or common.is_pass_day(self.attr[FN_P_ATTR_DAY][FN_P_ATTR_FTIME]): self.attr[FN_P_ATTR_DAY] = {FN_P_ATTR_FTIME:common.current_time(), FN_P_ATTR_RESET:{}}