From f475f86f283742abf05db4b4879df6f60d095b36 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 11 Jul 2024 19:18:36 +0800 Subject: [PATCH 1/5] 1 --- sql/gamedb.sql | 1 + sql/gamedb2006_migrate_240711_01.sql | 1 + webapp/models/ServerTaskBattleCount.php | 21 ++++++++++++--------- webapp/services/LootService.php | 17 ++++++++++++----- webapp/services/RoomBattleDataService.php | 1 + 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 5d77f7b5..a3281809 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1877,6 +1877,7 @@ CREATE TABLE `t_server_task_battle_count` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id', `period` int(11) NOT NULL DEFAULT '0' COMMENT '周期', + `loot_index` int(11) NOT NULL DEFAULT '0' COMMENT '掉落包索引', `state` int(11) NOT NULL DEFAULT '0' COMMENT '1:总计数 2:循环计数', `val` bigint(20) NOT NULL DEFAULT '0' COMMENT 'val', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', diff --git a/sql/gamedb2006_migrate_240711_01.sql b/sql/gamedb2006_migrate_240711_01.sql index 47ea0300..5fab5884 100644 --- a/sql/gamedb2006_migrate_240711_01.sql +++ b/sql/gamedb2006_migrate_240711_01.sql @@ -6,6 +6,7 @@ CREATE TABLE `t_server_task_battle_count` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id', `period` int(11) NOT NULL DEFAULT '0' COMMENT '周期', + `loot_index` int(11) NOT NULL DEFAULT '0' COMMENT '掉落包索引', `state` int(11) NOT NULL DEFAULT '0' COMMENT '1:总计数 2:循环计数', `val` bigint(20) NOT NULL DEFAULT '0' COMMENT 'val', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', diff --git a/webapp/models/ServerTaskBattleCount.php b/webapp/models/ServerTaskBattleCount.php index 32a9fc9a..4b9528a4 100644 --- a/webapp/models/ServerTaskBattleCount.php +++ b/webapp/models/ServerTaskBattleCount.php @@ -10,30 +10,31 @@ class ServerTaskBattleCount extends BaseModel const TOTAL_COUNT = 1; //总计数 const LOOP_COUNT = 2; //循环计数 - public static function getV($period, $state, $defVal = 0) + public static function getV($period,$lootIndex, $state, $defVal = 0) { - $valData = self::internalGetV($period, $state, $defVal); + $valData = self::internalGetV($period, $lootIndex,$state, $defVal); return $valData['val']; } - public static function setV($period, $state, $defVal) + public static function setV($period,$lootIndex, $state, $defVal) { - self::internalSetV($period, $state, $defVal); + self::internalSetV($period,$lootIndex, $state, $defVal); } - public static function incV($period, $state, $val) + public static function incV($period,$lootIndex, $state, $val) { - $oldVal = self::getV($period, $state); - self::internalSetV($period, $state, $oldVal + $val); + $oldVal = self::getV($period,$lootIndex, $state); + self::internalSetV($period,$lootIndex, $state, $oldVal + $val); } - private static function internalGetV($period, $state, $defVal = 0){ + private static function internalGetV($period,$lootIndex, $state, $defVal = 0){ $row = SqlHelper::ormSelectOne( myself()->_getSelfMysql(), 't_server_task_battle_count', array( 'account_id' => myself()->_getAccountId(), 'period' => $period, + 'loot_index' => $lootIndex, 'state' => $state, ) ); @@ -43,7 +44,7 @@ class ServerTaskBattleCount extends BaseModel ); } - private static function internalSetV($period,$state, $val) + private static function internalSetV($period,$lootIndex,$state, $val) { SqlHelper::upsert (myself()->_getSelfMysql(), @@ -51,6 +52,7 @@ class ServerTaskBattleCount extends BaseModel array( 'account_id' => myself()->_getAccountId(), 'period' => $period, + 'loot_index' => $lootIndex, 'state' => $state ), array( @@ -60,6 +62,7 @@ class ServerTaskBattleCount extends BaseModel array( 'account_id' => myself()->_getAccountId(), 'period' => $period, + 'loot_index' => $lootIndex, 'state' => $state, 'val' => $val, 'createtime' => myself()->_getNowTime(), diff --git a/webapp/services/LootService.php b/webapp/services/LootService.php index fd3962c5..cbcc1bf9 100644 --- a/webapp/services/LootService.php +++ b/webapp/services/LootService.php @@ -82,9 +82,9 @@ class LootService $period = $serverTaskMeta?$serverTaskMeta['id']:0; // $totalTimes = myself()->_getV(TN_TOTAL_LOOT_TIMES,0); - $totalTimes = ServerTaskBattleCount::getV($period,ServerTaskBattleCount::TOTAL_COUNT); + $totalTimes = ServerTaskBattleCount::getV($period,$lootMeta['id'],ServerTaskBattleCount::TOTAL_COUNT); // $recycleTimes = myself()->_getV(TN_TOTAL_LOOT_TIMES,1); - $recycleTimes = ServerTaskBattleCount::getV(0,ServerTaskBattleCount::LOOP_COUNT); + $recycleTimes = ServerTaskBattleCount::getV(0,$lootMeta['id'],ServerTaskBattleCount::LOOP_COUNT); $contentArr = explode("|",$lootMeta['content']); $initTimes = $contentArr[0]; $po = $contentArr[1]; @@ -97,15 +97,22 @@ class LootService } $p = min($po + ($recycleTimes-1) * $pd,$pm) * 100 ; $rnd = rand(1,100); + error_log("LOOT".json_encode(array( + 'totalTimes' => $lootMeta['id'].'|'.$totalTimes, + 'recycleTimes' => $lootMeta['id'].'|'.$recycleTimes, + 'rnd' => $rnd, + 'rate' => $p, + 'lootMeta' => $lootMeta, + ))); // myself()->_incV(TN_TOTAL_LOOT_TIMES,0,1); - ServerTaskBattleCount::incV($period,ServerTaskBattleCount::TOTAL_COUNT,1); + ServerTaskBattleCount::incV($period,$lootMeta['id'],ServerTaskBattleCount::TOTAL_COUNT,1); if ($rnd <= $p){ // myself()->_setV(TN_TOTAL_LOOT_TIMES,1,1); - ServerTaskBattleCount::setV(0,ServerTaskBattleCount::LOOP_COUNT,1); + ServerTaskBattleCount::setV(0,$lootMeta['id'],ServerTaskBattleCount::LOOP_COUNT,1); self::disposeLootIndex($index1,$depth,$items); }else{ // myself()->_incV(TN_TOTAL_LOOT_TIMES,1,1); - ServerTaskBattleCount::incV(0,ServerTaskBattleCount::LOOP_COUNT,1); + ServerTaskBattleCount::incV(0,$lootMeta['id'],ServerTaskBattleCount::LOOP_COUNT,1); self::disposeLootIndex($index2,$depth,$items); } } diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index c63be2f3..e4c66598 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -167,6 +167,7 @@ class RoomBattleDataService extends BaseService { $gold = 0; // $accountLucky = Hero::getAccountLucky($userDb['address']); $accountLucky = Hero::getAccountLuckyTemp(); + error_log("LootLucky:".$accountLucky); $rewardMeta = mt\BattleReward::find($mapModeMeta['rewardMode'],$accountLucky); if (!$rewardMeta){ return ; From 403e3b8448ae880ee048f0044c9e575577f963d6 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 12 Jul 2024 11:56:31 +0800 Subject: [PATCH 2/5] 1 --- webapp/services/LootService.php | 7 ------- webapp/services/RoomBattleDataService.php | 24 +---------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/webapp/services/LootService.php b/webapp/services/LootService.php index cbcc1bf9..150c34ea 100644 --- a/webapp/services/LootService.php +++ b/webapp/services/LootService.php @@ -97,13 +97,6 @@ class LootService } $p = min($po + ($recycleTimes-1) * $pd,$pm) * 100 ; $rnd = rand(1,100); - error_log("LOOT".json_encode(array( - 'totalTimes' => $lootMeta['id'].'|'.$totalTimes, - 'recycleTimes' => $lootMeta['id'].'|'.$recycleTimes, - 'rnd' => $rnd, - 'rate' => $p, - 'lootMeta' => $lootMeta, - ))); // myself()->_incV(TN_TOTAL_LOOT_TIMES,0,1); ServerTaskBattleCount::incV($period,$lootMeta['id'],ServerTaskBattleCount::TOTAL_COUNT,1); if ($rnd <= $p){ diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index 8eea608d..bffe9630 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -167,7 +167,6 @@ class RoomBattleDataService extends BaseService { $gold = 0; // $accountLucky = Hero::getAccountLucky($userDb['address']); $accountLucky = Hero::getAccountLuckyTemp(); - error_log("LootLucky:".$accountLucky); $rewardMeta = mt\BattleReward::find($mapModeMeta['rewardMode'],$accountLucky); if (!$rewardMeta){ return ; @@ -240,28 +239,7 @@ class RoomBattleDataService extends BaseService { $hashRateValue = round($powerRate,4); } - if ($userDb['account_id'] == "6517_2006_s1_0_104162729566475397176"){ - error_log("BattleGoldRecord:".json_encode(array( - 'goldLootIndex' => $rewardMeta['goldLoot'], - 'map_mode' => $this->mapMode, - '*baseGold*' => $baseGold, - 'teamRank' => $teamRank, - '*ranking*' => isset($coefficient) ? $coefficient : '空', - 'battleScore' => $battleScore, - 'realUserCount' => $this->realUserCount, - 'teamScoreTotal' => $teamScore, - 'teamScoreAvg' => $teamScoreAvg, - '*score*' => '=========', - 'wealthK' => $wealthK, - 'wealthE' => $wealthE, - 'wealthValue' => Hero::getHeroWealth($heroDb), - '*wealth*' => (1 + $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK))), - 'lastCompute' => isset($lastCompute) ? $lastCompute : '空', - 'currentCompute' => isset($currentCompute) ? $currentCompute : '空', - '*compute*' => isset($compute) ? $compute : '算力系统关闭', - 'finalGold' => floor($gold) - ))); - } + } if ($gold > 0){ From 6503c3cbdb9c2289bf0d9930f6245568592e5b49 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 12 Jul 2024 14:16:55 +0800 Subject: [PATCH 3/5] 1 --- sql/gamedb2006_migrate_240711_01.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/sql/gamedb2006_migrate_240711_01.sql b/sql/gamedb2006_migrate_240711_01.sql index 5fab5884..78956987 100644 --- a/sql/gamedb2006_migrate_240711_01.sql +++ b/sql/gamedb2006_migrate_240711_01.sql @@ -1,7 +1,5 @@ begin; -alter table t_ingame_mall add column `unit_price` decimal(10, 2) NOT NULL DEFAULT '0' COMMENT '单价'; - CREATE TABLE `t_server_task_battle_count` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id', From 09426d58a0903b7842e8fb4a62c1b59e0631600c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 12 Jul 2024 14:27:45 +0800 Subject: [PATCH 4/5] 1 --- sql/{ => archived}/gamedb2006_migrate_240710_01.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/{ => archived}/gamedb2006_migrate_240710_01.sql (100%) diff --git a/sql/gamedb2006_migrate_240710_01.sql b/sql/archived/gamedb2006_migrate_240710_01.sql similarity index 100% rename from sql/gamedb2006_migrate_240710_01.sql rename to sql/archived/gamedb2006_migrate_240710_01.sql From 024c5f0ec746ca4b6e714d5d4fd0ff4cdca3cbaf Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 16 Jul 2024 12:00:14 +0800 Subject: [PATCH 5/5] 1 --- webapp/controller/OutAppNftController.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index dd0e202a..72ef94cc 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -180,6 +180,10 @@ class OutAppNftController extends BaseController { $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".gif"; $info['animation_url'] = "https://res.counterfire.games/nft/video/". $heroDb['hero_id'].'_'.$this->getRealHeroQuality($heroDb).".mp4"; + if ($info['token_id'] > 6240603010001668 && $info['token_id'] <= 6240603010002168){ + $info['animation_url'] = "https://res.counterfire.games/nft/video/wing/". + $heroDb['hero_id'].'_w'.$this->getRealHeroQuality($heroDb).".mp4"; + } array_push($info['attributes'],array( "trait_type" => "Tier", "value" => intval($this->getRealHeroQuality($heroDb)),