if (!empty($func_list)) { foreach ($func_list as $val) { $func_open[$val['func_id']] = 1; } } else { $func_open[] = array(); } $data['func_open'] = json_encode($func_open); $pkey = "data|player_detail:{$info['player_id']}"; $this->redis()->hash_set($pkey, $data); } } } public function fix_player_data() { $player_ids = $this->redis()->keys("data|player:*"); foreach ($player_ids as $key) { $info = $this->redis()->hash_get($key); if (!empty($info['player_id'])) { $filter = array('exp', 'gold', 'silver', 'ticket', 'chips', 'kf_coin', 'honor', 'crystal', 'fame', 'kf_score'); $up = array(); foreach ($filter as $k) { $up[$k] = intval($info[$k]); } $this->redis()->hash_set($key, $up); } } } } $obj = new FixPosition(); $obj->fix_player_data();
$datas = $this->redis()->hash_get($player_key); if ($datas) { foreach ($datas as $key => $val) { $val = json_decode($val, true); if ($val['prop_id'] == 63501) { if ($val['sub_type'] != 16) { echo "player_id:{$val['player_id']} player_prop_id:{$key} prop_id:{$val['prop_id']} sub_type:{$val['sub_type']}\n"; $val['sub_type'] = 16; // $this->redis()->hash_set($player_key,$key,json_encode($val)); } } } } } } public function fix_kfarena() { $keys = $this->redis()->keys('data|kf_arena_list:*'); if (!empty($keys)) { foreach ($keys as $key) { $val = $this->redis()->hash_get($key); if ($val['dw'] == 3 && $val['dw_lv'] == 1 && $val['dw_star'] == 1 && $val['score'] < 36) { echo "player_id:{$val['player_id']} dw:{$val['dw']} dw_lv:{$val['dw_lv']} dw_star:{$val['dw_star']} score:{$val['score']}\n"; } } } } } $obj = new FixPosition(); $obj->fix_prop_sub_type(); #$obj->fix_del_func();