From 33607dc6172dc3c6c721c4416131202c78d318f2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 26 Nov 2021 13:44:00 +0800 Subject: [PATCH] 1 --- webapp/metatable/activity.php | 106 ---------------------- webapp/metatable/activityplus.php | 93 -------------------- webapp/metatable/draw.php | 26 ------ webapp/metatable/drop.php | 138 ----------------------------- webapp/metatable/equip.php | 38 -------- webapp/metatable/item.php | 26 ------ webapp/metatable/parameter.php | 37 -------- webapp/metatable/season.php | 63 ------------- webapp/metatable/seasoncard.php | 124 -------------------------- webapp/metatable/shop.php | 141 ------------------------------ webapp/metatable/shopGoods.php | 38 -------- 11 files changed, 830 deletions(-) delete mode 100644 webapp/metatable/activity.php delete mode 100644 webapp/metatable/activityplus.php delete mode 100644 webapp/metatable/draw.php delete mode 100644 webapp/metatable/drop.php delete mode 100644 webapp/metatable/equip.php delete mode 100644 webapp/metatable/item.php delete mode 100644 webapp/metatable/parameter.php delete mode 100644 webapp/metatable/season.php delete mode 100644 webapp/metatable/seasoncard.php delete mode 100644 webapp/metatable/shop.php delete mode 100644 webapp/metatable/shopGoods.php diff --git a/webapp/metatable/activity.php b/webapp/metatable/activity.php deleted file mode 100644 index e560ded..0000000 --- a/webapp/metatable/activity.php +++ /dev/null @@ -1,106 +0,0 @@ -= strtotime($act['time1']) && phpcommon\getNowTime() <= strtotime($act['time2'])) { - return $act; - } - } - return null; -} - -function getActInfo($act_conf) -{ - $info_list = array(); - $conditions = getActExplode($act_conf['condition']); - for ($i = 0; $i < count($conditions); $i++) { - array_push($info_list,array( - 'id' => $i, - 'status' => 0, - 'times' => 0, - 'type' => $conditions[$i][0], - 'condition' => $conditions[$i][1], - )); - } - return $info_list; -} - -function getRewardInfo($act_id, $id, $type) -{ - $act_conf = getActivityById($act_id); - if (!$act_conf) { - return null; - } - $items = explode('|', $act_conf['reward']); - if ($type == 1) { - if (empty($act_conf['extra_reward'])) { - return null; - } - $items = explode('|', $act_conf['extra_reward']); - } - $arr = array(); - for ($i = 0; $i < count($items); $i++) { - $mul = explode(';', $items[$i]); - array_push($arr, $mul); - } - $arr2 = array(); - $str = $arr[$id]; - for ($i = 0; $i < count($str); $i++) { - $mul = explode(':', $str[$i]); - array_push($arr2, $mul); - } - return $arr2; -} diff --git a/webapp/metatable/activityplus.php b/webapp/metatable/activityplus.php deleted file mode 100644 index 8273570..0000000 --- a/webapp/metatable/activityplus.php +++ /dev/null @@ -1,93 +0,0 @@ - $act['id'], - )); - } - return $info_list; -} - - -class ActivityPlus -{ - - public static function get($id) - { - return self::getMeta()[$id]; - } - - public static function getCondIdx($actMeta, $cond) - { - $condConf = explode('|', $actMeta['condition']); - $idx = 0; - foreach ($condConf as $c) { - if ($c == $cond) { - return $idx; - } - ++$idx;; - } - return -1; - } - - public static function getReward($actMeta, $condIdx) - { - $rewardConf = explode('|', $actMeta['reward']); - return $rewardConf[$condIdx]; - } - - protected static function getMeta() - { - if (!self::$meta) { - self::$meta = getMetaTable('activityplus@activityplus.php'); - } - return self::$meta; - } - - private static $meta = null; -} diff --git a/webapp/metatable/draw.php b/webapp/metatable/draw.php deleted file mode 100644 index 056cc87..0000000 --- a/webapp/metatable/draw.php +++ /dev/null @@ -1,26 +0,0 @@ - $random) { - $item_id = $item_id_array[$i][0]; - $item_num = $item_num_array[$i][0]; - $time = 0; - if (!empty($time_array[$i][0]) && $time_array[$i][0] != '') { - $time = $time_array[$i][0]; - } - array_push($item_list, array( - 'item_id' => $item_id, - 'item_num' => $item_num, - 'time' => $time, - )); - } - } - } else if ($d['type'] == 2) { - $weight_sum = 0; - $keys = 0; - for ($i = 0; $i < count($weight_array); $i++) { - $weight_sum += $weight_array[$i][0]; - } - $random = Rand(0, $weight_sum); - $weight = 0; - for ($i = 0; $i < count($weight_array); $i++) { - $weight += $weight_array[$i][0]; - if ($weight > $random) { - $keys = $i; - break; - } - } - $item_id = $item_id_array[$keys][0]; - $item_num = $item_num_array[$keys][0]; - $item_time = $time_array[$keys][0]; - array_push($item_list, array( - 'item_id' => $item_id, - 'item_num' => $item_num, - 'time' => $item_time, - )); - } - return $item_list; -} - -function getDropListById($drop_id) -{ - $d = getDropById($drop_id); - if (!$d) { - return null; - } - $item_list = array(); - $item_list = getDropInfo($d, $item_list); - return $item_list; -} - -function getDropInfoById($drop_id) -{ - $d = getDropById($drop_id); - if (!$d) { - return null; - } - $item_list = array(); - $item_id_array = getExplode($d['item_id']); - $item_num_array = getExplode($d['num']); - $weight_array = getExplode($d['weight']); - $time_array = getExplode($d['time']); - for ($i = 0; $i < count($weight_array); $i++) { - $item_id = $item_id_array[$i][0]; - $item_num = $item_num_array[$i][0]; - $weight = $weight_array[$i][0]; - $time = 0; - if (!empty($time_array[$i][0]) && $time_array[$i][0] != '') { - $time = $time_array[$i][0]; - } - array_push($item_list, array( - 'item_id' => $item_id, - 'item_num' => $item_num, - 'time' => $time, - 'weight' => $weight, - )); - } - return $item_list; -} diff --git a/webapp/metatable/equip.php b/webapp/metatable/equip.php deleted file mode 100644 index a6822a8..0000000 --- a/webapp/metatable/equip.php +++ /dev/null @@ -1,38 +0,0 @@ - $val) { - if ($val['param_name'] == $param_name) { - return $val['param_value']; - } - } - return null; -} - -function _internalGetParameterConf() -{ - global $g_parameter_table; - if (!$g_parameter_table) { - $g_parameter_table = require(getConfigBaseDir() . 'parameter@parameter.php'); - } - return $g_parameter_table; -} diff --git a/webapp/metatable/season.php b/webapp/metatable/season.php deleted file mode 100644 index e9e40c2..0000000 --- a/webapp/metatable/season.php +++ /dev/null @@ -1,63 +0,0 @@ -= strtotime($sea['time1']) && phpcommon\getNowTime() <= strtotime($sea['time2'])) { - return $sea; - } - } - return null; -} - -function getNowSeasonNum() -{ - $conf = getSeasonConf(); - for ($i = 1; $i <= count($conf); $i++) { - $sea = getSeasonById($i); - if (phpcommon\getNowTime() >= strtotime($sea['time1']) && phpcommon\getNowTime() <= strtotime($sea['time2'])) { - return $i; - } - } - return null; -} diff --git a/webapp/metatable/seasoncard.php b/webapp/metatable/seasoncard.php deleted file mode 100644 index 11ee2f9..0000000 --- a/webapp/metatable/seasoncard.php +++ /dev/null @@ -1,124 +0,0 @@ -= $sea['min_point'] && $score <= $sea['max_exp'] - || $score >= $sea['min_point'] && $sea['max_exp'] == -1) { - $level = $sea['lv']; - $pass_score = $score - $sea['min_point'] + 1; - $max_pass_score = $sea['max_exp'] - $sea['min_point'] + 1; - $min_pass_score = $sea['min_point']; - if ($sea['max_exp'] == -1) { - $max_pass_score = $sea['min_point']; - $pass_score = $score; - } - array_push($pass_array, array( - 'level' => $level, - 'pass_score' => $pass_score, - 'max_pass_score' => $max_pass_score, - 'min_pass_score' => $min_pass_score, - 'exp' => $sea['task_exp'], - )); - return $pass_array; - } - } - return null; -} - -function getNowSeasoncardInfo($score) -{ - $conf = getSeacardConf(); - for ($i = 1; $i <= count($conf); $i++) { - $sea = getSeacardById($i); - if ($score >= $sea['min_point'] && $score <= $sea['max_exp'] - || $score >= $sea['min_point'] && $sea['max_exp'] == -1) { - return $sea['lv']; - } - } - return null; -} - -function getNowSeasoncardExp($score) -{ - $conf = getSeacardConf(); - for ($i = 1; $i <= count($conf); $i++) { - $sea = getSeacardById($i); - if ($score >= $sea['min_point'] && $score <= $sea['max_exp'] - || $score >= $sea['min_point'] && $sea['max_exp'] == -1) { - return $sea['task_exp']; - } - } - return null; -} - -function getNowSeasoncardMaxExp($score) -{ - $conf = getSeacardConf(); - for ($i = 1; $i <= count($conf); $i++) { - $sea = getSeacardById($i); - if ($score >= $sea['min_point'] && $score <= $sea['max_exp'] - || $score >= $sea['min_point'] && $sea['max_exp'] == -1) { - return $sea['max_exp']; - } - } - return null; -} - -function getNowSeasoncardCost($score) -{ - $conf = getSeacardConf(); - for ($i = 1; $i <= count($conf); $i++) { - $sea = getSeacardById($i); - if ($score >= $sea['min_point'] && $score <= $sea['max_exp'] - || $score >= $sea['min_point'] && $sea['max_exp'] == -1) { - return $sea['cost']; - } - } - return null; -} diff --git a/webapp/metatable/shop.php b/webapp/metatable/shop.php deleted file mode 100644 index 2670cf0..0000000 --- a/webapp/metatable/shop.php +++ /dev/null @@ -1,141 +0,0 @@ - $goods_list[$ii], - 'buy' => $goods_buy[$ii][0], - 'price' => $goods_buy[$ii][1], - 'status' => 0, - 'isdiscount' => $discount, - 'dis_num' => $goods_discount[$ii], - 'limit_val' => $limit_val, - 'isdorefresh' => $shop_conf['isdorefresh'], - 'hasrefreshnum' => 0, - 'refreshnum' => $shop_conf['refreshnum'], - )); - array_splice($goods_list, $ii, 1); - array_splice($goods_weight, $ii, 1); - array_splice($goods_buy, $ii, 1); - array_splice($goods_discount, $ii, 1); - break; - } - } - } - return $goods; -} - -function shopGoodsList($shop_conf) -{ - $goods_list = explode('|', $shop_conf['goods_list']); - $goods_weight = explode('|', $shop_conf['goods_weight']); - $goods_buy = getExplode1($shop_conf['price']); - $goods_discount = explode('|', $shop_conf['discount']); - $discount_num = $shop_conf['discount_num']; - $goods = array(); - $discount = false; - if ($discount_num != 0) { - $discount = true; - $discount_num--; - } - for ($ii = 0; $ii < count($goods_weight); ++$ii) { - $limit_val = 0; - if ($shop_conf['limit'] != '') { - $limit = explode('|', $shop_conf['limit']); - $limit_val = $limit[$ii]; - } - array_push($goods, array( - 'id' => $goods_list[$ii], - 'buy' => $goods_buy[$ii][0], - 'price' => $goods_buy[$ii][1], - 'status' => 0, - 'isdiscount' => $discount, - 'dis_num' => $goods_discount[$ii], - 'weight' => $goods_weight[$ii], - 'limit_val' => $limit_val, - )); - } - - return $goods; -} - -function _internalGetShopConf() -{ - global $g_shop_table; - if (!$g_shop_table) { - $g_shop_table = require(getConfigBaseDir() . 'shop@shop.php'); - } - return $g_shop_table; -} diff --git a/webapp/metatable/shopGoods.php b/webapp/metatable/shopGoods.php deleted file mode 100644 index 5408ac9..0000000 --- a/webapp/metatable/shopGoods.php +++ /dev/null @@ -1,38 +0,0 @@ -