def members(self, is_other=False): """ 获取自己同盟某页成员""" onls = [] dis_onls = [] pids = self.get_member_pids() online_pids = self._mgr.rpc_player_mgr.get_online_ids(pids) p_dicts = dict( (data['id'], data) for data in PlayerData.get_players_values( pids, ['name', 'level', 'tLogout'], store=self.rpc_store)) for assist_data in self.members_list: try: t_dit = dict() pid = assist_data.pid if pid not in p_dicts: #玩家不存在 log.error(u'同盟(%s)玩家(%s)不存在', self.data.name, pid) continue p_dic = p_dicts[pid] t_dit['pid'] = pid t_dit['n'] = p_dic['name'] t_dit['lv'] = p_dic['level'] t_dit['duty'] = assist_data.duty t_dit['pvp'] = 2000 pvp = self._mgr._game.rpc_arena_mgr.get_rank(pid) if pvp: t_dit['pvp'] = pvp #是不是查看其他的同盟 是就不加载exp和dt dis_onls.append(t_dit) if not is_other: t_dit['exp'] = assist_data.exp if pid in online_pids: t_dit['dt'] = 0 dis_onls.remove(t_dit) onls.append(t_dit) else: t_dit['dt'] = p_dic['tLogout'] except: log.error( "PlayerData.get_values is None pid:%s in ally.py func->members", assist_data.pid) if onls or dis_onls: onls = sor_member(is_other, True, onls) dis_onls = sor_member(is_other, False, dis_onls) mems = onls mems.extend(dis_onls) return mems
def members(self, is_other = False): """ 获取自己同盟某页成员""" onls = [] dis_onls = [] pids = self.get_member_pids() online_pids = self._mgr.rpc_player_mgr.get_online_ids(pids) p_dicts= dict((data['id'], data) for data in PlayerData.get_players_values( pids, ['name', 'level', 'tLogout'], store=self.rpc_store)) for assist_data in self.members_list: try: t_dit = dict() pid = assist_data.pid if pid not in p_dicts:#玩家不存在 log.error(u'同盟(%s)玩家(%s)不存在', self.data.name, pid) continue p_dic = p_dicts[pid] t_dit['pid'] = pid t_dit['n'] = p_dic['name'] t_dit['lv'] = p_dic['level'] t_dit['duty'] = assist_data.duty t_dit['pvp'] = 2000 pvp = self._mgr._game.rpc_arena_mgr.get_rank(pid) if pvp: t_dit['pvp'] = pvp #是不是查看其他的同盟 是就不加载exp和dt dis_onls.append(t_dit) if not is_other: t_dit['exp'] = assist_data.exp if pid in online_pids: t_dit['dt'] = 0 dis_onls.remove(t_dit) onls.append(t_dit) else: t_dit['dt'] = p_dic['tLogout'] except: log.error("PlayerData.get_values is None pid:%s in ally.py func->members", assist_data.pid) if onls or dis_onls: onls = sor_member(is_other, True, onls) dis_onls = sor_member(is_other, False, dis_onls) mems = onls mems.extend(dis_onls) return mems
def get_player_detail(self, pids, cols): """ 返回玩家详细信息 """ return PlayerData.get_players_values(pids, cols)
def get_player_detail(self, pids, cols): """ 返回玩家详细信息 """ return PlayerData.get_players_values(pids, cols)