This commit is contained in:
aozhiwei 2024-07-16 12:00:40 +08:00
commit b091246d04
7 changed files with 24 additions and 38 deletions

View File

@ -1879,6 +1879,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 '创建时间',

View File

@ -1,11 +1,10 @@
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',
`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 '创建时间',

View File

@ -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)),

View File

@ -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(),

View File

@ -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];
@ -98,14 +98,14 @@ class LootService
$p = min($po + ($recycleTimes-1) * $pd,$pm) * 100 ;
$rnd = rand(1,100);
// 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);
}
}

View File

@ -239,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){